Re: ESC closes window without warning

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Michal Kozusznik <kozusznik(dot)michal(at)ifortuna(dot)cz>
Cc: pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: ESC closes window without warning
Date: 2013-02-07 11:37:02
Message-ID: CA+OCxowsT1U2hM748Vf6K8x58drETh9zLpiZP8vFBgGTGvg2-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Thu, Feb 7, 2013 at 10:57 AM, Michal Kozusznik
<kozusznik(dot)michal(at)ifortuna(dot)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

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Tim Romano 2013-02-07 11:57:22 Re: cannot get Debugger to install on 9.2 on Win7 x-64
Previous Message Michal Kozusznik 2013-02-07 10:57:52 Re: ESC closes window without warning