Focus password text box if there's an account saved by default. Save settings!

This commit is contained in:
Petr Mrázek 2013-04-08 18:21:43 +02:00
parent 1f13f0c665
commit ae6937ab81
2 changed files with 8 additions and 0 deletions

View File

@ -43,6 +43,13 @@ LoginDialog::LoginDialog(QWidget *parent, const QString& loginErrMsg) :
QStringList accounts = k->getStoredAccounts("minecraft");
ui->usernameTextBox->addItems(accounts);
// TODO: restore last selected account here, if applicable
int index = ui->usernameTextBox->currentIndex();
if(index != -1)
{
ui->passwordTextBox->setFocus(Qt::OtherFocusReason);
}
}
LoginDialog::~LoginDialog()

View File

@ -36,6 +36,7 @@ void INISettingsObject::changeSetting(const Setting &setting, QVariant value)
m_ini.set(setting.configKey(), value);
else
m_ini.remove(setting.configKey());
m_ini.saveFile(m_filePath);
}
}