[X2Go-Commits] [x2goclient] 02/02: {src/{help.cpp, onmainwindow.{cpp, h}}, man/man1/x2goclient.1}: add new --branding option that replaces the seal logo. Fixes: #1162.

git-admin at x2go.org git-admin at x2go.org
Wed Mar 22 03:06:24 CET 2017


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

x2go pushed a commit to branch master
in repository x2goclient.

commit 12a567a3cedde2ba58b33b545de284cd93aeb9c8
Author: Seth Galitzer <sgsax at ksu.edu>
Date:   Wed Mar 22 03:00:39 2017 +0100

    {src/{help.cpp,onmainwindow.{cpp,h}},man/man1/x2goclient.1}: add new --branding option that replaces the seal logo. Fixes: #1162.
---
 debian/changelog      |  2 ++
 man/man1/x2goclient.1 |  3 +++
 src/help.cpp          |  1 +
 src/onmainwindow.cpp  | 17 ++++++++++++++++-
 src/onmainwindow.h    |  2 ++
 5 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 09a10f5..42c1e52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -185,6 +185,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium
   * New upstream version (4.1.0.1):
     - src/help.cpp: add documentation for the --background option.
       Part of #1162.
+    - {src/{help.cpp,onmainwindow.{cpp,h}},man/man1/x2goclient.1}: add new
+      --branding option that replaces the seal logo. Fixes: #1162.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Wed, 22 Feb 2017 07:13:10 +0100
 
diff --git a/man/man1/x2goclient.1 b/man/man1/x2goclient.1
index 895e1f0..d90a888 100644
--- a/man/man1/x2goclient.1
+++ b/man/man1/x2goclient.1
@@ -97,6 +97,9 @@ The support information is provided via a simple HTML file. Example:
 \*(T<\fB\-\-background=<svg-file>\fR\*(T>
 Use a custom/branded background image (SVG format) for X2Go Client's main window (i.e. replace the blue gradient area
 in X2Go Client by some background of your own (business/workgroup/project).
+.TP
+\*(T<\fB\-\-branding=<svg-file>\fR\*(T>
+Use a custom icon (SVG format) for additional branding to replace the default in the lower left corner of X2Go Client's main window.
 
 .SH SESSION PROFILE DEFAULTS
 You can set certain defaults for session profiles via command line switches using the following options:
diff --git a/src/help.cpp b/src/help.cpp
index c3f6a59..e3cb1de 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -155,6 +155,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 ("--background=<svg-file>", QT_TRANSLATE_NOOP ("Help", "Use a custom/branded background image (SVG format) for X2Go Client's main window."));
+  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."));
 
 # undef NEWLINE
 # undef ADD_OPT
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 57363ff..5dd3906 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -360,7 +360,11 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     pl.setColor ( QPalette::Window, QColor ( 255,255,255,0 ) );
     x2g->setPalette ( pl );
 
-    SVGFrame* on=new SVGFrame ( ( QString ) ":/img/svg/onlogo.svg",false,fr );
+    if (OnFile.size())
+        on=new SVGFrame ( ( QString ) OnFile,false,fr );
+    else
+        on=new SVGFrame ( ( QString ) ":/img/svg/onlogo.svg",false,fr );
+
     on->setPalette ( pl );
 
     if ( !miniMode )
@@ -7545,6 +7549,17 @@ bool ONMainWindow::parseParameter ( QString param )
         portableDataPath=value;
         return true;
     }
+    if (setting == "--branding")
+    {
+        value = expandHome(value);
+        if (! QFile::exists(value))
+        {
+            printError( param + tr(" (file does not exist)"));
+            return false;
+        }
+        OnFile=value;
+        return true;
+    }
 
     printError ( param );
     return false;
diff --git a/src/onmainwindow.h b/src/onmainwindow.h
index 8ec120f..37b454c 100644
--- a/src/onmainwindow.h
+++ b/src/onmainwindow.h
@@ -672,6 +672,7 @@ private:
 
     IMGFrame* fr;
     SVGFrame *bgFrame;
+    SVGFrame *on;
     QLineEdit* uname;
     ClickLineEdit* pass;
     ClickLineEdit* login;
@@ -801,6 +802,7 @@ private:
 
     QString supportMenuFile;
     QString BGFile;
+    QString OnFile;
     QString SPixFile;
 
     QString LDAPSndSys;

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