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:
commit
61ef6429e2
|
@ -185,9 +185,19 @@ void LoginScreen::onLogin()
|
||||||
QString name = ui->loginUsernames->currentText();
|
QString name = ui->loginUsernames->currentText();
|
||||||
QString pass = ui->loginPassword->text();
|
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))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,12 +206,14 @@ void LoginScreen::onLogin()
|
||||||
{
|
{
|
||||||
if (!ProfileLocker::isLockable(name))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
else
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user