Skip to content

Commit

Permalink
UI: Add "--no-splash" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
tnodir committed Feb 17, 2024
1 parent 1bef339 commit 1a28ab8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/ui/fortsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ void FortSettings::processArguments(const QStringList &args)
const QCommandLineOption noCacheOption("no-cache", "Don't use cache on disk.");
parser.addOption(noCacheOption);

const QCommandLineOption noSplashOption("no-splash", "Don't show Splash screen on startup.");
parser.addOption(noSplashOption);

const QCommandLineOption langOption("lang", "Default language.", "lang", "en");
parser.addOption(langOption);

Expand All @@ -186,6 +189,11 @@ void FortSettings::processArguments(const QStringList &args)
m_noCache = true;
}

// No Splash
if (parser.isSet(noSplashOption)) {
m_noSplash = true;
}

// Default Language
if (parser.isSet(langOption)) {
m_defaultLanguage = parser.value(langOption);
Expand Down
2 changes: 2 additions & 0 deletions src/ui/fortsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class FortSettings : public Settings

bool isDefaultProfilePath() const { return m_isDefaultProfilePath; }
bool noCache() const { return m_noCache; }
bool noSplash() const { return m_noSplash; }
bool canInstallDriver() const { return m_canInstallDriver; }

bool isService() const { return m_isService; }
Expand Down Expand Up @@ -107,6 +108,7 @@ public slots:
private:
uint m_isDefaultProfilePath : 1 = false;
uint m_noCache : 1 = false;
uint m_noSplash : 1 = false;
uint m_canInstallDriver : 1 = false;
uint m_isService : 1 = false;
uint m_hasService : 1 = false;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/manager/windowmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void WindowManager::initialize()

setupTrayIcon();

if (ini.splashWindowVisible()) {
if (ini.splashWindowVisible() && !IoC<FortSettings>()->noSplash()) {
showSplashScreen();
}

Expand Down

0 comments on commit 1a28ab8

Please sign in to comment.