[X2Go-Commits] [x2goclient] 03/07: {src/{help.cpp, onmainwindow.{cpp, h}}, man/man1/x2goclient.1}: add new option --closebt. Fixes: #1227.

git-admin at x2go.org git-admin at x2go.org
Thu Jan 25 14:53:23 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goclient.

commit e5ae6b9c174cb10bbdadc27b5b4c1154d7f0aee1
Author: Walid Moghrabi <w.moghrabi at servicemagic.eu>
Date:   Thu Jan 25 12:24:30 2018 +0100

    {src/{help.cpp,onmainwindow.{cpp,h}},man/man1/x2goclient.1}: add new option --closebt. Fixes: #1227.
    
    Adds a close button in the top-left client corner (maybe next to the
    halt button) that currently just terminates the client.
---
 debian/changelog      |  4 ++++
 man/man1/x2goclient.1 |  4 ++++
 src/help.cpp          |  1 +
 src/onmainwindow.cpp  | 25 +++++++++++++++++++++++++
 src/onmainwindow.h    |  1 +
 5 files changed, 35 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 534233b..30e2e0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -64,6 +64,10 @@ x2goclient (4.1.1.1-0x2go1) UNRELEASED; urgency=medium
   [ Walid Moghrabi ]
   * New upstream version (4.1.1.1):
     - {res/img/png/,res/resources.qrc}: add close-button.png file.
+    - {src/{help.cpp,onmainwindow.{cpp,h}},man/man1/x2goclient.1}: add new
+      option --closebt. Fixes: #1227. Adds a close button in the top-left
+      client corner (maybe next to the halt button) that currently just
+      terminates the client.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Sun, 29 Oct 2017 11:44:44 +0100
 
diff --git a/man/man1/x2goclient.1 b/man/man1/x2goclient.1
index 2717e6a..1106b2b 100644
--- a/man/man1/x2goclient.1
+++ b/man/man1/x2goclient.1
@@ -191,6 +191,10 @@ new block devices (CD/DVDs, USB sticks, etc.).
 \*(T<\fB\-\-haltbt\fR\*(T>
 Show a "Shutdown" button in the top left corner of X2Go Client. When pressed, X2Go Client will create the file
 $HOME/.halt. An external script has to watch for this file and trigger a thinclient shutdown once it appears.
+.TP
+\*(T<\fB\-\-closebt\fR\*(T>
+Show a "Close" button in the top left corner of X2Go Client when logged in broker/thinclient mode. 
+When pressed, X2Go Client will be closed and automaticaly restarted if in thinclient mode.
 
 .SH PORTABLE OPTIONS
 X2Go Client can be installed on a USB-Flashdrive as a portable applications. If installed that way, the following
diff --git a/src/help.cpp b/src/help.cpp
index 0e54df6..6feef1e 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -125,6 +125,7 @@ help::params_t help::build_params () {
   ADD_OPT ("--ldap-printing", QT_TRANSLATE_NOOP ("Help", "Allows client side printing in LDAP mode."));
   ADD_OPT ("--thinclient", QT_TRANSLATE_NOOP ("Help", "Enables thinclient mode. Starts without a window manager."));
   ADD_OPT ("--haltbt", QT_TRANSLATE_NOOP ("Help", "Enables shutdown button."));
+  ADD_OPT ("--closebt", QT_TRANSLATE_NOOP ("Help", "Enables close button."));
   ADD_OPT ("--add-to-known-hosts", QT_TRANSLATE_NOOP ("Help", "Adds RSA key fingerprint to \".ssh/known_hosts\" if authenticity of the server can't be determined."));
   ADD_OPT ("--ldap=<host:port:dn>", QT_TRANSLATE_NOOP ("Help", "Starts with LDAP support. Example: --ldap=ldapserver:389:o=organization,c=de"));
   ADD_OPT ("--ldap1=<host:port>", QT_TRANSLATE_NOOP ("Help", "Defines the first LDAP failover server."));
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 740a4d8..0dead8c 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -78,6 +78,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     thinMode=false;
     closeDisconnect=false;
     showHaltBtn=false;
+    showCloseBtn=false;
     defaultUseSound=true;
     defaultSetKbd=true;
     extStarted=false;
@@ -523,6 +524,25 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
         connect(bHalt,SIGNAL(clicked()),this, SLOT(slotShutdownThinClient()));
     }
 
+    if (showCloseBtn)
+    {
+        QPushButton* bClose=new QPushButton(bgFrame);
+        QPixmap p(":/img/png/close-button.png");
+        bClose->setIcon(p);
+        bClose->setFocusPolicy(Qt::NoFocus);
+        bClose->setFixedSize(32,32);
+        if (showHaltBtn)
+        {
+            bClose->move(40,10);
+        }
+        else
+        {
+            bClose->move(10,10);
+        }
+        bClose->show();
+        connect(bClose,SIGNAL(clicked()),this, SLOT(close()));
+    }
+
     if (brokerMode)
     {
         broker=new HttpBrokerClient ( this, &config );
@@ -7444,6 +7464,11 @@ bool ONMainWindow::parseParameter ( QString param )
         showHaltBtn=true;
         return true;
     }
+    if (param == "--closebt")
+    {
+        showCloseBtn=true;
+        return true;
+    }
     if ( param=="--hide" )
     {
         startHidden=true;
diff --git a/src/onmainwindow.h b/src/onmainwindow.h
index 0a115bb..c3ce44a 100644
--- a/src/onmainwindow.h
+++ b/src/onmainwindow.h
@@ -796,6 +796,7 @@ private:
     bool useLdap;
     bool showToolBar;
     bool showHaltBtn;
+    bool showCloseBtn;
     bool newSession;
     bool runStartApp;
     bool ldapOnly;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list