mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix #436
This commit is contained in:
parent
f2f572273c
commit
a0ca379c1b
|
@ -64,6 +64,8 @@ public:
|
|||
void increaseVideoBusyness();
|
||||
void decreaseVideoBusyness();
|
||||
|
||||
bool anyActiveCalls();
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
void process();
|
||||
|
|
|
@ -28,6 +28,14 @@ ALCdevice* Core::alOutDev, *Core::alInDev;
|
|||
ALCcontext* Core::alContext;
|
||||
ALuint Core::alMainSource;
|
||||
|
||||
bool Core::anyActiveCalls()
|
||||
{
|
||||
for (auto& call : calls)
|
||||
if (call.active)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Core::prepareCall(int friendId, int callId, ToxAv* toxav, bool videoEnabled)
|
||||
{
|
||||
qDebug() << QString("Core: preparing call %1").arg(callId);
|
||||
|
|
|
@ -108,7 +108,14 @@ void IdentityForm::setStatusMessage(const QString &msg)
|
|||
|
||||
void IdentityForm::onLoadClicked()
|
||||
{
|
||||
Core::getInstance()->switchConfiguration(bodyUI->profiles->currentText());
|
||||
if (bodyUI->profiles->currentText() != Settings::getInstance().getCurrentProfile())
|
||||
{
|
||||
if (Core::getInstance()->anyActiveCalls())
|
||||
QMessageBox::warning(this, tr("Call active", "popup title"),
|
||||
tr("You can't switch profiles while a call is active!", "popup text"));
|
||||
else
|
||||
Core::getInstance()->switchConfiguration(bodyUI->profiles->currentText());
|
||||
}
|
||||
}
|
||||
|
||||
void IdentityForm::onRenameClicked()
|
||||
|
|
Loading…
Reference in New Issue
Block a user