<div dir="ltr"><div>Hi Damien,</div><div>highly appreciated that you add patches to the TQT code.</div><div><br></div><div>Thanks<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 4, 2018 at 11:24 PM, Damien Goutte-Gattat via Gnupg-devel <span dir="ltr"><<a href="mailto:gnupg-devel@gnupg.org" target="_blank">gnupg-devel@gnupg.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* tqt/secqlineedit.h (backspacePressed): New signal.<br>
* tqt/secqinternal.cpp (SecTQLineEdit::backspace): Emit new signal.<br>
* tqt/pinentrydialog.h (_got_input): New member field.<br>
(onBackspace): New slot.<br>
* tqt/pinentrydialog.cpp (onBackspace): New slot.<br>
(PinEntryDialog::<wbr>updateQuality): Prevent echo disabling as soon as<br>
the text has been edited.<br>
<br>
GnuPG-bug-id: 3428<br>
Signed-off-by: Damien Goutte-Gattat <<a href="mailto:dgouttegattat@incenp.org">dgouttegattat@incenp.org</a>><br>
---<br>
 tqt/pinentrydialog.cpp | 14 +++++++++++++-<br>
 tqt/pinentrydialog.h   |  2 ++<br>
 tqt/secqlineedit.cpp   |  2 ++<br>
 tqt/secqlineedit.h     |  1 +<br>
 4 files changed, 18 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/tqt/pinentrydialog.cpp b/tqt/pinentrydialog.cpp<br>
index 069eeaf..6a2ae12 100644<br>
--- a/tqt/pinentrydialog.cpp<br>
+++ b/tqt/pinentrydialog.cpp<br>
@@ -32,7 +32,8 @@<br>
<br>
 PinEntryDialog::<wbr>PinEntryDialog( TQWidget* parent, const char* name,<br>
                                 bool modal, bool enable_quality_bar )<br>
-  : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false )<br>
+  : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false ),<br>
+    _got_input( false )<br>
 {<br>
   TQBoxLayout* top = new TQVBoxLayout( this, 6 );<br>
   TQBoxLayout* upperLayout = new TQHBoxLayout( top );<br>
@@ -89,6 +90,8 @@ PinEntryDialog::<wbr>PinEntryDialog( TQWidget* parent, const char* name,<br>
           this, SIGNAL( rejected() ) );<br>
   connect( _edit, SIGNAL( textModified(const SecTQString&) ),<br>
           this, SLOT( updateQuality(const SecTQString&) ) );<br>
+  connect (_edit, SIGNAL (backspacePressed()),<br>
+          this, SLOT (onBackspace ()));<br>
   connect (this, SIGNAL (accepted ()),<br>
           this, SLOT (accept ()));<br>
   connect (this, SIGNAL (rejected ()),<br>
@@ -131,6 +134,8 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )<br>
   int percent;<br>
   TQPalette pal;<br>
<br>
+  _got_input = true;<br>
+<br>
   if (!_have_quality_bar || !_pinentry_info)<br>
     return;<br>
   pin = (char*)txt.utf8();<br>
@@ -159,6 +164,13 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )<br>
 }<br>
<br>
<br>
+void PinEntryDialog::onBackspace()<br>
+{<br>
+  if (!_got_input)<br>
+    _edit->setEchoMode( SecTQLineEdit::NoEcho );<br>
+}<br>
+<br>
+<br>
 void PinEntryDialog::<wbr>setDescription( const TQString& txt )<br>
 {<br>
   _desc->setText( txt );<br>
diff --git a/tqt/pinentrydialog.h b/tqt/pinentrydialog.h<br>
index d6f20c6..eb4d332 100644<br>
--- a/tqt/pinentrydialog.h<br>
+++ b/tqt/pinentrydialog.h<br>
@@ -63,6 +63,7 @@ public:<br>
<br>
 public slots:<br>
   void updateQuality(const SecTQString &);<br>
+  void onBackspace();<br>
<br>
 signals:<br>
   void accepted();<br>
@@ -86,6 +87,7 @@ private:<br>
   bool       _grabbed;<br>
   bool       _have_quality_bar;<br>
   pinentry_t _pinentry_info;<br>
+  bool       _got_input;<br>
 };<br>
<br>
<br>
diff --git a/tqt/secqlineedit.cpp b/tqt/secqlineedit.cpp<br>
index ee95c8d..da0637a 100644<br>
--- a/tqt/secqlineedit.cpp<br>
+++ b/tqt/secqlineedit.cpp<br>
@@ -719,6 +719,8 @@ void SecTQLineEdit::backspace()<br>
            d->del( TRUE );<br>
     }<br>
     d->finishChange( priorState );<br>
+<br>
+    emit backspacePressed();<br>
 }<br>
<br>
 /*!<br>
diff --git a/tqt/secqlineedit.h b/tqt/secqlineedit.h<br>
index bd28cec..126f231 100644<br>
--- a/tqt/secqlineedit.h<br>
+++ b/tqt/secqlineedit.h<br>
@@ -187,6 +187,7 @@ signals:<br>
     void returnPressed();<br>
     void lostFocus();<br>
     void selectionChanged();<br>
+    void backspacePressed();<br>
<br>
 protected:<br>
     bool event( TQEvent * );<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.4<br>
<br>
<br>
</font></span><br>______________________________<wbr>_________________<br>
Gnupg-devel mailing list<br>
<a href="mailto:Gnupg-devel@gnupg.org">Gnupg-devel@gnupg.org</a><br>
<a href="http://lists.gnupg.org/mailman/listinfo/gnupg-devel" rel="noreferrer" target="_blank">http://lists.gnupg.org/<wbr>mailman/listinfo/gnupg-devel</a><br>
<br></blockquote></div><br></div>