-#if 0
-static void accel_alternate_activate_cb(GtkWidget *widget, gpointer data)
-{
- gtk_action_activate((GtkAction*)data);
-}
-
-#define DUPL "-alt-"
-
-void accel_add_alt_selection(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
-{
- LayoutWindow *lw;
- GList *groups, *actions;
- GtkAction *action;
- GtkAccelKey key, *key2;
- GtkAccelMap *map;
- gchar *accel_path2, *accel;
- const gchar *accel_path;
- gint freeduplnum = 1;
- gint len;
- GClosure* closure;
- GtkAccelGroup *group;
- GtkAction *action_new, *action_new2;
- gchar *name, *accel_path_new, *accel_path_new2;
-
- if (!accel_store || !layout_window_list || !layout_window_list->data) return;
-
- gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path2, -1);
- len = strlen(accel_path2);
-
- gtk_tree_store_clear(accel_store);
- lw = layout_window_list->data;
-
- g_assert(lw && lw->ui_manager);
- groups = gtk_ui_manager_get_action_groups(lw->ui_manager);
- group = gtk_ui_manager_get_accel_group(lw->ui_manager);
-
- while (groups)
- {
- actions = gtk_action_group_list_actions(GTK_ACTION_GROUP(groups->data));
- while (actions)
- {
- gchar *dupl;
- guint64 num;
-
- action = GTK_ACTION(actions->data);
- actions = actions->next;
-
- accel_path = gtk_action_get_accel_path(action);
- if (!accel_path) continue;
-
- dupl = g_strrstr(accel_path, DUPL);
-
- printf("D: %s %s %s\n", accel_path, accel_path2, dupl);
-
- if ((dupl && (len != (dupl - accel_path)) ) ||
- g_ascii_strncasecmp(accel_path, accel_path2, len) != 0)
- continue;
-
- if (dupl && (num = g_ascii_strtoull(dupl + strlen(DUPL), NULL, 10)) > 0 &&
- num > freeduplnum)
- {
- freeduplnum = num + 1;
- }
- else
- {
- closure = gtk_action_get_accel_closure(action);
- name = gtk_action_get_name(action);
- accel_path_new = g_strdup(accel_path);
- action_new2 = action;
- }
- }
- groups = groups->next;
- }
-
- action_new = gtk_action_new(name, NULL, NULL, NULL);
- gtk_action_set_accel_group(action_new, group);
-
- g_signal_connect(G_OBJECT(action_new), "activate",
- G_CALLBACK(accel_alternate_activate_cb), action_new2);
-
-// accel_path_new2 = g_strdup_printf("%s%s%d", accel_path_new, dupl, freeduplnum);
- g_free(accel_path_new);
-
- gtk_action_set_accel_path(action_new, accel_path_new);
-
-// gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1);
- printf("D: %s\n", accel_path_new2);
-
- g_free(accel_path_new2);
- gtk_action_connect_accelerator(action_new);
-}
-
-static void accel_add_alt_cb(GtkWidget *widget, gpointer data)
-{
- GtkWidget *accel_view = data;
- GtkTreeSelection *selection;
-
- if (!accel_store) return;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data));
- gtk_tree_selection_selected_foreach(selection, &accel_add_alt_selection, NULL);
-}
-
-static void accel_default_ok_cb(GenericDialog *gd, gpointer data)
-{
- accel_store_populate();
-}
-
-#endif