- ChatViewSettings viewSettings(idString());
- _showFields = viewSettings.value("showFields", AllFields).toInt();
- _showOwnMessages = viewSettings.value("showOwnMsgs", true).toBool();
- viewSettings.notify("showFields", this, SLOT(showFieldsSettingsChanged(const QVariant &)));
- viewSettings.notify("showOwnMsgs", this, SLOT(showOwnMessagesSettingChanged(const QVariant &)));
-
- // ChatMonitorSettingsPage
- QString highlightAlwaysSettingsId = "HighlightAlways";
- QString operationModeSettingsId = "OperationMode";
- QString buffersSettingsId = "Buffers";
-
- _highlightAlways = viewSettings.value(highlightAlwaysSettingsId, false).toBool();
- _operationMode = viewSettings.value(operationModeSettingsId, 0).toInt();
- // read configured list of buffers to monitor/ignore
- foreach(QVariant v, viewSettings.value(buffersSettingsId, QVariant()).toList())
- _bufferIds << v.value<BufferId>();
-
- viewSettings.notify(highlightAlwaysSettingsId, this, SLOT(highlightAlwaysSettingsChanged(const QVariant &)));
- viewSettings.notify(operationModeSettingsId, this, SLOT(operationModeSettingsChanged(const QVariant &)));
- viewSettings.notify(buffersSettingsId, this, SLOT(buffersSettingsChanged(const QVariant &)));
+ // Global configuration
+ ChatViewSettings defaultSettings;
+ defaultSettings.initAndNotify("ShowSenderBrackets", this, &ChatMonitorFilter::showSenderBracketsSettingChanged);
+
+ // NOTE: Whenever changing defaults here, also update ChatMonitorSettingsPage::loadSettings()
+ // and ChatMonitorSettingsPage::defaults() to match
+
+ // Chat Monitor specific configuration
+ ChatViewSettings viewSettings(ChatMonitorFilter::idString());
+ _showFields = viewSettings.value("ShowFields", AllFields).toInt();
+ _showOwnMessages = viewSettings.value("ShowOwnMsgs", true).toBool();
+ viewSettings.notify("ShowFields", this, &ChatMonitorFilter::showFieldsSettingChanged);
+ viewSettings.notify("ShowOwnMsgs", this, &ChatMonitorFilter::showOwnMessagesSettingChanged);
+
+ // ChatMonitorSettingsPage
+ QString showHighlightsSettingsId = "ShowHighlights";
+ QString operationModeSettingsId = "OperationMode";
+ QString buffersSettingsId = "Buffers";
+ QString showBacklogSettingsId = "ShowBacklog";
+ QString includeReadSettingsId = "IncludeRead";
+ QString alwaysOwnSettingsId = "AlwaysOwn";
+
+ _showHighlights = viewSettings.value(showHighlightsSettingsId, false).toBool();
+ _operationMode = viewSettings.value(operationModeSettingsId, ChatViewSettings::InvalidMode).toInt();
+ // read configured list of buffers to monitor/ignore
+ foreach (QVariant v, viewSettings.value(buffersSettingsId, QVariant()).toList())
+ _bufferIds << v.value<BufferId>();
+ _showBacklog = viewSettings.value(showBacklogSettingsId, true).toBool();
+ _includeRead = viewSettings.value(includeReadSettingsId, false).toBool();
+ _alwaysOwn = viewSettings.value(alwaysOwnSettingsId, false).toBool();
+
+ viewSettings.notify(showHighlightsSettingsId, this, &ChatMonitorFilter::showHighlightsSettingChanged);
+ viewSettings.notify(operationModeSettingsId, this, &ChatMonitorFilter::operationModeSettingChanged);
+ viewSettings.notify(buffersSettingsId, this, &ChatMonitorFilter::buffersSettingChanged);
+ viewSettings.notify(showBacklogSettingsId, this, &ChatMonitorFilter::showBacklogSettingChanged);
+ viewSettings.notify(includeReadSettingsId, this, &ChatMonitorFilter::includeReadSettingChanged);
+ viewSettings.notify(alwaysOwnSettingsId, this, &ChatMonitorFilter::alwaysOwnSettingChanged);