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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-142-gff022c4)



The branch, master has been updated
       via  ff022c441d470f85b6db064411b1228e3511e959 (commit)
       via  a6ec74886d5c7b291df6e05e8e7cb181452c4c22 (commit)
      from  cb6223880a8732453dd2d0c0d7b17011e4113ff7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/src/gattrib.c  |    1 -
 gattrib/src/s_attrib.c |   12 ++++++--
 gattrib/src/x_dialog.c |   71 ++++++++++++++++++++++++++++++++++-------------
 3 files changed, 60 insertions(+), 24 deletions(-)


=================
 Commit Messages
=================

commit ff022c441d470f85b6db064411b1228e3511e959
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Aug 19 01:53:08 2008 +0100

    gattrib: Implement "Save changes?" dialog to match rest of suite.

:100644 100644 596db91... ec90b61... M	gattrib/src/gattrib.c
:100644 100644 d948fa5... b2d52d8... M	gattrib/src/x_dialog.c

commit a6ec74886d5c7b291df6e05e8e7cb181452c4c22
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Aug 19 01:52:28 2008 +0100

    gattrib: Fix s_attrib_name_in_list() to avoid critical warning and leak
    
    A NULL string should not be passed to o_attrib_get_name_value(), as this
    now causes a critical level warning. Skip over NULL list items.
    
    Free memory allocated by o_attrib_get_name_value().

:100644 100644 cf4559f... 67f8a15... M	gattrib/src/s_attrib.c

=========
 Changes
=========

commit ff022c441d470f85b6db064411b1228e3511e959
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Aug 19 01:53:08 2008 +0100

    gattrib: Implement "Save changes?" dialog to match rest of suite.

diff --git a/gattrib/src/gattrib.c b/gattrib/src/gattrib.c
index 596db91..ec90b61 100644
--- a/gattrib/src/gattrib.c
+++ b/gattrib/src/gattrib.c
@@ -77,7 +77,6 @@
 gboolean gattrib_really_quit(void)
 {
   if (sheet_head->CHANGED == TRUE) {
-    printf("User is quitting without saving last changes.\n");
     x_dialog_unsaved_data();
   } else {
     gattrib_quit(0);
diff --git a/gattrib/src/x_dialog.c b/gattrib/src/x_dialog.c
index d948fa5..b2d52d8 100644
--- a/gattrib/src/x_dialog.c
+++ b/gattrib/src/x_dialog.c
@@ -206,27 +206,58 @@ void x_dialog_missing_sym()
 void x_dialog_unsaved_data()
 {
   GtkWidget *dialog;
-  const char *string = "Warning!  You have unsaved data in the spreadsheet!\n"
-                       "Are you sure you want to quit?";
-
-  /* Create the dialog */
-  dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
-                                  GTK_MESSAGE_WARNING,
-                                  GTK_BUTTONS_YES_NO,
-                                  string);
-
-  gtk_window_set_title(GTK_WINDOW(dialog), "Unsaved data.  Really quit?");
-
-  switch(gtk_dialog_run(GTK_DIALOG(dialog))) {
-    case GTK_RESPONSE_YES:
-      gattrib_quit(0);
-      break;
-
-    default:
-      break;
-  }
+  gchar *tmp;
+  gchar *str;
+
+  tmp = "Save the changes before closing?";
+  str = g_strconcat ("<big><b>", tmp, "</b></big>", NULL);
+
+  tmp = "If you don't save, all your changes will be permanently lost.";
+  str = g_strconcat (str, "\n\n", tmp, NULL);
+
+  dialog = gtk_message_dialog_new (GTK_WINDOW (window),
+                                   GTK_DIALOG_MODAL |
+                                     GTK_DIALOG_DESTROY_WITH_PARENT,
+                                     GTK_MESSAGE_WARNING,
+                                   GTK_BUTTONS_NONE, NULL);
+  gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), str);
+  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+                          "Close without saving",    GTK_RESPONSE_NO,
+                          GTK_STOCK_CANCEL,          GTK_RESPONSE_CANCEL,
+                          GTK_STOCK_SAVE,            GTK_RESPONSE_YES,
+                          NULL);
+
+#if GTK_CHECK_VERSION (2,6,0)
+  /* Set the alternative button order (ok, cancel, help) for other systems */
+  gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
+                                          GTK_RESPONSE_YES,
+                                          GTK_RESPONSE_NO,
+                                          GTK_RESPONSE_CANCEL,
+                                          -1);
+#endif
 
-  gtk_widget_destroy(dialog);
+  switch (gtk_dialog_run (GTK_DIALOG (dialog)))
+    {
+      case GTK_RESPONSE_NO:
+        {
+          gattrib_quit(0);
+          break;
+        }
+      case GTK_RESPONSE_YES:
+        {
+          s_toplevel_gtksheet_to_toplevel();  /* Dumps sheet data into TOPLEVEL */
+          s_page_save_all(pr_current);  /* saves all pages in design */
+          sheet_head->CHANGED = FALSE;
+          gattrib_quit(0);
+          break;
+        }
+      case GTK_RESPONSE_CANCEL:
+      default:
+        {
+          break;
+        }
+      }
+  gtk_widget_destroy (dialog);
   return;
 }
 

commit a6ec74886d5c7b291df6e05e8e7cb181452c4c22
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Tue Aug 19 01:52:28 2008 +0100

    gattrib: Fix s_attrib_name_in_list() to avoid critical warning and leak
    
    A NULL string should not be passed to o_attrib_get_name_value(), as this
    now causes a critical level warning. Skip over NULL list items.
    
    Free memory allocated by o_attrib_get_name_value().

diff --git a/gattrib/src/s_attrib.c b/gattrib/src/s_attrib.c
index cf4559f..67f8a15 100644
--- a/gattrib/src/s_attrib.c
+++ b/gattrib/src/s_attrib.c
@@ -50,13 +50,19 @@ int s_attrib_name_in_list(STRING_LIST *name_value_list, char *name)
   STRING_LIST *local_list_item;
   char *local_name;
 
-  local_list_item = name_value_list;
-  while (local_list_item != NULL) {
+  for (local_list_item = name_value_list;
+       local_list_item != NULL;
+       local_list_item = local_list_item->next) {
+
+    if (local_list_item->data == NULL)
+      continue;
+
     o_attrib_get_name_value(local_list_item->data, &local_name, NULL);
     if (strcmp(local_name, name) == 0) {
+      g_free (local_name);
       return TRUE;
     }
-    local_list_item = local_list_item->next;
+    g_free (local_name);
   }
   return FALSE;
 }




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs