mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
UI for autoaway
This commit is contained in:
parent
a3beb991e1
commit
db6b488515
@ -52,6 +52,8 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|||||||
else
|
else
|
||||||
bodyUI->styleBrowser->setCurrentText("None");
|
bodyUI->styleBrowser->setCurrentText("None");
|
||||||
|
|
||||||
|
bodyUI->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime());
|
||||||
|
|
||||||
bodyUI->cbUDPDisabled->setChecked(Settings::getInstance().getForceTCP());
|
bodyUI->cbUDPDisabled->setChecked(Settings::getInstance().getForceTCP());
|
||||||
bodyUI->proxyAddr->setText(Settings::getInstance().getProxyAddr());
|
bodyUI->proxyAddr->setText(Settings::getInstance().getProxyAddr());
|
||||||
int port = Settings::getInstance().getProxyPort();
|
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->proxyPort, SIGNAL(valueChanged(int)), this, SLOT(onProxyPortEdited(int)));
|
||||||
connect(bodyUI->cbUseProxy, &QCheckBox::stateChanged, this, &GeneralForm::onUseProxyUpdated);
|
connect(bodyUI->cbUseProxy, &QCheckBox::stateChanged, this, &GeneralForm::onUseProxyUpdated);
|
||||||
connect(bodyUI->styleBrowser, SIGNAL(currentTextChanged(QString)), this, SLOT(onStyleSelected(QString)));
|
connect(bodyUI->styleBrowser, SIGNAL(currentTextChanged(QString)), this, SLOT(onStyleSelected(QString)));
|
||||||
|
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralForm::~GeneralForm()
|
GeneralForm::~GeneralForm()
|
||||||
@ -107,6 +110,11 @@ void GeneralForm::onStyleSelected(QString style)
|
|||||||
parent->setStyle(style);
|
parent->setStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralForm::onAutoAwayChanged()
|
||||||
|
{
|
||||||
|
Settings::getInstance().setAutoAwayTime(bodyUI->autoAwaySpinBox->value());
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralForm::onSetStatusChange()
|
void GeneralForm::onSetStatusChange()
|
||||||
{
|
{
|
||||||
Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChangesCheckbox->isChecked());
|
Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChangesCheckbox->isChecked());
|
||||||
|
@ -42,6 +42,8 @@ private slots:
|
|||||||
void onUseProxyUpdated();
|
void onUseProxyUpdated();
|
||||||
void onStyleSelected(QString style);
|
void onStyleSelected(QString style);
|
||||||
void onSetStatusChange();
|
void onSetStatusChange();
|
||||||
|
void onAutoAwayChanged();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GeneralSettings *bodyUI;
|
Ui::GeneralSettings *bodyUI;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>527</width>
|
<width>527</width>
|
||||||
<height>397</height>
|
<height>500</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -60,6 +60,42 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user