[X2Go-Commits] [x2goclient] 01/02: {res/{img/png/close-button.png, resources.qrc}, src/{{onmainwindow, httpbrokerclient}.{cpp, h}, help.cpp}, man/man1/x2goclient.1}: rename close button to broker logout button.

git-admin at x2go.org git-admin at x2go.org
Thu Feb 15 02:15:45 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 a177b756536a9fd0e8cec70ed330448d72eef9aa
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Feb 15 01:58:39 2018 +0100

    {res/{img/png/close-button.png,resources.qrc},src/{{onmainwindow,httpbrokerclient}.{cpp,h},help.cpp},man/man1/x2goclient.1}: rename close button to broker logout button.
    
    Reimplement the way it is shown - disable it upon startup and only
    enable it after successful broker authentication.
---
 debian/changelog                                   |   5 ++
 man/man1/x2goclient.1                              |   8 ++--
 .../{close-button.png => broker-logout-button.png} | Bin
 res/resources.qrc                                  |   2 +-
 src/help.cpp                                       |   2 +-
 src/httpbrokerclient.cpp                           |   1 +
 src/httpbrokerclient.h                             |   1 +
 src/onmainwindow.cpp                               |  52 +++++++++++----------
 src/onmainwindow.h                                 |   7 +--
 9 files changed, 44 insertions(+), 34 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9e7c201..d861014 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -79,6 +79,11 @@ x2goclient (4.1.1.1-0x2go1) UNRELEASED; urgency=medium
       lets the user re-login to the broker or closes the client.
     - src/onmainwindow.cpp: correctly initialize brokerAuthentication member
       of ConfigFile struct.
+    - {res/{img/png/close-button.png,resources.qrc},
+       src/{{onmainwindow,httpbrokerclient}.{cpp,h},help.cpp},
+       man/man1/x2goclient.1}: rename close button to broker logout button.
+      Reimplement the way it is shown - disable it upon startup and only
+      enable it after successful broker authentication.
 
   [ Oleksandr Shneyder ]
   * New upstream version (4.1.1.1):
diff --git a/man/man1/x2goclient.1 b/man/man1/x2goclient.1
index d0dd806..ee6acc8 100644
--- a/man/man1/x2goclient.1
+++ b/man/man1/x2goclient.1
@@ -191,10 +191,6 @@ 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 to a broker, pressing this button
-X2Go Client lets you login to the broker again. Otherwise, X2Go Client will be closed.
 
 .SH PORTABLE OPTIONS
 X2Go Client can be installed on a USB-Flashdrive as a portable applications. If installed that way, the following
@@ -274,6 +270,10 @@ Send a change-password request to an X2Go Session Broker. Not supported by all b
 Informs the broker to use the username you entered for X2Go Server authentication when selecting a server/session. Only has functionality if --broker-noauth is used.
 \*(T<\fB\-\-broker-use-creds-for-session\fR\*(T>
 Use broker credentials as session user/password credentials when using broker mode with broker authentication. Currently only affects direct RDP sessions.
+.TP
+\*(T<\fB\-\-broker\-logoutbt\fR\*(T>
+Show a "Logout" button in the top left corner of X2Go Client. When logged in to a broker, pressing this button
+X2Go Client lets you login to the broker again.
 
 .SH LDAP OPTIONS (deprecated)
 NOTE: LDAP support won't be continued in X2Go Client 2 (next generation of X2Go Client).
diff --git a/res/img/png/close-button.png b/res/img/png/broker-logout-button.png
similarity index 100%
rename from res/img/png/close-button.png
rename to res/img/png/broker-logout-button.png
diff --git a/res/resources.qrc b/res/resources.qrc
index eaddf61..c59f74d 100644
--- a/res/resources.qrc
+++ b/res/resources.qrc
@@ -16,7 +16,7 @@
        <file>img/png/sess_ico.png</file>
        <file>img/png/ico_440x180.png</file>
        <file>img/png/power-button.png</file>
-       <file>img/png/close-button.png</file>
+       <file>img/png/broker-logout-button.png</file>
        <file>img/icons/128x128/x2go.png</file>
        <file>img/icons/128x128/folder.png</file>
        <file>img/icons/128x128/x2gosession.png</file>
diff --git a/src/help.cpp b/src/help.cpp
index 6feef1e..d5343e8 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -125,7 +125,6 @@ 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."));
@@ -160,6 +159,7 @@ help::params_t help::build_params () {
   ADD_OPT ("--broker-autologin", QT_TRANSLATE_NOOP ("Help", "Enables the use of the default SSH key or SSH agent for authentication against an SSH session broker. The client's behavior is undefined if this flag is used for non-SSH session brokers."));
   ADD_OPT ("--broker-noauth", QT_TRANSLATE_NOOP ("Help", "Does not ask for user credentials during session broker authentication. This can be useful if you are using an HTTP(S) session broker without authentication. If you run an HTTP(S) server without authentication, but with user-specific profiles, then put the user name into the broker URL (refer to --broker-url.) The user name then will be extracted from the broker URL and be sent to the session broker. The client's behavior is undef [...]
   ADD_OPT ("--broker-use-creds-for-session", QT_TRANSLATE_NOOP ("Help", "Use broker credentials as session user/password credentials when using broker mode with broker authentication. Currently only affects direct RDP sessions."));
+  ADD_OPT ("--broker-logoutbt", QT_TRANSLATE_NOOP ("Help", "Enables broker logout button."));
   ADD_OPT ("--background=<svg-file|dir>", QT_TRANSLATE_NOOP ("Help", "Use a custom/branded background image (SVG format) for X2Go Client's main window. If a directory is given, will randomly pick an SVG file inside of it."));
   ADD_OPT ("--branding=<svg-file>", QT_TRANSLATE_NOOP ("Help", "Use a custom icon (SVG format) for additional branding to replace the default in the lower left corner of X2Go Client's main window."));
 
diff --git a/src/httpbrokerclient.cpp b/src/httpbrokerclient.cpp
index 96245f5..1416348 100644
--- a/src/httpbrokerclient.cpp
+++ b/src/httpbrokerclient.cpp
@@ -436,6 +436,7 @@ bool HttpBrokerClient::checkAccess(QString answer )
         return false;
     }
     config->brokerAuthenticated=true;
+    emit (enableBrokerLogoutButton ());
     int authBegin=answer.indexOf("AUTHID:");
     if (authBegin!=-1)
     {
diff --git a/src/httpbrokerclient.h b/src/httpbrokerclient.h
index 1b62b26..3cb0eb0 100644
--- a/src/httpbrokerclient.h
+++ b/src/httpbrokerclient.h
@@ -92,6 +92,7 @@ signals:
     void sessionSelected( );
     void passwordChanged( QString );
     void connectionTime(int, int);
+    void enableBrokerLogoutButton ();
 };
 
 #endif
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 0caa920..fdc043b 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -78,7 +78,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     thinMode=false;
     closeDisconnect=false;
     showHaltBtn=false;
-    showCloseBtn=false;
+    showBrokerLogoutBtn=false;
     defaultUseSound=true;
     defaultSetKbd=true;
     extStarted=false;
@@ -201,7 +201,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     gpgAgent=0l;
     statusLabel=0;
     gpg=0l;
-    bClose = NULL;
+    bBrokerLogout = NULL;
     restartResume=false;
     isPassShown=true;
     readExportsFrom=QString::null;
@@ -530,33 +530,33 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     }
 
 
-    bClose = new QPushButton (bgFrame);
-    QPixmap p (":/img/png/close-button.png");
-    bClose->setIcon (p);
-    bClose->setFocusPolicy (Qt::NoFocus);
-    bClose->setFixedSize (32,32);
+    bBrokerLogout = new QPushButton (bgFrame);
+    QPixmap p (":/img/png/broker-logout-button.png");
+    bBrokerLogout->setIcon (p);
+    bBrokerLogout->setFocusPolicy (Qt::NoFocus);
+    bBrokerLogout->setFixedSize (32,32);
 
     if (showHaltBtn)
     {
-        bClose->move (40,10);
+        bBrokerLogout->move (40,10);
     }
     else
     {
-        bClose->move (10,10);
+        bBrokerLogout->move (10,10);
     }
 
-    bClose->setEnabled (true);
+    bBrokerLogout->setEnabled (false);
 
-    if (showCloseBtn)
+    if (showBrokerLogoutBtn)
     {
-        bClose->show ();
+        bBrokerLogout->show ();
     }
     else
     {
-        bClose->hide ();
+        bBrokerLogout->hide ();
     }
 
-    connect (bClose, SIGNAL (clicked ()), this, SLOT (slotCloseButton ()));
+    connect (bBrokerLogout, SIGNAL (clicked ()), this, SLOT (slotBrokerLogoutButton ()));
 
 
     if (brokerMode)
@@ -568,6 +568,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
         connect ( broker, SIGNAL( sessionsLoaded()), this, SLOT (slotReadSessions()));
         connect ( broker, SIGNAL ( sessionSelected()), this, SLOT (slotGetBrokerSession()));
         connect ( broker, SIGNAL ( passwordChanged(QString)), this, SLOT ( slotPassChanged(QString)));
+        connect (broker, SIGNAL (enableBrokerLogoutButton ()), this, SLOT (slotEnableBrokerLogoutButton ()));
     }
 
     proxyWinTimer=new QTimer ( this );
@@ -611,19 +612,19 @@ void ONMainWindow::slotShutdownThinClient()
     file.close();
 }
 
-void ONMainWindow::slotCloseButton () {
+void ONMainWindow::slotEnableBrokerLogoutButton () {
+  bBrokerLogout->setEnabled (true);
+}
+
+void ONMainWindow::slotBrokerLogoutButton () {
   /*
    * Log out of the broker if currently logged in, otherwise
-   * close the client.
+   * does nothing.
    */
   if (config.brokerAuthenticated) {
-    x2goDebug << "Logging off from broker via close button.";
+    x2goDebug << "Logging off from broker via logout button.";
     QTimer::singleShot (1, this, SLOT (slotGetBrokerAuth ()));
   }
-  else {
-    x2goDebug << "Closing client via close button.";
-    close ();
-  }
 }
 
 
@@ -1198,7 +1199,8 @@ void ONMainWindow::slotGetBrokerAuth()
        text+=config.brokerurl;*/
     nameLabel->setText ( text );
     slotShowPassForm();
-    config.brokerAuthenticated=false;
+    config.brokerAuthenticated = false;
+    bBrokerLogout->setEnabled (false);
 
     if(config.brokerUser.length()>0)
     {
@@ -1669,7 +1671,7 @@ void ONMainWindow::closeClient()
         x2goDebug << "libssh finalized.";
     }
 
-    delete (bClose);
+    delete (bBrokerLogout);
 
     x2goInfof(7)<<tr("Finished X2Go Client closing hooks.");
 }
@@ -7497,9 +7499,9 @@ bool ONMainWindow::parseParameter ( QString param )
         showHaltBtn=true;
         return true;
     }
-    if (param == "--closebt")
+    if (param == "--broker-logoutbt")
     {
-        showCloseBtn=true;
+        showBrokerLogoutBtn=true;
         return true;
     }
     if ( param=="--hide" )
diff --git a/src/onmainwindow.h b/src/onmainwindow.h
index e857a1c..2d6f1ec 100644
--- a/src/onmainwindow.h
+++ b/src/onmainwindow.h
@@ -684,7 +684,7 @@ private:
     QPushButton* bCancel;
 
 
-    QPushButton *bClose;
+    QPushButton *bBrokerLogout;
 
 
     QLabel* selectSessionLabel;
@@ -799,7 +799,7 @@ private:
     bool useLdap;
     bool showToolBar;
     bool showHaltBtn;
-    bool showCloseBtn;
+    bool showBrokerLogoutBtn;
     bool newSession;
     bool runStartApp;
     bool ldapOnly;
@@ -1061,7 +1061,7 @@ private slots:
     void slotChangeKbdLayout(const QString& layout);
     void slotSyncX();
     void slotShutdownThinClient();
-    void slotCloseButton ();
+    void slotBrokerLogoutButton ();
     void slotReadApplications(bool result, QString output, int pid );
 
 public slots:
@@ -1071,6 +1071,7 @@ public slots:
     void slotDetachProxyWindow();
     void slotActivateWindow();
     void setFocus();
+    void slotEnableBrokerLogoutButton ();
 
 private slots:
     void slotShowPAMSGDialog(bool error, const QString& main_text, const QString& info_text, bool modal);

--
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