[X2Go-Commits] [x2goclient] 04/04: src/onmainwindow.cpp: unbreak on Qt 4 by emulating QKeySequence::Cancel.

git-admin at x2go.org git-admin at x2go.org
Sat Nov 27 01:59:30 CET 2021


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

x2go pushed a commit to branch master
in repository x2goclient.

commit 6b49bcc91ae72ac090c01afa5b6ed8413f4db30b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Nov 27 01:54:12 2021 +0100

    src/onmainwindow.cpp: unbreak on Qt 4 by emulating QKeySequence::Cancel.
---
 debian/changelog     |  1 +
 src/onmainwindow.cpp | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f09846c..87822b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -102,6 +102,7 @@ x2goclient (4.1.2.3-0x2go1) UNRELEASED; urgency=medium
       mini mode.
     - src/onmainwindow.cpp: increase fixed height of session selection dialog
       in normal mode and also set as minimum height.
+    - src/onmainwindow.cpp: unbreak on Qt 4 by emulating QKeySequence::Cancel.
   * debian/control:
     + Move to debian/control.in.
   * debian/control.in:
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 97c955d..640ae65 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -12502,7 +12502,15 @@ void ONMainWindow::initPassDlg()
     setWidgetStyle ( ok );
     cancel=new QPushButton ( tr ( "Cancel" ),passForm );
     setWidgetStyle ( cancel );
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
     cancel->setShortcut (QKeySequence::Cancel);
+#else /* QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) */
+#ifdef Q_OS_DARWIN
+    cancel->setShortCuts (QList<QKeySequence> { Qt::Key_Escape, Qt::CTRL + Qt::Key_Period });
+#else /* defined (Q_OS_DARWIN) */
+    cancel->setShortcut (QKeySequence (Qt::Key_Escape));
+#endif /* defined (Q_OS_DARWIN) */
+#endif /* QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) */
     ok->hide();
     cancel->hide();
 
@@ -12835,7 +12843,15 @@ void ONMainWindow::initSelectSessDlg()
     setWidgetStyle ( sOk );
     sCancel=new QPushButton ( tr ( "Cancel" ),selectSessionDlg );
     setWidgetStyle ( sCancel );
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
     sCancel->setShortcut (QKeySequence::Cancel);
+#else /* QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) */
+#ifdef Q_OS_DARWIN
+    sCancel->setShortCuts (QList<QKeySequence> { Qt::Key_Escape, Qt::CTRL + Qt::Key_Period });
+#else /* defined (Q_OS_DARWIN) */
+    sCancel->setShortcut (QKeySequence (Qt::Key_Escape));
+#endif /* defined (Q_OS_DARWIN) */
+#endif /* QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) */
     bCancel=new QPushButton ( tr ( "Cancel" ),selectSessionDlg );
     setWidgetStyle ( bCancel );
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list