[balsa/popover: 56/65] balsa-index: Add action-entries in a helper




commit 5ffc59f6219e8d2e9059a9be0581974d5888d27c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 24 16:57:21 2020 -0400

    balsa-index: Add action-entries in a helper

 src/balsa-index.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/balsa-index.c b/src/balsa-index.c
index fb3144dd6..01c224d78 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -2004,7 +2004,8 @@ move_to_change_state(GSimpleAction *action,
  * bndx_popup_menu_create: create the popup menu and popover at init time
  */
 static void
-bndx_popup_menu_create(BalsaIndex * bindex)
+bndx_add_actions(BalsaIndex  *bindex,
+                 const gchar *action_namespace)
 {
     GSimpleActionGroup *simple;
     static const GActionEntry entries[] = {
@@ -2021,18 +2022,21 @@ bndx_popup_menu_create(BalsaIndex * bindex)
         {"toggle-flagged",   toggle_flagged_activated},
         {"toggle-unread",    toggle_unread_activated},
         {"view-source",      view_source_activated},
-        {"move-to",          libbalsa_radio_activated,
-            "s", "''", move_to_change_state}
+        {"move-to",          libbalsa_radio_activated, "s", "''", move_to_change_state}
     };
-    GMenu *menu, *section, *submenu;
 
     simple = g_simple_action_group_new();
-    g_action_map_add_action_entries(G_ACTION_MAP(simple),
-                                    entries,
-                                    G_N_ELEMENTS(entries),
-                                    bindex);
-    gtk_widget_insert_action_group(GTK_WIDGET(bindex), "popup", G_ACTION_GROUP(simple));
+    g_action_map_add_action_entries(G_ACTION_MAP(simple), entries, G_N_ELEMENTS(entries), bindex);
+    gtk_widget_insert_action_group(GTK_WIDGET(bindex), action_namespace, G_ACTION_GROUP(simple));
     g_object_unref(simple);
+}
+
+static void
+bndx_popup_menu_create(BalsaIndex * bindex)
+{
+    GMenu *menu, *section, *submenu;
+
+    bndx_add_actions(bindex, "popup");
 
     menu = g_menu_new();
 


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