diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index f3938c5c9..8bb56ad10 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -110,7 +110,7 @@ namespace BlackCore CStatusMessage m(this->requestReloadOfSetupAndVersion()); if (m.isWarningOrAbove()) { - this->errorMessage(m.getMessage()); + this->cmdLineErrorMessage(m.getMessage()); return false; } } @@ -384,7 +384,7 @@ namespace BlackCore void CApplication::severeStartupProblem(const CStatusMessage &message) { CLogMessage(this).preformatted(message); - this->errorMessage(message.getMessage()); + this->cmdLineErrorMessage(message.getMessage()); this->exit(EXIT_FAILURE); // if I get here the event loop was not yet running @@ -467,7 +467,7 @@ namespace BlackCore QStringList args(QCoreApplication::instance()->arguments()); if (!this->m_parser.parse(args)) { - this->errorMessage(this->m_parser.errorText()); + this->cmdLineErrorMessage(this->m_parser.errorText()); return false; } @@ -475,12 +475,12 @@ namespace BlackCore if (this->m_parser.isSet(this->m_cmdHelp)) { // Important parser help will already stop application - this->helpMessage(); + this->cmdLineHelpMessage(); return true; } if (this->m_parser.isSet(this->m_cmdVersion)) { - this->versionMessage(); + this->cmdLineVersionMessage(); return true; } @@ -493,20 +493,20 @@ namespace BlackCore return true; } - void CApplication::errorMessage(const QString &errorMessage) const + void CApplication::cmdLineErrorMessage(const QString &errorMessage) const { fputs(qPrintable(errorMessage), stderr); fputs("\n\n", stderr); fputs(qPrintable(this->m_parser.helpText()), stderr); } - void CApplication::helpMessage() + void CApplication::cmdLineHelpMessage() { this->m_parser.showHelp(); // terminates Q_UNREACHABLE(); } - void CApplication::versionMessage() const + void CApplication::cmdLineVersionMessage() const { printf("%s %s\n", qPrintable(QCoreApplication::applicationName()), qPrintable(QCoreApplication::applicationVersion())); } diff --git a/src/blackcore/application.h b/src/blackcore/application.h index 16421f253..0b79570a8 100644 --- a/src/blackcore/application.h +++ b/src/blackcore/application.h @@ -148,7 +148,7 @@ namespace BlackCore QString getParserOptionValue(const QCommandLineOption &option) const; //! Display parser error message - virtual void errorMessage(const QString &errorMessage) const; + virtual void cmdLineErrorMessage(const QString &cmdLineErrorMessage) const; //! 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 @@ -213,10 +213,10 @@ namespace BlackCore CApplication(const QString &applicationName, QCoreApplication *app); //! Display help message - virtual void helpMessage(); + virtual void cmdLineHelpMessage(); //! Display version message - virtual void versionMessage() const; + virtual void cmdLineVersionMessage() const; //! Can be used to parse specialized arguments virtual bool parsingHookIn() { return true; } diff --git a/src/blackcore/setupreader.cpp b/src/blackcore/setupreader.cpp index ab9e0d773..6d1f51bd1 100644 --- a/src/blackcore/setupreader.cpp +++ b/src/blackcore/setupreader.cpp @@ -112,7 +112,7 @@ namespace BlackCore QFile f(this->m_localSetupFileValue); if (!f.exists()) { - sApp->errorMessage("File " + this->m_localSetupFileValue + " does not exist"); + sApp->cmdLineErrorMessage("File " + this->m_localSetupFileValue + " does not exist"); return false; } } @@ -124,7 +124,7 @@ namespace BlackCore { if (!CNetworkUtils::canConnect(url)) { - sApp->errorMessage("URL " + url.toString() + " not reachable"); + sApp->cmdLineErrorMessage("URL " + url.toString() + " not reachable"); return false; } } diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index 3c6860194..33b9f5c46 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -310,7 +310,7 @@ namespace BlackGui } if (msgs.hasErrorMessages()) { - this->showMessages(msgs); + this->showOverlayMessages(msgs); } } @@ -379,7 +379,7 @@ namespace BlackGui // errors if any if (msgs.hasErrorMessages()) { - this->showMessages(msgs); + this->showOverlayMessages(msgs); } } @@ -594,7 +594,7 @@ namespace BlackGui ); if (msgs.hasWarningOrErrorMessages()) { - this->showMessages(msgs); + this->showOverlayMessages(msgs); } } diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 9b0e18ba3..db98824f2 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -89,7 +89,7 @@ namespace BlackGui CApplication::exit(retcode); } - void CGuiApplication::errorMessage(const QString &errorMessage) const + void CGuiApplication::cmdLineErrorMessage(const QString &errorMessage) const { if (CProject::isRunningOnWindowsNtPlatform()) { @@ -99,11 +99,11 @@ namespace BlackGui } else { - CApplication::errorMessage(errorMessage); + CApplication::cmdLineErrorMessage(errorMessage); } } - void CGuiApplication::helpMessage() + void CGuiApplication::cmdLineHelpMessage() { if (CProject::isRunningOnWindowsNtPlatform()) { @@ -113,11 +113,11 @@ namespace BlackGui } else { - CApplication::helpMessage(); + CApplication::cmdLineHelpMessage(); } } - void CGuiApplication::versionMessage() const + void CGuiApplication::cmdLineVersionMessage() const { if (CProject::isRunningOnWindowsNtPlatform()) { @@ -127,7 +127,7 @@ namespace BlackGui } else { - CApplication::versionMessage(); + CApplication::cmdLineVersionMessage(); } } diff --git a/src/blackgui/guiapplication.h b/src/blackgui/guiapplication.h index d832cc971..09a37426e 100644 --- a/src/blackgui/guiapplication.h +++ b/src/blackgui/guiapplication.h @@ -54,8 +54,10 @@ namespace BlackGui //! Init the main application window based on information in this application void initMainApplicationWindow(QWidget *mainWindow) const; - //! \copydoc BlackCore::CApplication::errorMessage - virtual void errorMessage(const QString &errorMessage) const override; + //! \name print messages generated during parsing / cmd handling + //! @{ + virtual void cmdLineErrorMessage(const QString &cmdLineErrorMessage) const override; + //! @} //! Set icon //! \note Pixmap requires a valid QApplication, so it cannot be passed as constructor parameter @@ -65,10 +67,10 @@ namespace BlackGui static void exit(int retcode = 0); protected: - //! \name print messages generated during parsing + //! \name print messages generated during parsing / cmd handling //! @{ - virtual void helpMessage() override; - virtual void versionMessage() const override; + virtual void cmdLineHelpMessage() override; + virtual void cmdLineVersionMessage() const override; //! @} //! Handle paring of special GUI cmd arguments diff --git a/src/swiftcore/main.cpp b/src/swiftcore/main.cpp index 384af73ef..6b6911f1a 100644 --- a/src/swiftcore/main.cpp +++ b/src/swiftcore/main.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) if (!QSystemTrayIcon::isSystemTrayAvailable()) { - a.errorMessage("I could not detect any system tray on this system."); + a.cmdLineErrorMessage("I could not detect any system tray on this system."); return EXIT_FAILURE; } diff --git a/src/swiftguistandard/swiftguistdapplication.cpp b/src/swiftguistandard/swiftguistdapplication.cpp index 90d74d3b0..b49cdeec1 100644 --- a/src/swiftguistandard/swiftguistdapplication.cpp +++ b/src/swiftguistandard/swiftguistdapplication.cpp @@ -59,7 +59,7 @@ bool CSwiftGuiStdApplication::parsingHookIn() // check if rechable if (!CDBusServer::isDBusAvailable(dBusAddress)) { - this->errorMessage("DBus server at " + dBusAddress + " can not be reached"); + this->cmdLineErrorMessage("DBus server at " + dBusAddress + " can not be reached"); return false; } }