114 .
label(
"Command Palette")
117 .
description(
"Open command palette for quick access to all actions")
122 if (mw_->commandPalette_)
123 mw_->commandPalette_->showPalette();
128 .
label(
"Focus Search")
135 mw_->searchEdit_->setFocus();
136 mw_->searchEdit_->selectAll();
141 .
label(
"Open Settings")
145 .
action([
this]() { mw_->onSettingsClicked(); })
149 .
label(
"Refresh Library")
153 .
action([
this]() { mw_->onRefreshLibrary(); })
157 .
label(
"Launch Game")
161 .
action([
this]() { mw_->onLaunchClicked(); })
162 .canExecute([
this]() {
return !mw_->selectedGameId_.empty(); })
166 .
label(
"Configure Game")
173 if (!mw_->selectedGameId_.empty())
175 Game* game = mw_->libraryController_->getGameForEdit(mw_->selectedGameId_);
179 if (dialog.exec() == QDialog::Accepted)
181 mw_->libraryController_->updateGame(mw_->selectedGameId_, *game);
182 mw_->detailsPanelManager_->update(mw_->selectedGameId_);
187 .canExecute([
this]() {
return !mw_->selectedGameId_.empty(); })
191 .
label(
"Toggle Favorite")
194 .
description(
"Toggle favorite status for selected game")
195 .
action([
this]() { mw_->toggleSelectedFavorite(); })
196 .canExecute([
this]() {
return !mw_->selectedGameId_.empty(); })
200 .
label(
"Remove from Library")
203 .
description(
"Remove selected game(s) from library")
204 .
action([
this]() { mw_->deleteSelectedGame(); })
205 .canExecute([
this]() {
return !mw_->selectedGameId_.empty(); })
216 mw_->listViewAction_->setChecked(
true);
229 mw_->gridViewAction_->setChecked(
true);
235 .
label(
"Compact View")
242 mw_->compactViewAction_->setChecked(
true);
255 if (mw_->zoomSlider_)
256 mw_->zoomSlider_->setValue(
257 qMin(mw_->zoomSlider_->maximum(), mw_->zoomSlider_->value() + 10));
269 if (mw_->zoomSlider_)
270 mw_->zoomSlider_->setValue(
271 qMax(mw_->zoomSlider_->minimum(), mw_->zoomSlider_->value() - 10));
283 if (mw_->zoomSlider_)
284 mw_->zoomSlider_->setValue(100);
289 .
label(
"Toggle Sidebar")
296 if (mw_->sidebarContainer_)
297 mw_->togglePanel(mw_->sidebarContainer_, mw_->panelSidebarBtn_,
"Sidebar");
302 .
label(
"Toggle Details")
309 if (mw_->detailsContainer_)
310 mw_->togglePanel(mw_->detailsContainer_, mw_->panelDetailsBtn_,
"Details");
316 .
label(
"Toggle Home Assistant")
319 .
description(
"Show or hide the Home Assistant panel")
323 if (mw_->haContainer_)
325 bool willShow = !mw_->haContainer_->isVisible();
326 mw_->togglePanel(mw_->haContainer_, mw_->panelHABtn_,
"Home Assistant");
327 if (willShow && mw_->haPanel_)
328 mw_->haPanel_->loadDashboard();
335 .
label(
"Go to First Game")
342 if (mw_->gameListProxy_ && mw_->gameListProxy_->rowCount() > 0)
344 mw_->gameList_->setCurrentIndex(mw_->gameListProxy_->index(0, 0));
345 mw_->gameList_->scrollToTop();
351 .
label(
"Go to Last Game")
358 if (mw_->gameListProxy_ && mw_->gameListProxy_->rowCount() > 0)
360 const int last = mw_->gameListProxy_->rowCount() - 1;
361 mw_->gameList_->setCurrentIndex(mw_->gameListProxy_->index(last, 0));
362 mw_->gameList_->scrollToBottom();
368 .
label(
"Keyboard Shortcuts")
393 .
label(
"Launch Game (Ctrl+Enter)")
396 .
description(
"Alternative launch binding (Ctrl+Enter)")
397 .
action([
this]() { mw_->onLaunchClicked(); })
398 .canExecute([
this]() {
return !mw_->selectedGameId_.empty(); })
402 .
label(
"Select All Games")
405 .
description(
"Select all games in the current view")
406 .
action([
this]() { mw_->gameList_->selectAll(); })
410 .
label(
"Clear Search")
413 .
description(
"Clear the search box and return focus to the game list")
417 if (mw_->searchEdit_ && !mw_->searchEdit_->text().isEmpty())
419 mw_->searchEdit_->clear();
421 mw_->gameList_->setFocus();
424 .canExecute([
this]() {
return mw_->searchEdit_ && !mw_->searchEdit_->text().isEmpty(); })
428 .
label(
"Add Game Manually")
432 .
action([
this]() { mw_->onAddGameClicked(); })
441 mw_->frameMetricsTimer_ =
new QTimer(mw_);
442 mw_->frameMetricsTimer_->setObjectName(
"frameMetricsTimer");
443 mw_->frameMetricsTimer_->setInterval(750);
444 connect(mw_->frameMetricsTimer_, &QTimer::timeout, mw_,
448 if (!mw_->selectedGameId_.empty() &&
449 mw_->launchController_->isGameRunning(mw_->selectedGameId_))
451 mw_->detailsPanelManager_->updateRunningInfo(mw_->selectedGameId_);
455 mw_->updateRunningGameStatus();
457 mw_->frameMetricsTimer_->start();
462 if (!mw_->commandPalette_)
465 std::vector<PaletteCommand> commands;
472 .label(
"Launch Game")
476 .description(
"Launch the currently selected game")
478 .action([
this]() { mw_->onLaunchClicked(); })
482 return !mw_->selectedGameId_.empty() &&
483 !mw_->launchController_->isGameRunning(
484 mw_->selectedGameId_);
492 .icon(
"\xE2\x96\xA0")
493 .description(
"Stop the currently running game")
495 .action([
this]() { mw_->onStopClicked(); })
499 return !mw_->selectedGameId_.empty() &&
500 mw_->launchController_->isGameRunning(mw_->selectedGameId_);
505 return !mw_->selectedGameId_.empty() &&
506 mw_->launchController_->isGameRunning(mw_->selectedGameId_);
512 .label(
"Configure Game...")
515 .icon(
"\xE2\x9A\x99")
516 .description(
"Open game configuration dialog")
521 if (!mw_->selectedGameId_.empty())
523 Game* game = mw_->libraryController_->getGameForEdit(mw_->selectedGameId_);
527 if (dialog.exec() == QDialog::Accepted)
529 mw_->libraryController_->updateGame(mw_->selectedGameId_, *game);
530 mw_->detailsPanelManager_->update(mw_->selectedGameId_);
535 .
enabledWhen([
this]() {
return !mw_->selectedGameId_.empty(); })
539 .label(
"Toggle Favorite")
543 .description(
"Add or remove game from favorites")
545 .action([
this]() { mw_->toggleSelectedFavorite(); })
546 .
enabledWhen([
this]() {
return !mw_->selectedGameId_.empty(); })
551 .label(
"Open Game Folder")
554 .description(
"Open the game's installation folder in file manager")
559 if (!mw_->selectedGameId_.empty())
561 const Game* game = mw_->libraryController_->getGame(mw_->selectedGameId_);
566 QString::fromStdString(exePath.parent_path().string());
567 QDesktopServices::openUrl(QUrl::fromLocalFile(folderPath));
571 .
enabledWhen([
this]() {
return !mw_->selectedGameId_.empty(); })
575 .label(
"View on ProtonDB")
578 .description(
"Open ProtonDB page for mw_ game")
583 if (!mw_->selectedGameId_.empty())
586 mw_->libraryController_->getGame(mw_->selectedGameId_);
589 QString url = QString(
"https://www.protondb.com/app/%1")
591 QDesktopServices::openUrl(QUrl(url));
598 if (mw_->selectedGameId_.empty())
601 mw_->libraryController_->getGame(mw_->selectedGameId_);
607 .label(
"Remove from Library")
611 .description(
"Remove the selected game(s) from library")
613 .action([
this]() { mw_->deleteSelectedGame(); })
614 .
enabledWhen([
this]() {
return !mw_->selectedGameId_.empty(); })
622 .label(
"Add Game Manually...")
625 .icon(
"\xE2\x9E\x95")
626 .description(
"Add a new game to the library manually")
628 .action([
this]() { mw_->onAddGameClicked(); })
633 .label(
"Import Games...")
636 .description(
"Scan and import games from various sources")
642 if (dialog.exec() == QDialog::Accepted)
645 mw_->libraryController_->getAllGames(),
646 [
this](
const std::string& gameId,
647 const std::function<
void(
Game&)>& updater)
648 { mw_->libraryController_->executeWithGame(gameId, updater); });
649 mw_->updateSourceFilters();
650 mw_->updateCategoryCounts();
651 mw_->refreshGameList();
652 QTimer::singleShot(500, mw_, [
this]() { mw_->fetchMissingProtonDB(); });
658 .label(
"Install from Lutris...")
661 .description(
"Search and install games from Lutris database")
672 .label(
"Refresh Library")
676 .description(
"Refresh the game library")
678 .action([
this]() { mw_->onRefreshLibrary(); })
689 .icon(
"\xE2\x98\xB0")
690 .description(
"Switch to list view")
695 mw_->listViewAction_->setChecked(
true);
704 .icon(
"\xE2\x8A\x9E")
705 .description(
"Switch to grid view")
710 mw_->gridViewAction_->setChecked(
true);
716 .label(
"Compact View")
719 .icon(
"\xE2\x96\xA4")
720 .description(
"Switch to compact view")
725 mw_->compactViewAction_->setChecked(
true);
731 .label(
"Toggle Sidebar")
734 .icon(
"\xE2\x96\x8C")
735 .description(
"Show or hide the sidebar panel")
740 if (mw_->sidebarContainer_)
741 mw_->togglePanel(mw_->sidebarContainer_,
742 mw_->panelSidebarBtn_,
"Sidebar");
747 .label(
"Toggle Details Panel")
750 .icon(
"\xE2\x96\x90")
751 .description(
"Show or hide the details panel")
756 if (mw_->detailsContainer_)
757 mw_->togglePanel(mw_->detailsContainer_,
758 mw_->panelDetailsBtn_,
"Details");
762#ifdef HAVE_QTERMWIDGET
764 .label(
"Toggle System Monitor")
767 .description(
"Show or hide the system monitor panel")
772 if (mw_->terminalContainer_)
773 mw_->togglePanel(mw_->terminalContainer_,
774 mw_->panelMonitorBtn_,
"Monitor");
781 .label(
"Toggle Home Assistant")
784 .description(
"Show or hide the Home Assistant panel")
789 if (mw_->haContainer_)
791 bool willShow = !mw_->haContainer_->isVisible();
792 mw_->togglePanel(mw_->haContainer_, mw_->panelHABtn_,
794 if (willShow && mw_->haPanel_)
795 mw_->haPanel_->loadDashboard();
802 .label(
"Focus Search")
806 .description(
"Focus the search input")
811 mw_->searchEdit_->setFocus();
812 mw_->searchEdit_->selectAll();
817 .label(
"Clear Search")
820 .icon(
"\xE2\x9C\x95")
821 .description(
"Clear the search filter")
826 mw_->searchEdit_->clear();
827 mw_->gameList_->setFocus();
829 .
enabledWhen([
this]() {
return !mw_->searchEdit_->text().isEmpty(); })
837 .icon(
"\xE2\x9E\x95")
838 .description(
"Increase zoom level")
843 if (mw_->zoomSlider_)
844 mw_->zoomSlider_->setValue(
845 qMin(mw_->zoomSlider_->maximum(), mw_->zoomSlider_->value() + 10));
854 .icon(
"\xE2\x9E\x96")
855 .description(
"Decrease zoom level")
860 if (mw_->zoomSlider_)
861 mw_->zoomSlider_->setValue(
862 qMax(mw_->zoomSlider_->minimum(), mw_->zoomSlider_->value() - 10));
871 .description(
"Reset zoom to 100%")
876 if (mw_->zoomSlider_)
877 mw_->zoomSlider_->setValue(100);
886 .label(
"Manage Runners...")
889 .description(
"Manage Proton and Wine versions")
900 .label(
"System Info...")
903 .description(
"View detailed system information")
909 widget->setWindowFlag(Qt::Window);
910 widget->setWindowTitle(
"System Readiness");
911 widget->resize(600, 700);
917 .label(
"Performance Profiles...")
919 .icon(
"\xE2\x9A\xA1")
920 .description(
"Manage per-game performance profiles")
927 mw_->selectedGameId_.empty()
929 : mw_->libraryController_->getGame(mw_->selectedGameId_);
930 if (mw_->performanceProfileService_)
933 game, mw_->performanceProfileService_.get(), mw_);
944 .label(
"Settings...")
945 .category(
"Settings")
947 .icon(
"\xE2\x9A\x99")
948 .description(
"Open application settings")
950 .action([
this]() { mw_->onSettingsClicked(); })
955 for (
const QString& themeId : themeManager.getAvailableThemeIds())
957 const Theme* theme = themeManager.getTheme(themeId);
960 QString capturedId = themeId;
963 .label(QString(
"Theme: %1").arg(theme->
displayName))
968 .
action([capturedId]() { ThemeManager::instance().setTheme(capturedId); })
977 .label(
"Go to All Games")
978 .category(
"Navigation")
980 .description(
"Show all games in library")
985 if (mw_->sidebarManager_)
986 mw_->sidebarManager_->selectCategoryByRow(0);
987 mw_->currentCategory_ = 0;
988 mw_->currentCollection_.clear();
989 mw_->refreshGameList();
994 .label(
"Go to Favorites")
995 .category(
"Navigation")
997 .description(
"Show favorite games")
1002 if (mw_->sidebarManager_)
1003 mw_->sidebarManager_->selectCategoryByText(
1004 QStringLiteral(
"Favorites"));
1009 .label(
"Go to Recently Played")
1010 .category(
"Navigation")
1012 .description(
"Show recently played games")
1017 if (mw_->sidebarManager_)
1018 mw_->sidebarManager_->selectCategoryByText(
1019 QStringLiteral(
"Recently"));
1024 .label(
"Go to Running Games")
1025 .category(
"Navigation")
1026 .icon(
"\xE2\x96\xB6")
1027 .description(
"Show currently running games")
1032 if (mw_->sidebarManager_)
1033 mw_->sidebarManager_->selectCategoryByText(
1034 QStringLiteral(
"Running"));
1039 .label(
"Go to Updates Available")
1040 .category(
"Navigation")
1041 .icon(
"\xE2\xAC\x86")
1042 .description(
"Show games with pending updates")
1047 if (mw_->sidebarManager_)
1048 mw_->sidebarManager_->selectCategoryByText(
1049 QStringLiteral(
"Updates"));
1054 .label(
"Keyboard Shortcuts")
1057 .icon(
"\xE2\x8C\xA8")
1058 .description(
"Show keyboard shortcut cheat sheet")
1074 .category(
"Application")
1076 .description(
"Exit the application")
1081 mw_->forceQuit_ =
true;
1087 mw_->commandPalette_->registerCommands(commands);
1093 mw_->commandPalette_->registerDynamicProvider(
1094 [
this]() -> std::vector<PaletteCommand>
1096 std::vector<PaletteCommand> dynamic;
1099 auto runningGames = mw_->launchController_->getAllRunningGames();
1100 for (
const auto& info : runningGames)
1102 std::string gameId = info.gameId;
1103 QString gameName = QString::fromStdString(info.gameName);
1105 CommandBuilder(QString(
"dynamic.stop.%1").arg(QString::fromStdString(gameId)))
1106 .label(QString(
"Stop %1").arg(gameName))
1107 .category(
"Running Games")
1108 .icon(
"\xE2\x96\xA0")
1109 .description(QString(
"Stop %1").arg(gameName))
1111 .action([
this, gameId]() { mw_->launchController_->stopGame(gameId); })
1116 auto collections = mw_->libraryController_->getCollections();
1117 for (
const auto& collection : collections)
1119 QString collName = QString::fromStdString(collection);
1122 .label(QString(
"Go to Collection: %1").arg(collName))
1123 .category(
"Navigation")
1125 .description(QString(
"Show games in %1 collection").arg(collName))
1128 [
this, collection]()
1130 mw_->currentCollection_ = collection;
1131 mw_->currentCategory_ = 0;
1132 mw_->refreshGameList();