Qt: Remove game info from settings

Doesn't belong here, and I need the space.
This commit is contained in:
Stenzek
2026-01-08 15:13:35 +10:00
parent 3dcb73f66f
commit f7e83492b9
9 changed files with 1 additions and 85 deletions

View File

@@ -1005,7 +1005,6 @@ void Achievements::UpdateRichPresence(std::unique_lock<std::recursive_mutex>& lo
s_state.rich_presence_string.assign(sv);
INFO_LOG("Rich presence updated: {}", s_state.rich_presence_string);
Host::OnAchievementsRefreshed();
lock.unlock();
System::UpdateRichPresence(false);
@@ -1247,8 +1246,6 @@ void Achievements::ClientLoadGameCallback(int result, const char* error_message,
if (display_summary)
DisplayAchievementSummary();
Host::OnAchievementsRefreshed();
}
void Achievements::ClearGameInfo()
@@ -1274,8 +1271,6 @@ void Achievements::ClearGameInfo()
s_state.has_rich_presence = false;
s_state.rich_presence_string = {};
s_state.game_summary = {};
Host::OnAchievementsRefreshed();
}
void Achievements::ClearGameHash()

View File

@@ -209,10 +209,6 @@ void OnAchievementsLoginRequested(Achievements::LoginRequestReason reason);
/// Called when achievements login completes.
void OnAchievementsLoginSuccess(const char* display_name, u32 points, u32 sc_points, u32 unread_messages);
/// Called whenever game details or rich presence information is updated.
/// Implementers can assume the lock is held when this is called.
void OnAchievementsRefreshed();
/// Called when achievements login completes or they are disabled.
void OnAchievementsActiveChanged(bool active);

View File

@@ -1105,11 +1105,6 @@ void Host::OnAchievementsLoginSuccess(const char* username, u32 points, u32 sc_p
// noop
}
void Host::OnAchievementsRefreshed()
{
// noop
}
void Host::OnAchievementsActiveChanged(bool active)
{
// noop

View File

@@ -105,19 +105,11 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi
connect(m_ui.loginButton, &QPushButton::clicked, this, &AchievementSettingsWidget::onLoginLogoutPressed);
connect(m_ui.viewProfile, &QPushButton::clicked, this, &AchievementSettingsWidget::onViewProfilePressed);
connect(m_ui.refreshProgress, &QPushButton::clicked, g_main_window, &MainWindow::refreshAchievementProgress);
connect(g_core_thread, &CoreThread::achievementsRefreshed, this,
&AchievementSettingsWidget::onAchievementsRefreshed);
updateLoginState();
// force a refresh of game info
Host::RunOnCoreThread(Host::OnAchievementsRefreshed);
}
else
{
// remove login and game info, not relevant for per-game
m_ui.verticalLayout->removeWidget(m_ui.gameInfoBox);
m_ui.gameInfoBox->deleteLater();
m_ui.gameInfoBox = nullptr;
// remove login, not relevant for per-game
m_ui.verticalLayout->removeWidget(m_ui.loginBox);
m_ui.loginBox->deleteLater();
m_ui.loginBox = nullptr;
@@ -274,8 +266,3 @@ void AchievementSettingsWidget::onViewProfilePressed()
QtUtils::GetRootWidget(this),
QUrl(QStringLiteral("https://retroachievements.org/user/%1").arg(QString::fromUtf8(encoded_username))));
}
void AchievementSettingsWidget::onAchievementsRefreshed(quint32 id, const QString& game_info_string)
{
m_ui.gameInfo->setText(game_info_string);
}

View File

@@ -27,7 +27,6 @@ private:
void onLoginLogoutPressed();
void onLoginCompleted();
void onViewProfilePressed();
void onAchievementsRefreshed(quint32 id, const QString& game_info_string);
Ui::AchievementSettingsWidget m_ui;

View File

@@ -273,28 +273,6 @@ Login token generated at:</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gameInfoBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>75</height>
</size>
</property>
<property name="title">
<string>Game Info</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="gameInfo">
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

View File

@@ -1668,34 +1668,6 @@ void Host::OnAchievementsLoginSuccess(const char* username, u32 points, u32 sc_p
emit g_core_thread->achievementsLoginSuccess(QString::fromUtf8(username), points, sc_points, unread_messages);
}
void Host::OnAchievementsRefreshed()
{
u32 game_id = 0;
QString game_info;
if (Achievements::HasActiveGame())
{
game_id = Achievements::GetGameID();
game_info = qApp->translate("CoreThread", "Game: %1 (%2)\n")
.arg(QString::fromStdString(Achievements::GetGameTitle()))
.arg(game_id);
const std::string& rich_presence_string = Achievements::GetRichPresenceString();
if (Achievements::HasRichPresence() && !rich_presence_string.empty())
game_info.append(QString::fromStdString(StringUtil::Ellipsise(rich_presence_string, 128)));
else
game_info.append(qApp->translate("CoreThread", "Rich presence inactive or unsupported."));
}
else
{
game_info = qApp->translate("CoreThread", "Game not loaded or no RetroAchievements available.");
}
emit g_core_thread->achievementsRefreshed(game_id, game_info);
}
void Host::OnAchievementsActiveChanged(bool active)
{
emit g_core_thread->achievementsActiveChanged(active);

View File

@@ -124,7 +124,6 @@ Q_SIGNALS:
void fullscreenUIStartedOrStopped(bool running);
void achievementsLoginRequested(Achievements::LoginRequestReason reason);
void achievementsLoginSuccess(const QString& username, quint32 points, quint32 sc_points, quint32 unread_messages);
void achievementsRefreshed(quint32 id, const QString& game_info_string);
void achievementsActiveChanged(bool active);
void achievementsHardcoreModeChanged(bool enabled);
void mediaCaptureStarted();

View File

@@ -646,11 +646,6 @@ void Host::OnAchievementsLoginSuccess(const char* username, u32 points, u32 sc_p
// noop
}
void Host::OnAchievementsRefreshed()
{
// noop
}
void Host::OnAchievementsActiveChanged(bool active)
{
// noop