aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-04-16 11:29:12 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2014-04-16 11:29:12 +0000
commit66e32b3c3dc28ef2a34128aa8bf79c7ad441fa67 (patch)
tree44ab52378301e0b18b2d96f8b0104ddc5350d127
parentb2f1abb77d4fb168bd10b7239e41d2e99e44817c (diff)
downloadqmmp-66e32b3c3dc28ef2a34128aa8bf79c7ad441fa67.tar.gz
qmmp-66e32b3c3dc28ef2a34128aa8bf79c7ad441fa67.tar.bz2
qmmp-66e32b3c3dc28ef2a34128aa8bf79c7ad441fa67.zip
show command line documenation in the dialog under windows
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4256 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/app/qmmpstarter.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/app/qmmpstarter.cpp b/src/app/qmmpstarter.cpp
index 4b463ab27..078c8f0ab 100644
--- a/src/app/qmmpstarter.cpp
+++ b/src/app/qmmpstarter.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2013 by Ilya Kotov *
+ * Copyright (C) 2006-2014 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -41,6 +41,11 @@
#include "builtincommandlineoption.h"
#ifdef Q_OS_WIN
+#include <sstream>
+#include <QMessageBox>
+#endif
+
+#ifdef Q_OS_WIN
#define UDS_PATH QString("qmmp")
#else
#define UDS_PATH QString("/tmp/qmmp.sock.%1").arg(getuid()).toAscii().constData()
@@ -290,6 +295,12 @@ QString QMMPStarter::processCommandArgs(const QStringList &slist, const QString&
void QMMPStarter::printUsage()
{
+//show dialog with command line documentation under ms windows
+#ifdef Q_OS_WIN
+ stringstream tmp_stream;
+ tmp_stream.copyfmt(cout);
+ streambuf* old_stream = cout.rdbuf(tmp_stream.rdbuf());
+#endif
cout << qPrintable(tr("Usage: qmmp [options] [files]")) << endl;
cout << qPrintable(tr("Options:")) << endl;
cout << "--------" << endl;
@@ -299,11 +310,27 @@ void QMMPStarter::printUsage()
cout << "--help " << qPrintable(tr("Display this text and exit")) << endl;
cout << "--version " << qPrintable(tr("Print version number and exit")) << endl;
cout << qPrintable(tr("Ideas, patches, bugreports send to forkotov02@hotmail.ru")) << endl;
+#ifdef Q_OS_WIN
+ string text = tmp_stream.str();
+ QMessageBox::information(0, tr("Command Line Help"), QString::fromLocal8Bit(text.c_str()));
+ cout.rdbuf(old_stream); //restore old stream buffer
+#endif
}
void QMMPStarter::printVersion()
{
+ //show dialog with qmmp version under ms windows
+#ifdef Q_OS_WIN
+ stringstream tmp_stream;
+ tmp_stream.copyfmt(cout);
+ streambuf* old_stream = cout.rdbuf(tmp_stream.rdbuf());
+#endif
cout << qPrintable(tr("QMMP version: %1").arg(Qmmp::strVersion())) << endl;
cout << qPrintable(tr("Compiled with Qt version: %1").arg(QT_VERSION_STR)) << endl;
cout << qPrintable(tr("Using Qt version: %1").arg(qVersion())) << endl;
+#ifdef Q_OS_WIN
+ string text = tmp_stream.str();
+ QMessageBox::information(0, tr("Qmmp Version"), QString::fromLocal8Bit(text.c_str()));
+ cout.rdbuf(old_stream); //restore old stream buffer
+#endif
}