[balsa] Code cleanup



commit c7e7c33709e9a32cc5eeed9428a9889f8aea867c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed May 31 20:25:18 2017 -0400

    Code cleanup
    
        * src/pref-manager.c (option_menu_cb), (pgdown_modified_cb):
        simplify callback placement.

 ChangeLog          |    7 +++++++
 src/pref-manager.c |   24 +++++++++++++-----------
 2 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 75d5efc..3755a5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-05-31  Peter Bloomfield  <pbloomfield bellsouth net>
 
+       Code cleanup
+
+       * src/pref-manager.c (option_menu_cb), (pgdown_modified_cb):
+       simplify callback placement.
+
+2017-05-31  Peter Bloomfield  <pbloomfield bellsouth net>
+
        Port preferences window from GtkNotebook to GtkStack
 
        * src/pref-manager.c (pm_combo_box_info_free), (pm_combo_box_new),
diff --git a/src/pref-manager.c b/src/pref-manager.c
index 6c6988f..7cbd28f 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -195,7 +195,6 @@ struct pm_combo_box_info {
 
     /* callbacks */
 static void properties_modified_cb(GtkWidget * widget, GtkWidget * pbox);
-static void option_menu_cb(GtkMenuItem * menuitem, gpointer data);
 static void address_book_change(LibBalsaAddressBook * address_book, gboolean append);
 
 guint pwindow_type[NUM_PWINDOW_MODES] = {
@@ -993,8 +992,6 @@ add_button_to_box(const gchar * label, GCallback cb, gpointer cb_data,
     return button;
 }
 
-static GtkWidget * server_add_menu_widget(void);
-
 static void
 add_show_menu(const char* label, gint level, GtkWidget* menu)
 {
@@ -1005,6 +1002,19 @@ add_show_menu(const char* label, gint level, GtkWidget* menu)
     info->levels = g_slist_append(info->levels, GINT_TO_POINTER(level));
 }
 
+/*
+ * callback for create_pref_option_menu
+ */
+
+static void
+option_menu_cb(GtkMenuItem * widget, gpointer data)
+{
+    /* update the index number */
+    gint *index = (gint *) data;
+
+    *index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
+}
+
 static GtkWidget *
 create_pref_option_menu(const gchar * names[], gint size, gint * index)
 {
@@ -1760,14 +1770,6 @@ pgdown_modified_cb(GtkWidget * widget, GtkWidget * pbox)
 }
 
 static void
-option_menu_cb(GtkMenuItem * widget, gpointer data)
-{
-    /* update the index number */
-    gint *index = (gint *) data;
-    *index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
-}
-
-static void
 mailbox_close_timer_modified_cb(GtkWidget * widget, GtkWidget * pbox)
 {
     gboolean newstate =


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