mirror of https://github.com/RPCS3/rpcs3.git
Qt: fix user manager localusername and add textvalue to the inputdialog
This commit is contained in:
parent
f84883223b
commit
e29ea61f7c
|
@ -12,12 +12,18 @@ UserAccount::UserAccount(const std::string& user_id)
|
||||||
fs::file file;
|
fs::file file;
|
||||||
if (file.open(m_user_dir + "localusername", fs::read))
|
if (file.open(m_user_dir + "localusername", fs::read))
|
||||||
{
|
{
|
||||||
file.read(m_username, 16*sizeof(char)); // max of 16 chars on real PS3
|
m_username = file.to_string();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
if (m_username.length() > 16) // max of 16 chars on real PS3
|
||||||
|
{
|
||||||
|
m_username = m_username.substr(0, 16);
|
||||||
|
LOG_WARNING(GENERAL, "UserAccount: localusername of userId=%s was too long, cropped to: %s", m_user_id, m_username);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_WARNING(GENERAL, "UserAccount: localusername file read error (userId=%s, userDir=%s).", m_user_id, m_user_dir);
|
LOG_ERROR(GENERAL, "UserAccount: localusername file read error (userId=%s, userDir=%s).", m_user_id, m_user_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,10 +270,12 @@ void user_manager_dialog::OnUserRename()
|
||||||
|
|
||||||
const std::string user_id = m_user_list[key].GetUserId();
|
const std::string user_id = m_user_list[key].GetUserId();
|
||||||
const std::string username = m_user_list[key].GetUsername();
|
const std::string username = m_user_list[key].GetUsername();
|
||||||
|
const QString q_username = qstr(username);
|
||||||
|
|
||||||
QInputDialog* dialog = new QInputDialog(this);
|
QInputDialog* dialog = new QInputDialog(this);
|
||||||
dialog->setWindowTitle(tr("Rename User"));
|
dialog->setWindowTitle(tr("Rename User"));
|
||||||
dialog->setLabelText(tr("User Id: %0\nOld Username: %1\n\nNew Username: ").arg(qstr(user_id)).arg(qstr(username)));
|
dialog->setLabelText(tr("User Id: %0\nOld Username: %1\n\nNew Username: ").arg(qstr(user_id)).arg(q_username));
|
||||||
|
dialog->setTextValue(q_username);
|
||||||
dialog->resize(200, 100);
|
dialog->resize(200, 100);
|
||||||
|
|
||||||
while (dialog->exec() != QDialog::Rejected)
|
while (dialog->exec() != QDialog::Rejected)
|
||||||
|
|
Loading…
Reference in New Issue