Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: add option to reset time played #13698

Merged
merged 1 commit into from Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.cpp
Expand Up @@ -1302,6 +1302,7 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
QAction* download_compat = menu.addAction(tr("&Download Compatibility Database"));
menu.addSeparator();
QAction* edit_notes = menu.addAction(tr("&Edit Tooltip Notes"));
QAction* reset_time_played = menu.addAction(tr("&Reset Time Played"));

QMenu* icon_menu = menu.addMenu(tr("&Custom Images"));
const std::array<QAction*, 3> custom_icon_actions =
Expand Down Expand Up @@ -1625,6 +1626,16 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
Refresh();
}
});
connect(reset_time_played, &QAction::triggered, this, [this, name, serial]
{
if (QMessageBox::question(this, tr("Confirm Reset"), tr("Reset time played?\n\n%0 [%1]").arg(name).arg(serial)) == QMessageBox::Yes)
{
m_persistent_settings->SetPlaytime(serial, 0);
m_persistent_settings->SetLastPlayed(serial, 0);
m_persistent_settings->sync();
Refresh();
}
});
connect(copy_info, &QAction::triggered, this, [name, serial]
{
QApplication::clipboard()->setText(name % QStringLiteral(" [") % serial % QStringLiteral("]"));
Expand Down