.clear() instead = ""; and switch improved.

This commit is contained in:
boludoz 2023-10-16 16:47:21 -03:00
parent d759de9f96
commit ae88d01d8d
1 changed files with 8 additions and 16 deletions

View File

@ -2997,23 +2997,17 @@ bool GMainWindow::CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QSt
QMessageBox::StandardButtons buttons; QMessageBox::StandardButtons buttons;
int result = 0; int result = 0;
switch (imsg) { switch (imsg) {
case GMainWindow::CREATE_SHORTCUT_MSGBOX_FULLSCREEN_YES: case GMainWindow::CREATE_SHORTCUT_MSGBOX_FULLSCREEN_YES:
buttons = QMessageBox::Yes | QMessageBox::No; buttons = QMessageBox::Yes | QMessageBox::No;
result = result =
QMessageBox::information(parent, tr("Create Shortcut"), QMessageBox::information(parent, tr("Create Shortcut"),
tr("Do you want to launch the game in fullscreen?"), buttons); tr("Do you want to launch the game in fullscreen?"), buttons);
return (result == QMessageBox::Yes);
LOG_INFO(Frontend, "Shortcut will launch in fullscreen");
return result == QMessageBox::Yes;
case GMainWindow::CREATE_SHORTCUT_MSGBOX_SUCCESS: case GMainWindow::CREATE_SHORTCUT_MSGBOX_SUCCESS:
QMessageBox::information(parent, tr("Create Shortcut"), QMessageBox::information(parent, tr("Create Shortcut"),
tr("Successfully created a shortcut to %1").arg(game_title)); tr("Successfully created a shortcut to %1").arg(game_title));
return true; break;
case GMainWindow::CREATE_SHORTCUT_MSGBOX_APPVOLATILE_WARNING: case GMainWindow::CREATE_SHORTCUT_MSGBOX_APPVOLATILE_WARNING:
buttons = QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel; buttons = QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel;
result = result =
@ -3021,22 +3015,20 @@ bool GMainWindow::CreateShortcutMessagesGUI(QWidget* parent, int imsg, const QSt
tr("This will create a shortcut to the current AppImage. This may " tr("This will create a shortcut to the current AppImage. This may "
"not work well if you update. Continue?"), "not work well if you update. Continue?"),
buttons); buttons);
return result == QMessageBox::StandardButton::Ok; return (result == QMessageBox::Ok);
case GMainWindow::CREATE_SHORTCUT_MSGBOX_ADMIN: case GMainWindow::CREATE_SHORTCUT_MSGBOX_ADMIN:
buttons = QMessageBox::Ok; buttons = QMessageBox::Ok;
QMessageBox::critical(parent, tr("Create Shortcut"), QMessageBox::critical(parent, tr("Create Shortcut"),
tr("Cannot create shortcut in Apps. Restart yuzu as administrator."), tr("Cannot create shortcut in Apps. Restart yuzu as administrator."),
buttons); buttons);
LOG_ERROR(Frontend, "Cannot create shortcut in Apps. Restart yuzu as administrator."); break;
return true;
default: default:
buttons = QMessageBox::Ok; buttons = QMessageBox::Ok;
QMessageBox::critical(parent, tr("Create Shortcut"), QMessageBox::critical(parent, tr("Create Shortcut"),
tr("Failed to create a shortcut to %1").arg(game_title), buttons); tr("Failed to create a shortcut to %1").arg(game_title), buttons);
return true; break;
} }
return false;
return true;
} }
bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name, bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_view game_file_name,
@ -3058,7 +3050,7 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
tr("Cannot create icon file. Path \"%1\" does not exist and cannot be created.") tr("Cannot create icon file. Path \"%1\" does not exist and cannot be created.")
.arg(QString::fromStdString(out_icon_path.string())), .arg(QString::fromStdString(out_icon_path.string())),
QMessageBox::StandardButton::Ok); QMessageBox::StandardButton::Ok);
out_icon_path = ""; // Reset path out_icon_path.clear();
return false; return false;
} }
@ -3165,7 +3157,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga
arguments = "-f " + arguments; arguments = "-f " + arguments;
} }
const std::string comment = const std::string comment =
tr("Start %1 with the yuzu Emulator").arg(QString::fromStdString(game_title)).toStdString(); tr("Start %1 with the yuzu Emulator").arg(qt_game_title).toStdString();
const std::string categories = "Game;Emulator;Qt;"; const std::string categories = "Game;Emulator;Qt;";
const std::string keywords = "Switch;Nintendo;"; const std::string keywords = "Switch;Nintendo;";