11#include <QApplication>
14#include <QDirIterator>
24#include <QRegularExpression>
33 : QWizard(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance())
35 setWindowTitle(
"Welcome to Game Launcher");
36 setWizardStyle(QWizard::ModernStyle);
37 setMinimumSize(720, 560);
40 setOption(QWizard::HaveHelpButton,
false);
43 addPage(
new ThemePage(
this, themeManager_));
45 addPage(
new DonePage(
this, themeManager_));
56 return settings.value(
"app/firstRunCompleted",
false).toBool();
62 settings.setValue(
"app/firstRunCompleted",
true);
68 if (!currentTheme.isEmpty())
70 settings.setValue(
"app/wizardThemeId", currentTheme);
74void FirstRunWizard::setupStyle()
76 const auto& c = themeManager_->
colors();
78 QColor accentFaded = c.
accent;
79 accentFaded.setAlpha(40);
93 "QPushButton[text=\"Next\"], QPushButton[text=\"Finish\"],"
94 "QPushButton[text=\"&Next >\"], QPushButton[text=\"&Finish\"] {"
98 " border-radius: 6px;"
100 " font-weight: bold;"
102 "QPushButton[text=\"Next\"]:hover, QPushButton[text=\"Finish\"]:hover,"
103 "QPushButton[text=\"&Next >\"]:hover, QPushButton[text=\"&Finish\"]:hover {"
110 " border: 1px solid %4;"
111 " border-radius: 6px;"
112 " padding: 8px 18px;"
114 "QPushButton:hover {"
118 "QPushButton:pressed {"
125 " border: 1px solid %4;"
126 " border-radius: 6px;"
128 "QListWidget::item {"
129 " padding: 7px 10px;"
130 " border-radius: 4px;"
133 "QListWidget::item:hover {"
136 "QListWidget::item:selected {"
144 "QCheckBox::indicator {"
147 " border: 2px solid %4;"
148 " border-radius: 4px;"
151 "QCheckBox::indicator:checked {"
155 "QCheckBox::indicator:hover {"
162 "QRadioButton::indicator {"
165 " border: 2px solid %4;"
166 " border-radius: 9px;"
169 "QRadioButton::indicator:checked {"
173 "QRadioButton::indicator:hover {"
179 " border: 1px solid %4;"
180 " border-radius: 6px;"
181 " padding: 6px 10px;"
186 .arg(c.windowBackground.name(),
187 c.textPrimary.name(),
188 c.cardBackground.name(),
190 c.hoverBackground.name(),
192 c.textOnAccent.name(),
193 c.inputBackground.name(),
194 c.accentHover.name(),
195 accentFaded.name(QColor::HexArgb)
204 : QWizardPage(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance())
210void WelcomePage::setupUI()
212 auto* layout =
new QVBoxLayout(
this);
213 layout->setSpacing(16);
215 layout->addStretch(2);
218 auto* iconLabel =
new QLabel(
this);
219 iconLabel->setPixmap(QApplication::windowIcon().pixmap(72, 72));
220 iconLabel->setAlignment(Qt::AlignCenter);
221 layout->addWidget(iconLabel);
223 layout->addSpacing(8);
226 auto* titleLabel =
new QLabel(
"Game Launcher",
this);
227 QFont titleFont = titleLabel->font();
229 titleFont.setBold(
true);
230 titleLabel->setFont(titleFont);
231 titleLabel->setAlignment(Qt::AlignCenter);
232 layout->addWidget(titleLabel);
234 layout->addSpacing(4);
237 auto* subtitleLabel =
new QLabel(
"Your complete game library, unified.\n"
238 "Let's get you set up.",
240 QFont subFont = subtitleLabel->font();
242 subtitleLabel->setFont(subFont);
243 subtitleLabel->setAlignment(Qt::AlignCenter);
244 subtitleLabel->setWordWrap(
true);
245 const auto& c = themeManager_->
colors();
246 QPalette subPal = subtitleLabel->palette();
247 subPal.setColor(QPalette::WindowText, c.textSecondary);
248 subtitleLabel->setPalette(subPal);
249 layout->addWidget(subtitleLabel);
251 layout->addStretch(3);
259 : QWizardPage(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance()),
260 selectedThemeId_(themeManager_->currentThemeId())
262 setTitle(
"Appearance");
263 setSubTitle(
"Choose a color scheme. You can change this anytime in Settings.");
267void ThemePage::setupUI()
269 auto* layout =
new QVBoxLayout(
this);
270 layout->setSpacing(16);
272 layout->addStretch(1);
275 auto* grid =
new QGridLayout();
276 grid->setSpacing(12);
277 grid->setAlignment(Qt::AlignCenter);
282 QColor bg, fg, accent;
285 QList<ThemeInfo> themes = {
286 {
"auto",
"Auto", QColor(
"#2b2b2b"), QColor(
"#e0e0e0"), QColor(
"#4a9eff")},
287 {
"standard-dark",
"Dark", QColor(
"#1e1e2e"), QColor(
"#cdd6f4"), QColor(
"#89b4fa")},
288 {
"standard-light",
"Light", QColor(
"#f5f5f5"), QColor(
"#1e1e1e"), QColor(
"#1a73e8")},
289 {
"cachyos-emerald",
"CachyOS", QColor(
"#1a1b26"), QColor(
"#c0caf5"), QColor(
"#00b894")},
290 {
"nord-dark",
"Nord Dark", QColor(
"#2e3440"), QColor(
"#d8dee9"), QColor(
"#88c0d0")},
291 {
"nord-light",
"Nord Light", QColor(
"#eceff4"), QColor(
"#2e3440"), QColor(
"#5e81ac")},
292 {
"dracula",
"Dracula", QColor(
"#282a36"), QColor(
"#f8f8f2"), QColor(
"#bd93f9")},
293 {
"catppuccin-mocha",
"Catppuccin", QColor(
"#1e1e2e"), QColor(
"#cdd6f4"), QColor(
"#cba6f7")},
294 {
"gruvbox-dark",
"Gruvbox Dark", QColor(
"#282828"), QColor(
"#ebdbb2"), QColor(
"#fe8019")},
295 {
"gruvbox-light",
"Gruvbox Light", QColor(
"#fbf1c7"), QColor(
"#3c3836"), QColor(
"#d65d0e")},
296 {
"tokyo-night",
"Tokyo Night", QColor(
"#1a1b26"), QColor(
"#c0caf5"), QColor(
"#7aa2f7")},
297 {
"solarized-light",
"Solarized", QColor(
"#fdf6e3"), QColor(
"#657b83"), QColor(
"#268bd2")},
300 for (
int i = 0; i < themes.size(); ++i)
302 const auto& t = themes[i];
303 auto* btn = createThemeButton(t.id, t.label, t.bg, t.fg, t.accent);
304 grid->addWidget(btn, i / 4, i % 4);
307 layout->addLayout(grid);
308 layout->addStretch(2);
310 selectTheme(selectedThemeId_);
313QPushButton* ThemePage::createThemeButton(
const QString& themeId,
const QString& label,
314 const QColor& bg,
const QColor& fg,
const QColor& accent)
316 auto* btn =
new QPushButton(
this);
317 btn->setFixedSize(150, 90);
318 btn->setCursor(Qt::PointingHandCursor);
319 btn->setProperty(
"themeId", themeId);
321 auto* btnLayout =
new QVBoxLayout(btn);
322 btnLayout->setContentsMargins(0, 0, 0, 0);
323 btnLayout->setSpacing(4);
326 auto* swatchFrame =
new QFrame(btn);
327 swatchFrame->setFixedHeight(48);
328 swatchFrame->setStyleSheet(QString(
"QFrame { background: %1; border-top-left-radius: 5px; "
329 "border-top-right-radius: 5px; border: none; }")
332 auto* swatchLayout =
new QVBoxLayout(swatchFrame);
333 swatchLayout->setContentsMargins(10, 6, 10, 6);
336 auto* sampleLabel =
new QLabel(
"Aa", swatchFrame);
337 sampleLabel->setStyleSheet(
339 "color: %1; font-size: %2px; font-weight: bold; background: transparent; border: none;")
341 .arg(themeManager_->scaledFontSize(16)));
342 sampleLabel->setAlignment(Qt::AlignCenter);
343 swatchLayout->addWidget(sampleLabel);
346 auto* accentBar =
new QFrame(swatchFrame);
347 accentBar->setFixedHeight(3);
348 accentBar->setStyleSheet(
349 QString(
"QFrame { background: %1; border-radius: 1px; border: none; }").arg(accent.name()));
350 swatchLayout->addWidget(accentBar);
352 btnLayout->addWidget(swatchFrame);
355 auto* nameLabel =
new QLabel(label, btn);
356 nameLabel->setAlignment(Qt::AlignCenter);
357 QFont nameFont = nameLabel->font();
358 nameFont.setPointSize(themeManager_->scaledFontSize(9));
359 nameLabel->setFont(nameFont);
360 nameLabel->setStyleSheet(
"background: transparent; border: none;");
361 btnLayout->addWidget(nameLabel);
363 themeButtons_.append(btn);
365 connect(btn, &QPushButton::clicked,
this, [
this, themeId]() { selectTheme(themeId); });
370void ThemePage::selectTheme(
const QString& themeId)
372 selectedThemeId_ = themeId;
374 themeManager_->setTheme(themeId);
375 themeManager_->applyToApplication();
377 const auto& c = themeManager_->colors();
379 for (
auto* btn : themeButtons_)
381 QString
id = btn->property(
"themeId").toString();
382 bool selected = (
id == themeId);
384 btn->setStyleSheet(QString(
"QPushButton {"
387 " border-radius: 6px;"
390 "QPushButton:hover {"
391 " border: 2px solid %3;"
393 .arg(c.cardBackground.name(),
394 selected ? QString(
"2px solid %1").arg(c.accent.name())
395 : QString(
"1px solid %1").arg(c.border.name()),
405 : QWizardPage(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance())
407 setTitle(
"Home Page");
408 setSubTitle(
"Choose what you see when the app starts.");
412void IntegrationsPage::setupUI()
414 auto* layout =
new QVBoxLayout(
this);
415 layout->setSpacing(20);
417 layout->addStretch(1);
419 const auto& c = themeManager_->
colors();
423 auto* libraryCard =
new QFrame(
this);
424 libraryCard->setStyleSheet(
425 QString(
"QFrame#libraryCard { background: %1; border: 1px solid %2; border-radius: 8px; }")
426 .arg(c.cardBackground.name(), c.border.name()));
427 libraryCard->setObjectName(
"libraryCard");
429 auto* libLayout =
new QVBoxLayout(libraryCard);
430 libLayout->setContentsMargins(20, 14, 20, 14);
431 libLayout->setSpacing(6);
433 homeGameLibrary_ =
new QRadioButton(
"Game Library", libraryCard);
434 QFont radioFont = homeGameLibrary_->font();
436 radioFont.setBold(
true);
437 homeGameLibrary_->setFont(radioFont);
438 homeGameLibrary_->setStyleSheet(
"border: none;");
439 libLayout->addWidget(homeGameLibrary_);
441 auto* libDesc =
new QLabel(
442 "Start on your game collection with quick access to launch, configure, and manage games.",
444 libDesc->setWordWrap(
true);
445 libDesc->setStyleSheet(
446 QString(
"color: %1; border: none; padding-left: 24px;").arg(c.textSecondary.name()));
447 libLayout->addWidget(libDesc);
449 layout->addWidget(libraryCard);
452 auto* haCard =
new QFrame(
this);
453 haCard->setStyleSheet(
454 QString(
"QFrame#haCard { background: %1; border: 1px solid %2; border-radius: 8px; }")
455 .arg(c.cardBackground.name(), c.border.name()));
456 haCard->setObjectName(
"haCard");
458 auto* haLayout =
new QVBoxLayout(haCard);
459 haLayout->setContentsMargins(20, 14, 20, 14);
460 haLayout->setSpacing(6);
462 homeAssistantRadio_ =
new QRadioButton(
"Home Assistant Dashboard", haCard);
463 homeAssistantRadio_->setFont(radioFont);
464 homeAssistantRadio_->setStyleSheet(
"border: none;");
465 haLayout->addWidget(homeAssistantRadio_);
467 auto* haDesc =
new QLabel(
"Open your Home Assistant dashboard on launch. "
468 "Control smart home devices without leaving the launcher.",
470 haDesc->setWordWrap(
true);
471 haDesc->setStyleSheet(
472 QString(
"color: %1; border: none; padding-left: 24px;").arg(c.textSecondary.name()));
473 haLayout->addWidget(haDesc);
476 auto* urlRow =
new QHBoxLayout();
477 urlRow->setContentsMargins(24, 4, 0, 0);
478 auto* urlLabel =
new QLabel(
"URL:", haCard);
479 urlLabel->setStyleSheet(
"border: none;");
480 haUrlEdit_ =
new QLineEdit(haCard);
481 haUrlEdit_->setPlaceholderText(
"http://homeassistant.local:8123");
483 QString savedUrl = settings.value(
"app/homeAssistantUrl",
"").toString();
484 haUrlEdit_->setText(savedUrl);
486 urlRow->addWidget(urlLabel);
487 urlRow->addWidget(haUrlEdit_, 1);
488 haLayout->addLayout(urlRow);
490 layout->addWidget(haCard);
492 layout->addStretch(2);
495 bool haEnabled = settings.value(
"app/enableHomeAssistant",
false).toBool();
496 if (haEnabled && !savedUrl.isEmpty())
497 homeAssistantRadio_->setChecked(
true);
499 homeGameLibrary_->setChecked(
true);
503 connect(homeGameLibrary_, &QRadioButton::toggled,
this, &IntegrationsPage::updateHAFields);
504 connect(homeAssistantRadio_, &QRadioButton::toggled,
this, &IntegrationsPage::updateHAFields);
507void IntegrationsPage::updateHAFields()
509 bool haSelected = homeAssistantRadio_->isChecked();
510 haUrlEdit_->setEnabled(haSelected);
516 bool haEnabled = homeAssistantRadio_->isChecked();
519 settings.setValue(
"wizard/enableHomeAssistant", haEnabled);
520 if (!haUrlEdit_->text().trimmed().isEmpty())
522 settings.setValue(
"wizard/homeAssistantUrl", haUrlEdit_->text().trimmed());
531 : QWizardPage(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance())
533 setTitle(
"Game Libraries");
534 setSubTitle(
"Scanning your system for installed games.");
538void LibraryDetectionPage::setupUI()
540 auto* layout =
new QVBoxLayout(
this);
541 layout->setSpacing(12);
543 sourcesList_ =
new QListWidget(
this);
544 sourcesList_->setSelectionMode(QAbstractItemView::NoSelection);
545 sourcesList_->setFocusPolicy(Qt::NoFocus);
546 layout->addWidget(sourcesList_, 1);
548 summaryLabel_ =
new QLabel(
this);
549 summaryLabel_->setWordWrap(
true);
550 QFont summaryFont = summaryLabel_->font();
552 summaryLabel_->setFont(summaryFont);
553 const auto& c = themeManager_->
colors();
554 QPalette sumPal = summaryLabel_->palette();
555 sumPal.setColor(QPalette::WindowText, c.textSecondary);
556 summaryLabel_->setPalette(sumPal);
557 layout->addWidget(summaryLabel_);
565void LibraryDetectionPage::runDetection()
567 sourcesList_->clear();
569 int sourcesFound = 0;
571 const auto& c = themeManager_->
colors();
572 auto addSourceItem = [&](
const QString& name,
bool found,
int games = 0,
bool showCount =
true)
574 auto* item =
new QListWidgetItem(sourcesList_);
575 auto* label =
new QLabel(sourcesList_);
576 label->setTextFormat(Qt::RichText);
578 QString statusColor, statusText, iconHtml;
581 iconHtml = QString(
"<span style='color:%1; font-weight:bold;'>✓</span>")
582 .arg(c.success.name());
583 statusColor = c.success.name();
585 (showCount && games > 0) ? QString(
"%1 game(s) found").arg(games) :
"detected";
591 iconHtml = QString(
"<span style='color:%1; font-weight:bold;'>✗</span>")
592 .arg(c.error.name());
593 statusColor = c.textSecondary.name();
594 statusText =
"not detected";
597 int fs14 = themeManager_->scaledFontSize(14);
598 int fs13 = themeManager_->scaledFontSize(13);
599 label->setText(QString(
"%1 <b style='color:%2; font-size:%6px;'>%3</b>"
600 " <span style='color:%4; font-size:%7px;'>— %5</span>")
601 .arg(iconHtml, c.textPrimary.name(), name, statusColor, statusText)
605 QFont labelFont = label->font();
606 labelFont.setPointSize(themeManager_->scaledFontSize(11));
607 label->setFont(labelFont);
608 label->setStyleSheet(QString(
"color: %1; padding: 8px 12px; background: transparent;")
609 .arg(c.textPrimary.name()));
610 label->setMinimumHeight(32);
611 item->setSizeHint(QSize(0, 36));
612 sourcesList_->setItemWidget(item, label);
617 QStringList steamPaths = {
618 QDir::homePath() +
"/.local/share/Steam",
619 QDir::homePath() +
"/.steam/steam",
620 QDir::homePath() +
"/.steam/root",
621 QDir::homePath() +
"/.var/app/com.valvesoftware.Steam/.local/share/Steam",
627 for (
const auto& path : steamPaths)
634 QDir steamApps(path +
"/steamapps");
635 if (steamApps.exists())
637 games =
static_cast<int>(
638 steamApps.entryList(QStringList() <<
"appmanifest_*.acf", QDir::Files).size());
642 QFile libFile(path +
"/steamapps/libraryfolders.vdf");
643 if (libFile.open(QIODevice::ReadOnly | QIODevice::Text))
645 QString content = libFile.readAll();
647 QRegularExpression pathRegex(QStringLiteral(
"\"path\"\\s+\"([^\"]+)\""));
648 auto iter = pathRegex.globalMatch(content);
649 while (iter.hasNext())
651 auto match = iter.next();
652 QString libPath = match.captured(1);
655 QDir extra(libPath +
"/steamapps");
657 games +=
static_cast<int>(
658 extra.entryList(QStringList() <<
"appmanifest_*.acf", QDir::Files)
665 addSourceItem(
"Steam", found, games);
672 QStringList paths = {
673 QDir::homePath() +
"/.local/share/lutris",
674 QDir::homePath() +
"/.config/lutris",
676 for (
const auto& path : paths)
678 if (!QDir(path).exists())
681 QDir gamesDir(path +
"/games");
682 if (gamesDir.exists())
684 games,
static_cast<int>(
685 gamesDir.entryList(QStringList() <<
"*.yml" <<
"*.yaml", QDir::Files)
689 addSourceItem(
"Lutris", found, games);
694 bool found = QDir(QDir::homePath() +
"/.config/heroic").exists();
695 addSourceItem(
"Heroic Games Launcher", found, 0,
false);
701 QDir(QDir::homePath() +
"/.local/share/bottles").exists() ||
702 QDir(QDir::homePath() +
"/.var/app/com.usebottles.bottles/data/bottles").exists();
703 addSourceItem(
"Bottles", found, 0,
false);
707 if (sourcesFound > 0)
709 summaryLabel_->setText(QString(
"Found %1 source(s) with %2 total game(s). "
710 "You can add more sources from Settings after setup.")
716 summaryLabel_->setText(
"No game sources detected. You can add games manually "
717 "or configure sources in Settings after setup.");
726 : QWizardPage(parent), themeManager_(themeManager ? themeManager : &
ThemeManager::instance())
729 setSubTitle(
"Your system has been scanned for game sources.");
733void DonePage::setupUI()
735 auto* layout =
new QVBoxLayout(
this);
736 layout->setSpacing(12);
737 layout->setContentsMargins(20, 8, 20, 8);
740 sourcesList_ =
new QListWidget(
this);
741 sourcesList_->setSelectionMode(QAbstractItemView::NoSelection);
742 sourcesList_->setFocusPolicy(Qt::NoFocus);
743 sourcesList_->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
744 sourcesList_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
745 layout->addWidget(sourcesList_);
747 layout->addSpacing(4);
749 summaryLabel_ =
new QLabel(
this);
750 summaryLabel_->setAlignment(Qt::AlignCenter);
751 summaryLabel_->setWordWrap(
true);
752 QFont summaryFont = summaryLabel_->font();
754 summaryLabel_->setFont(summaryFont);
755 layout->addWidget(summaryLabel_);
757 layout->addSpacing(8);
760 const auto& c = themeManager_->
colors();
761 auto* tipsLabel =
new QLabel(
"Ctrl+K command palette · Right-click game options "
762 "· Ctrl+I import games",
764 tipsLabel->setTextFormat(Qt::RichText);
765 QFont tipsFont = tipsLabel->font();
767 tipsLabel->setFont(tipsFont);
768 tipsLabel->setStyleSheet(
769 QString(
"color: %1; padding: 10px 16px; background: %2; border-radius: 6px;")
770 .arg(c.textSecondary.name(), c.cardBackground.name()));
771 tipsLabel->setAlignment(Qt::AlignCenter);
772 tipsLabel->setWordWrap(
true);
773 layout->addWidget(tipsLabel);
775 layout->addStretch(1);
777 setButtonText(QWizard::FinishButton,
"Get Started");
783 auto* wizard = qobject_cast<FirstRunWizard*>(this->wizard());
786 for (
int i = 0; i < wizard->pageIds().size(); ++i)
788 auto* page = qobject_cast<IntegrationsPage*>(wizard->page(wizard->pageIds()[i]));
791 page->saveSettings();
801void DonePage::runDetection()
803 sourcesList_->clear();
805 int sourcesFound = 0;
807 const auto& c = themeManager_->
colors();
808 auto addSourceItem = [&](
const QString& name,
bool found,
int games = 0,
bool showCount =
true)
810 auto* item =
new QListWidgetItem(sourcesList_);
811 auto* label =
new QLabel(sourcesList_);
812 label->setTextFormat(Qt::RichText);
814 QString statusColor, statusText, iconHtml;
817 iconHtml = QString(
"<span style='color:%1; font-weight:bold;'>✓</span>")
818 .arg(c.success.name());
819 statusColor = c.success.name();
821 (showCount && games > 0) ? QString(
"%1 game(s) found").arg(games) :
"detected";
827 iconHtml = QString(
"<span style='color:%1; font-weight:bold;'>✗</span>")
828 .arg(c.error.name());
829 statusColor = c.textSecondary.name();
830 statusText =
"not detected";
833 int fs14 = themeManager_->scaledFontSize(14);
834 int fs13 = themeManager_->scaledFontSize(13);
835 label->setText(QString(
"%1 <b style='color:%2; font-size:%6px;'>%3</b>"
836 " <span style='color:%4; font-size:%7px;'>— %5</span>")
837 .arg(iconHtml, c.textPrimary.name(), name, statusColor, statusText)
841 QFont labelFont = label->font();
842 labelFont.setPointSize(themeManager_->scaledFontSize(11));
843 label->setFont(labelFont);
844 label->setStyleSheet(QString(
"color: %1; padding: 8px 12px; background: transparent;")
845 .arg(c.textPrimary.name()));
846 label->setMinimumHeight(32);
847 item->setSizeHint(QSize(0, 36));
848 sourcesList_->setItemWidget(item, label);
853 QStringList steamPaths = {
854 QDir::homePath() +
"/.local/share/Steam",
855 QDir::homePath() +
"/.steam/steam",
856 QDir::homePath() +
"/.steam/root",
857 QDir::homePath() +
"/.var/app/com.valvesoftware.Steam/.local/share/Steam",
863 for (
const auto& path : steamPaths)
870 QDir steamApps(path +
"/steamapps");
871 if (steamApps.exists())
873 games =
static_cast<int>(
874 steamApps.entryList(QStringList() <<
"appmanifest_*.acf", QDir::Files).size());
877 QFile libFile(path +
"/steamapps/libraryfolders.vdf");
878 if (libFile.open(QIODevice::ReadOnly | QIODevice::Text))
880 QString content = libFile.readAll();
882 QRegularExpression pathRegex(QStringLiteral(
"\"path\"\\s+\"([^\"]+)\""));
883 auto iter = pathRegex.globalMatch(content);
884 while (iter.hasNext())
886 auto match = iter.next();
887 QString libPath = match.captured(1);
890 QDir extra(libPath +
"/steamapps");
892 games +=
static_cast<int>(
893 extra.entryList(QStringList() <<
"appmanifest_*.acf", QDir::Files)
900 addSourceItem(
"Steam", found, games);
907 QStringList paths = {
908 QDir::homePath() +
"/.local/share/lutris",
909 QDir::homePath() +
"/.config/lutris",
911 for (
const auto& path : paths)
913 if (!QDir(path).exists())
916 QDir gamesDir(path +
"/games");
917 if (gamesDir.exists())
919 games,
static_cast<int>(
920 gamesDir.entryList(QStringList() <<
"*.yml" <<
"*.yaml", QDir::Files)
924 addSourceItem(
"Lutris", found, games);
929 bool found = QDir(QDir::homePath() +
"/.config/heroic").exists();
930 addSourceItem(
"Heroic Games Launcher", found, 0,
false);
936 QDir(QDir::homePath() +
"/.local/share/bottles").exists() ||
937 QDir(QDir::homePath() +
"/.var/app/com.usebottles.bottles/data/bottles").exists();
938 addSourceItem(
"Bottles", found, 0,
false);
942 QString theme = themeManager_->currentThemeId();
943 const auto* themeObj = themeManager_->getTheme(theme);
944 QString themeName = themeObj ? themeObj->displayName : theme;
946 if (sourcesFound > 0)
948 summaryLabel_->setText(QString(
"Found %1 source(s) with %2 game(s). Theme: <b>%3</b>.\n"
949 "Use Ctrl+I to import your games after setup.")
956 summaryLabel_->setText(QString(
"No game sources detected. Theme: <b>%1</b>.\n"
957 "Add games manually or configure sources in Settings.")
void initializePage() override
DonePage(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
static bool hasBeenCompleted()
static void markCompleted()
FirstRunWizard(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
IntegrationsPage(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
LibraryDetectionPage(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
void initializePage() override
static ThemeManager & instance()
QString currentThemeId() const
Get current theme ID.
void themeChanged()
Emitted when theme or accent color changes.
int scaledFontSize(int baseSize) const
Get scaled font size for given base size.
const ThemeColors & colors() const
Get effective colors (with accent customization applied).
ThemePage(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
WelcomePage(QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)