mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Add CLI option to open main window when launching instance
Signed-off-by: Matthew_Cash <matthew@matthew-cash.com>
This commit is contained in:
parent
83e0b93938
commit
eae13f705f
2 changed files with 7 additions and 1 deletions
|
|
@ -318,6 +318,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||
{ { "a", "profile" }, "Use the account specified by its profile name (only valid in combination with --launch)", "profile" },
|
||||
{ { "o", "offline" }, "Launch offline, with given player name (only valid in combination with --launch)", "offline" },
|
||||
{ "alive", "Write a small '" + liveCheckFile + "' file after the launcher starts" },
|
||||
{ "show-window", "Show the main launcher window (useful in combination with --launch)" },
|
||||
{ { "I", "import" }, "Import instance or resource from specified local path or URL", "url" },
|
||||
{ "show", "Opens the window for the specified instance (by instance ID)", "show" } });
|
||||
// Has to be positional for some OS to handle that properly
|
||||
|
|
@ -339,6 +340,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||
m_liveCheck = parser.isSet("alive");
|
||||
|
||||
m_instanceIdToShowWindowOf = parser.value("show");
|
||||
m_showMainWindow = parser.isSet("show-window");
|
||||
|
||||
for (auto url : parser.values("import")) {
|
||||
m_urlsToImport.append(normalizeImportUrl(url));
|
||||
|
|
@ -1352,7 +1354,10 @@ void Application::performMainStartupAction()
|
|||
}
|
||||
|
||||
launch(inst, m_launchOffline ? LaunchMode::Offline : LaunchMode::Normal, targetToJoin, accountToUse, m_offlineName);
|
||||
return;
|
||||
|
||||
if (!m_showMainWindow) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_instanceIdToShowWindowOf.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ class Application : public QApplication {
|
|||
bool m_liveCheck = false;
|
||||
QList<QUrl> m_urlsToImport;
|
||||
QString m_instanceIdToShowWindowOf;
|
||||
bool m_showMainWindow = false;
|
||||
std::unique_ptr<QFile> logFile;
|
||||
std::unique_ptr<LogModel> logModel;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue