mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
add reconnect button for connection settings
some ui guru should make it not stretch to width
This commit is contained in:
parent
576fd7269e
commit
8153a3e8c3
|
@ -20,6 +20,7 @@
|
|||
#include "src/widget/widget.h"
|
||||
#include "src/misc/settings.h"
|
||||
#include "src/misc/smileypack.h"
|
||||
#include "src/core.h"
|
||||
#include <QMessageBox>
|
||||
#include <QStyleFactory>
|
||||
|
||||
|
@ -85,6 +86,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|||
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()));
|
||||
connect(bodyUI->reconnectButton, &QPushButton::clicked, this, &GeneralForm::onReconnectClicked);
|
||||
}
|
||||
|
||||
GeneralForm::~GeneralForm()
|
||||
|
@ -178,6 +180,15 @@ void GeneralForm::onUseProxyUpdated()
|
|||
Settings::getInstance().setUseProxy(state);
|
||||
}
|
||||
|
||||
void GeneralForm::onReconnectClicked()
|
||||
{
|
||||
if (Core::getInstance()->anyActiveCalls())
|
||||
QMessageBox::warning(this, tr("Call active", "popup title"),
|
||||
tr("You can't disconnect while a call is active!", "popup text"));
|
||||
else
|
||||
emit Widget::getInstance()->changeProfile(Settings::getInstance().getCurrentProfile());
|
||||
}
|
||||
|
||||
void GeneralForm::reloadSmiles()
|
||||
{
|
||||
QList<QStringList> emoticons = SmileyPack::getInstance().getEmoticons();
|
||||
|
|
|
@ -45,7 +45,7 @@ private slots:
|
|||
void onSetStatusChange();
|
||||
void onAutoAwayChanged();
|
||||
void onSetMinimizeToTray();
|
||||
|
||||
void onReconnectClicked();
|
||||
|
||||
private:
|
||||
Ui::GeneralSettings *bodyUI;
|
||||
|
|
|
@ -341,6 +341,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="reconnectButton">
|
||||
<property name="text">
|
||||
<string comment="reconnect button">Reconnect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue
Block a user