[X2Go-Commits] x2goclient.git - build-baikal (branch) updated: 4.0.1.1-16-g24561cc

X2Go dev team git-admin at x2go.org
Wed Jan 8 22:20:05 CET 2014


The branch, build-baikal has been updated
       via  24561ccdeb367345797ead5db7ad5305b962135d (commit)
      from  ec8bb38e02b8c4c1be428c6690fa45d35c13b26e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    3 +++
 onmainwindow.cpp |   51 ++++++++++++++++++++++++++++++++++++++-------------
 onmainwindow.h   |    1 +
 3 files changed, 42 insertions(+), 13 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 09fc5e0..a772355 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ x2goclient (4.0.1.2-0~x2go2) UNRELEASED; urgency=low
   * New upstream versino (4.0.1.2):
     - Strip whitespaces off of user name, host name and other
       strings when loading / saving session profiles.(Fixes: #315).
+    - New option --tray-icon. Force showing the tray icon, even for
+      hidden sessions. Also allow creation of .desktop files with
+      --tray-icon optionally being enabled. (Fixes: #316).
 
   [ Oleksandr Shneyder ]
   * New upstream version (4.0.1.2):
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index d0a3108..7811540 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -101,6 +101,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     lastSession=0l;
     changeBrokerPass=false;
     resumeAfterSuspending=false;
+    forceToShowTrayicon=false;
 
     appSeparator=0;
     config.brokerNoAuth=false;
@@ -1099,7 +1100,7 @@ void ONMainWindow::trayIconInit()
             trayIcon->setToolTip(tr("Left mouse button to hide/restore - Right mouse button to display context menu"));
         }
 
-        if (!startHidden)
+        if (!startHidden | forceToShowTrayicon)
         {
             trayIcon->show();
             plugAppsInTray();
@@ -2034,17 +2035,29 @@ void ONMainWindow::slotEdit ( SessionButton* bt )
 
 void ONMainWindow::slotCreateDesktopIcon ( SessionButton* bt )
 {
-    bool crHidden= ( QMessageBox::question (
-                         this,
-                         tr ( "Create session icon on desktop" ),
-                         tr ( "Desktop icons can be configured "
-                              "not to show x2goclient (hidden mode). "
-                              "If you like to use this feature you'll "
-                              "need to configure login by a gpg key "
-                              "or gpg smart card.\n\n"
-                              "Use x2goclient hidden mode?" ),
-                         QMessageBox::Yes|QMessageBox::No ) ==
-                     QMessageBox::Yes );
+    QMessageBox messageBox(QMessageBox::Question,
+                           tr ( "Create session icon on desktop" ),
+                           tr ( "Desktop icons can be configured "
+                                "not to show x2goclient (hidden mode). "
+                                "If you like to use this feature you'll "
+                                "need to configure login by a gpg key "
+                                "or gpg smart card.\n\n"
+                                "Use x2goclient hidden mode?" ),
+                           QMessageBox::Yes|QMessageBox::No,
+                           this);
+
+    //adding a chekbox to know if user want to enable trayicon in hide sessions
+    QCheckBox cbShowTrayIcon(tr("Show session tray icon when running"));
+    messageBox.layout()->addWidget(&cbShowTrayIcon);
+    QGridLayout* gridLayout = (QGridLayout*) messageBox.layout();
+    gridLayout->addWidget(&cbShowTrayIcon, gridLayout->rowCount(), 0, 1, gridLayout->columnCount());
+    cbShowTrayIcon.blockSignals(true);
+
+    //getting the result
+    bool crHidden = (messageBox.exec() == QMessageBox::Yes);
+    bool bShowTrayicon = (cbShowTrayIcon.checkState() == Qt::Checked);
+
+
     X2goSettings st ( "sessions" );
 
     QString name=st.setting()->value ( bt->id() +"/name",
@@ -2073,6 +2086,10 @@ void ONMainWindow::slotCreateDesktopIcon ( SessionButton* bt )
     QString cmd="x2goclient";
     if ( crHidden )
         cmd="x2goclient --hide";
+
+    if (bShowTrayicon)
+        cmd += " --tray-icon";
+
     QTextStream out ( &file );
     out << "[Desktop Entry]\n"<<
         "Exec="<<cmd<<" --sessionid="<<bt->id() <<"\n"<<
@@ -6474,6 +6491,12 @@ bool ONMainWindow::parseParameter ( QString param )
         return true;
     }
 
+    //force to show trayicon
+    if (param == "--tray-icon")
+    {
+        forceToShowTrayicon = true;
+        return true;
+    }
 
     QString setting,value;
     QStringList vals=param.split ( "=" );
@@ -6980,7 +7003,9 @@ void ONMainWindow::showHelp()
         "--set-kbd=<0|1>\t\t\t overwrite current keyboard settings\n"
         "--autostart=<app> \t\t launch \"app\" by session start in \"published "
         "applications\" mode\n"
-        "--session-conf=<file>\t\t path to alternative session config\n";
+        "--session-conf=<file>\t\t path to alternative session config\n"
+        "--tray-icon\t\t force to show session trayicon\n";
+
     qCritical ( "%s",helpMsg.toLocal8Bit().data() );
     if (!startHidden)
     {
diff --git a/onmainwindow.h b/onmainwindow.h
index 7e1d02c..7e51291 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -595,6 +595,7 @@ private:
     QList<serv> x2goServers;
     QList<Application> applications;
     QList<sshKey> cmdSshKeys;
+    bool forceToShowTrayicon; //true if --tray-icon passed in command line
 
     QPushButton* bSusp;
     QPushButton* bTerm;


hooks/post-receive
-- 
x2goclient.git (X2Go Client)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goclient.git" (X2Go Client).




More information about the x2go-commits mailing list