1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge remote-tracking branch 'zetok/fix-warning-no-profile'

This commit is contained in:
agilob 2015-10-21 19:05:48 +01:00
commit 61ef6429e2
No known key found for this signature in database
GPG Key ID: 296F0B764741106C

View File

@ -185,9 +185,19 @@ void LoginScreen::onLogin()
QString name = ui->loginUsernames->currentText();
QString pass = ui->loginPassword->text();
// name can be empty when there are no profiles
if (name.isEmpty())
{
QMessageBox::critical(this, tr("Couldn't load profile"),
tr("There is no selected profile.\n\n"
"You may want to create one."));
return;
}
if (!ProfileLocker::isLockable(name))
{
QMessageBox::critical(this, tr("Couldn't load this profile"), tr("This profile is already in use."));
QMessageBox::critical(this, tr("Couldn't load this profile"),
tr("This profile is already in use."));
return;
}
@ -196,12 +206,14 @@ void LoginScreen::onLogin()
{
if (!ProfileLocker::isLockable(name))
{
QMessageBox::critical(this, tr("Couldn't load this profile"), tr("Profile already in use. Close other clients."));
QMessageBox::critical(this, tr("Couldn't load this profile"),
tr("Profile already in use. Close other clients."));
return;
}
else
{
QMessageBox::critical(this, tr("Couldn't load this profile"), tr("Wrong password."));
QMessageBox::critical(this, tr("Couldn't load this profile"),
tr("Wrong password."));
return;
}
}