This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/general in repository x2goclient. from a2798ac onmainwindow.cpp: clarify message regarding missing SSH daemon host keys. new fa582dd non_modal_messagebox.{cpp,h}: add new Non_Modal_MessageBox class for non-modal message boxes. new cd1e12e onmainwindow.cpp: use Non_Modal_MessageBox::critical function to display errors relating to missing sshd host keys. The 2 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 | 4 ++++ src/{x2goutils.h => non_modal_messagebox.cpp} | 32 +++++++++++++++++-------- src/{x2goutils.h => non_modal_messagebox.h} | 24 ++++++++++--------- src/onmainwindow.cpp | 26 +++++++++++--------- src/onmainwindow.h | 2 +- x2goclient.pro | 6 +++-- 6 files changed, 59 insertions(+), 35 deletions(-) copy src/{x2goutils.h => non_modal_messagebox.cpp} (51%) copy src/{x2goutils.h => non_modal_messagebox.h} (64%) -- 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/general in repository x2goclient. commit fa582ddbfe871ff5d7b82fdd474dfb2c4ddd0e53 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 9 22:49:25 2015 +0100 non_modal_messagebox.{cpp,h}: add new Non_Modal_MessageBox class for non-modal message boxes. --- debian/changelog | 2 ++ src/non_modal_messagebox.cpp | 43 ++++++++++++++++++++++++++++++++++++++++++ src/non_modal_messagebox.h | 33 ++++++++++++++++++++++++++++++++ src/onmainwindow.h | 2 +- x2goclient.pro | 6 ++++-- 5 files changed, 83 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index c234f16..89482fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -186,6 +186,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low #804. - onmainwindow.cpp: clarify message regarding missing SSH daemon host keys. Fixes #793. + - non_modal_messagebox.{cpp,h}: Add new Non_Modal_MessageBox class for + non-modal message boxes. -- 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 new file mode 100644 index 0000000..68ff7ac --- /dev/null +++ b/src/non_modal_messagebox.cpp @@ -0,0 +1,43 @@ +/************************************************************************** +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program. If not, see <http://www.gnu.org/licenses/>. * +***************************************************************************/ + +#include "non_modal_messagebox.h" +#include <QGridLayout> +#include <QSpacerItem> + +// Please look up the documentation in the header file! +void Non_Modal_MessageBox::critical (QWidget *parent, const QString &title, + const QString &text, + QMessageBox::StandardButtons buttons, + QMessageBox::StandardButton defaultButton) { + QMessageBox *msg_box = new QMessageBox (QMessageBox::Critical, title, text, buttons, parent); + + msg_box->setAttribute (Qt::WA_DeleteOnClose); + msg_box->setDefaultButton (defaultButton); + + // Set to minimum width of 300px. + 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 ()); + + // Here's the real magic. + msg_box->setModal (false); + + msg_box->show (); + msg_box->raise (); + msg_box->activateWindow (); +} + diff --git a/src/non_modal_messagebox.h b/src/non_modal_messagebox.h new file mode 100644 index 0000000..ab7505e --- /dev/null +++ b/src/non_modal_messagebox.h @@ -0,0 +1,33 @@ +/************************************************************************** +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program. If not, see <http://www.gnu.org/licenses/>. * +***************************************************************************/ + +#ifndef NON_MODAL_MESSAGEBOX_H +#define NON_MODAL_MESSAGEBOX_H + +#include <QMessageBox> + +class Non_Modal_MessageBox { + public: + // 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, + const QString &text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok, + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + +}; + +#endif /* !defined (NON_MODAL_MESSAGEBOX_H) */ diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 57ad65b..e1b68dc 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -42,7 +42,7 @@ #include <QToolBar> #include <QSystemTrayIcon> #include "sshmasterconnection.h" - +#include "non_modal_messagebox.h" #ifdef Q_OS_WIN diff --git a/x2goclient.pro b/x2goclient.pro index e790d5e..d41b07e 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -75,7 +75,8 @@ HEADERS += src/configdialog.h \ src/helpdialog.h \ src/sessionexplorer.h \ src/folderbutton.h \ - src/folderexplorer.h + src/folderexplorer.h \ + src/non_modal_messagebox.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -116,7 +117,8 @@ SOURCES += src/sharewidget.cpp \ src/helpdialog.cpp \ src/sessionexplorer.cpp \ src/folderbutton.cpp \ - src/folderexplorer.cpp + src/folderexplorer.cpp \ + src/non_modal_messagebox.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 -- 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/general in repository x2goclient. commit cd1e12ee5a71a5c264846dabbb04e4e71d10778e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 9 22:53:56 2015 +0100 onmainwindow.cpp: use Non_Modal_MessageBox::critical function to display errors relating to missing sshd host keys. Fixes #794. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 89482fa..1a40e53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -188,6 +188,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low keys. Fixes #793. - non_modal_messagebox.{cpp,h}: Add new Non_Modal_MessageBox class for non-modal message boxes. + - onmainwindow.cpp: use Non_Modal_MessageBox::critical function to display + errors relating to missing sshd host keys. Fixes #794. -- X2Go Release Manager <git-admin@x2go.org> Thu, 19 Feb 2015 13:25:28 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 4eae095..07707b9 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -11392,17 +11392,21 @@ void ONMainWindow::printSshDError_noHostPubKey() { if ( closeEventSent ) return; - QMessageBox::critical ( 0l,tr ( "SSH Error" ), - tr ( "SSH daemon failed to open the its public host key.\n\n" - - "You have enabled Remote Printing or File Sharing.\n" - "These features require a running and functioning SSH server on your computer.\n\n" - "The Server is currently not configured correctly.\n\n" - "Please ensure that the server's public exists.\n" - "Host keys can be generated by running:\n\n" - "\tsudo ssh-keygen -A" - ), - QMessageBox::Ok, QMessageBox::NoButton ); + Non_Modal_MessageBox::critical (0l, tr ( "SSH Error" ), + tr ("SSH daemon failed to open its public host key.\n\n" + + "You have enabled Remote Printing or File Sharing.\n" + "These features require a running and functioning SSH server on your computer.\n\n" + + "The Server is currently not configured correctly.\n\n" + + "Please ensure that the server's public exists.\n" + "Host keys can be generated by running:\n\n" + + "\tsudo ssh-keygen -A\n\n" + + "Disabling Remote Printing or File Sharing support will get rid of this message."), + QMessageBox::Ok, QMessageBox::NoButton); } void ONMainWindow::printSshDError_noExportPubKey() -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git