Allow the user a chance to abort if there is an error when deleting rows in the edit...
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 27 Feb 2008 21:22:58 +0000 (21:22 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 27 Feb 2008 21:22:58 +0000 (21:22 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7107 a7884b65-44f6-0310-8a51-81a127f17b15

CHANGELOG
pgadmin/frm/frmEditGrid.cpp

index 7d78f9613fea4abbe9d913edae14a6f7ff33d201..c3b811cdf0f40db6161d2c52199817a78d0a56a4 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,8 @@ Changes
 
 Date       Dev Ver    Change details
 ---------- --- -----  --------------
+2008-02-27 DP  1.9.0  Allow the user a chance to abort if there is an error
+                      when deleting rows in the edit grid [Robins Tharakan]
 2008-02-27 DP  1.9.0  Remove an obsolete FORCE option on the Maintenance 
                       dialogue [Robins Tharakan]
 2008-02-27 DP  1.8.3  Properly quote synonym names when refreshing.
index e31af94d5758b584c103d9a33c5c0bd8a0473120..a718ac33dd0a2a0bc692398d9a3aa8d4b2f706a1 100644 (file)
@@ -1034,8 +1034,20 @@ void frmEditGrid::OnDelete(wxCommandEvent& event)
 
     // don't care a lot about optimizing here; doing it line by line
     // just as sqlTable::DeleteRows does
-       while (i--)
-               sqlGrid->DeleteRows(delrows.Item(i), 1);
+    bool show_continue_message = true;
+    while (i--)
+    {
+        if (!sqlGrid->DeleteRows(delrows.Item(i), 1) &&
+            i > 0 &&
+            show_continue_message)
+        {
+               wxMessageDialog msg(this, wxString::Format(_("There was an error deleting the previous record.\nAre you sure you wish to delete the remaining %d rows ?"), i), _("Delete more records ?"), wxYES_NO | wxICON_QUESTION);
+               if (msg.ShowModal() != wxID_YES)
+               break;
+            else
+                show_continue_message = false;
+        }
+    }
 
 
     sqlGrid->EndBatch();