[glom/glom-1-12] Intial Dialog: Do not crash sometimes if cancelling the file chooser.



commit 293232c7eec2441284d64ca578f786bf3e843bb8
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Mar 9 17:30:35 2010 +0100

    Intial Dialog: Do not crash sometimes if cancelling the file chooser.
    
    * glom/application.cc: offer_new_or_existing(): Show the dialog again if
        we get a 0 response, because we cannot (yet) prevent the dialog from
        doing this when the child file chooser dialog is cancelled. Fixes a crash
        if pressing the Select button instead of double-clicking on an item.
        Bug #612303 (David King)

 ChangeLog           |   10 ++++++++++
 glom/application.cc |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9bc2edd..49059bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-09  Murray Cumming  <murrayc murrayc com>
+
+    Intial Dialog: Do not crash sometimes if cancelling the file chooser.
+
+	* glom/application.cc: offer_new_or_existing(): Show the dialog again if
+    we get a 0 response, because we cannot (yet) prevent the dialog from
+    doing this when the child file chooser dialog is cancelled. Fixes a crash
+    if pressing the Select button instead of double-clicking on an item.
+    Bug #612303 (David King)
+
 2010-03-06  Murray Cumming  <murrayc murrayc com>
 
     Details: Do not make field widgets too wide, so this fits on a laptop screen.
diff --git a/glom/application.cc b/glom/application.cc
index eb08b2a..556a05b 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1390,6 +1390,13 @@ bool App_Glom::offer_new_or_existing()
     {
       return false; //close the window to close the application, because they need to choose a new or existing document.
     }
+    else if((response_id == Gtk::RESPONSE_NONE)
+     || (response_id == 0))
+    {
+       //For instance, the file-open dialog was cancelled after Dialog_ExistingOrNew opened it,
+       //so just ask again.
+       //TODO: Stop Dialog_ExistingOrNew from emitting a response in this case.
+    }
     else
     {
       // This would mean that we got a unhandled response from the dialog



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]