[PATCH] Re: `Store address' user interface






On 2001.11.09 03:24 Pawel Salek wrote:
...
> One might believe that OK will save all the addresses. Would 
> "Save&Close", "Save", "Close" be better?
> 
> /Pawel

On 2001.11.09 14:16 Emmanuel wrote:
...
> Just 3 buttons named "Save and quit", "Save", "Close" wouldn't do it ?
> Bye
> Manu

Well...to be completely clear, how about:

Save this address and close the dialog?
+------+  +------+  +-------+
|  OK  |  | Save |  | Close |
+------+  +------+  +-------+

(see the attached screenshot and patch)

store.png

diff -dNru --exclude-from=excl balsa-cvs/src/store-address.c balsa-store/src/store-address.c
--- balsa-cvs/src/store-address.c	Tue Nov  6 07:47:55 2001
+++ balsa-store/src/store-address.c	Fri Nov  9 13:34:09 2001
@@ -71,13 +71,23 @@
     info->current_address_book = NULL;
     dialog = store_address_dialog(info);
 
-    gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
     if (info->entries_list) {
         GtkNotebook *notebook = GTK_NOTEBOOK(info->notebook);
-        while (gnome_dialog_run(GNOME_DIALOG(dialog)) == 0) {
+        gint button;
+
+        gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
+        /* button ==  0 => OK
+         * button ==  1 => save
+         * button ==  2 => close
+         * button == -1    if user closed dialog using the window
+         *                   decorations */
+        while ((button = gnome_dialog_run(GNOME_DIALOG(dialog))) == 0 
+                || button == 1) {
             gint page = gtk_notebook_get_current_page(notebook);
             GList *list = g_list_nth(info->entries_list, page);
             store_address_from_entries(info, list->data);
+            if (button == 0)
+                break;
         }
         g_list_foreach(info->entries_list, (GFunc) g_free, NULL);
         g_list_free(info->entries_list);
@@ -94,7 +104,9 @@
 store_address_dialog(struct store_address_info * info)
 {
     GtkWidget *dialog =
-        gnome_dialog_new(_("Store Address"), _("Save in address book"),
+        gnome_dialog_new(_("Store Address"),
+                         GNOME_STOCK_BUTTON_OK,
+                         "Save",
                          GNOME_STOCK_BUTTON_CLOSE, NULL);
     GtkWidget *vbox = GNOME_DIALOG(dialog)->vbox;
     GtkWidget *frame;
@@ -103,6 +115,10 @@
     gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
     frame = store_address_note_frame(info);
     gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), 
+                       gtk_label_new(_("Save this address "
+                                       "and close the dialog?")),
+                       TRUE, TRUE, 0);
     gtk_widget_show_all(dialog);
     return dialog;
 }




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