This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. from 4776273 onmainwindow.{cpp,h}: make slotTunnelOk parameter optional and use the non-parameter call for the QSingleShotTimer::timeout() signal. new 9dc4db3 {x2goutils,non_modal_messagebox}.cpp: include the correct headers. new b59e5d9 x2goutils.{h,cpp}: split up show_RichText_WarningMsgBox() into the aforementioned function and a new convert_to_rich_text() helper function. new 27354ff non_modal_messagebox.{h,cpp}: add new Non_Modal_MessageBox::critical() overloaded functions to be able to use informative text and a (forceful, if requested) conversion to rich text. The 3 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 | 5 +++++ src/non_modal_messagebox.cpp | 28 +++++++++++++++++++++++++--- src/non_modal_messagebox.h | 14 ++++++++++++++ src/x2goutils.cpp | 29 +++++++++++++++++++---------- src/x2goutils.h | 1 + 5 files changed, 64 insertions(+), 13 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 bugfix/osx in repository x2goclient. commit 9dc4db3c46ecdce985bcb93c62e7533bb2cd082b Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 12 20:18:39 2015 +0100 {x2goutils,non_modal_messagebox}.cpp: include the correct headers. --- src/non_modal_messagebox.cpp | 3 ++- src/x2goutils.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/non_modal_messagebox.cpp b/src/non_modal_messagebox.cpp index 68ff7ac..47f66c0 100644 --- a/src/non_modal_messagebox.cpp +++ b/src/non_modal_messagebox.cpp @@ -14,10 +14,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ -#include "non_modal_messagebox.h" #include <QGridLayout> #include <QSpacerItem> +#include "non_modal_messagebox.h" + // Please look up the documentation in the header file! void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, const QString &text, diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 33b5410..a053306 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -22,6 +22,8 @@ #include <QDir> #include <QMessageBox> +#include "x2goutils.h" + QString expandHome( QString path ) { path = path.trimmed(); -- 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 bugfix/osx in repository x2goclient. commit b59e5d94fb84a22d4b553aa8c0378c1d7561f621 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 12 20:21:27 2015 +0100 x2goutils.{h,cpp}: split up show_RichText_WarningMsgBox() into the aforementioned function and a new convert_to_rich_text() helper function. --- debian/changelog | 2 ++ src/x2goutils.cpp | 27 +++++++++++++++++---------- src/x2goutils.h | 1 + 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c327e6..eb9c295 100644 --- a/debian/changelog +++ b/debian/changelog @@ -222,6 +222,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low reformat code. - onmainwindow.{cpp,h}: make slotTunnelOk parameter optional and use the non-parameter call for the QSingleShotTimer::timeout() signal. + - x2goutils.{h,cpp}: split up show_RichText_WarningMsgBox() into the + aforementioned function and a new convert_to_rich_text() helper function. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index a053306..7f6eb5b 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -74,17 +74,24 @@ QString wrap_legacy_resource_URIs (const QString& res_path) { return (ret); } +QString convert_to_rich_text (const QString &text, bool force) { + QString fixup_text (text); + fixup_text.replace ("\n", "\n<br />\n"); + + if (force) { + // This is a workaround for a bug in Qt. Even though we set Qt::RichText as the text format + // later on, the informative text is not recognized as rich text, UNLESS a HTML tag + // is used ON THE VERY FIRST LINE. + // Make sure, that there always is one... + fixup_text.prepend ("<b></b>"); + } + + return (fixup_text); +} + void show_RichText_WarningMsgBox (const QString& main_text, const QString& informative_text) { - QString fixup_main_text (main_text); - QString fixup_informative_text (informative_text); - fixup_main_text.replace ("\n", "\n<br />\n"); - fixup_informative_text.replace ("\n", "\n<br />\n"); - - // This is a workaround for a bug in Qt. Even though we set Qt::RichText as the text format - // later on, the informative text is not recognized as rich text, UNLESS a HTML tag - // is used ON THE VERY FIRST LINE. - // Make sure, that there always is one... - fixup_informative_text.prepend ("<b></b>"); + QString fixup_main_text (convert_to_rich_text (main_text)); + QString fixup_informative_text (convert_to_rich_text (informative_text, true)); QMessageBox msg_box (QMessageBox::Warning, QString ("X2Go Client"), fixup_main_text, NULL); diff --git a/src/x2goutils.h b/src/x2goutils.h index 82a5f76..cf95b58 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -26,6 +26,7 @@ QString expandHome( QString path ); QString fixup_resource_URIs (const QString& res_path); QString wrap_legacy_resource_URIs (const QString& res_path); +QString convert_to_rich_text (const QString &text, bool force = false); void show_RichText_WarningMsgBox (const QString& main_text, const QString& informative_text = ""); #endif /* !defined (X2GOUTILS_H) */ -- 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 bugfix/osx in repository x2goclient. commit 27354ff754a10cc5fbcf52edcf125605b84bbf37 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 12 20:24:38 2015 +0100 non_modal_messagebox.{h,cpp}: add new Non_Modal_MessageBox::critical() overloaded functions to be able to use informative text and a (forceful, if requested) conversion to rich text. --- debian/changelog | 3 +++ src/non_modal_messagebox.cpp | 25 +++++++++++++++++++++++-- src/non_modal_messagebox.h | 14 ++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index eb9c295..b7272da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -224,6 +224,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low non-parameter call for the QSingleShotTimer::timeout() signal. - x2goutils.{h,cpp}: split up show_RichText_WarningMsgBox() into the aforementioned function and a new convert_to_rich_text() helper function. + - non_modal_messagebox.{h,cpp}: add new Non_Modal_MessageBox::critical() + overloaded functions to be able to use informative text and a (forceful, + if requested) conversion to rich text. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/non_modal_messagebox.cpp b/src/non_modal_messagebox.cpp index 47f66c0..1dd1ef8 100644 --- a/src/non_modal_messagebox.cpp +++ b/src/non_modal_messagebox.cpp @@ -18,10 +18,12 @@ #include <QSpacerItem> #include "non_modal_messagebox.h" +#include "x2goutils.h" // Please look up the documentation in the header file! void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, - const QString &text, + const QString &text, const QString &informative_text, + bool rich_text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) { QMessageBox *msg_box = new QMessageBox (QMessageBox::Critical, title, text, buttons, parent); @@ -29,7 +31,12 @@ void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, msg_box->setAttribute (Qt::WA_DeleteOnClose); msg_box->setDefaultButton (defaultButton); - // Set to minimum width of 300px. + if (rich_text) { + msg_box->setTextFormat (Qt::RichText); + msg_box->setInformativeText (convert_to_rich_text (informative_text, true)); + } + + // Set to minimum width of 500px. QSpacerItem *horizontal_spacer = new QSpacerItem (500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); QGridLayout *grid_layout = (QGridLayout*) (msg_box->layout ()); grid_layout->addItem (horizontal_spacer, grid_layout->rowCount (), 0, 1, grid_layout->columnCount ()); @@ -42,3 +49,17 @@ void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, msg_box->activateWindow (); } +void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, + const QString &text, const QString &informative_text, + QMessageBox::StandardButtons buttons, + QMessageBox::StandardButton defaultButton) { + Non_Modal_MessageBox::critical (parent, title, text, informative_text, false, buttons, defaultButton); +} + +void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, + const QString &text, + QMessageBox::StandardButtons buttons, + QMessageBox::StandardButton defaultButton) { + Non_Modal_MessageBox::critical (parent, title, text, QString (), buttons, defaultButton); +} + diff --git a/src/non_modal_messagebox.h b/src/non_modal_messagebox.h index ab7505e..ca0aa93 100644 --- a/src/non_modal_messagebox.h +++ b/src/non_modal_messagebox.h @@ -21,6 +21,20 @@ class Non_Modal_MessageBox { public: + // Main implementation. + static void critical (QWidget *parent, const QString &title, + const QString &text, const QString &informative_text, + bool rich_text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok, + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + + // Wrapper. + static void critical (QWidget *parent, const QString &title, + const QString &text, const QString &informative_text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok, + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + + // Wrapper for QMessageBox::critical-like usage. // Use this instead QMessageBox::critical for a non-modal variant. // Caveat: this function does return immediately and will NOT return the clicked button. static void critical (QWidget *parent, const QString &title, -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git