diff options
| author | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-11-12 20:36:49 +0200 |
|---|---|---|
| committer | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-11-12 20:36:49 +0200 |
| commit | f7d7d76ee879c3bdd539e5c8c956cbd2c7328bf0 (patch) | |
| tree | fc29fceba46d77bf93ba407ef9840648df442e8f /launcher/ui | |
| parent | 7e5076b06891f28c1b2e27befd33005d400c49c9 (diff) | |
| download | PrismLauncher-f7d7d76ee879c3bdd539e5c8c956cbd2c7328bf0.tar.gz PrismLauncher-f7d7d76ee879c3bdd539e5c8c956cbd2c7328bf0.tar.bz2 PrismLauncher-f7d7d76ee879c3bdd539e5c8c956cbd2c7328bf0.zip | |
Mac: now supported! [UNTESTED]
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
Diffstat (limited to 'launcher/ui')
| -rw-r--r-- | launcher/ui/MainWindow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 0a846b59..02f60233 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -2100,7 +2100,20 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() } #ifdef Q_OS_MACOS - QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on macOS yet!")); + // handle macOS bundle weirdness + QFileInfo appFileInfo(QApplication::applicationFilePath())); + QString appName = appFileInfo.baseName(); + QString exeName = FS::PathCombine(appFileInfo.filePath(), "Contents/MacOS/" + appName); + + if (FS::createShortcut(FS::PathCombine(desktopPath, m_selectedInstance->name()), + exeName, { "--launch", m_selectedInstance->id() }, m_selectedInstance->name(), "")) { + QMessageBox::information(this, tr("Create instance shortcut"), tr("Created a shortcut to this instance on your desktop!")); + } + else + { + QMessageBox::critical(this, tr("Create instance shortcut"), tr("Failed to create instance shortcut!")); + } + return; #endif auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey()); |
