[git] Pinentry - branch, master, updated. pinentry-1.0.0-20-g4101806

by Andre Heinecke cvs at cvs.gnupg.org
Wed May 3 12:13:39 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The standard pinentry collection".

The branch, master has been updated
       via  4101806bf73caf25c8ce4e455b154901da1fe788 (commit)
       via  8bf41fe086438de9fa223ccf4162ed9d98e54646 (commit)
      from  5c3f796798d655b5583257f9dfc81ae9c1427fb3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4101806bf73caf25c8ce4e455b154901da1fe788
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed May 3 11:49:09 2017 +0200

    qt: Improve width of pinentryconfirm
    
    * qt/pinentryconfirm.cpp (PinentryConfirm::showEvent): Add spacer
    item for text width.
    
    --
    This fixes a pinentry-qt4 bug where part of the text might have
    been hidden. And improves the layout for pinentry-qt5 where
    the fingerprint will no longer be wordwrapped. Needs to be
    done in the show event because only there we have the icon available.

diff --git a/qt/pinentryconfirm.cpp b/qt/pinentryconfirm.cpp
index 8b59d9d..50c19a4 100644
--- a/qt/pinentryconfirm.cpp
+++ b/qt/pinentryconfirm.cpp
@@ -19,6 +19,9 @@
 #include "pinentryconfirm.h"
 #include "pinentrydialog.h"
 #include <QAbstractButton>
+#include <QGridLayout>
+#include <QSpacerItem>
+#include <QFontMetrics>
 
 PinentryConfirm::PinentryConfirm(Icon icon, int timeout, const QString &title,
                                  const QString &desc, StandardButtons buttons, QWidget *parent) :
@@ -44,6 +47,18 @@ bool PinentryConfirm::timedOut() const
 
 void PinentryConfirm::showEvent(QShowEvent *event)
 {
+    static bool resized;
+    if (!resized) {
+        QGridLayout* lay = dynamic_cast<QGridLayout*> (layout());
+        if (lay) {
+            QSize textSize = fontMetrics().size(Qt::TextExpandTabs, text(), fontMetrics().maxWidth());
+            QSpacerItem* horizontalSpacer = new QSpacerItem(textSize.width() + iconPixmap().width(),
+                                                            0, QSizePolicy::Minimum, QSizePolicy::Expanding);
+            lay->addItem(horizontalSpacer, lay->rowCount(), 1, 1, lay->columnCount() - 1);
+        }
+        resized = true;
+    }
+
     QDialog::showEvent(event);
     raiseWindow(this);
 }

commit 8bf41fe086438de9fa223ccf4162ed9d98e54646
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed May 3 11:48:16 2017 +0200

    qt: Fix build with Qt4
    
    * qt/main.cpp (main): Don't use Q_NULLPTR.

diff --git a/qt/main.cpp b/qt/main.cpp
index 40d0a5b..7d1a264 100644
--- a/qt/main.cpp
+++ b/qt/main.cpp
@@ -312,7 +312,7 @@ main(int argc, char *argv[])
 {
     pinentry_init("pinentry-qt");
 
-    QApplication *app = Q_NULLPTR;
+    QApplication *app = NULL;
 
 #ifdef FALLBACK_CURSES
     if (!pinentry_have_display(argc, argv)) {

-----------------------------------------------------------------------

Summary of changes:
 qt/main.cpp            |  2 +-
 qt/pinentryconfirm.cpp | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list