mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(Settings): Add setting for hiding group join and leave system messages
Messages can become spammy is long lasting quiet groups, drowning out real user messages
This commit is contained in:
parent
e5df648e1a
commit
1be5b99d17
|
@ -36,5 +36,9 @@ public:
|
||||||
virtual QStringList getBlackList() const = 0;
|
virtual QStringList getBlackList() const = 0;
|
||||||
virtual void setBlackList(const QStringList& blist) = 0;
|
virtual void setBlackList(const QStringList& blist) = 0;
|
||||||
|
|
||||||
|
virtual bool getShowGroupJoinLeaveMessages() const = 0;
|
||||||
|
virtual void setShowGroupJoinLeaveMessages(bool newValue) = 0;
|
||||||
|
|
||||||
DECLARE_SIGNAL(blackListChanged, QStringList const& blist);
|
DECLARE_SIGNAL(blackListChanged, QStringList const& blist);
|
||||||
|
DECLARE_SIGNAL(showGroupJoinLeaveMessagesChanged, bool show);
|
||||||
};
|
};
|
||||||
|
|
|
@ -200,6 +200,7 @@ void Settings::loadGlobal()
|
||||||
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
|
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
|
||||||
useEmoticons = s.value("useEmoticons", true).toBool();
|
useEmoticons = s.value("useEmoticons", true).toBool();
|
||||||
statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
|
statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool();
|
||||||
|
showGroupJoinLeaveMessages = s.value("showGroupJoinLeaveMessages", true).toBool();
|
||||||
spellCheckingEnabled = s.value("spellCheckingEnabled", true).toBool();
|
spellCheckingEnabled = s.value("spellCheckingEnabled", true).toBool();
|
||||||
themeColor = s.value("themeColor", 0).toInt();
|
themeColor = s.value("themeColor", 0).toInt();
|
||||||
style = s.value("style", "").toString();
|
style = s.value("style", "").toString();
|
||||||
|
@ -663,6 +664,7 @@ void Settings::saveGlobal()
|
||||||
s.setValue("style", style);
|
s.setValue("style", style);
|
||||||
s.setValue("nameColors", nameColors);
|
s.setValue("nameColors", nameColors);
|
||||||
s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled);
|
s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled);
|
||||||
|
s.setValue("showGroupJoinLeaveMessages", showGroupJoinLeaveMessages);
|
||||||
s.setValue("spellCheckingEnabled", spellCheckingEnabled);
|
s.setValue("spellCheckingEnabled", spellCheckingEnabled);
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
@ -1023,6 +1025,19 @@ void Settings::setStatusChangeNotificationEnabled(bool newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Settings::getShowGroupJoinLeaveMessages() const
|
||||||
|
{
|
||||||
|
QMutexLocker locker{&bigLock};
|
||||||
|
return showGroupJoinLeaveMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setShowGroupJoinLeaveMessages(bool newValue)
|
||||||
|
{
|
||||||
|
if (setVal(showGroupJoinLeaveMessages, newValue)) {
|
||||||
|
emit showGroupJoinLeaveMessagesChanged(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Settings::getSpellCheckingEnabled() const
|
bool Settings::getSpellCheckingEnabled() const
|
||||||
{
|
{
|
||||||
const QMutexLocker locker{&bigLock};
|
const QMutexLocker locker{&bigLock};
|
||||||
|
|
|
@ -463,9 +463,12 @@ public:
|
||||||
|
|
||||||
QStringList getBlackList() const override;
|
QStringList getBlackList() const override;
|
||||||
void setBlackList(const QStringList& blist) override;
|
void setBlackList(const QStringList& blist) override;
|
||||||
|
|
||||||
SIGNAL_IMPL(Settings, blackListChanged, QStringList const& blist)
|
SIGNAL_IMPL(Settings, blackListChanged, QStringList const& blist)
|
||||||
|
|
||||||
|
bool getShowGroupJoinLeaveMessages() const override;
|
||||||
|
void setShowGroupJoinLeaveMessages(bool newValue) override;
|
||||||
|
SIGNAL_IMPL(Settings, showGroupJoinLeaveMessagesChanged, bool show)
|
||||||
|
|
||||||
// State
|
// State
|
||||||
QByteArray getWindowGeometry() const;
|
QByteArray getWindowGeometry() const;
|
||||||
void setWindowGeometry(const QByteArray& value);
|
void setWindowGeometry(const QByteArray& value);
|
||||||
|
@ -655,6 +658,7 @@ private:
|
||||||
QString timestampFormat;
|
QString timestampFormat;
|
||||||
QString dateFormat;
|
QString dateFormat;
|
||||||
bool statusChangeNotificationEnabled;
|
bool statusChangeNotificationEnabled;
|
||||||
|
bool showGroupJoinLeaveMessages;
|
||||||
bool spellCheckingEnabled;
|
bool spellCheckingEnabled;
|
||||||
|
|
||||||
// Privacy
|
// Privacy
|
||||||
|
|
|
@ -63,9 +63,12 @@ class MockGroupSettings : public QObject, public IGroupSettings
|
||||||
public:
|
public:
|
||||||
QStringList getBlackList() const override;
|
QStringList getBlackList() const override;
|
||||||
void setBlackList(const QStringList& blist) override;
|
void setBlackList(const QStringList& blist) override;
|
||||||
|
|
||||||
SIGNAL_IMPL(MockGroupSettings, blackListChanged, QStringList const& blist)
|
SIGNAL_IMPL(MockGroupSettings, blackListChanged, QStringList const& blist)
|
||||||
|
|
||||||
|
bool getShowGroupJoinLeaveMessages() const override { return true; };
|
||||||
|
void setShowGroupJoinLeaveMessages(bool newValue) override {};
|
||||||
|
SIGNAL_IMPL(MockGroupSettings, showGroupJoinLeaveMessagesChanged, bool show)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList blacklist;
|
QStringList blacklist;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user