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