ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
// connect slots
- connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), this, SLOT(switchOperationMode(int)));
+ 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()));
}
bool ChatMonitorSettingsPage::hasDefaults() const {
void ChatMonitorSettingsPage::defaults() {
settings["OperationMode"] = ChatViewSettings::OptOut;
settings["ShowHighlights"] = false;
+ settings["ShowOwnMsgs"] = false;
settings["Buffers"] = QVariant();
settings["Default"] = true;
load();
ui.operationMode->setCurrentIndex(settings["OperationMode"].toInt() - 1);
ui.showHighlights->setChecked(settings["ShowHighlights"].toBool());
+ ui.showOwnMessages->setChecked(settings["ShowOwnMsgs"].toBool());
// get all available buffer Ids
QList<BufferId> allBufferIds = Client::networkModel()->allBufferIds();
settings["OperationMode"] == ChatViewSettings::OptOut;
}
settings["ShowHighlights"] = chatViewSettings.value("ShowHighlights", false);
+ settings["ShowOwnMsgs"] = chatViewSettings.value("ShowOwnMsgs", false);
settings["Buffers"] = chatViewSettings.value("Buffers", QVariantList());
}
void ChatMonitorSettingsPage::save() {
ChatViewSettings chatViewSettings("ChatMonitor");
// save operation mode
- chatViewSettings.setValue("OperationMode", settings["OperationMode"]);
- chatViewSettings.setValue("ShowHighlights", settings["ShowHighlights"]);
+ chatViewSettings.setValue("OperationMode", ui.operationMode->currentIndex() + 1);
+ chatViewSettings.setValue("ShowHighlights", ui.showHighlights->isChecked());
+ chatViewSettings.setValue("ShowOwnMsgs", ui.showOwnMessages->isChecked());
// save list of active buffers
QVariantList saveableBufferIdList;
bool ChatMonitorSettingsPage::testHasChanged() {
if(settings["OperationMode"] != ui.operationMode->itemData(ui.operationMode->currentIndex()))
return true;
+ if(settings["ShowHighlights"].toBool() != ui.showHighlights->isChecked())
+ return true;
+ if(settings["ShowOwnMsgs"].toBool() != ui.showOwnMessages->isChecked())
+ return true;
if(_configActive->bufferList().count() != settings["Buffers"].toList().count())
return true;
}
}
-void ChatMonitorSettingsPage::on_showHighlights_toggled(bool state)
-{
- settings["ShowHighlights"] = state;
- widgetHasChanged();
-}
-
/*
switchOperationMode gets called on combobox signal currentIndexChanged.
modeIndex is the row id in combobox itemlist