[gnumeric] GUI: Fix quit dialog.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Fix quit dialog.
- Date: Sat, 26 Feb 2011 16:41:58 +0000 (UTC)
commit cdcdf0f33e65d775ea027e4e591fe762cf7351fc
Author: Morten Welinder <terra gnome org>
Date: Sat Feb 26 11:41:24 2011 -0500
GUI: Fix quit dialog.
src/dialogs/ChangeLog | 4 +++
src/dialogs/dialog-quit.c | 62 ++++++++++++++++++++++++---------------------
2 files changed, 37 insertions(+), 29 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 65941c1..f010f0d 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-26 Morten Welinder <terra gnome org>
+
+ * dialog-quit.c (show_quit_dialog): Fix the fix.
+
2011-02-25 Morten Welinder <terra gnome org>
* dialog-preferences.c (wordlist_pref_create_widget): Plug leak.
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index 026b6a9..22fedc5 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -362,8 +362,6 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
-1);
}
- g_object_unref (list);
-
/* ---------------------------------------- */
atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (dialog)),
@@ -374,37 +372,43 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
switch (res) {
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
- return FALSE;
+ quit = FALSE;
+ break;
case GTK_RESPONSE_NO:
- return TRUE;
+ quit = TRUE;
+ break;
+
+ default:
+ model = GTK_TREE_MODEL (list);
+ ok = gtk_tree_model_get_iter_first (model, &iter);
+
+ g_return_val_if_fail (ok, FALSE);
+ quit = TRUE;
+ do {
+ gboolean save = TRUE;
+ GODoc *doc = NULL;
+
+ gtk_tree_model_get (model, &iter,
+ QUIT_COL_CHECK, &save,
+ QUIT_COL_DOC, &doc,
+ -1);
+ if (save) {
+ gboolean ok;
+ Workbook *wb = WORKBOOK (doc);
+ WBCGtk *wbcg2 = wbcg_find_for_workbook (wb, wbcg, NULL, NULL);
+
+ ok = wbcg2 && gui_file_save (wbcg2, wb_control_view (WORKBOOK_CONTROL (wbcg2)));
+ if (!ok)
+ quit = FALSE;
+ }
+
+ ok = gtk_tree_model_iter_next (model, &iter);
+ } while (ok);
+ break;
}
- model = gtk_tree_view_get_model (tree);
- ok = gtk_tree_model_get_iter_first (model, &iter);
- g_return_val_if_fail (ok, FALSE);
- quit = TRUE;
- do {
- gboolean save = TRUE;
- GODoc *doc = NULL;
-
- gtk_tree_model_get (model, &iter,
- QUIT_COL_CHECK, &save,
- QUIT_COL_DOC, &doc,
- -1);
- if (save) {
- gboolean ok;
- Workbook *wb = WORKBOOK (doc);
- WBCGtk *wbcg2 = wbcg_find_for_workbook (wb, wbcg, NULL, NULL);
-
- ok = wbcg2 && gui_file_save (wbcg2, wb_control_view (WORKBOOK_CONTROL (wbcg2)));
- if (!ok)
- quit = FALSE;
- }
-
- ok = gtk_tree_model_iter_next (model, &iter);
- } while (ok);
-
+ g_object_unref (list);
return quit;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]