[balsa/gtk4: 180/311] Various: Rename libbalsa_add_button_to_box()




commit 04547d0a907234a568f2ad2c634e8a1edec52eed
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Aug 30 13:09:07 2020 -0400

    Various: Rename libbalsa_add_button_to_box()
    
    to libbalsa_add_mnemonic_button_to_box(). Some of our buttons have
    images rather than text; the new name makes it clear why we don't use
    the helper in that case.

 libbalsa/misc.c                   |  4 ++--
 libbalsa/misc.h                   |  2 +-
 src/ab-main.c                     |  6 +++---
 src/ab-window.c                   |  4 ++--
 src/balsa-mime-widget-crypto.c    |  6 +++---
 src/balsa-mime-widget-vcalendar.c |  6 +++---
 src/filter-edit-dialog.c          | 14 +++++++-------
 src/filter-run-dialog.c           |  2 +-
 src/main-window.c                 |  4 ++--
 src/toolbar-prefs.c               |  4 ++--
 10 files changed, 26 insertions(+), 26 deletions(-)
---
diff --git a/libbalsa/misc.c b/libbalsa/misc.c
index 4cf5b0fd5..93fca39e0 100644
--- a/libbalsa/misc.c
+++ b/libbalsa/misc.c
@@ -1254,7 +1254,7 @@ libbalsa_parser_options(void)
 }
 
 /*
- * libbalsa_add_button_to_box
+ * libbalsa_add_mnemonic_button_to_box
  *
  * Create a button widget and add it to a GtkBox with the same
  * look as a regular button in a GtkButtonBox; returns the button.
@@ -1282,7 +1282,7 @@ libbalsa_parser_options(void)
 #define LIBBALSA_SIZE_GROUP_KEY "libbalsa-size-group-key"
 
 GtkWidget *
-libbalsa_add_button_to_box(const gchar *markup,
+libbalsa_add_mnemonic_button_to_box(const gchar *markup,
                            GtkWidget   *box,
                            GtkAlign     align)
 {
diff --git a/libbalsa/misc.h b/libbalsa/misc.h
index fd69e9706..a4983de09 100644
--- a/libbalsa/misc.h
+++ b/libbalsa/misc.h
@@ -163,7 +163,7 @@ gchar *libbalsa_font_string_to_css(const gchar * font_string, const gchar * name
 void libbalsa_parser_options_init(void);
 GMimeParserOptions *libbalsa_parser_options(void);
 
-GtkWidget * libbalsa_add_button_to_box(const gchar *markup,
+GtkWidget * libbalsa_add_mnemonic_button_to_box(const gchar *markup,
                                        GtkWidget   *box,
                                        GtkAlign     align);
 
diff --git a/src/ab-main.c b/src/ab-main.c
index b83d984e6..7e7afc545 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -835,15 +835,15 @@ bab_get_edit_button_box(struct ABMainWindow *abmw)
 
     box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 
-    abmw->apply_button = libbalsa_add_button_to_box(_("_Apply"), box, GTK_ALIGN_START);
+    abmw->apply_button = libbalsa_add_mnemonic_button_to_box(_("_Apply"), box, GTK_ALIGN_START);
     g_signal_connect(abmw->apply_button, "clicked",
                      G_CALLBACK(apply_button_cb), (gpointer) NULL);
 
-    abmw->remove_button = libbalsa_add_button_to_box(_("_Remove"), box, GTK_ALIGN_CENTER);
+    abmw->remove_button = libbalsa_add_mnemonic_button_to_box(_("_Remove"), box, GTK_ALIGN_CENTER);
     g_signal_connect(abmw->remove_button, "clicked",
                      G_CALLBACK(remove_button_cb), (gpointer) NULL);
 
-    abmw->cancel_button = libbalsa_add_button_to_box(_("_Cancel"), box, GTK_ALIGN_END);
+    abmw->cancel_button = libbalsa_add_mnemonic_button_to_box(_("_Cancel"), box, GTK_ALIGN_END);
     g_signal_connect(abmw->cancel_button, "clicked",
                      G_CALLBACK(cancel_button_cb), abmw);
 
diff --git a/src/ab-window.c b/src/ab-window.c
index 9bdec0d29..c19884cb0 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -328,11 +328,11 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_grid_attach(GTK_GRID(grid), hbox, 0, 2, 1, 1);
     gtk_widget_show(GTK_WIDGET(hbox));
 
-    w = libbalsa_add_button_to_box(_("Run _Editor"), hbox, GTK_ALIGN_CENTER);
+    w = libbalsa_add_mnemonic_button_to_box(_("Run _Editor"), hbox, GTK_ALIGN_CENTER);
     g_signal_connect(w, "clicked",
                      G_CALLBACK(balsa_ab_window_run_editor), NULL);
 
-    w = libbalsa_add_button_to_box(_("_Re-import"), hbox, GTK_ALIGN_CENTER);
+    w = libbalsa_add_mnemonic_button_to_box(_("_Re-import"), hbox, GTK_ALIGN_CENTER);
     g_signal_connect(w, "clicked",
                      G_CALLBACK(balsa_ab_window_reload),
                       ab);
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 4a9a70623..e9e45d546 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -141,7 +141,7 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
 
                autocrypt_key = autocrypt_get_key(g_mime_gpgme_sigstat_fingerprint(mime_body->sig_info), 
NULL);
                if (autocrypt_key != NULL) {
-                       button = libbalsa_add_button_to_box(_("_Import Autocrypt key"),
+                       button = libbalsa_add_mnemonic_button_to_box(_("_Import Autocrypt key"),
                                                             hbox, GTK_ALIGN_FILL);
                        g_object_set_data_full(G_OBJECT(button), "autocrypt_key", autocrypt_key, 
(GDestroyNotify) g_bytes_unref);
                        g_signal_connect(button, "clicked", G_CALLBACK(on_key_import_button), NULL);
@@ -153,10 +153,10 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
                        gtk_container_add(GTK_CONTAINER(hbox), button);
                }
 #endif
-            button = libbalsa_add_button_to_box(_("_Search key server for this key"),
+            button = libbalsa_add_mnemonic_button_to_box(_("_Search key server for this key"),
                                                 hbox, GTK_ALIGN_FILL);
         } else {
-            button = libbalsa_add_button_to_box(_("_Search key server for updates of this key"),
+            button = libbalsa_add_mnemonic_button_to_box(_("_Search key server for updates of this key"),
                                                 hbox, GTK_ALIGN_FILL);
         }
         g_signal_connect(button, "clicked",
diff --git a/src/balsa-mime-widget-vcalendar.c b/src/balsa-mime-widget-vcalendar.c
index 835b7d0ad..1288507cf 100644
--- a/src/balsa-mime-widget-vcalendar.c
+++ b/src/balsa-mime-widget-vcalendar.c
@@ -268,7 +268,7 @@ balsa_vevent_widget(LibBalsaVEvent *event, LibBalsaVCal *vcal, gboolean may_repl
         bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_container_add(GTK_CONTAINER(box), bbox);
 
-        button = libbalsa_add_button_to_box(_("Accept"), bbox, GTK_ALIGN_CENTER);
+        button = libbalsa_add_mnemonic_button_to_box(_("Accept"), bbox, GTK_ALIGN_CENTER);
        g_object_set_data(G_OBJECT(button), "event", event);
 
        /* Note: we must ref the full VCal object here as time zone information is stored in it.  Only 
ref'ing the event would thus
@@ -280,14 +280,14 @@ balsa_vevent_widget(LibBalsaVEvent *event, LibBalsaVCal *vcal, gboolean may_repl
        g_signal_connect(button, "clicked",
                         G_CALLBACK(vevent_reply), bbox);
 
-        button = libbalsa_add_button_to_box(_("Accept tentatively"), bbox, GTK_ALIGN_CENTER);
+        button = libbalsa_add_mnemonic_button_to_box(_("Accept tentatively"), bbox, GTK_ALIGN_CENTER);
        g_object_set_data(G_OBJECT(button), "event", event);
        g_object_set_data(G_OBJECT(button), "mode",
                          GINT_TO_POINTER(ICAL_PARTSTAT_TENTATIVE));
        g_signal_connect(button, "clicked",
                         G_CALLBACK(vevent_reply), bbox);
 
-        button = libbalsa_add_button_to_box(_("Decline"), bbox, GTK_ALIGN_CENTER);
+        button = libbalsa_add_mnemonic_button_to_box(_("Decline"), bbox, GTK_ALIGN_CENTER);
        g_object_set_data(G_OBJECT(button), "event", event);
        g_object_set_data(G_OBJECT(button), "mode",
                          GINT_TO_POINTER(ICAL_PARTSTAT_DECLINED));
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index 049bb6af7..97f730dd5 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -223,11 +223,11 @@ build_left_side(void)
 
     /* new button */
     /* Translators: button "New" filter */
-    fe_new_button = libbalsa_add_button_to_box(C_("filter", "_New"), bbox, GTK_ALIGN_CENTER);
+    fe_new_button = libbalsa_add_mnemonic_button_to_box(C_("filter", "_New"), bbox, GTK_ALIGN_CENTER);
     g_signal_connect(fe_new_button, "clicked",
                     G_CALLBACK(fe_new_pressed), NULL);
     /* delete button */
-    fe_delete_button = libbalsa_add_button_to_box(("_Delete"), bbox, GTK_ALIGN_CENTER);
+    fe_delete_button = libbalsa_add_mnemonic_button_to_box(("_Delete"), bbox, GTK_ALIGN_CENTER);
     g_signal_connect(fe_delete_button, "clicked",
                     G_CALLBACK(fe_delete_pressed), NULL);
     gtk_widget_set_sensitive(fe_delete_button, FALSE);
@@ -308,15 +308,15 @@ build_match_page()
     gtk_widget_set_hexpand(box, TRUE);
     gtk_grid_attach(GTK_GRID(page), box, 0, 3, 2, 1);
 
-    fe_condition_edit_button = libbalsa_add_button_to_box(_("_Edit"), box, GTK_ALIGN_START);
+    fe_condition_edit_button = libbalsa_add_mnemonic_button_to_box(_("_Edit"), box, GTK_ALIGN_START);
     gtk_widget_set_sensitive(fe_condition_edit_button,FALSE);
     g_signal_connect(fe_condition_edit_button, "clicked",
                      G_CALLBACK(fe_edit_condition), GINT_TO_POINTER(0));
     /* Translators: button "New" filter match */
-    button = libbalsa_add_button_to_box(C_("filter match", "Ne_w"), box, GTK_ALIGN_CENTER);
+    button = libbalsa_add_mnemonic_button_to_box(C_("filter match", "Ne_w"), box, GTK_ALIGN_CENTER);
     g_signal_connect(button, "clicked",
                      G_CALLBACK(fe_edit_condition), GINT_TO_POINTER(1));
-    fe_condition_delete_button = libbalsa_add_button_to_box(_("_Remove"), box, GTK_ALIGN_END);
+    fe_condition_delete_button = libbalsa_add_mnemonic_button_to_box(_("_Remove"), box, GTK_ALIGN_END);
     gtk_widget_set_sensitive(fe_condition_delete_button,FALSE);
     g_signal_connect(fe_condition_delete_button, "clicked",
                     G_CALLBACK(fe_condition_remove_pressed), NULL);
@@ -506,11 +506,11 @@ build_right_side(GtkWindow * window)
     bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     gtk_container_add(GTK_CONTAINER(rightside), bbox);
 
-    fe_apply_button = libbalsa_add_button_to_box(_("_Apply"), bbox, GTK_ALIGN_START);
+    fe_apply_button = libbalsa_add_mnemonic_button_to_box(_("_Apply"), bbox, GTK_ALIGN_START);
     g_signal_connect(fe_apply_button, "clicked",
                     G_CALLBACK(fe_apply_pressed), NULL);
 
-    fe_revert_button = libbalsa_add_button_to_box(_("Re_vert"), bbox, GTK_ALIGN_END);
+    fe_revert_button = libbalsa_add_mnemonic_button_to_box(_("Re_vert"), bbox, GTK_ALIGN_END);
     g_signal_connect(fe_revert_button, "clicked",
                     G_CALLBACK(fe_revert_pressed), NULL);
     gtk_widget_set_sensitive(fe_apply_button, FALSE);
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index 3383047b0..9a821f401 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -347,7 +347,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
 
     /* "Apply selected" button */
     p->apply_selected_button = button =
-            libbalsa_add_button_to_box(_("_Apply Selected"), bbox, GTK_ALIGN_CENTER);
+            libbalsa_add_mnemonic_button_to_box(_("_Apply Selected"), bbox, GTK_ALIGN_CENTER);
     gtk_widget_set_sensitive(button, FALSE);
     g_signal_connect_swapped(button, "clicked",
                              G_CALLBACK(fr_apply_selected_pressed), p);
diff --git a/src/main-window.c b/src/main-window.c
index 4de82ac97..7d2ed9054 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -3902,11 +3902,11 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
        /* Button box */
        box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_container_set_border_width(GTK_CONTAINER(box), 6);
-        button = libbalsa_add_button_to_box(_("_Apply"), box, GTK_ALIGN_START);
+        button = libbalsa_add_mnemonic_button_to_box(_("_Apply"), box, GTK_ALIGN_START);
        g_signal_connect(button, "clicked",
                         G_CALLBACK(bw_find_button_clicked),
                         GINT_TO_POINTER(FIND_RESPONSE_FILTER));
-        button = libbalsa_add_button_to_box(_("_Clear"), box, GTK_ALIGN_END);
+        button = libbalsa_add_mnemonic_button_to_box(_("_Clear"), box, GTK_ALIGN_END);
        g_signal_connect(button, "clicked",
                         G_CALLBACK(bw_find_button_clicked),
                         GINT_TO_POINTER(FIND_RESPONSE_RESET));
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index aa383e328..c4f031d99 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -414,10 +414,10 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
 
     /* Standard button */
     page->standard_button =
-        libbalsa_add_button_to_box(_("_Restore toolbar to standard buttons"), button_box, GTK_ALIGN_START);
+        libbalsa_add_mnemonic_button_to_box(_("_Restore toolbar to standard buttons"), button_box, 
GTK_ALIGN_START);
 
     /* Style button */
-    style_button = libbalsa_add_button_to_box(_("Toolbar _style…"), button_box, GTK_ALIGN_END);
+    style_button = libbalsa_add_mnemonic_button_to_box(_("Toolbar _style…"), button_box, GTK_ALIGN_END);
 
     /* Done with preview */
 


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