+ old_state = g_action_get_state (G_ACTION (action));
+ new_state = g_variant_new_boolean (!g_variant_get_boolean (old_state));
+
+ DB( g_print ("Toggle action %s activated, state changes from %d to %d\n",
+ g_action_get_name (G_ACTION (action)),
+ g_variant_get_boolean (old_state),
+ g_variant_get_boolean (new_state)) );
+
+ data->showall = g_variant_get_boolean (new_state);
+ ui_mainwindow_populate_accounts(GLOBALS->mainwindow, NULL);
+
+ g_simple_action_set_state (action, new_state);
+ g_variant_unref (old_state);
+}
+
+static void
+activate_radio (GSimpleAction *action, GVariant *parameter, gpointer user_data)
+{
+//struct hbfile_data *data = user_data;
+GVariant *old_state, *new_state;
+
+ old_state = g_action_get_state (G_ACTION (action));
+ new_state = g_variant_new_string (g_variant_get_string (parameter, NULL));
+
+ DB( g_print ("Radio action %s activated, state changes from %s to %s\n",
+ g_action_get_name (G_ACTION (action)),
+ g_variant_get_string (old_state, NULL),
+ g_variant_get_string (new_state, NULL)) );
+
+ PREFS->pnl_acc_show_by = DSPACC_GROUP_BY_TYPE;
+ if( !strcmp("bank", g_variant_get_string(new_state, NULL)) )
+ PREFS->pnl_acc_show_by = DSPACC_GROUP_BY_BANK;
+
+ ui_mainwindow_populate_accounts(GLOBALS->mainwindow, NULL);
+
+ g_simple_action_set_state (action, new_state);
+ g_variant_unref (old_state);
+}
+
+
+static const GActionEntry actions[] = {
+// { "paste", activate_action, NULL, NULL, NULL, {0,0,0} },
+ { "showall", activate_toggle, NULL, "false" , NULL, {0,0,0} },
+ { "groupby", activate_radio , "s", "'type'", NULL, {0,0,0} }
+};
+
+
+static void ui_panel_accounts_setup(struct hbfile_data *data)
+{
+GAction *action;
+GVariant *new_state;
+
+ if( !G_IS_SIMPLE_ACTION_GROUP(data->action_group_acc) )
+ return;
+
+ action = g_action_map_lookup_action (G_ACTION_MAP (data->action_group_acc), "showall");
+ if( action )
+ {
+ new_state = g_variant_new_boolean (data->showall);
+ g_simple_action_set_state (G_SIMPLE_ACTION(action), new_state);
+ }
+
+ action = g_action_map_lookup_action (G_ACTION_MAP (data->action_group_acc), "groupby");
+ if( action )
+ {
+ const gchar *value = (PREFS->pnl_acc_show_by == DSPACC_GROUP_BY_TYPE) ? "type" : "bank";
+ new_state = g_variant_new_string (value);
+ g_simple_action_set_state (G_SIMPLE_ACTION (action), new_state);
+ }
+
+}