Hello J.F.
Honestly, I don't sure that SaveSettings() must be called every time you push the Find button.
What about the destructor method? (see the attached file)

08.07.2014 21:16, J.F. Oster пишет:
Hello,

On Sun, Jun 22, 2014 at 11:29 AM, Dmitriy Olshevskiy <olshevski...@bk.ru> wrote:
Hello.
I think it'll be useful to save the settings of search objects dialog. So I
decided to add this feature.
Please see the attached patch.
Thank you.
Reporting my user experience :)
SaveSettings() is called on Cancel button press (and Esc key press).
If I close the dialog with Alt-F4 or a [x] button, settings won't get
saved. Same situation was in dlgFindReplace.
Also what if call SaveSettings() in OnSearch()?

--
Dmitriy Olshevskiy

From 52842393128c022216cfafb298e3d462788e56dd Mon Sep 17 00:00:00 2001
From: olshevskiy87 <olshevski...@bk.ru>
Date: Tue, 8 Jul 2014 22:05:56 +0400
Subject: [PATCH] moving SaveSettings() to destructor method

---
 pgadmin/dlg/dlgSearchObject.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pgadmin/dlg/dlgSearchObject.cpp b/pgadmin/dlg/dlgSearchObject.cpp
index 3205037..e0e81ae 100644
--- a/pgadmin/dlg/dlgSearchObject.cpp
+++ b/pgadmin/dlg/dlgSearchObject.cpp
@@ -193,6 +193,7 @@ dlgSearchObject::dlgSearchObject(frmMain *p, pgDatabase 
*db, pgObject *obj)
 
 dlgSearchObject::~dlgSearchObject()
 {
+       SaveSettings();
        SavePosition();
 }
 
@@ -903,7 +904,7 @@ wxString dlgSearchObject::TranslatePath(wxString &path)
 
 void dlgSearchObject::OnCancel(wxCommandEvent &ev)
 {
-       SaveSettings();
+       //SaveSettings();
        if (IsModal())
                EndModal(wxID_CANCEL);
        else
-- 
1.8.3.msysgit.0

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to