mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr529'
This commit is contained in:
commit
07bc995d6b
|
@ -20,6 +20,7 @@
|
||||||
#include "src/widget/widget.h"
|
#include "src/widget/widget.h"
|
||||||
#include "src/misc/settings.h"
|
#include "src/misc/settings.h"
|
||||||
#include "src/misc/smileypack.h"
|
#include "src/misc/smileypack.h"
|
||||||
|
#include "src/core.h"
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
||||||
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()));
|
connect(bodyUI->autoAwaySpinBox, SIGNAL(editingFinished()), this, SLOT(onAutoAwayChanged()));
|
||||||
|
connect(bodyUI->reconnectButton, &QPushButton::clicked, this, &GeneralForm::onReconnectClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralForm::~GeneralForm()
|
GeneralForm::~GeneralForm()
|
||||||
|
@ -178,6 +180,15 @@ void GeneralForm::onUseProxyUpdated()
|
||||||
Settings::getInstance().setUseProxy(state);
|
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()
|
void GeneralForm::reloadSmiles()
|
||||||
{
|
{
|
||||||
QList<QStringList> emoticons = SmileyPack::getInstance().getEmoticons();
|
QList<QStringList> emoticons = SmileyPack::getInstance().getEmoticons();
|
||||||
|
|
|
@ -45,7 +45,7 @@ private slots:
|
||||||
void onSetStatusChange();
|
void onSetStatusChange();
|
||||||
void onAutoAwayChanged();
|
void onAutoAwayChanged();
|
||||||
void onSetMinimizeToTray();
|
void onSetMinimizeToTray();
|
||||||
|
void onReconnectClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GeneralSettings *bodyUI;
|
Ui::GeneralSettings *bodyUI;
|
||||||
|
|
|
@ -341,6 +341,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="reconnectButton">
|
||||||
|
<property name="text">
|
||||||
|
<string comment="reconnect button">Reconnect</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -36,6 +36,7 @@ IdentityForm::IdentityForm() :
|
||||||
{
|
{
|
||||||
bodyUI = new Ui::IdentitySettings;
|
bodyUI = new Ui::IdentitySettings;
|
||||||
bodyUI->setupUi(this);
|
bodyUI->setupUi(this);
|
||||||
|
core = Core::getInstance();
|
||||||
|
|
||||||
// tox
|
// tox
|
||||||
toxId = new ClickableTE();
|
toxId = new ClickableTE();
|
||||||
|
@ -47,7 +48,7 @@ IdentityForm::IdentityForm() :
|
||||||
|
|
||||||
connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
||||||
connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
||||||
connect(Core::getInstance(), &Core::idSet, this, &IdentityForm::setToxId);
|
connect(core, &Core::idSet, this, &IdentityForm::setToxId);
|
||||||
connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited()));
|
connect(bodyUI->userName, SIGNAL(editingFinished()), this, SLOT(onUserNameEdited()));
|
||||||
connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited()));
|
connect(bodyUI->statusMessage, SIGNAL(editingFinished()), this, SLOT(onStatusMessageEdited()));
|
||||||
connect(bodyUI->loadButton, &QPushButton::clicked, this, &IdentityForm::onLoadClicked);
|
connect(bodyUI->loadButton, &QPushButton::clicked, this, &IdentityForm::onLoadClicked);
|
||||||
|
@ -57,6 +58,16 @@ IdentityForm::IdentityForm() :
|
||||||
connect(bodyUI->importButton, &QPushButton::clicked, this, &IdentityForm::onImportClicked);
|
connect(bodyUI->importButton, &QPushButton::clicked, this, &IdentityForm::onImportClicked);
|
||||||
connect(bodyUI->newButton, &QPushButton::clicked, this, &IdentityForm::onNewClicked);
|
connect(bodyUI->newButton, &QPushButton::clicked, this, &IdentityForm::onNewClicked);
|
||||||
|
|
||||||
|
connect(core, &Core::avStart, this, &IdentityForm::disableSwitching);
|
||||||
|
connect(core, &Core::avStarting, this, &IdentityForm::disableSwitching);
|
||||||
|
connect(core, &Core::avInvite, this, &IdentityForm::disableSwitching);
|
||||||
|
connect(core, &Core::avRinging, this, &IdentityForm::disableSwitching);
|
||||||
|
connect(core, &Core::avCancel, this, &IdentityForm::enableSwitching);
|
||||||
|
connect(core, &Core::avEnd, this, &IdentityForm::enableSwitching);
|
||||||
|
connect(core, &Core::avEnding, this, &IdentityForm::enableSwitching);
|
||||||
|
connect(core, &Core::avPeerTimeout, this, &IdentityForm::enableSwitching);
|
||||||
|
connect(core, &Core::avRequestTimeout, this, &IdentityForm::enableSwitching);
|
||||||
|
|
||||||
connect(Core::getInstance(), &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); });
|
connect(Core::getInstance(), &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); });
|
||||||
connect(Core::getInstance(), &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); });
|
connect(Core::getInstance(), &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); });
|
||||||
}
|
}
|
||||||
|
@ -203,3 +214,18 @@ bool IdentityForm::checkContinue(const QString& title, const QString& msg)
|
||||||
QMessageBox::StandardButton resp = QMessageBox::question(this, title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
QMessageBox::StandardButton resp = QMessageBox::question(this, title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
return resp == QMessageBox::Yes;
|
return resp == QMessageBox::Yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IdentityForm::disableSwitching()
|
||||||
|
{
|
||||||
|
bodyUI->loadButton->setEnabled(false);
|
||||||
|
bodyUI->newButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IdentityForm::enableSwitching()
|
||||||
|
{
|
||||||
|
if (!core->anyActiveCalls())
|
||||||
|
{
|
||||||
|
bodyUI->loadButton->setEnabled(true);
|
||||||
|
bodyUI->newButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
class CroppingLabel;
|
class CroppingLabel;
|
||||||
|
class Core;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class IdentitySettings;
|
class IdentitySettings;
|
||||||
|
@ -65,9 +66,12 @@ private slots:
|
||||||
void onImportClicked();
|
void onImportClicked();
|
||||||
void onNewClicked();
|
void onNewClicked();
|
||||||
bool checkContinue(const QString& title, const QString& msg);
|
bool checkContinue(const QString& title, const QString& msg);
|
||||||
|
void disableSwitching();
|
||||||
|
void enableSwitching();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::IdentitySettings* bodyUI;
|
Ui::IdentitySettings* bodyUI;
|
||||||
|
Core* core;
|
||||||
|
|
||||||
ClickableTE* toxId;
|
ClickableTE* toxId;
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,6 +114,9 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string comment="load profile button">Load</string>
|
<string comment="load profile button">Load</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string comment="tooltip">Switching profiles is disabled during calls</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -156,6 +159,9 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string comment="new profile button">New Tox ID</string>
|
<string comment="new profile button">New Tox ID</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string comment="tooltip">Switching profiles is disabled during calls</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user