ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
// connect slots
- connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), SLOT(switchOperationMode(int)));
- connect(ui.showHighlights, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.showOwnMessages, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.alwaysOwn, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.showBacklog, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
- connect(ui.includeRead, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
+ connect(ui.operationMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &ChatMonitorSettingsPage::switchOperationMode);
+ connect(ui.showHighlights, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.showOwnMessages, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.alwaysOwn, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.showBacklog, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+ connect(ui.includeRead, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
}
void ChatMonitorSettingsPage::defaults()
{
+ // NOTE: Whenever changing defaults here, also update ChatMonitorFilter::ChatMonitorFilter()
+ // and ChatMonitorSettingsPage::loadSettings() to match
+
settings["OperationMode"] = ChatViewSettings::OptOut;
settings["ShowHighlights"] = false;
- settings["ShowOwnMsgs"] = false;
+ settings["ShowOwnMsgs"] = true;
settings["AlwaysOwn"] = false;
settings["Buffers"] = QVariant();
settings["Default"] = true;
void ChatMonitorSettingsPage::loadSettings()
{
+ // NOTE: Whenever changing defaults here, also update ChatMonitorFilter::ChatMonitorFilter()
+ // and ChatMonitorSettingsPage::defaults() to match
ChatViewSettings chatViewSettings("ChatMonitor");
- settings["OperationMode"] = (ChatViewSettings::OperationMode)chatViewSettings.value("OperationMode", ChatViewSettings::OptOut).toInt();
+ settings["OperationMode"] = (ChatViewSettings::OperationMode)
+ chatViewSettings.value("OperationMode", ChatViewSettings::OptOut).toInt();
settings["ShowHighlights"] = chatViewSettings.value("ShowHighlights", false);
- settings["ShowOwnMsgs"] = chatViewSettings.value("ShowOwnMsgs", false);
+ settings["ShowOwnMsgs"] = chatViewSettings.value("ShowOwnMsgs", true);
settings["AlwaysOwn"] = chatViewSettings.value("AlwaysOwn", false);
settings["Buffers"] = chatViewSettings.value("Buffers", QVariantList());
settings["ShowBacklog"] = chatViewSettings.value("ShowBacklog", true);
- settings["IncludeRead"] = chatViewSettings.value("IncludeRead", true);
+ settings["IncludeRead"] = chatViewSettings.value("IncludeRead", false);
}
This can probably be removed whenever BufferViewConfig::bulkAdd or something
like that is available.
*/
- qobject_cast<BufferViewFilter *>(outView->model())->setConfig(0);
- qobject_cast<BufferViewFilter *>(inView->model())->setConfig(0);
+ qobject_cast<BufferViewFilter *>(outView->model())->setConfig(nullptr);
+ qobject_cast<BufferViewFilter *>(inView->model())->setConfig(nullptr);
// actually move the ids
foreach(QList<BufferId> list, selectedBuffers) {
*/
void ChatMonitorSettingsPage::switchOperationMode(int idx)
{
- ChatViewSettings::OperationMode mode = (ChatViewSettings::OperationMode)(idx + 1);
+ auto mode = (ChatViewSettings::OperationMode)(idx + 1);
if (mode == ChatViewSettings::OptIn) {
ui.labelActiveBuffers->setText(tr("Show:"));
}