This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from 707f990 src/sessionbutton.cpp: we cannot use ".." in resource paths to move up one level, so use images_resource_path () instead and hope that we finally get a yummy hamburger. new cd36a75 src/onmainwindow.{cpp,h}: let iconsPath () take a const-reference instead of an object and make it a const member function. new 5eca0cf src/onmainwindow.{cpp,h}: let images_resource_path () take a new, optional "base" parameter, that might be empty and is put in-between the fixed resource path string and the filename parameter. new 7f48257 src/onmainwindow.cpp: use images_resource_path () in iconsPath (). new b04960e src/sessionbutton.cpp: instead of using the hamburger.svg file directly, render it to a raster image and use this Pixmap as the icon file - otherwise the icon will not show up. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 10 ++++++++++ src/onmainwindow.cpp | 38 ++++++++++++++++++++++++++++++++++---- src/onmainwindow.h | 4 ++-- src/sessionbutton.cpp | 26 +++++++++++++++++++++----- 4 files changed, 67 insertions(+), 11 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 5eca0cffdfb303364f21150271284524511340da Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jan 18 07:45:38 2017 +0100 src/onmainwindow.{cpp,h}: let images_resource_path () take a new, optional "base" parameter, that might be empty and is put in-between the fixed resource path string and the filename parameter. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 34 ++++++++++++++++++++++++++++++++-- src/onmainwindow.h | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d12436a..13b269b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium finally get a yummy hamburger. - src/onmainwindow.{cpp,h}: let iconsPath () take a const-reference instead of an object and make it a const member function. + - src/onmainwindow.{cpp,h}: let images_resource_path () take a new, + optional "base" parameter, that might be empty and is put in-between the + fixed resource path string and the filename parameter. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 73f5a3d..e11269d 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -1670,8 +1670,38 @@ QString ONMainWindow::iconsPath ( const QString &fname ) const return ( QString ) ":/img/icons"+fname; } -QString ONMainWindow::images_resource_path (const QString &filename) const { - return (QString (":/img/" + filename)); +QString ONMainWindow::images_resource_path (const QString &filename, const QString &base) const { + QString ret = ":/img"; + + /* + * The base parameter is optional and might be empty. + * In this case, it's completely skipped. + * Otherwise, we want to make sure that the base parameter + * is appended to the fixed start with a slash, but doesn't + * end in a slash to avoid double-slashes. + * We add a trailing slash if the file name doesn't start + * with one. + */ + if (!(base.isEmpty ())) { + if (!(base.startsWith ('/'))) { + ret.append ('/'); + } + + ret.append (base); + + if (ret.endsWith ('/')) { + ret.chop (1); + } + } + + if (!(filename.startsWith ('/'))) { + ret.append ('/'); + } + + ret.append (filename); + + x2goDebug << "returning " << ret; + return (ret); } void ONMainWindow::displayUsers() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index bd3e31a..45c096d 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -352,7 +352,7 @@ public: ~ONMainWindow(); static void installTranslator(); QString iconsPath ( const QString &fname ) const; - QString images_resource_path (const QString &filename) const; + QString images_resource_path (const QString &filename, const QString &base = "") const; static bool isServerRunning ( int port ); void startNewSession(); void suspendSession ( QString sessId ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit cd36a7561c449ad2412eb5570ba448c733869e5d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jan 18 07:42:46 2017 +0100 src/onmainwindow.{cpp,h}: let iconsPath () take a const-reference instead of an object and make it a const member function. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 2 +- src/onmainwindow.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b84b2f9..d12436a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/sessionbutton.cpp: we cannot use ".." in resource paths to move up one level, so use images_resource_path () instead and hope that we finally get a yummy hamburger. + - src/onmainwindow.{cpp,h}: let iconsPath () take a const-reference + instead of an object and make it a const member function. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 806f9f2..73f5a3d 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -1662,7 +1662,7 @@ void ONMainWindow::loadSettings() } -QString ONMainWindow::iconsPath ( QString fname ) +QString ONMainWindow::iconsPath ( const QString &fname ) const { /* QFile fl(this->kdeIconsPath+fname); if(fl.exists()) diff --git a/src/onmainwindow.h b/src/onmainwindow.h index c8af781..bd3e31a 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -351,7 +351,7 @@ public: ONMainWindow ( QWidget *parent = 0 ); ~ONMainWindow(); static void installTranslator(); - QString iconsPath ( QString fname ); + QString iconsPath ( const QString &fname ) const; QString images_resource_path (const QString &filename) const; static bool isServerRunning ( int port ); void startNewSession(); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 7f48257cdcbd388c9fb5bc1cbf391f7e8835ca51 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jan 18 07:48:42 2017 +0100 src/onmainwindow.cpp: use images_resource_path () in iconsPath (). --- debian/changelog | 1 + src/onmainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 13b269b..998ae31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - src/onmainwindow.{cpp,h}: let images_resource_path () take a new, optional "base" parameter, that might be empty and is put in-between the fixed resource path string and the filename parameter. + - src/onmainwindow.cpp: use images_resource_path () in iconsPath (). [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index e11269d..f234e2f 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -1667,7 +1667,7 @@ QString ONMainWindow::iconsPath ( const QString &fname ) const /* QFile fl(this->kdeIconsPath+fname); if(fl.exists()) return kdeIconsPath+fname;*/ - return ( QString ) ":/img/icons"+fname; + return (images_resource_path (fname, "/icons/")); } QString ONMainWindow::images_resource_path (const QString &filename, const QString &base) const { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit b04960e58b8664b76b807fe28f6569d9654acaf0 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Jan 18 07:53:04 2017 +0100 src/sessionbutton.cpp: instead of using the hamburger.svg file directly, render it to a raster image and use this Pixmap as the icon file - otherwise the icon will not show up. Also change the icon size back to 16x16 px, that's big enough. --- debian/changelog | 4 ++++ src/sessionbutton.cpp | 26 +++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 998ae31..e3b968a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,10 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium optional "base" parameter, that might be empty and is put in-between the fixed resource path string and the filename parameter. - src/onmainwindow.cpp: use images_resource_path () in iconsPath (). + - src/sessionbutton.cpp: instead of using the hamburger.svg file directly, + render it to a raster image and use this Pixmap as the icon file - + otherwise the icon will not show up. Also change the icon size back to + 16x16 px, that's big enough. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 49f0ae3..2863050 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -33,6 +33,10 @@ #include "x2gologdebug.h" #include <QApplication> #include <QDesktopWidget> +#include <QSvgRenderer> +#include <QPainter> +#include <QImage> +#include <QPixmap> #include "sessionexplorer.h" @@ -121,9 +125,21 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id ) editBut=new QPushButton ( this ); editBut->setMouseTracking ( true ); connect ( editBut,SIGNAL ( pressed() ),this,SLOT ( slotShowMenu() ) ); - editBut->setIcon ( QIcon ( par->images_resource_path ( "/svg/hamburger.svg" ) ) ); - editBut->setIconSize ( QSize ( 32,32 ) ); - editBut->setFixedSize ( 48,48 ); + + /* Load our edit button SVG file. */ + QSvgRenderer svg_renderer (par->images_resource_path ("/svg/hamburger.svg")); + + /* Prepare image to render to with full transparency. */ + QImage tmp_image (16, 16, QImage::Format_ARGB32); + tmp_image.fill (0x00000000); + + /* Paint icon to the image. */ + QPainter tmp_painter (&tmp_image); + svg_renderer.render (&tmp_painter); + + editBut->setIcon ( QIcon ( QPixmap::fromImage (tmp_image) ) ); + editBut->setIconSize ( QSize ( 16,16 ) ); + editBut->setFixedSize ( 24,24 ); editBut->setFlat ( true ); editBut->setPalette ( cpal ); sessMenu=new QMenu ( this ); @@ -167,7 +183,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id ) { sessName->move ( 80,34 ); sessStatus->move(80,50); - editBut->move ( 283,132 ); + editBut->move ( 307,156 ); serverIcon->move ( 58,84 ); server->move ( 80,84 ); cmdIcon->move ( 58,108 ); @@ -181,7 +197,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id ) } else { - editBut->move ( 194,89 ); + editBut->move ( 218,113 ); sessName->move ( 64,11 ); sessStatus->hide(); serverIcon->move ( 66,44 ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git