Add instructive text to disabled RetroAchievements login button

Changes the RetroAchievements "Log In" button's text to "To log in, stop the current emulation." when the button is disabled because an emulation session is active. This allows a user to understand why the button is disabled, and how this state can be resolved.

Previously, it could be unclear why this button was disabled without an understanding of the underlying system.

Co-Authored-By: JosJuice <josjuice@gmail.com>
This commit is contained in:
NivekH 2024-07-20 00:11:08 -04:00 committed by Admiral H. Curtiss
parent 46454f9b4e
commit db9b3592e1
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 9 additions and 0 deletions

View File

@ -178,6 +178,15 @@ void AchievementSettingsWidget::LoadSettings()
SignalBlocking(m_common_login_button)->setVisible(logged_out);
SignalBlocking(m_common_login_button)
->setEnabled(enabled && !Core::IsRunning(Core::System::GetInstance()));
if (enabled && Core::IsRunning(Core::System::GetInstance()))
{
SignalBlocking(m_common_login_button)->setText(tr("To log in, stop the current emulation."));
}
else
{
SignalBlocking(m_common_login_button)->setText(tr("Log In"));
}
SignalBlocking(m_common_logout_button)->setVisible(!logged_out);
SignalBlocking(m_common_logout_button)->setEnabled(enabled);