Re: Save Query in frmEditGrid

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Save Query in frmEditGrid
Дата
Msg-id 4C8E7FB9.6070503@lelarge.info
обсуждение исходный текст
Ответ на Save Query in frmEditGrid  (Steffen Kuhn <pg@kuhnsteffen.de>)
Ответы Re: Save Query in frmEditGrid  ("Steffen Kuhn" <pg@kuhnsteffen.de>)
Список pgadmin-hackers
Hi again :)

Le 13/09/2010 20:55, Steffen Kuhn a écrit :
> [...]
> doing around with the context menu I encountered another issue,
> I wasn't able to solve my self:
> 1: bring a cell in edit mode do not change it.
> 2.1: stay in the not edited cell an click row label or some emtpy space
> on the right border and close
> 2.2: choose another cell in the same row do not change anything and close.
>
> => you will be asked if you want to save even though you didn't change
> the data.
>

Yes. Just another bug...

> I could track this so far that frmEditGrid::OnCellChange  is doing that
> right if the row also changes.
> I hope this helps you to spot the issue.
>

I probably can give you some hints on that one. As soon as you enter in
edit mode, the save menu is already enabled [1]. That's the one that
triggers the question dialog [2]. So, when a guy hits Escape, we should
simply call CancelChanges(), this way:

diff --git a/pgadmin/frm/frmEditGrid.cpp b/pgadmin/frm/frmEditGrid.cpp
index 5973434..d75afe2 100644
--- a/pgadmin/frm/frmEditGrid.cpp
+++ b/pgadmin/frm/frmEditGrid.cpp
@@ -881,6 +881,10 @@ void frmEditGrid::OnKey(wxKeyEvent &event)

             break;

+        case WXK_ESCAPE:
+            CancelChange();
+            break;
+
         default:
             if (sqlGrid->IsEditable() && keycode >= WXK_SPACE &&
keycode < WXK_START)
             {

When a guy chooses another cell or hits enter, with changing anything,
we should compare the current value with the old value. Which means we
need to remember the old value (probably in the OnEditorShown() method).

Try this. If it doesn't work out that well or if you don't find that
easy to do, I'll probably find some time to do it.

Right now, I'll get to your previous question.

[1]
http://github.com/postgres/pgadmin3/blob/REL-1_12_0_PATCHES/pgadmin/frm/frmEditGrid.cpp#L1146
[2]
http://github.com/postgres/pgadmin3/blob/REL-1_12_0_PATCHES/pgadmin/frm/frmEditGrid.cpp#L905


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: 1.12.0 release date
Следующее
От: Dave Page
Дата:
Сообщение: Re: 1.12.0 release date