Mailing List Archive

[PATCH pinentry 4/4] tqt: Disable echoing if backspace is pressed first.
* tqt/secqlineedit.h (backspacePressed): New signal.
* tqt/secqinternal.cpp (SecTQLineEdit::backspace): Emit new signal.
* tqt/pinentrydialog.h (_got_input): New member field.
(onBackspace): New slot.
* tqt/pinentrydialog.cpp (onBackspace): New slot.
(PinEntryDialog::updateQuality): Prevent echo disabling as soon as
the text has been edited.

GnuPG-bug-id: 3428
Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
---
tqt/pinentrydialog.cpp | 14 +++++++++++++-
tqt/pinentrydialog.h | 2 ++
tqt/secqlineedit.cpp | 2 ++
tqt/secqlineedit.h | 1 +
4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/tqt/pinentrydialog.cpp b/tqt/pinentrydialog.cpp
index 069eeaf..6a2ae12 100644
--- a/tqt/pinentrydialog.cpp
+++ b/tqt/pinentrydialog.cpp
@@ -32,7 +32,8 @@

PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
bool modal, bool enable_quality_bar )
- : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false )
+ : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed( false ),
+ _got_input( false )
{
TQBoxLayout* top = new TQVBoxLayout( this, 6 );
TQBoxLayout* upperLayout = new TQHBoxLayout( top );
@@ -89,6 +90,8 @@ PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
this, SIGNAL( rejected() ) );
connect( _edit, SIGNAL( textModified(const SecTQString&) ),
this, SLOT( updateQuality(const SecTQString&) ) );
+ connect (_edit, SIGNAL (backspacePressed()),
+ this, SLOT (onBackspace ()));
connect (this, SIGNAL (accepted ()),
this, SLOT (accept ()));
connect (this, SIGNAL (rejected ()),
@@ -131,6 +134,8 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )
int percent;
TQPalette pal;

+ _got_input = true;
+
if (!_have_quality_bar || !_pinentry_info)
return;
pin = (char*)txt.utf8();
@@ -159,6 +164,13 @@ void PinEntryDialog::updateQuality( const SecTQString & txt )
}


+void PinEntryDialog::onBackspace()
+{
+ if (!_got_input)
+ _edit->setEchoMode( SecTQLineEdit::NoEcho );
+}
+
+
void PinEntryDialog::setDescription( const TQString& txt )
{
_desc->setText( txt );
diff --git a/tqt/pinentrydialog.h b/tqt/pinentrydialog.h
index d6f20c6..eb4d332 100644
--- a/tqt/pinentrydialog.h
+++ b/tqt/pinentrydialog.h
@@ -63,6 +63,7 @@ public:

public slots:
void updateQuality(const SecTQString &);
+ void onBackspace();

signals:
void accepted();
@@ -86,6 +87,7 @@ private:
bool _grabbed;
bool _have_quality_bar;
pinentry_t _pinentry_info;
+ bool _got_input;
};


diff --git a/tqt/secqlineedit.cpp b/tqt/secqlineedit.cpp
index ee95c8d..da0637a 100644
--- a/tqt/secqlineedit.cpp
+++ b/tqt/secqlineedit.cpp
@@ -719,6 +719,8 @@ void SecTQLineEdit::backspace()
d->del( TRUE );
}
d->finishChange( priorState );
+
+ emit backspacePressed();
}

/*!
diff --git a/tqt/secqlineedit.h b/tqt/secqlineedit.h
index bd28cec..126f231 100644
--- a/tqt/secqlineedit.h
+++ b/tqt/secqlineedit.h
@@ -187,6 +187,7 @@ signals:
void returnPressed();
void lostFocus();
void selectionChanged();
+ void backspacePressed();

protected:
bool event( TQEvent * );
--
2.14.4
Re: [PATCH pinentry 4/4] tqt: Disable echoing if backspace is pressed first. [ In reply to ]
Hi Damien,
highly appreciated that you add patches to the TQT code.

Thanks

On Sat, Aug 4, 2018 at 11:24 PM, Damien Goutte-Gattat via Gnupg-devel <
gnupg-devel@gnupg.org> wrote:

> * tqt/secqlineedit.h (backspacePressed): New signal.
> * tqt/secqinternal.cpp (SecTQLineEdit::backspace): Emit new signal.
> * tqt/pinentrydialog.h (_got_input): New member field.
> (onBackspace): New slot.
> * tqt/pinentrydialog.cpp (onBackspace): New slot.
> (PinEntryDialog::updateQuality): Prevent echo disabling as soon as
> the text has been edited.
>
> GnuPG-bug-id: 3428
> Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
> ---
> tqt/pinentrydialog.cpp | 14 +++++++++++++-
> tqt/pinentrydialog.h | 2 ++
> tqt/secqlineedit.cpp | 2 ++
> tqt/secqlineedit.h | 1 +
> 4 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tqt/pinentrydialog.cpp b/tqt/pinentrydialog.cpp
> index 069eeaf..6a2ae12 100644
> --- a/tqt/pinentrydialog.cpp
> +++ b/tqt/pinentrydialog.cpp
> @@ -32,7 +32,8 @@
>
> PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
> bool modal, bool enable_quality_bar )
> - : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed(
> false )
> + : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed(
> false ),
> + _got_input( false )
> {
> TQBoxLayout* top = new TQVBoxLayout( this, 6 );
> TQBoxLayout* upperLayout = new TQHBoxLayout( top );
> @@ -89,6 +90,8 @@ PinEntryDialog::PinEntryDialog( TQWidget* parent, const
> char* name,
> this, SIGNAL( rejected() ) );
> connect( _edit, SIGNAL( textModified(const SecTQString&) ),
> this, SLOT( updateQuality(const SecTQString&) ) );
> + connect (_edit, SIGNAL (backspacePressed()),
> + this, SLOT (onBackspace ()));
> connect (this, SIGNAL (accepted ()),
> this, SLOT (accept ()));
> connect (this, SIGNAL (rejected ()),
> @@ -131,6 +134,8 @@ void PinEntryDialog::updateQuality( const SecTQString
> & txt )
> int percent;
> TQPalette pal;
>
> + _got_input = true;
> +
> if (!_have_quality_bar || !_pinentry_info)
> return;
> pin = (char*)txt.utf8();
> @@ -159,6 +164,13 @@ void PinEntryDialog::updateQuality( const SecTQString
> & txt )
> }
>
>
> +void PinEntryDialog::onBackspace()
> +{
> + if (!_got_input)
> + _edit->setEchoMode( SecTQLineEdit::NoEcho );
> +}
> +
> +
> void PinEntryDialog::setDescription( const TQString& txt )
> {
> _desc->setText( txt );
> diff --git a/tqt/pinentrydialog.h b/tqt/pinentrydialog.h
> index d6f20c6..eb4d332 100644
> --- a/tqt/pinentrydialog.h
> +++ b/tqt/pinentrydialog.h
> @@ -63,6 +63,7 @@ public:
>
> public slots:
> void updateQuality(const SecTQString &);
> + void onBackspace();
>
> signals:
> void accepted();
> @@ -86,6 +87,7 @@ private:
> bool _grabbed;
> bool _have_quality_bar;
> pinentry_t _pinentry_info;
> + bool _got_input;
> };
>
>
> diff --git a/tqt/secqlineedit.cpp b/tqt/secqlineedit.cpp
> index ee95c8d..da0637a 100644
> --- a/tqt/secqlineedit.cpp
> +++ b/tqt/secqlineedit.cpp
> @@ -719,6 +719,8 @@ void SecTQLineEdit::backspace()
> d->del( TRUE );
> }
> d->finishChange( priorState );
> +
> + emit backspacePressed();
> }
>
> /*!
> diff --git a/tqt/secqlineedit.h b/tqt/secqlineedit.h
> index bd28cec..126f231 100644
> --- a/tqt/secqlineedit.h
> +++ b/tqt/secqlineedit.h
> @@ -187,6 +187,7 @@ signals:
> void returnPressed();
> void lostFocus();
> void selectionChanged();
> + void backspacePressed();
>
> protected:
> bool event( TQEvent * );
> --
> 2.14.4
>
>
>
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
>
>
Re: [PATCH pinentry 4/4] tqt: Disable echoing if backspace is pressed first. [ In reply to ]
Hi Damien, all,
long time passed since we worked on this together.
As the TDE release 14.1 is planned to happen by the end of this year, I was
wondering if we have to do something to finalize the work already done.

pinentry-tqt is working perfectly well on the TDE desktop and I am
wondering how we can integrate it into the TDE project.

Was it merged in gnupg? Can and should it be merged?

How we can setup our repository to follow the main branch?

Thank you in advance for your answers, ideas and directions.

regards


On Sat, Aug 4, 2018 at 11:24 PM Damien Goutte-Gattat via Gnupg-devel <
gnupg-devel@gnupg.org> wrote:

> * tqt/secqlineedit.h (backspacePressed): New signal.
> * tqt/secqinternal.cpp (SecTQLineEdit::backspace): Emit new signal.
> * tqt/pinentrydialog.h (_got_input): New member field.
> (onBackspace): New slot.
> * tqt/pinentrydialog.cpp (onBackspace): New slot.
> (PinEntryDialog::updateQuality): Prevent echo disabling as soon as
> the text has been edited.
>
> GnuPG-bug-id: 3428
> Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
> ---
> tqt/pinentrydialog.cpp | 14 +++++++++++++-
> tqt/pinentrydialog.h | 2 ++
> tqt/secqlineedit.cpp | 2 ++
> tqt/secqlineedit.h | 1 +
> 4 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tqt/pinentrydialog.cpp b/tqt/pinentrydialog.cpp
> index 069eeaf..6a2ae12 100644
> --- a/tqt/pinentrydialog.cpp
> +++ b/tqt/pinentrydialog.cpp
> @@ -32,7 +32,8 @@
>
> PinEntryDialog::PinEntryDialog( TQWidget* parent, const char* name,
> bool modal, bool enable_quality_bar )
> - : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed(
> false )
> + : TQDialog( parent, name, modal, TQt::WStyle_StaysOnTop ), _grabbed(
> false ),
> + _got_input( false )
> {
> TQBoxLayout* top = new TQVBoxLayout( this, 6 );
> TQBoxLayout* upperLayout = new TQHBoxLayout( top );
> @@ -89,6 +90,8 @@ PinEntryDialog::PinEntryDialog( TQWidget* parent, const
> char* name,
> this, SIGNAL( rejected() ) );
> connect( _edit, SIGNAL( textModified(const SecTQString&) ),
> this, SLOT( updateQuality(const SecTQString&) ) );
> + connect (_edit, SIGNAL (backspacePressed()),
> + this, SLOT (onBackspace ()));
> connect (this, SIGNAL (accepted ()),
> this, SLOT (accept ()));
> connect (this, SIGNAL (rejected ()),
> @@ -131,6 +134,8 @@ void PinEntryDialog::updateQuality( const SecTQString
> & txt )
> int percent;
> TQPalette pal;
>
> + _got_input = true;
> +
> if (!_have_quality_bar || !_pinentry_info)
> return;
> pin = (char*)txt.utf8();
> @@ -159,6 +164,13 @@ void PinEntryDialog::updateQuality( const SecTQString
> & txt )
> }
>
>
> +void PinEntryDialog::onBackspace()
> +{
> + if (!_got_input)
> + _edit->setEchoMode( SecTQLineEdit::NoEcho );
> +}
> +
> +
> void PinEntryDialog::setDescription( const TQString& txt )
> {
> _desc->setText( txt );
> diff --git a/tqt/pinentrydialog.h b/tqt/pinentrydialog.h
> index d6f20c6..eb4d332 100644
> --- a/tqt/pinentrydialog.h
> +++ b/tqt/pinentrydialog.h
> @@ -63,6 +63,7 @@ public:
>
> public slots:
> void updateQuality(const SecTQString &);
> + void onBackspace();
>
> signals:
> void accepted();
> @@ -86,6 +87,7 @@ private:
> bool _grabbed;
> bool _have_quality_bar;
> pinentry_t _pinentry_info;
> + bool _got_input;
> };
>
>
> diff --git a/tqt/secqlineedit.cpp b/tqt/secqlineedit.cpp
> index ee95c8d..da0637a 100644
> --- a/tqt/secqlineedit.cpp
> +++ b/tqt/secqlineedit.cpp
> @@ -719,6 +719,8 @@ void SecTQLineEdit::backspace()
> d->del( TRUE );
> }
> d->finishChange( priorState );
> +
> + emit backspacePressed();
> }
>
> /*!
> diff --git a/tqt/secqlineedit.h b/tqt/secqlineedit.h
> index bd28cec..126f231 100644
> --- a/tqt/secqlineedit.h
> +++ b/tqt/secqlineedit.h
> @@ -187,6 +187,7 @@ signals:
> void returnPressed();
> void lostFocus();
> void selectionChanged();
> + void backspacePressed();
>
> protected:
> bool event( TQEvent * );
> --
> 2.14.4
>
>
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
>
Re: [PATCH pinentry 4/4] tqt: Disable echoing if backspace is pressed first. [ In reply to ]
On Wed, Mar 11, 2020 at 09:03:29PM +0100, deloptes wrote:
>pinentry-tqt is working perfectly well on the TDE desktop

Since I don’t use TDE myself and therefore can’t fully test pinentry-tqt
in its “natural” environment, I am glad to read that.


>Was it merged in gnupg? Can and should it be merged?

Yes, I merged it into the main branch back in November 2017, it is part
of the last pinentry release (1.1.0, published in December 2017).


>As the TDE release 14.1 is planned to happen by the end of this year, I
>was wondering if we have to do something to finalize the work already
>done.

At the source level, I don’t think so, especially since you say that
pinentry-tqt is working well.

I guess the hurdle that TDE users will need to overcome though is
getting pinentry-tqt installed on their system. A quick search through
the repositories of some common GNU/Linux distributions (Debian, Ubuntu,
Fedora, Arch) tells me that none of them are packaging pinentry-tqt, and
this is unlikely to change since they don’t package TQt either.

I see that the TDE project provides its own packages for the most common
distributions, so it would make sense for you to provide a binary
package for pinentry-tqt as well. Make a binary package that provides
*only* pinentry-tqt (disable all other pinentries at the configure
step), and provide it along with the other TDE packages.


>How we can setup our repository to follow the main branch?

Not sure I understand your question here.

If you have changes to pinentry-tqt (e.g. fixes for bugs reported by TDE
users), the “standard” workflow would be to clone the pinentry main
branch from git.gnupg.org, do your development on a dedicated branch,
them send the patches to gnupg-devel. From there I (or another GnuPG
developer) would take care of merging them.


Regards,

- Damien
Re: [PATCH pinentry 4/4] tqt: Disable echoing if backspace is pressed first. [ In reply to ]
Hi Damien,
thank you for your swift response.

On Wed, Mar 11, 2020 at 10:08 PM Damien Goutte-Gattat <
dgouttegattat@incenp.org> wrote:

> On Wed, Mar 11, 2020 at 09:03:29PM +0100, deloptes wrote:
> >pinentry-tqt is working perfectly well on the TDE desktop
>
> Since I don’t use TDE myself and therefore can’t fully test pinentry-tqt
> in its “natural” environment, I am glad to read that.
>
> Shame on you :) (joking)


>
> >Was it merged in gnupg? Can and should it be merged?
>
> Yes, I merged it into the main branch back in November 2017, it is part
> of the last pinentry release (1.1.0, published in December 2017).
>
>
Thank you for confirming this.


>
> >As the TDE release 14.1 is planned to happen by the end of this year, I
> >was wondering if we have to do something to finalize the work already
> >done.
>
> At the source level, I don’t think so, especially since you say that
> pinentry-tqt is working well.
>
> I guess the hurdle that TDE users will need to overcome though is
> getting pinentry-tqt installed on their system. A quick search through
> the repositories of some common GNU/Linux distributions (Debian, Ubuntu,
> Fedora, Arch) tells me that none of them are packaging pinentry-tqt, and
> this is unlikely to change since they don’t package TQt either.
>
> I see that the TDE project provides its own packages for the most common
> distributions, so it would make sense for you to provide a binary
> package for pinentry-tqt as well. Make a binary package that provides
> *only* pinentry-tqt (disable all other pinentries at the configure
> step), and provide it along with the other TDE packages.
>
> Yes, this is exactly what the TDE team will do - provide a binary package
for the supported distros only for pinentry-tqt.
I must make a note here that I am just a contributor to the project and not
a speaker for the team.


>
> >How we can setup our repository to follow the main branch?
>
> Not sure I understand your question here.
>
> If you have changes to pinentry-tqt (e.g. fixes for bugs reported by TDE
> users), the “standard” workflow would be to clone the pinentry main
> branch from git.gnupg.org, do your development on a dedicated branch,
> them send the patches to gnupg-devel. From there I (or another GnuPG
> developer) would take care of merging them.
>
> You understood correctly. I am more interested on how to follow changes
by upstream and if you have some special requirements for such process, but
the workflow described is sufficient for the beginning. I'll share the
answers with the TDE team and come back to you if more questions emerge.

Thank you once again

regards