From b15cb09af6a174cd24cb6991de8c2f19518dd005 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Wed, 26 Sep 2012 20:26:46 +0200 Subject: [PATCH] Fixed #3489 ('cppcheck-gui -h' doesnt work on WinXP) --- gui/main.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/gui/main.cpp b/gui/main.cpp index 0c6ce2fa7..648bdb71f 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include // currently used only on _WIN32 #include #include "mainwindow.h" #include "erroritem.h" @@ -67,10 +68,21 @@ bool CheckArgs(const QStringList &args) void ShowUsage() { - std::cout << "Cppcheck GUI.\n\n"; - std::cout << "Syntax:\n"; - std::cout << " cppcheck-gui [OPTIONS] [files or paths]\n\n"; - std::cout << "Options:\n"; - std::cout << " -h, --help Print this help\n"; - std::cout << " -p Open given project file and start checking it\n"; + const char helpMessage[] = + "Cppcheck GUI.\n\n" + "Syntax:\n" + " cppcheck-gui [OPTIONS] [files or paths]\n\n" + "Options:\n" + " -h, --help Print this help\n" + " -p Open given project file and start checking it\n"; +#if defined(_WIN32) + QMessageBox msgBox(QMessageBox::Information, + "Cppcheck GUI", + helpMessage, + QMessageBox::Ok + ); + (void)msgBox.exec(); +#else + std::cout << helpMessage; +#endif }