Re: ESC closes window without warning - Mailing list pgadmin-support

From Dave Page
Subject Re: ESC closes window without warning
Date
Msg-id CA+OCxowsT1U2hM748Vf6K8x58drETh9zLpiZP8vFBgGTGvg2-Q@mail.gmail.com
Whole thread Raw
In response to Re: ESC closes window without warning  (Michal Kozusznik <kozusznik.michal@ifortuna.cz>)
Responses Re: ESC closes window without warning
List pgadmin-support
On Thu, Feb 7, 2013 at 10:57 AM, Michal Kozusznik
<kozusznik.michal@ifortuna.cz> wrote:
> OK. Thanx for deeper explanation. Looks like I missed a point twice :)
>
>
>> If you have a simple way to make it work, I'd love
>> to see a proposed patch because at the moment, I don't see a way to do
>> it that wouldn't take at least a few days of work.
>
>
>
> Don't know architecture of pgadmin, but if requesters inherit from some base
> class, it should be enough to modify only this one. Store old values into
> some array (or maybe consider some hash) and compare it to current while
> hitting ESC/Cancel. I would do that this way if I was author of code.
> Basically small change.

That's basically what the patch I posted does. The problem is that the
base class doesn't have any knowledge of what controls are on an
instantiated dialogue, or how to test if they've been changed from
whatever the default is (for new objects) or from whatever pgObject
derived object exists for edits.

The only way I can see to do this is to write a function for each
individual dialogue that can compare the values of each control to the
defaults or an existing object - pretty similar to what CheckChange()
already does - the difference being that it is validating as well.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgadmin-support by date:

Previous
From: Michal Kozusznik
Date:
Subject: Re: ESC closes window without warning
Next
From: Dave Page
Date:
Subject: Re: cannot get Debugger to install on 9.2 on Win7 x-64