pgAdmin III commit: Improve the handling of the dirty flag in the query

From: Dave Page <dpage(at)pgadmin(dot)org>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: pgAdmin III commit: Improve the handling of the dirty flag in the query
Date: 2014-05-30 10:48:55
Message-ID: E1WqKMp-0007dQ-BR@gothos.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Improve the handling of the dirty flag in the query tool:

Attached patch adds member variable to track last origin of query
modification:
ORIGIN_MANUAL - edited directly by user
ORIGIN_FILE - loaded from file
ORIGIN_INITIAL - passed into constructor
ORIGIN_HISTORY - picked from "previous queries"
ORIGIN_GQB - generated by query builder

Such approach allows for some enhancements of user's experience.
I've implemented the following in this patch:

1. Text initialization in constructor isn't considered a change, so it
will not ask for save confirmation if left intact.

2. Allow to "Save As" the initial text immediately, without having to
modify text in order to enable save button. Also the behaviour
shouldn't depend on settings->GetStickySql(), because there are other
use-cases not related to this option (for example, insert-scripts on a
table).

3. Skip confirmation to replace query text by GQB if previously it was
generated by GQB and was left intact.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=e3672540de81dddeed2a8ae54de36e3884a06e9b
Author: J.F. Oster <jinfroster(at)mail(dot)ru>

Modified Files
--------------
pgadmin/frm/frmQuery.cpp | 64 +++++++++++++++++++++++++++++-----------
pgadmin/include/frm/frmQuery.h | 16 ++++++++++
2 files changed, 62 insertions(+), 18 deletions(-)

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2014-05-30 10:50:15 Re: PATCH: Precise control over query's modification state
Previous Message Dave Page 2014-05-30 08:11:23 Re: Fix for a problem with auto reconnection