diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-10-24 22:51:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 22:51:30 +0200 |
commit | d0e668e1d8e3b7260fea7d54ea10cc41ba7b812b (patch) | |
tree | 6f202797850d6002553cd9c0c56df60f6c7a4a6e | |
parent | e4e0c27e1c8317b7287a84dc24b274674c359615 (diff) | |
parent | 82d1dbf1736bb234938db7fdb8aecbc954023989 (diff) | |
download | PrismLauncher-d0e668e1d8e3b7260fea7d54ea10cc41ba7b812b.tar.gz PrismLauncher-d0e668e1d8e3b7260fea7d54ea10cc41ba7b812b.tar.bz2 PrismLauncher-d0e668e1d8e3b7260fea7d54ea10cc41ba7b812b.zip |
Merge pull request #211 from Hibiii/show-instace-arg
-rw-r--r-- | launcher/Application.cpp | 14 | ||||
-rw-r--r-- | launcher/Application.h | 1 | ||||
-rw-r--r-- | program_info/prismlauncher.6.scd | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 97f757f7..f6b41850 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -245,7 +245,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) {{"s", "server"}, "Join the specified server on launch (only valid in combination with --launch)", "address"}, {{"a", "profile"}, "Use the account specified by its profile name (only valid in combination with --launch)", "profile"}, {"alive", "Write a small '" + liveCheckFile + "' file after the launcher starts"}, - {{"I", "import"}, "Import instance from specified zip (local path or URL)", "file"} + {{"I", "import"}, "Import instance from specified zip (local path or URL)", "file"}, + {"show", "Opens the window for the specified instance (by instance ID)", "show"} }); parser.addHelpOption(); parser.addVersionOption(); @@ -257,6 +258,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_profileToUse = parser.value("profile"); m_liveCheck = parser.isSet("alive"); m_zipToImport = parser.value("import"); + m_instanceIdToShowWindowOf = parser.value("show"); // error if --launch is missing with --server or --profile if((!m_serverToJoin.isEmpty() || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) @@ -986,6 +988,16 @@ void Application::performMainStartupAction() return; } } + if(!m_instanceIdToShowWindowOf.isEmpty()) + { + auto inst = instances()->getInstanceById(m_instanceIdToShowWindowOf); + if(inst) + { + qDebug() << "<> Showing window of instance " << m_instanceIdToShowWindowOf; + showInstanceWindow(inst); + return; + } + } if(!m_mainWindow) { // normal main window diff --git a/launcher/Application.h b/launcher/Application.h index 34ad8c15..c453cc28 100644 --- a/launcher/Application.h +++ b/launcher/Application.h @@ -301,6 +301,7 @@ public: QString m_profileToUse; bool m_liveCheck = false; QUrl m_zipToImport; + QString m_instanceIdToShowWindowOf; std::unique_ptr<QFile> logFile; }; diff --git a/program_info/prismlauncher.6.scd b/program_info/prismlauncher.6.scd index e3c7de86..f979e457 100644 --- a/program_info/prismlauncher.6.scd +++ b/program_info/prismlauncher.6.scd @@ -26,6 +26,9 @@ Here are the current features of Prism Launcher. *-l, --launch*=INSTANCE_ID Launch the instance specified by INSTANCE_ID. +*--show*=INSTANCE_ID + Show the configuration window of the instance specified by INSTANCE_ID. + *--alive* Write a small 'live.check' file after Prism Launcher starts. |