Thread: Patch: Config editors

Patch: Config editors

From
"Magnus Hagander"
Date:
Attached patch implements an editor for pgpass.conf/.pgpass modeled on
the HBA editor. In doing so it also:

* Adds the ability to delete a row to the pg_hba editor
* Moves the "get the name of the password file" to pgSettings so it can
be shared. Sets up a tiny bit of infrastructure for when there may be
more config files.

Trying a .zip this time so it doesn't get eaten by the list filter.

//Ma <<Config_editors.zip>> gnus




Attachment

Re: Patch: Config editors

From
"Dave Page"
Date:
Patch discussed with Magnus on IM. To be reposted with fixes for the
following:

- Undo button doesn't undo a delete.
- There is no delete button on the dialogue
- Help button on the main editor window doesn't work.

Regards, Dave.

> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org
> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of
> Magnus Hagander
> Sent: 23 January 2006 13:18
> To: pgadmin-hackers@postgresql.org
> Subject: [pgadmin-hackers] Patch: Config editors
>
> Attached patch implements an editor for pgpass.conf/.pgpass modeled on
> the HBA editor. In doing so it also:
>
> * Adds the ability to delete a row to the pg_hba editor
> * Moves the "get the name of the password file" to pgSettings
> so it can
> be shared. Sets up a tiny bit of infrastructure for when there may be
> more config files.
>
> Trying a .zip this time so it doesn't get eaten by the list filter.
>
> //Ma <<Config_editors.zip>> gnus
>
>
>
>

Re: Patch: Config editors

From
"Magnus Hagander"
Date:
Updated version attached:

* Include xrc file that was missing last time ;-) Haven't included the
appropriate .cpp update because it was huge ;-)
* Fix help button in all editors (didn't work in hba editor either..)
* Add delete button
* Disable the hint button in the hba and pgpass editors, because we
don't hint anyway
* "Fix" the undo by disabling the undo button when you delete something,
so you don't think it works (see below)


Now, as for the undo functionality. The undo as it is now in these
dialogs don't work like a standard undo which is "undo the latest edit".
It is "undo the latest edit on the current line". So this patch actually
follows that (since there is no way to select a deleted line). Changing
this to a "normal undo" is a different patch alltogether ;-)

For example:
1) Edit line #1
2) Edit line #2
3) Select line #1
4) Click undo
5) Watch how the change from (1) gets reverted, not the one from (2)


//Magnus


> -----Original Message-----
> From: Dave Page [mailto:dpage@vale-housing.co.uk]
> Sent: Monday, January 23, 2006 4:00 PM
> To: Magnus Hagander; pgadmin-hackers@postgresql.org
> Subject: RE: [pgadmin-hackers] Patch: Config editors
>
> Patch discussed with Magnus on IM. To be reposted with fixes for the
> following:
>
> - Undo button doesn't undo a delete.
> - There is no delete button on the dialogue
> - Help button on the main editor window doesn't work.
>
> Regards, Dave.
>
> > -----Original Message-----
> > From: pgadmin-hackers-owner@postgresql.org
> > [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of Magnus
> > Hagander
> > Sent: 23 January 2006 13:18
> > To: pgadmin-hackers@postgresql.org
> > Subject: [pgadmin-hackers] Patch: Config editors
> >
> > Attached patch implements an editor for pgpass.conf/.pgpass
> modeled on
> > the HBA editor. In doing so it also:
> >
> > * Adds the ability to delete a row to the pg_hba editor
> > * Moves the "get the name of the password file" to pgSettings so it
> > can be shared. Sets up a tiny bit of infrastructure for
> when there may
> > be more config files.
> >
> > Trying a .zip this time so it doesn't get eaten by the list filter.
> >
> > //Ma <<Config_editors.zip>> gnus
> >
> >
> >
> >
>

Attachment

Re: Patch: Config editors

From
Andreas Pflug
Date:
Magnus Hagander wrote:

>Attached patch implements an editor for pgpass.conf/.pgpass modeled on
>the HBA editor. In doing so it also:
>
>

Do we need this? .pgpass is maintained automatically from pgAdmin.

>* Adds the ability to delete a row to the pg_hba editor
>
>
Hm, missed that? Probably thought disabling (commenting out) is enough.

Regards,
Andreas


Re: Patch: Config editors

From
"Magnus Hagander"
Date:
> >Attached patch implements an editor for pgpass.conf/.pgpass
> modeled on
> >the HBA editor. In doing so it also:
>
> Do we need this? .pgpass is maintained automatically from pgAdmin.

No it's not :-) Not if you want to use wildcards, for example. Or did I
miss some way of doing that?


> >* Adds the ability to delete a row to the pg_hba editor
> >
> >
> Hm, missed that? Probably thought disabling (commenting out)
> is enough.

Then you can never get rid of the line at all, can you? That sounds like
a bad idea to me... And there is a different way to comment it out
already, so if that's all you need then this patch isn't needed. I think
a real delete is a good thing, though.

//Magnus

Re: Patch: Config editors

From
Andreas Pflug
Date:
Magnus Hagander wrote:

>>>Attached patch implements an editor for pgpass.conf/.pgpass
>>>
>>>
>>modeled on
>>
>>
>>>the HBA editor. In doing so it also:
>>>
>>>
>>Do we need this? .pgpass is maintained automatically from pgAdmin.
>>
>>
>
>No it's not :-) Not if you want to use wildcards, for example. Or did I
>miss some way of doing that?
>
>
>

Ok. Hope users don't get confused that pgAdmin uses two ways to
(partially :-) maintain the file.

>
>
>>>* Adds the ability to delete a row to the pg_hba editor
>>>
>>>
>>>
>>>
>>Hm, missed that? Probably thought disabling (commenting out)
>>is enough.
>>
>>
>
>Then you can never get rid of the line at all, can you? That sounds like
>a bad idea to me... And there is a different way to comment it out
>already, so if that's all you need then this patch isn't needed. I think
>a real delete is a good thing, though.
>
>
Ok.



Re: Patch: Config editors

From
"Magnus Hagander"
Date:
> >>Do we need this? .pgpass is maintained automatically from pgAdmin.
> >>
> >>
> >
> >No it's not :-) Not if you want to use wildcards, for
> example. Or did I
> >miss some way of doing that?
> >
>
> Ok. Hope users don't get confused that pgAdmin uses two ways
> to (partially :-) maintain the file.

Users are alreayd confused because pgadmin doesn't tell them that the
"save your password" checkbox affects all non-pgadmin applications as
well :-P
(Yes, I've been bitten myself. And had to explain it to several others
that hav ebeen..)


//Magnus

Re: Patch: Config editors

From
Andreas Pflug
Date:
Magnus Hagander wrote:

>>
>>ly :-) maintain the file.
>>
>>
>
>Users are alreayd confused because pgadmin doesn't tell them that the
>"save your password" checkbox affects all non-pgadmin applications as
>well :-P
>(Yes, I've been bitten myself. And had to explain it to several others
>that hav ebeen..)
>
>

You're right. How can we fix this? (not the mechanism, but the user
confusion)

Regards,
Andreas


Re: Patch: Config editors

From
Dave Page
Date:


On 23/1/06 18:55, "Andreas Pflug" <pgadmin@pse-consulting.de> wrote:

>>
>
> Ok. Hope users don't get confused that pgAdmin uses two ways to
> (partially :-) maintain the file.

It'll also be handy for maintaining files other than your own, such as used
for your pgAgent service account.

/D


Re: Patch: Config editors

From
"Dave Page"
Date:
Thanks, patch applied. I made some additional changes to the editors to
prevent undo on the wrong line, and to prevent deletion of the blank
'new' item.

Regards, Dave.

> -----Original Message-----
> From: Magnus Hagander [mailto:mha@sollentuna.net]
> Sent: 23 January 2006 15:41
> To: Dave Page; pgadmin-hackers@postgresql.org
> Subject: RE: [pgadmin-hackers] Patch: Config editors
>
> Updated version attached:
>
> * Include xrc file that was missing last time ;-) Haven't included the
> appropriate .cpp update because it was huge ;-)
> * Fix help button in all editors (didn't work in hba editor either..)
> * Add delete button
> * Disable the hint button in the hba and pgpass editors, because we
> don't hint anyway
> * "Fix" the undo by disabling the undo button when you delete
> something,
> so you don't think it works (see below)
>
>
> Now, as for the undo functionality. The undo as it is now in these
> dialogs don't work like a standard undo which is "undo the
> latest edit".
> It is "undo the latest edit on the current line". So this
> patch actually
> follows that (since there is no way to select a deleted
> line). Changing
> this to a "normal undo" is a different patch alltogether ;-)
>
> For example:
> 1) Edit line #1
> 2) Edit line #2
> 3) Select line #1
> 4) Click undo
> 5) Watch how the change from (1) gets reverted, not the one from (2)
>
>
> //Magnus
>
>
> > -----Original Message-----
> > From: Dave Page [mailto:dpage@vale-housing.co.uk]
> > Sent: Monday, January 23, 2006 4:00 PM
> > To: Magnus Hagander; pgadmin-hackers@postgresql.org
> > Subject: RE: [pgadmin-hackers] Patch: Config editors
> >
> > Patch discussed with Magnus on IM. To be reposted with fixes for the
> > following:
> >
> > - Undo button doesn't undo a delete.
> > - There is no delete button on the dialogue
> > - Help button on the main editor window doesn't work.
> >
> > Regards, Dave.
> >
> > > -----Original Message-----
> > > From: pgadmin-hackers-owner@postgresql.org
> > > [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of Magnus
> > > Hagander
> > > Sent: 23 January 2006 13:18
> > > To: pgadmin-hackers@postgresql.org
> > > Subject: [pgadmin-hackers] Patch: Config editors
> > >
> > > Attached patch implements an editor for pgpass.conf/.pgpass
> > modeled on
> > > the HBA editor. In doing so it also:
> > >
> > > * Adds the ability to delete a row to the pg_hba editor
> > > * Moves the "get the name of the password file" to
> pgSettings so it
> > > can be shared. Sets up a tiny bit of infrastructure for
> > when there may
> > > be more config files.
> > >
> > > Trying a .zip this time so it doesn't get eaten by the
> list filter.
> > >
> > > //Ma <<Config_editors.zip>> gnus
> > >
> > >
> > >
> > >
> >
>

Re: Patch: Config editors

From
"Magnus Hagander"
Date:
> >>ly :-) maintain the file.
> >>
> >>
> >
> >Users are alreayd confused because pgadmin doesn't tell them
> that the
> >"save your password" checkbox affects all non-pgadmin
> applications as
> >well :-P (Yes, I've been bitten myself. And had to explain it to
> >several others that hav ebeen..)
> >
> >
>
> You're right. How can we fix this? (not the mechanism, but the user
> confusion)

Dunno. Perhaps a popup the first time the user choses save password that
says "realise that checking this box means it's enabled for all libpq
apps, including ODBC". Popping it up every time would be horribly
annoying, but doing it once for each user seems reasonable to me.

//Magnus