mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr447'
This commit is contained in:
commit
2a401a7e3b
|
@ -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,13 @@ void GeneralForm::onStyleSelected(QString style)
|
|||
parent->setBodyHeadStyle(style);
|
||||
}
|
||||
|
||||
void GeneralForm::onAutoAwayChanged()
|
||||
{
|
||||
int minutes = bodyUI->autoAwaySpinBox->value();
|
||||
Settings::getInstance().setAutoAwayTime(minutes);
|
||||
Widget::getInstance()->setIdleTimer(minutes);
|
||||
}
|
||||
|
||||
void GeneralForm::onSetStatusChange()
|
||||
{
|
||||
Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChangesCheckbox->isChecked());
|
||||
|
|
|
@ -42,6 +42,8 @@ private slots:
|
|||
void onUseProxyUpdated();
|
||||
void onStyleSelected(QString style);
|
||||
void onSetStatusChange();
|
||||
void onAutoAwayChanged();
|
||||
|
||||
|
||||
private:
|
||||
Ui::GeneralSettings *bodyUI;
|
||||
|
|
|
@ -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 @@
|
|||
</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>
|
||||
|
|
|
@ -294,6 +294,11 @@ QString Widget::askProfiles()
|
|||
return profile;
|
||||
}
|
||||
|
||||
void Widget::setIdleTimer(int minutes)
|
||||
{
|
||||
idleTimer->start(minutes * 1000*60);
|
||||
}
|
||||
|
||||
QString Widget::getUsername()
|
||||
{
|
||||
return core->getUsername();
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
bool getIsWindowMinimized();
|
||||
static QList<QString> searchProfiles();
|
||||
void clearContactsList();
|
||||
void setIdleTimer(int minutes);
|
||||
~Widget();
|
||||
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
|
Loading…
Reference in New Issue
Block a user