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 (#5107)
This commit is contained in:
commit
03543a0cbb
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" },
|
{ { "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" },
|
{ { "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" },
|
{ "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" },
|
{ { "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" } });
|
{ "show", "Opens the window for the specified instance (by instance ID)", "show" } });
|
||||||
// Has to be positional for some OS to handle that properly
|
// 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_liveCheck = parser.isSet("alive");
|
||||||
|
|
||||||
m_instanceIdToShowWindowOf = parser.value("show");
|
m_instanceIdToShowWindowOf = parser.value("show");
|
||||||
|
m_showMainWindow = parser.isSet("show-window");
|
||||||
|
|
||||||
for (auto url : parser.values("import")) {
|
for (auto url : parser.values("import")) {
|
||||||
m_urlsToImport.append(normalizeImportUrl(url));
|
m_urlsToImport.append(normalizeImportUrl(url));
|
||||||
|
|
@ -1353,7 +1355,10 @@ void Application::performMainStartupAction()
|
||||||
}
|
}
|
||||||
|
|
||||||
launch(inst, m_launchOffline ? LaunchMode::Offline : LaunchMode::Normal, targetToJoin, accountToUse, m_offlineName);
|
launch(inst, m_launchOffline ? LaunchMode::Offline : LaunchMode::Normal, targetToJoin, accountToUse, m_offlineName);
|
||||||
return;
|
|
||||||
|
if (!m_showMainWindow) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!m_instanceIdToShowWindowOf.isEmpty()) {
|
if (!m_instanceIdToShowWindowOf.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -314,6 +314,7 @@ class Application : public QApplication {
|
||||||
bool m_liveCheck = false;
|
bool m_liveCheck = false;
|
||||||
QList<QUrl> m_urlsToImport;
|
QList<QUrl> m_urlsToImport;
|
||||||
QString m_instanceIdToShowWindowOf;
|
QString m_instanceIdToShowWindowOf;
|
||||||
|
bool m_showMainWindow = false;
|
||||||
std::unique_ptr<QFile> logFile;
|
std::unique_ptr<QFile> logFile;
|
||||||
std::unique_ptr<LogModel> logModel;
|
std::unique_ptr<LogModel> logModel;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue