Browse Source

UI for autoaway

pull/447/head
agilob 11 years ago
parent
commit
db6b488515
No known key found for this signature in database
GPG Key ID: 2CACF3EEF598C663
  1. 8
      src/widget/form/settings/generalform.cpp
  2. 2
      src/widget/form/settings/generalform.h
  3. 38
      src/widget/form/settings/generalsettings.ui

8
src/widget/form/settings/generalform.cpp

@ -52,6 +52,8 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : @@ -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) : @@ -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) @@ -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());

2
src/widget/form/settings/generalform.h

@ -42,6 +42,8 @@ private slots: @@ -42,6 +42,8 @@ private slots:
void onUseProxyUpdated();
void onStyleSelected(QString style);
void onSetStatusChange();
void onAutoAwayChanged();
private:
Ui::GeneralSettings *bodyUI;

38
src/widget/form/settings/generalsettings.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>527</width>
<height>397</height>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@ -60,6 +60,42 @@ @@ -60,6 +60,42 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item alignment="Qt::AlignLeft">
<widget class="QLabel" name="autoAwayLabel">
<property name="toolTip">
<string>Provided in minutes</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Auto away after:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoAwaySpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string> minutes</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>600</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>

Loading…
Cancel
Save