|
|
|
@ -63,24 +63,26 @@ IConfigOptions::~IConfigOptions() |
|
|
|
|
bool IConfigOptions::isChanged() const |
|
|
|
|
{ |
|
|
|
|
bool changed = cf_ShowOptions != ui->chkShowOptions->isChecked() |
|
|
|
|
|| cf_Reconnect != ui->chkReconnect->isChecked() |
|
|
|
|
|| cf_RejoinChannelsOnConnect != ui->chkRejoinConnect->isChecked() |
|
|
|
|
|| cf_ShowWhoisActiveWindow != ui->chkWhoisActive->isChecked() |
|
|
|
|
|| cf_ShowModeInMessage != ui->chkShowModeMsg->isChecked() |
|
|
|
|
|| cf_TrayNotify != ui->chkTrayNotify->isChecked() |
|
|
|
|
|| cf_TrayNotifyDelay != ui->edTrayDelay->value() |
|
|
|
|
|| cf_ShowTimestamp != ui->chkTimestamp->isChecked() |
|
|
|
|
|| cf_TimestampFormat != ui->edTimestamp->text() |
|
|
|
|
|| cf_QuitMessage != ui->edQuit->text() |
|
|
|
|
|| cf_Font.family() != ui->edFont->currentFont().family() |
|
|
|
|
|| cf_FontSize != ui->edFontSize->value() |
|
|
|
|
|| cf_BgImageEnabled != ui->chkEnableBgImage->isChecked() |
|
|
|
|
|| cf_BgImagePath != ui->edImage->text() |
|
|
|
|
// TODO background image scaling combo box
|
|
|
|
|
|| cf_BgImageOpacity != ui->hsImageOpacity->value() |
|
|
|
|
|| cf_SSLSelfSigned != ui->chkSSLSelfsigned->isChecked() |
|
|
|
|
|| cf_SSLExpired != ui->chkSSLExpired->isChecked() |
|
|
|
|
|| cf_SSLCNMismatch != ui->chkSSLCNMismatch->isChecked(); |
|
|
|
|
|| cf_Reconnect != ui->chkReconnect->isChecked() |
|
|
|
|
|| cf_RejoinChannelsOnConnect != ui->chkRejoinConnect->isChecked() |
|
|
|
|
|| cf_ShowWhoisActiveWindow != ui->chkWhoisActive->isChecked() |
|
|
|
|
|| cf_ShowModeInMessage != ui->chkShowModeMsg->isChecked() |
|
|
|
|
|| cf_TrayNotify != ui->chkTrayNotify->isChecked() |
|
|
|
|
|| cf_TrayNotifyDelay != ui->edTrayDelay->value() |
|
|
|
|
|| cf_ShowTimestamp != ui->chkTimestamp->isChecked() |
|
|
|
|
|| cf_TimestampFormat != ui->edTimestamp->text() |
|
|
|
|
|| cf_ManualKeepaliveEnabled != ui->chkManualKeepalive->isChecked() |
|
|
|
|
|| cf_ManualKeepalive != ui->edManualKeepalive->value() |
|
|
|
|
|| cf_QuitMessage != ui->edQuit->text() |
|
|
|
|
|| cf_Font.family() != ui->edFont->currentFont().family() |
|
|
|
|
|| cf_FontSize != ui->edFontSize->value() |
|
|
|
|
|| cf_BgImageEnabled != ui->chkEnableBgImage->isChecked() |
|
|
|
|
|| cf_BgImagePath != ui->edImage->text() |
|
|
|
|
// TODO background image scaling combo box
|
|
|
|
|
|| cf_BgImageOpacity != ui->hsImageOpacity->value() |
|
|
|
|
|| cf_SSLSelfSigned != ui->chkSSLSelfsigned->isChecked() |
|
|
|
|
|| cf_SSLExpired != ui->chkSSLExpired->isChecked() |
|
|
|
|
|| cf_SSLCNMismatch != ui->chkSSLCNMismatch->isChecked(); |
|
|
|
|
|
|
|
|
|
if (changed) |
|
|
|
|
return true; |
|
|
|
@ -90,27 +92,29 @@ bool IConfigOptions::isChanged() const |
|
|
|
|
|
|
|
|
|
void IConfigOptions::save() |
|
|
|
|
{ |
|
|
|
|
ConfigMgr& conf = ConfigMgr::instance(); |
|
|
|
|
conf.setCommon("ShowOptions", QString::number(ui->chkShowOptions->isChecked())); |
|
|
|
|
conf.setCommon("Reconnect", QString::number(ui->chkReconnect->isChecked())); |
|
|
|
|
conf.setCommon("RejoinChannelsOnConnect", QString::number(ui->chkRejoinConnect->isChecked())); |
|
|
|
|
conf.setCommon("ShowWhoisActiveWindow", QString::number(ui->chkWhoisActive->isChecked())); |
|
|
|
|
conf.setCommon("ShowModeInMessage", QString::number(ui->chkShowModeMsg->isChecked())); |
|
|
|
|
conf.setCommon("TrayNotify", QString::number(ui->chkTrayNotify->isChecked())); |
|
|
|
|
conf.setCommon("TrayNotifyDelay", QString::number(ui->edTrayDelay->value())); |
|
|
|
|
conf.setCommon("ShowTimestamp", QString::number(ui->chkTimestamp->isChecked())); |
|
|
|
|
conf.setCommon("TimestampFormat", ui->edTimestamp->text()); |
|
|
|
|
conf.setCommon("QuitMessage", ui->edQuit->text()); |
|
|
|
|
conf.setCommon("Font", ui->edFont->currentFont().family()); |
|
|
|
|
conf.setCommon("FontSize", QString::number(ui->edFontSize->value())); |
|
|
|
|
conf.setCommon("BgImageEnabled", QString::number(ui->chkEnableBgImage->isChecked())); |
|
|
|
|
conf.setCommon("BgImagePath", ui->edImage->text()); |
|
|
|
|
conf.setCommon("BgImageOpacity", QString::number(ui->hsImageOpacity->value())); |
|
|
|
|
conf.setCommon("SSLSelfsigned", QString::number(ui->chkSSLSelfsigned->isChecked())); |
|
|
|
|
conf.setCommon("SSLExpired", QString::number(ui->chkSSLExpired->isChecked())); |
|
|
|
|
conf.setCommon("SSLCNMismatch", QString::number(ui->chkSSLCNMismatch->isChecked())); |
|
|
|
|
reload(); |
|
|
|
|
colorCfg->save(); |
|
|
|
|
ConfigMgr& conf = ConfigMgr::instance(); |
|
|
|
|
conf.setCommon("ShowOptions", QString::number(ui->chkShowOptions->isChecked())); |
|
|
|
|
conf.setCommon("Reconnect", QString::number(ui->chkReconnect->isChecked())); |
|
|
|
|
conf.setCommon("RejoinChannelsOnConnect", QString::number(ui->chkRejoinConnect->isChecked())); |
|
|
|
|
conf.setCommon("ShowWhoisActiveWindow", QString::number(ui->chkWhoisActive->isChecked())); |
|
|
|
|
conf.setCommon("ShowModeInMessage", QString::number(ui->chkShowModeMsg->isChecked())); |
|
|
|
|
conf.setCommon("TrayNotify", QString::number(ui->chkTrayNotify->isChecked())); |
|
|
|
|
conf.setCommon("TrayNotifyDelay", QString::number(ui->edTrayDelay->value())); |
|
|
|
|
conf.setCommon("ShowTimestamp", QString::number(ui->chkTimestamp->isChecked())); |
|
|
|
|
conf.setCommon("TimestampFormat", ui->edTimestamp->text()); |
|
|
|
|
conf.setCommon("ManualKeepaliveEnabled", QString::number(ui->chkManualKeepalive->isChecked())); |
|
|
|
|
conf.setCommon("ManualKeepalive", QString::number(ui->edManualKeepalive->value())); |
|
|
|
|
conf.setCommon("QuitMessage", ui->edQuit->text()); |
|
|
|
|
conf.setCommon("Font", ui->edFont->currentFont().family()); |
|
|
|
|
conf.setCommon("FontSize", QString::number(ui->edFontSize->value())); |
|
|
|
|
conf.setCommon("BgImageEnabled", QString::number(ui->chkEnableBgImage->isChecked())); |
|
|
|
|
conf.setCommon("BgImagePath", ui->edImage->text()); |
|
|
|
|
conf.setCommon("BgImageOpacity", QString::number(ui->hsImageOpacity->value())); |
|
|
|
|
conf.setCommon("SSLSelfsigned", QString::number(ui->chkSSLSelfsigned->isChecked())); |
|
|
|
|
conf.setCommon("SSLExpired", QString::number(ui->chkSSLExpired->isChecked())); |
|
|
|
|
conf.setCommon("SSLCNMismatch", QString::number(ui->chkSSLCNMismatch->isChecked())); |
|
|
|
|
reload(); |
|
|
|
|
colorCfg->save(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void IConfigOptions::reset() |
|
|
|
@ -124,6 +128,8 @@ void IConfigOptions::reset() |
|
|
|
|
ui->edTrayDelay->setValue(cf_TrayNotifyDelay); |
|
|
|
|
ui->chkTimestamp->setChecked(cf_ShowTimestamp); |
|
|
|
|
ui->edTimestamp->setText(cf_TimestampFormat); |
|
|
|
|
ui->chkManualKeepalive->setChecked(cf_ManualKeepaliveEnabled); |
|
|
|
|
ui->edManualKeepalive->setValue(cf_ManualKeepalive); |
|
|
|
|
ui->edQuit->setText(cf_QuitMessage); |
|
|
|
|
ui->edFont->setCurrentFont(cf_Font); |
|
|
|
|
ui->edFontSize->setValue(cf_FontSize); |
|
|
|
@ -155,8 +161,10 @@ void IConfigOptions::reload() |
|
|
|
|
cf_TrayNotify = conf.common("TrayNotify").toInt(); |
|
|
|
|
cf_TrayNotifyDelay = conf.common("TrayNotifyDelay").toInt(); |
|
|
|
|
cf_ShowTimestamp = conf.common("ShowTimestamp").toInt(); |
|
|
|
|
cf_TimestampFormat = conf.common("TimestampFormat"); |
|
|
|
|
cf_QuitMessage = conf.common("QuitMessage"); |
|
|
|
|
cf_TimestampFormat = conf.common("TimestampFormat"); |
|
|
|
|
cf_ManualKeepaliveEnabled = conf.common("ManualKeepaliveEnabled").toInt(); |
|
|
|
|
cf_ManualKeepalive = conf.common("ManualKeepalive").toInt(); |
|
|
|
|
cf_QuitMessage = conf.common("QuitMessage"); |
|
|
|
|
cf_Font = conf.common("Font"); |
|
|
|
|
cf_FontSize = conf.common("FontSize").toInt(); |
|
|
|
|
cf_BgImageEnabled = conf.common("BgImageEnabled").toInt(); |
|
|
|
|