[X2Go-Commits] [x2goclient] 02/02: configdialog.cpp:

git-admin at x2go.org git-admin at x2go.org
Thu Mar 12 03:35:36 CET 2015


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

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit 551078ce72b56157539830978348c06415cb30eb
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Mar 12 03:34:38 2015 +0100

    configdialog.cpp:
    
      - Reformat code.
      - Add MacPorts and XQuartz references URL's and installation instructions
      - Don't show outdated version warning when no XQuartz server is installed.
    
    Fixes: #792.
---
 debian/changelog     |    3 ++
 src/configdialog.cpp |  106 +++++++++++++++++++++++++++-----------------------
 2 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 778c7a8..ea8e563 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -207,6 +207,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low
       (missed legacy resource URI wrapper call.)
     - configdialog.cpp: update XQuartz outdated version info message and
       links. Add MacPorts reference.
+    - configdialog.cpp: reformat code, add MacPorts and XQuartz references,
+      URL's and installation instructions, don't show outdated version warning
+      when no XQuartz server is installed. Fixes: #792.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Thu, 19 Feb 2015 13:25:28 +0100
 
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
index ca6277d..b23b6d4 100644
--- a/src/configdialog.cpp
+++ b/src/configdialog.cpp
@@ -461,69 +461,79 @@ QString ConfigDialog::retMaxXDarwinVersion ( QString v1, QString v2 )
 
 QString ConfigDialog::findXDarwin ( QString& version, QString path )
 {
-    if ( path=="" )
-    {
-        QString dir1="/Applications/Utilities/XQuartz.app";
-        QString ver1="0.0.0";
-        if ( QFile::exists ( dir1+"/Contents/Info.plist" ) )
-        {
-            QSettings vst ( dir1+"/Contents/Info.plist",
-                            QSettings::NativeFormat );
-            ver1=vst.value ( "CFBundleShortVersionString",
-                             ( QVariant ) "0.0.0" ).toString();
+    if (path.isEmpty ()) {
+        QString dir1 = "/Applications/Utilities/XQuartz.app";
+        QString ver1 = "0.0.0";
+        if (QFile::exists (dir1 + "/Contents/Info.plist")) {
+            QSettings vst (dir1 + "/Contents/Info.plist",
+                           QSettings::NativeFormat);
+            ver1 = vst.value ("CFBundleShortVersionString",
+                              (QVariant) "0.0.0").toString ();
         }
-        QString dir2="/usr/X11/X11.app";
-        QString ver2="0.0.0";;
-        if ( QFile::exists ( dir2+"/Contents/Info.plist" ) )
-        {
-            QSettings vst ( dir2+"/Contents/Info.plist",
-                            QSettings::NativeFormat );
-            ver2=vst.value ( "CFBundleShortVersionString",
-                             ( QVariant ) "0.0.0" ).toString();
+
+        QString dir2 = "/usr/X11/X11.app";
+        QString ver2 = "0.0.0";;
+        if (QFile::exists (dir2 + "/Contents/Info.plist")) {
+            QSettings vst (dir2 + "/Contents/Info.plist",
+                           QSettings::NativeFormat);
+            ver2 = vst.value ("CFBundleShortVersionString",
+                             (QVariant) "0.0.0").toString ();
         }
-        if ( retMaxXDarwinVersion ( ver1,ver2 ) ==ver1 )
-        {
-            version=ver1;
+        if (retMaxXDarwinVersion (ver1, ver2) == ver1) {
+            version = ver1;
             return dir1;
         }
-        else
-        {
-            version=ver2;
+        else {
+            version = ver2;
             return dir2;
         }
     }
-    version="0.0.0";
-    if ( QFile::exists ( path+"/Contents/Info.plist" ) )
-    {
-        QSettings vst ( path+"/Contents/Info.plist",
-                        QSettings::NativeFormat );
-        version=vst.value ( "CFBundleShortVersionString",
-                            ( QVariant ) "0.0.0" ).toString();
+    else {
+        version = "0.0.0";
+        if (QFile::exists (path + "/Contents/Info.plist")) {
+            QSettings vst (path + "/Contents/Info.plist",
+                           QSettings::NativeFormat);
+            version=vst.value ("CFBundleShortVersionString",
+                               (QVariant) "0.0.0").toString ();
+        }
+        return path;
     }
-    return path;
 }
 
 
-void ConfigDialog::slot_findXDarwin()
+void ConfigDialog::slot_findXDarwin ()
 {
     QString version;
-    QString path=findXDarwin ( version );
-    if ( path=="" )
-    {
-        QMessageBox::warning (
-            this,tr ( "Warning" ),
-            tr ( "x2goclient could not find any suitable X11 "
-                 "Application. Please install Apple X11 "
-                 "or select the path to the application" ) );
-    }
-    QString minVer="2.1.0";
-    if ( retMaxXDarwinVersion ( minVer,version ) ==minVer )
-    {
-        printXDarwinVersionWarning ( version );
+    QString path = findXDarwin (version);
+    if (path.isEmpty ()) {
+        QMessageBox::warning (this, tr ("Warning"),
+                              tr ("x2goclient could not find any suitable X11 Server.\n\n"
+
+                                  "MacPorts users, please install either the port <b>xorg-server</b>\n"
+                                  "or the port <b>xorg-server-devel</b>.\n"
+                                  "Upon successful installation, please follow the instructions printed\n"
+                                  "by the port utility to autostart/load the server.\n\n"
+
+                                  "All other users, please obtain and install XQuartz from\n\n"
+
+                                  "\t<a href=\"https://xquartz.macosforge.org/\">"
+                                      "https://xquartz.macosforge.org/"
+                                  "</a>\n\n"
+
+                                  "Afterwards, restart x2goclient and\n"
+                                  "select the correct path to the X11 application.\n"
+                                  "This will most likely be <b>/Applications/MacPorts/X11.app</b> or\n"
+                                  "<b>/Applications/Utilities/XQuartz.app</b>."));
     }
-    leXexec->setText ( path );
-    leCmdOpt->setText ( version );
+    else {
+        QString minVer = "2.1.0";
+        if (retMaxXDarwinVersion (minVer, version) == minVer) {
+            printXDarwinVersionWarning (version);
+        }
 
+        leXexec->setText (path);
+        leCmdOpt->setText (version);
+    }
 }
 
 void ConfigDialog::printXDarwinVersionWarning (QString version)

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list