mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-22 19:49:56 +00:00
NOISSUE shortcut creation: add option to create launch scripts
This allows shortcuts to be created on Macs (which don't have a concept of desktop shortcuts) as well as Linux systems that don't support the desktop file specification. Also included a windows batch file implementation.
This commit is contained in:
@@ -223,9 +223,7 @@ public:
|
||||
TranslatedAction actionLaunchInstanceOffline;
|
||||
TranslatedAction actionScreenshots;
|
||||
TranslatedAction actionExportInstance;
|
||||
#if defined(Q_OS_LINUX) // currently only implemented for linux; TODO: other OS implementations
|
||||
TranslatedAction actionCreateShortcut;
|
||||
#endif
|
||||
QVector<TranslatedAction *> all_actions;
|
||||
|
||||
LabeledToolButton *renameButton = nullptr;
|
||||
@@ -598,14 +596,12 @@ public:
|
||||
|
||||
instanceToolBar->addSeparator();
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
actionCreateShortcut = TranslatedAction(MainWindow);
|
||||
actionCreateShortcut->setObjectName(QStringLiteral("actionCreateShortcut"));
|
||||
actionCreateShortcut.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Create Shortcut"));
|
||||
actionCreateShortcut.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Create a shortcut that launches the selected instance"));
|
||||
all_actions.append(&actionCreateShortcut);
|
||||
instanceToolBar->addAction(actionCreateShortcut);
|
||||
#endif
|
||||
|
||||
actionExportInstance = TranslatedAction(MainWindow);
|
||||
actionExportInstance->setObjectName(QStringLiteral("actionExportInstance"));
|
||||
@@ -1857,14 +1853,12 @@ void MainWindow::on_actionLaunchInstance_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
void MainWindow::on_actionCreateShortcut_triggered() {
|
||||
if (m_selectedInstance)
|
||||
{
|
||||
CreateShortcutDialog(this, m_selectedInstance).exec();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::activateInstance(InstancePtr instance)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user