[desktop] Port some QtCommon changes from QML branch (#3703)

- Linker now resolves implementation differences
- Remove unneeded ifdefs
- Better abstractions overall

Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3703
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
This commit is contained in:
crueter 2026-03-10 05:37:45 +01:00
parent 07e3a2aa46
commit 0ff1d215c8
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
36 changed files with 405 additions and 371 deletions

View file

@ -403,29 +403,29 @@ void ResetMetadata(bool show_message) {
inline constexpr bool CreateShortcutMessagesGUI(ShortcutMessages imsg, const QString& game_title)
{
int result = 0;
QMessageBox::StandardButtons buttons;
using namespace QtCommon::Frontend;
int buttons;
switch (imsg) {
case ShortcutMessages::Fullscreen:
buttons = QMessageBox::Yes | QMessageBox::No;
result
= QtCommon::Frontend::Information(tr("Create Shortcut"),
tr("Do you want to launch the game in fullscreen?"),
buttons);
return result == QMessageBox::Yes;
buttons = Yes | No;
result = QtCommon::Frontend::Information(
tr("Create Shortcut"), tr("Do you want to launch the game in fullscreen?"), buttons);
return result == Yes;
case ShortcutMessages::Success:
QtCommon::Frontend::Information(tr("Shortcut Created"),
tr("Successfully created a shortcut to %1").arg(game_title));
QtCommon::Frontend::Information(
tr("Shortcut Created"), tr("Successfully created a shortcut to %1").arg(game_title));
return false;
case ShortcutMessages::Volatile:
buttons = QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Cancel;
buttons = Ok | Cancel;
result = QtCommon::Frontend::Warning(
tr("Shortcut may be Volatile!"),
tr("This will create a shortcut to the current AppImage. This may "
"not work well if you update. Continue?"),
buttons);
return result == QMessageBox::Ok;
return result == Ok;
default:
buttons = QMessageBox::Ok;
buttons = Ok;
QtCommon::Frontend::Critical(tr("Failed to Create Shortcut"),
tr("Failed to create a shortcut to %1").arg(game_title),
buttons);