diff --git a/src/widget/form/settings/generalform.cpp b/src/widget/form/settings/generalform.cpp index b03fb18ab..162e9413b 100644 --- a/src/widget/form/settings/generalform.cpp +++ b/src/widget/form/settings/generalform.cpp @@ -52,6 +52,8 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : else bodyUI->styleBrowser->setCurrentText("None"); + bodyUI->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime()); + bodyUI->cbUDPDisabled->setChecked(Settings::getInstance().getForceTCP()); bodyUI->proxyAddr->setText(Settings::getInstance().getProxyAddr()); int port = Settings::getInstance().getProxyPort(); @@ -73,6 +75,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : connect(bodyUI->proxyPort, SIGNAL(valueChanged(int)), this, SLOT(onProxyPortEdited(int))); connect(bodyUI->cbUseProxy, &QCheckBox::stateChanged, this, &GeneralForm::onUseProxyUpdated); connect(bodyUI->styleBrowser, SIGNAL(currentTextChanged(QString)), this, SLOT(onStyleSelected(QString))); + connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged())); } GeneralForm::~GeneralForm() @@ -107,6 +110,11 @@ void GeneralForm::onStyleSelected(QString style) parent->setStyle(style); } +void GeneralForm::onAutoAwayChanged() +{ + Settings::getInstance().setAutoAwayTime(bodyUI->autoAwaySpinBox->value()); +} + void GeneralForm::onSetStatusChange() { Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChangesCheckbox->isChecked()); diff --git a/src/widget/form/settings/generalform.h b/src/widget/form/settings/generalform.h index 0efa6ce4a..31a73eb32 100644 --- a/src/widget/form/settings/generalform.h +++ b/src/widget/form/settings/generalform.h @@ -42,6 +42,8 @@ private slots: void onUseProxyUpdated(); void onStyleSelected(QString style); void onSetStatusChange(); + void onAutoAwayChanged(); + private: Ui::GeneralSettings *bodyUI; diff --git a/src/widget/form/settings/generalsettings.ui b/src/widget/form/settings/generalsettings.ui index f10025c52..da70efdae 100644 --- a/src/widget/form/settings/generalsettings.ui +++ b/src/widget/form/settings/generalsettings.ui @@ -7,7 +7,7 @@ 0 0 527 - 397 + 500 @@ -60,6 +60,42 @@ + + + + + + Provided in minutes + + + Qt::LeftToRight + + + Auto away after: + + + + + + + + 0 + 0 + + + + minutes + + + 1 + + + 600 + + + + +