[balsa/popover: 57/66] balsa-index: Add action-entries in a helper
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/popover: 57/66] balsa-index: Add action-entries in a helper
- Date: Sat, 18 Jul 2020 00:52:47 +0000 (UTC)
commit 304c42805783a7173a12023a75d62aee82ed94b5
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 be119faad..5c2452503 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -1959,7 +1959,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[] = {
@@ -1976,18 +1977,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]