[X2Go-Commits] [x2goclient] 01/01: Don't show GUI dialog for --version, --help, etc, if started from terminal on linux and mac.
git-admin at x2go.org
git-admin at x2go.org
Fri Feb 28 13:50:06 CET 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goclient.
commit 91cf6c6e0fa92af2b2a106f627298b037b2bf781
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date: Fri Feb 28 13:49:58 2014 +0100
Don't show GUI dialog for --version, --help, etc, if started from terminal on linux and mac.
---
Info.plist | 18 ------------------
debian/changelog | 2 ++
onmainwindow.cpp | 23 +++++++++++++++++++----
onmainwindow.h | 1 +
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/Info.plist b/Info.plist
deleted file mode 100644
index 69e0cb8..0000000
--- a/Info.plist
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>CFBundleIconFile</key>
- <string>x2go-mac.icns</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleExecutable</key>
- <string>x2goclient</string>
- <key>NOTE</key>
- <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
-</dict>
-</plist>
diff --git a/debian/changelog b/debian/changelog
index 555fc18..588ad17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ x2goclient (4.0.2.0-0x2go1) UNRELEASED; urgency=low
- Setting keyboard modifiers with xmodmap.
- Fix multimonitor support on Linux.
- Display more version info. Parameters --version, --git, --changelog.
+ - Don't show GUI dialog for --version, --help, etc, if started
+ from terminal on linux and mac.
[ Mike Gabriel ]
* debian/control:
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 1f9176d..b57db9d 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -44,6 +44,17 @@ bool ONMainWindow::debugging=false;
ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
{
+
+ haveTerminal=false;
+#ifndef Q_OS_WIN
+ QFile fl("/dev/tty");
+ if(fl.open( QIODevice::ReadOnly))
+ {
+ haveTerminal=true;
+ fl.close();
+ }
+#endif
+
#ifdef Q_OS_LINUX
image=shape=0;
#endif
@@ -7215,7 +7226,7 @@ void ONMainWindow::showHelp()
"--tray-icon\t\t force to show session trayicon\n";
qCritical ( "%s",helpMsg.toLocal8Bit().data() );
- if (!startHidden)
+ if (!startHidden && !haveTerminal)
{
HelpDialog dlg(this);
dlg.setWindowTitle(tr("Help"));
@@ -7245,7 +7256,7 @@ void ONMainWindow::showHelpPack()
}
file.close();
qCritical()<<msg;
- if (!startHidden)
+ if (!startHidden && !haveTerminal)
{
HelpDialog dlg(this);
dlg.setWindowTitle(tr("Pack Methodes"));
@@ -7263,7 +7274,7 @@ void ONMainWindow::showTextFile(QString fname, QString title)
QString msg=in.readAll();
file.close();
qCritical()<<msg;
- if (!startHidden)
+ if (!startHidden && !haveTerminal)
{
HelpDialog dlg(this);
dlg.setWindowTitle(title);
@@ -7287,7 +7298,11 @@ void ONMainWindow::showGit()
void ONMainWindow::showVersion()
{
qCritical()<<VERSION;
- slotAbout();
+
+ if (!startHidden && !haveTerminal)
+ {
+ slotAbout();
+ }
}
diff --git a/onmainwindow.h b/onmainwindow.h
index 56567a2..afe63a7 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -541,6 +541,7 @@ private:
QStringList _transApplicationsNames;
QString portableDataPath;
QString proxyErrString;
+ bool haveTerminal;
bool proxyRunning;
bool drawMenu;
bool extStarted;
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list