mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Minor improvements at startup
Found due to expiry date
This commit is contained in:
committed by
Mathew Sutcliffe
parent
683cffd42b
commit
2821cd5213
@@ -873,14 +873,15 @@ namespace BlackCore
|
||||
// help/version
|
||||
if (this->m_parser.isSet(this->m_cmdHelp))
|
||||
{
|
||||
// Important parser help will already stop application
|
||||
// Important: parser help will already stop application
|
||||
this->cmdLineHelpMessage();
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if (this->m_parser.isSet(this->m_cmdVersion))
|
||||
{
|
||||
// Important: version will already stop application
|
||||
this->cmdLineVersionMessage();
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// dev.
|
||||
|
||||
@@ -244,6 +244,7 @@ namespace BlackCore
|
||||
//! Parses and handles the standard options such as help, version, parse error
|
||||
//! \note in some cases (error, version, help) application is terminated during this step
|
||||
//! \sa parsingHookIn
|
||||
//! \return true means to continue, false to stop
|
||||
bool parse();
|
||||
//! @}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable())
|
||||
{
|
||||
a.cmdLineErrorMessage("I could not detect any system tray on this system.");
|
||||
a.gracefulShutdown();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,13 @@ int main(int argc, char *argv[])
|
||||
CGuiApplication a("swift mapping tool", CApplicationInfo::MappingTool, CIcons::swiftDatabase48());
|
||||
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
||||
a.splashScreen(CIcons::swiftDatabase256());
|
||||
a.parse();
|
||||
if (!a.parse()) { return EXIT_FAILURE; }
|
||||
a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forMappingTool());
|
||||
if (!a.start()) { return EXIT_FAILURE; }
|
||||
if (!a.start())
|
||||
{
|
||||
a.gracefulShutdown();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
CSwiftData w;
|
||||
w.show();
|
||||
int r = a.exec();
|
||||
|
||||
@@ -24,9 +24,11 @@ int main(int argc, char *argv[])
|
||||
//! [SwiftApplicationDemo]
|
||||
CGuiApplication::highDpiScreenSupport();
|
||||
QApplication qa(argc, argv);
|
||||
Q_UNUSED(qa); // application init needed
|
||||
CSwiftGuiStdApplication a;
|
||||
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
||||
a.splashScreen(CIcons::swift256());
|
||||
if (!a.parse()) { return EXIT_FAILURE; }
|
||||
if (!a.start())
|
||||
{
|
||||
a.gracefulShutdown();
|
||||
|
||||
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
|
||||
CGuiApplication a("swift launcher", CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
|
||||
a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forLauncher());
|
||||
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup."), "installer"});
|
||||
a.parse();
|
||||
if (!a.parse()) { return EXIT_FAILURE; }
|
||||
if (!a.start()) { return EXIT_FAILURE; }
|
||||
//! [SwiftApplicationDemo]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user