UI: Add "--no-splash" argument

This commit is contained in:
Nodir Temirkhodjaev 2024-02-17 14:36:11 +03:00
parent 1bef33928d
commit 1a28ab8829
3 changed files with 11 additions and 1 deletions

View File

@ -165,6 +165,9 @@ void FortSettings::processArguments(const QStringList &args)
const QCommandLineOption noCacheOption("no-cache", "Don't use cache on disk."); const QCommandLineOption noCacheOption("no-cache", "Don't use cache on disk.");
parser.addOption(noCacheOption); 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"); const QCommandLineOption langOption("lang", "Default language.", "lang", "en");
parser.addOption(langOption); parser.addOption(langOption);
@ -186,6 +189,11 @@ void FortSettings::processArguments(const QStringList &args)
m_noCache = true; m_noCache = true;
} }
// No Splash
if (parser.isSet(noSplashOption)) {
m_noSplash = true;
}
// Default Language // Default Language
if (parser.isSet(langOption)) { if (parser.isSet(langOption)) {
m_defaultLanguage = parser.value(langOption); m_defaultLanguage = parser.value(langOption);

View File

@ -28,6 +28,7 @@ public:
bool isDefaultProfilePath() const { return m_isDefaultProfilePath; } bool isDefaultProfilePath() const { return m_isDefaultProfilePath; }
bool noCache() const { return m_noCache; } bool noCache() const { return m_noCache; }
bool noSplash() const { return m_noSplash; }
bool canInstallDriver() const { return m_canInstallDriver; } bool canInstallDriver() const { return m_canInstallDriver; }
bool isService() const { return m_isService; } bool isService() const { return m_isService; }
@ -107,6 +108,7 @@ private:
private: private:
uint m_isDefaultProfilePath : 1 = false; uint m_isDefaultProfilePath : 1 = false;
uint m_noCache : 1 = false; uint m_noCache : 1 = false;
uint m_noSplash : 1 = false;
uint m_canInstallDriver : 1 = false; uint m_canInstallDriver : 1 = false;
uint m_isService : 1 = false; uint m_isService : 1 = false;
uint m_hasService : 1 = false; uint m_hasService : 1 = false;

View File

@ -80,7 +80,7 @@ void WindowManager::initialize()
setupTrayIcon(); setupTrayIcon();
if (ini.splashWindowVisible()) { if (ini.splashWindowVisible() && !IoC<FortSettings>()->noSplash()) {
showSplashScreen(); showSplashScreen();
} }