From 6dbc869102f380bcc59479da4c8725dd5a992408 Mon Sep 17 00:00:00 2001 From: SeongGino Date: Thu, 2 Jan 2025 00:51:22 -0500 Subject: [PATCH 1/2] Clarification --- src/nerowizard.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nerowizard.cpp b/src/nerowizard.cpp index 798b541..3776270 100644 --- a/src/nerowizard.cpp +++ b/src/nerowizard.cpp @@ -55,6 +55,7 @@ NeroPrefixWizard::NeroPrefixWizard(QWidget *parent) connect(winetricksPresets.at(2), &QAction::triggered, this, &NeroPrefixWizard::SetVCRunTricks); connect(winetricksPresets.at(3), &QAction::triggered, this, &NeroPrefixWizard::SetXactTricks); + // adjust font color for light mode if(this->palette().window().color().value() > this->palette().text().color().value()) ui->symlinkDisclaimer->setStyleSheet("color: doubledarkgray"); } From 6c974494c80d3bf81ad72fc692bc257ad73627ca Mon Sep 17 00:00:00 2001 From: SeongGino Date: Thu, 2 Jan 2025 00:51:32 -0500 Subject: [PATCH 2/2] Add warning for non-existant file paths in shortcut settings With an appropriate coloring and message to indicate as such. That's kinda it. Happy New Year btw lol --- src/neroprefixsettings.cpp | 17 +++++ src/neroprefixsettings.ui | 137 +++++++++++++++++++++---------------- 2 files changed, 95 insertions(+), 59 deletions(-) diff --git a/src/neroprefixsettings.cpp b/src/neroprefixsettings.cpp index 9ae8e60..5335e80 100644 --- a/src/neroprefixsettings.cpp +++ b/src/neroprefixsettings.cpp @@ -255,6 +255,17 @@ void NeroPrefixSettingsWindow::LoadSettings() ui->shortcutPath->setText(settings["Path"].toString()); ui->shortcutArgs->setText(settings["Args"].toStringList().join(' ')); + if(QFileInfo::exists(settings["Path"].toString().replace("C:/", + NeroFS::GetPrefixesPath().canonicalPath()+'/'+NeroFS::GetCurrentPrefix()+"/drive_c/"))) + ui->pathNoExistWarning->setVisible(false); + else { + // adjust font recoloring for light mode (unused, but just in case?) + /* if(this->palette().window().color().value() > this->palette().text().color().value()) + ui->shortcutPath->setStyleSheet("color: darkred"); + else */ + ui->shortcutPath->setStyleSheet("color: red"); + } + QDir ico(QString("%1/%2/.icoCache").arg(NeroFS::GetPrefixesPath().path(), NeroFS::GetCurrentPrefix() )); if(ico.exists(QString("%1-%2.png").arg(settings["Name"].toString(), currentShortcutHash))) { @@ -379,6 +390,12 @@ void NeroPrefixSettingsWindow::on_shortcutPathBtn_clicked() if(newApp != settings.value("Path").toString()) ui->shortcutPath->setFont(boldFont); else ui->shortcutPath->setFont(QFont()); + + // probably assumed that in this decision path, the file is gonna be valid + if(ui->pathNoExistWarning->isVisible()) { + ui->pathNoExistWarning->setVisible(false); + ui->shortcutPath->setStyleSheet("color: gray"); + } } } diff --git a/src/neroprefixsettings.ui b/src/neroprefixsettings.ui index 8300fa6..fc83d37 100644 --- a/src/neroprefixsettings.ui +++ b/src/neroprefixsettings.ui @@ -139,44 +139,38 @@ - - - - true - - - <html><head/><body><p>The current path for this shortcut.</p><p>If the path is within the prefix's <span style=" font-style:italic;">drive_c</span> folder (or in other words, within the virtual Windows' <span style=" font-style:italic;">C:/</span> drive), this shortcut will always be run relative to the path of this current prefix - so if the current prefix changes name or location, but not the application itself, then this shortcut will still work until the application path itself changes.</p></body></html> - - - Executable Path + + + + + 9 + true + - color: gray - - - true + color: red - - Path + + Another shortcut with this name already exists! - - Path + + Qt::AlignmentFlag::AlignCenter - - + + - <html><head/><body><p>Click to select a new executable for this shortcut.</p></body></html> + <html><head/><body><p>Click to open the folder linked to this shortcut in the system's file explorer.</p></body></html> - Select an Executable + Open folder in file explorer - + @@ -184,31 +178,53 @@ 16 + + true + - - + + - <html><head/><body><p>Click to open the folder linked to this shortcut in the system's file explorer.</p></body></html> + <html><head/><body><p>Enter any arguments that gets passed to the executable for this shortcut. These usually allow for enabling hidden or undocumented features of an app, such as borderless windowed modes or fullscreen on launch. Refer to your app's documentation for information on what arguments can be used with it.</p><p>If unsure, leave this field blank.</p></body></html> - Open folder in file explorer + Shortcut Arguments - - + + Shortcut Arguments (-fullscreen, --borderless, etc.) - - + + true - - - 16 - 16 - + + Args - + + + + + true + + <html><head/><body><p>The current path for this shortcut.</p><p>If the path is within the prefix's <span style=" font-style:italic;">drive_c</span> folder (or in other words, within the virtual Windows' <span style=" font-style:italic;">C:/</span> drive), this shortcut will always be run relative to the path of this current prefix - so if the current prefix changes name or location, but not the application itself, then this shortcut will still work until the application path itself changes.</p></body></html> + + + Executable Path + + + color: gray + + + true + + + Path + + + Path + @@ -227,8 +243,30 @@ - - + + + + <html><head/><body><p>Click to select a new executable for this shortcut.</p></body></html> + + + Select an Executable + + + + + + + + + + 16 + 16 + + + + + + 9 @@ -239,32 +277,13 @@ color: red - Another shortcut with this name already exists! + File does not exist! Please update the path. Qt::AlignmentFlag::AlignCenter - - - - <html><head/><body><p>Enter any arguments that gets passed to the executable for this shortcut. These usually allow for enabling hidden or undocumented features of an app, such as borderless windowed modes or fullscreen on launch. Refer to your app's documentation for information on what arguments can be used with it.</p><p>If unsure, leave this field blank.</p></body></html> - - - Shortcut Arguments - - - Shortcut Arguments (-fullscreen, --borderless, etc.) - - - true - - - Args - - -