Skip site navigation (1) Skip section navigation (2)

SVN Commit by dpage: r4379 - in trunk/pgadmin3: . src/frm

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4379 - in trunk/pgadmin3: . src/frm
Date: 2005-07-06 10:26:21
Message-ID: 200507061026.j66AQL0N032761@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
Author: dpage
Date: 2005-07-06 11:26:21 +0100 (Wed, 06 Jul 2005)
New Revision: 4379

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/frm/frmQuery.cpp
Log:
Prompt the user to cancel running queries before closing the Query tool.

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt	2005-07-05 10:03:42 UTC (rev 4378)
+++ trunk/pgadmin3/CHANGELOG.txt	2005-07-06 10:26:21 UTC (rev 4379)
@@ -17,6 +17,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-07-06 DP        Prompt the user to cancel running queries before closing the Query tool.
     <li>2005-07-04 DP        Check for and display asynchronous notifications in the query tool.
     <li>2005-06-21 AP        typo fixes, rename "initial db" to "maintenance db"
     <li>2005-06-19 AP        pgAgent moved under server, some more fixes

Modified: trunk/pgadmin3/src/frm/frmQuery.cpp
===================================================================
--- trunk/pgadmin3/src/frm/frmQuery.cpp	2005-07-05 10:03:42 UTC (rev 4378)
+++ trunk/pgadmin3/src/frm/frmQuery.cpp	2005-07-06 10:26:21 UTC (rev 4379)
@@ -651,16 +651,20 @@
 
 void frmQuery::OnClose(wxCloseEvent& event)
 {
-    if (CheckChanged(event.CanVeto()) && event.CanVeto())
+    if (queryMenu->IsEnabled(MNU_CANCEL))
     {
-        event.Veto();
-        return;
-    }
+        if (event.CanVeto())
+        {
+            wxMessageDialog msg(this, _("A query is running. Do you wish to cancel it?"), _("pgAdmin III Query"), 
+                        wxYES_NO|wxNO_DEFAULT|wxICON_EXCLAMATION);
 
-    Hide();
+            if (msg.ShowModal() == wxID_NO)
+            {
+                event.Veto();
+                return;
+            }
+        }
 
-    if (queryMenu->IsEnabled(MNU_CANCEL))
-    {
         wxCommandEvent ev;
         OnCancel(ev);
     }
@@ -670,6 +674,15 @@
         wxLogInfo(wxT("SQL Query box: Waiting for query to abort"));
         wxSleep(1);
     }
+
+    if (CheckChanged(event.CanVeto()) && event.CanVeto())
+    {
+        event.Veto();
+        return;
+    }
+
+    Hide();
+
     Destroy();
 }
 


pgadmin-hackers by date

Next:From: Francisco Javier Jiménez GómezDate: 2005-07-08 00:30:50
Subject: SECURITY BUG.
Previous:From: svnDate: 2005-07-05 10:03:42
Subject: SVN Commit by dpage: r4378 - in trunk/pgadmin3/pkg/win32: . resources

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group