dia r4238 - in trunk: . app
- From: hans svn gnome org
- To: svn-commits-list gnome org
- Subject: dia r4238 - in trunk: . app
- Date: Sat, 31 Jan 2009 14:46:25 +0000 (UTC)
Author: hans
Date: Sat Jan 31 14:46:25 2009
New Revision: 4238
URL: http://svn.gnome.org/viewvc/dia?rev=4238&view=rev
Log:
2009-01-31 Hans Breuer <hans breuer org>
* app/display.[ch] app/diagram.[ch] app/menus.[ch] : get rid of nearly
unmaintainable UpdatableMenuItems and a lot of ui-variant-specific code
by dynamic action lookup when updating sensitivity. This not only fixes
bug #527565 but also bug #322190 and allows ...
* app/interface.c : make Tool accelerator single key strokes - e.g. no
more <alt><shift>L to draw a line but just "L" - another benefit of the
dedicated test edit mode ;) - bug #439854.
Modified:
trunk/ChangeLog
trunk/app/diagram.c
trunk/app/diagram.h
trunk/app/display.c
trunk/app/display.h
trunk/app/interface.c
trunk/app/menus.c
trunk/app/menus.h
Modified: trunk/app/diagram.c
==============================================================================
--- trunk/app/diagram.c (original)
+++ trunk/app/diagram.c Sat Jan 31 14:46:25 2009
@@ -496,118 +496,132 @@
TODO: move it to the DDisplay as it belongs to it IMHO
*/
void
-diagram_update_menu_sensitivity (Diagram *dia, UpdatableMenuItems *items)
+diagram_update_menu_sensitivity (Diagram *dia)
{
gint selected_count = g_list_length (dia->data->selected);
DDisplay *ddisp = ddisplay_active();
gboolean focus_active = (get_active_focus(dia->data) != NULL);
gboolean textedit_active = ddisp ? textedit_mode(ddisp) : FALSE;
+ GtkAction *action;
/* Edit menu */
- gtk_action_set_sensitive (items->undo,
- undo_available(dia->undo, TRUE));
- gtk_action_set_sensitive (items->redo,
- undo_available(dia->undo, FALSE));
-
- gtk_action_set_sensitive (items->copy,
- textedit_active || selected_count > 0);
- gtk_action_set_sensitive (items->cut,
- textedit_mode(ddisp) || selected_count > 0);
- gtk_action_set_sensitive (items->paste,
- textedit_active || cnp_exist_stored_objects());
- gtk_action_set_sensitive (items->edit_delete,
- !textedit_active && selected_count > 0);
- gtk_action_set_sensitive (items->edit_duplicate,
- !textedit_active && selected_count > 0);
-
- gtk_action_set_sensitive (items->copy_text, focus_active);
- gtk_action_set_sensitive (items->cut_text, focus_active);
- gtk_action_set_sensitive (items->paste_text, focus_active);
-
+ if ((action = menus_get_action ("EditUndo")) != NULL)
+ gtk_action_set_sensitive (action, dia ? undo_available(dia->undo, TRUE) : FALSE);
+ if ((action = menus_get_action ("EditRedo")) != NULL)
+ gtk_action_set_sensitive (action, dia ? undo_available(dia->undo, FALSE) : FALSE);
+ if ((action = menus_get_action ("EditCopy")) != NULL)
+ gtk_action_set_sensitive (action, textedit_active || selected_count > 0);
+ if ((action = menus_get_action ("EditCut")) != NULL)
+ gtk_action_set_sensitive (action, textedit_mode(ddisp) || selected_count > 0);
+ if ((action = menus_get_action ("EditPaste")) != NULL)
+ gtk_action_set_sensitive (action, textedit_active || cnp_exist_stored_objects());
+ if ((action = menus_get_action ("EditDelete")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+ if ((action = menus_get_action ("EditDuplicate")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+
+ if ((action = menus_get_action ("EditCopytext")) != NULL)
+ gtk_action_set_sensitive (action, focus_active);
+ if ((action = menus_get_action ("EditCuttext")) != NULL)
+ gtk_action_set_sensitive (action, focus_active);
+ if ((action = menus_get_action ("EditPastetext")) != NULL)
+ gtk_action_set_sensitive (action, focus_active);
+
/* Objects menu */
- gtk_action_set_sensitive (items->send_to_back,
- !textedit_active && selected_count > 0);
- gtk_action_set_sensitive (items->bring_to_front,
- !textedit_active && selected_count > 0);
- gtk_action_set_sensitive (items->send_backwards,
- !textedit_active && selected_count > 0);
- gtk_action_set_sensitive (items->bring_forwards,
- !textedit_active && selected_count > 0);
-
- gtk_action_set_sensitive (items->objects_layer_above,
- !textedit_active && selected_count > 0);
- gtk_action_set_sensitive (items->objects_layer_below,
- !textedit_active && selected_count > 0);
-
- gtk_action_set_sensitive (items->parent,
- !textedit_active && diagram_selected_can_parent (dia));
- gtk_action_set_sensitive (items->unparent,
- !textedit_active && diagram_selected_any_children (dia));
- gtk_action_set_sensitive (items->unparent_children,
- !textedit_active && diagram_selected_any_parents (dia));
- gtk_action_set_sensitive (items->group,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->ungroup,
- !textedit_active && diagram_selected_any_groups (dia));
- gtk_action_set_sensitive (items->properties, selected_count > 0);
-
+ if ((action = menus_get_action ("ObjectsSendtoback")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+ if ((action = menus_get_action ("ObjectsBringtofront")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+ if ((action = menus_get_action ("ObjectsSendbackwards")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+ if ((action = menus_get_action ("ObjectsBringforwards")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+
+ if ((action = menus_get_action ("ObjectsLayerAbove")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+ if ((action = menus_get_action ("ObjectsLayerBelow")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 0);
+
+ if ((action = menus_get_action ("ObjectsGroup")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsUngroup")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && diagram_selected_any_groups (dia));
+ if ((action = menus_get_action ("ObjectsParent")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && diagram_selected_can_parent (dia));
+ if ((action = menus_get_action ("ObjectsUnparent")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && diagram_selected_any_children (dia));
+ if ((action = menus_get_action ("ObjectsUnparentchildren")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && diagram_selected_any_parents (dia));
+
+ if ((action = menus_get_action ("ObjectsProperties")) != NULL)
+ gtk_action_set_sensitive (action, selected_count > 0);
+
/* Objects->Align menu */
- gtk_action_set_sensitive (items->align_h_l,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_h_c,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_h_r,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_h_e,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_h_a,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_v_t,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_v_c,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_v_b,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_v_e,
- !textedit_active && selected_count > 1);
- gtk_action_set_sensitive (items->align_v_a,
- !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignLeft")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignCenter")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignRight")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignSpreadouthorizontally")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignAdjacent")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignTop")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignMiddle")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignBottom")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignSpreadoutvertically")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
+ if ((action = menus_get_action ("ObjectsAlignStacked")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active && selected_count > 1);
/* Select menu */
- gtk_action_set_sensitive (items->select_all, !textedit_active);
- gtk_action_set_sensitive (items->select_none, !textedit_active);
- gtk_action_set_sensitive (items->select_invert, !textedit_active);
- gtk_action_set_sensitive (items->select_transitive, !textedit_active);
- gtk_action_set_sensitive (items->select_connected, !textedit_active);
- gtk_action_set_sensitive (items->select_same_type, !textedit_active);
+ if ((action = menus_get_action ("SelectAll")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectNone")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectInvert")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectTransitive")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectConnected")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectSametype")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+
+ if ((action = menus_get_action ("SelectReplace")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectUnion")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectIntersection")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectRemove")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ if ((action = menus_get_action ("SelectInverse")) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
- gtk_action_set_sensitive (items->select_replace, !textedit_active);
- gtk_action_set_sensitive (items->select_union, !textedit_active);
- gtk_action_set_sensitive (items->select_intersection, !textedit_active);
- gtk_action_set_sensitive (items->select_remove, !textedit_active);
- gtk_action_set_sensitive (items->select_inverse, !textedit_active);
+ /* Tools menu */
+ {
+ /* Keep in sync with menus.c(tool_entries) */
+ static gchar * action_names[] = {
+ "ToolsModify", "ToolsMagnify", "ToolsTextedit", "ToolsScroll",
+ "ToolsText", "ToolsBox", "ToolsEllipse", "ToolsPolygon", "ToolsBeziergon",
+ "ToolsLine", "ToolsArc", "ToolsZigzagline", "ToolsPolyline","ToolsBezierline",
+ "ToolsImage", "ToolsOutline", NULL
+ };
+ int i;
+ for (i = 0; action_names[i] != NULL; ++i) {
+ if ((action = menus_get_action (action_names[i])) != NULL)
+ gtk_action_set_sensitive (action, !textedit_active);
+ }
+ }
+ /* View menu - should not need disabling yet */
}
-void diagram_update_menubar_sensitivity(Diagram *dia, UpdatableMenuItems *items)
-{
- diagram_update_menu_sensitivity (dia, items);
-}
-
-
-void diagram_update_popupmenu_sensitivity(Diagram *dia)
-{
- static int initialized = 0;
- static UpdatableMenuItems items;
-
- if (initialized==0) {
- menus_initialize_updatable_items (&items, NULL);
- initialized = 1;
- }
-
- diagram_update_menu_sensitivity (dia, &items);
-}
-
void
diagram_add_ddisplay(Diagram *dia, DDisplay *ddisp)
{
Modified: trunk/app/diagram.h
==============================================================================
--- trunk/app/diagram.h (original)
+++ trunk/app/diagram.h Sat Jan 31 14:46:25 2009
@@ -125,9 +125,7 @@
DiaObject *notthis);
void diagram_update_extents(Diagram *dia);
-void diagram_update_menu_sensitivity (Diagram *dia, UpdatableMenuItems *items);
-void diagram_update_menubar_sensitivity(Diagram *dia, UpdatableMenuItems *items);
-void diagram_update_popupmenu_sensitivity(Diagram *dia);
+void diagram_update_menu_sensitivity (Diagram *dia);
void diagram_place_under_selected(Diagram *dia);
void diagram_place_over_selected(Diagram *dia);
Modified: trunk/app/display.c
==============================================================================
--- trunk/app/display.c (original)
+++ trunk/app/display.c Sat Jan 31 14:46:25 2009
@@ -242,9 +242,6 @@
ddisp = g_new0(DDisplay,1);
- /* initialize the whole struct to 0 so that we are sure to catch errors.*/
- memset (&ddisp->updatable_menu_items, 0, sizeof (UpdatableMenuItems));
-
ddisp->diagram = orig_ddisp->diagram;
/* Every display has its own reference */
g_object_ref(dia);
@@ -286,9 +283,6 @@
ddisp = g_new0(DDisplay,1);
- /* initialize the whole struct to 0 so that we are sure to catch errors.*/
- memset (&ddisp->updatable_menu_items, 0, sizeof (UpdatableMenuItems));
-
ddisp->diagram = dia;
/* Every display has it's own reference */
g_object_ref(dia);
@@ -1262,13 +1256,8 @@
if (ddisp == NULL) {
return;
}
- dia = ddisp->diagram;
- if (ddisp->menu_bar) {
- diagram_update_menubar_sensitivity(dia, &ddisp->updatable_menu_items);
- }
- else {
- diagram_update_popupmenu_sensitivity(dia);
- }
+ dia = ddisp->diagram;
+ diagram_update_menu_sensitivity (dia);
}
Modified: trunk/app/display.h
==============================================================================
--- trunk/app/display.h (original)
+++ trunk/app/display.h Sat Jan 31 14:46:25 2009
@@ -58,7 +58,6 @@
/* menu bar widgets */
GtkMenuItem *rulers;
- UpdatableMenuItems updatable_menu_items;
GtkWidget *zoom_status;
GtkWidget *grid_status;
Modified: trunk/app/interface.c
==============================================================================
--- trunk/app/interface.c (original)
+++ trunk/app/interface.c Sat Jan 31 14:46:25 2009
@@ -162,61 +162,61 @@
},
{ (char **) dia_zoom_tool_icon,
N_("Magnify"),
- "<shift><alt>M",
+ "M",
"ToolsMagnify",
{ MAGNIFY_TOOL, NULL, NULL}
},
{ (char **) dia_scroll_tool_icon,
N_("Scroll around the diagram"),
- "<shift><alt>S",
+ "S",
"ToolsScroll",
{ SCROLL_TOOL, NULL, NULL}
},
{ NULL,
N_("Text"),
- "<shift><alt>T",
+ "T",
"ToolsText",
{ CREATE_OBJECT_TOOL, "Standard - Text", NULL }
},
{ NULL,
N_("Box"),
- "<shift><alt>R",
+ "R",
"ToolsBox",
{ CREATE_OBJECT_TOOL, "Standard - Box", NULL }
},
{ NULL,
N_("Ellipse"),
- "<shift><alt>E",
+ "E",
"ToolsEllipse",
{ CREATE_OBJECT_TOOL, "Standard - Ellipse", NULL }
},
{ NULL,
N_("Polygon"),
- "<shift><alt>P",
+ "P",
"ToolsPolygon",
{ CREATE_OBJECT_TOOL, "Standard - Polygon", NULL }
},
{ NULL,
N_("Beziergon"),
- "<shift><alt>B",
+ "B",
"ToolsBeziergon",
{ CREATE_OBJECT_TOOL, "Standard - Beziergon", NULL }
},
{ NULL,
N_("Line"),
- "<shift><alt>L",
+ "L",
"ToolsLine",
{ CREATE_OBJECT_TOOL, "Standard - Line", NULL }
},
{ NULL,
N_("Arc"),
- "<shift><alt>A",
+ "A",
"ToolsArc",
{ CREATE_OBJECT_TOOL, "Standard - Arc", NULL }
},
{ NULL,
N_("Zigzagline"),
- "<shift><alt>Z",
+ "Z",
"ToolsZigzagline",
{ CREATE_OBJECT_TOOL, "Standard - ZigZagLine", NULL }
},
@@ -228,13 +228,13 @@
},
{ NULL,
N_("Bezierline"),
- "<shift><alt>C",
+ "C",
"ToolsBezierline",
{ CREATE_OBJECT_TOOL, "Standard - BezierLine", NULL }
},
{ NULL,
N_("Image"),
- "<shift><alt>I",
+ "I",
"ToolsImage",
{ CREATE_OBJECT_TOOL, "Standard - Image", NULL }
},
@@ -901,7 +901,6 @@
ddisp->menu_bar = menus_create_display_menubar (&ddisp->ui_manager, &ddisp->actions);
g_assert (ddisp->menu_bar);
gtk_box_pack_start (GTK_BOX (root_vbox), ddisp->menu_bar, FALSE, TRUE, 0);
- menus_initialize_updatable_items (&ddisp->updatable_menu_items, ddisp->actions);
}
/* the statusbars */
@@ -1713,8 +1712,6 @@
gnome_app_set_menus (GNOME_APP (window), GTK_MENU_BAR (menubar));
#else
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, TRUE, 0);
- /* TODO: integrated-UI --> Figure out how to deal with updateable menu items!!!
- menus_initialize_updatable_items (&ddisp->updatable_menu_items, ddisp->actions); */
gtk_widget_show (menubar);
#endif
Modified: trunk/app/menus.c
==============================================================================
--- trunk/app/menus.c (original)
+++ trunk/app/menus.c Sat Jan 31 14:46:25 2009
@@ -219,24 +219,24 @@
static const GtkActionEntry tool_entries[] =
{
{ "Tools", NULL, N_("_Tools"), NULL, NULL, NULL },
- { "ToolsModify", NULL, N_("Modify"), "<alt><shift>N", NULL, NULL },
- { "ToolsMagnify", NULL, N_("Magnify"), "<alt><shift>M", NULL, NULL },
+ { "ToolsModify", NULL, N_("Modify"), "N", NULL, NULL },
+ { "ToolsMagnify", NULL, N_("Magnify"), "M", NULL, NULL },
{ "ToolsTextedit", NULL, N_("Edit text"), "F2", NULL, NULL },
- { "ToolsScroll", NULL, N_("Scroll"), "<alt><shift>S", NULL, NULL },
- { "ToolsText", NULL, N_("Text"), "<alt><shift>T", NULL, NULL },
- { "ToolsBox", NULL, N_("Box"), "<alt><shift>R", NULL, NULL },
- { "ToolsEllipse", NULL, N_("Ellipse"), "<alt><shift>E", NULL, NULL },
- { "ToolsPolygon", NULL, N_("Polygon"), "<alt><shift>P", NULL, NULL },
- { "ToolsBeziergon", NULL, N_("Beziergon"), "<alt><shift>B", NULL, NULL },
-
- { "ToolsLine", NULL, N_("Line"), "<alt><shift>L", NULL, NULL },
- { "ToolsArc", NULL, N_("Arc"), "<alt><shift>A", NULL, NULL },
- { "ToolsZigzagline", NULL, N_("Zigzagline"), "<alt><shift>Z", NULL, NULL },
- { "ToolsPolyline", NULL, N_("Polyline"), "<alt><shift>Y", NULL },
- { "ToolsBezierline", NULL, N_("Bezierline"), "<alt><shift>C", NULL, NULL },
- { "ToolsOutline", NULL, N_("Outline"), "<alt><shift>O", NULL, NULL },
+ { "ToolsScroll", NULL, N_("Scroll"), "S", NULL, NULL },
+ { "ToolsText", NULL, N_("Text"), "T", NULL, NULL },
+ { "ToolsBox", NULL, N_("Box"), "R", NULL, NULL },
+ { "ToolsEllipse", NULL, N_("Ellipse"), "E", NULL, NULL },
+ { "ToolsPolygon", NULL, N_("Polygon"), "P", NULL, NULL },
+ { "ToolsBeziergon", NULL, N_("Beziergon"), "B", NULL, NULL },
+
+ { "ToolsLine", NULL, N_("Line"), "L", NULL, NULL },
+ { "ToolsArc", NULL, N_("Arc"), "A", NULL, NULL },
+ { "ToolsZigzagline", NULL, N_("Zigzagline"), "Z", NULL, NULL },
+ { "ToolsPolyline", NULL, N_("Polyline"), "Y", NULL },
+ { "ToolsBezierline", NULL, N_("Bezierline"), "C", NULL, NULL },
+ { "ToolsOutline", NULL, N_("Outline"), "O", NULL, NULL },
- { "ToolsImage", NULL, N_("Image"), "<alt><shift>I", NULL, NULL },
+ { "ToolsImage", NULL, N_("Image"), "I", NULL, NULL },
};
/* Toggle-Actions for diagram window */
@@ -1198,67 +1198,6 @@
}
}
-void
-menus_initialize_updatable_items (UpdatableMenuItems *items, GtkActionGroup *actions)
-{
- if (actions == NULL) {
- actions = display_actions;
- }
- items->undo = gtk_action_group_get_action (actions, "EditUndo");
- items->redo = gtk_action_group_get_action (actions, "EditRedo");
-
- items->copy = gtk_action_group_get_action (actions, "EditCopy");
- items->cut = gtk_action_group_get_action (actions, "EditCut");
- items->paste = gtk_action_group_get_action (actions, "EditPaste");
- items->edit_delete = gtk_action_group_get_action (actions, "EditDelete");
- items->edit_duplicate = gtk_action_group_get_action (actions, "EditDuplicate");
-
- items->copy_text = gtk_action_group_get_action (actions, "EditCopytext");
- items->cut_text = gtk_action_group_get_action (actions, "EditCuttext");
- items->paste_text = gtk_action_group_get_action (actions, "EditPastetext");
-
- items->send_to_back = gtk_action_group_get_action (actions, "ObjectsSendtoback");
- items->bring_to_front = gtk_action_group_get_action (actions, "ObjectsBringtofront");
- items->send_backwards = gtk_action_group_get_action (actions, "ObjectsSendbackwards");
- items->bring_forwards = gtk_action_group_get_action (actions, "ObjectsBringforwards");
-
- items->objects_layer_above = gtk_action_group_get_action (actions, "ObjectsLayerAbove");
- items->objects_layer_below = gtk_action_group_get_action (actions, "ObjectsLayerBelow");
-
- items->group = gtk_action_group_get_action (actions, "ObjectsGroup");
- items->ungroup = gtk_action_group_get_action (actions, "ObjectsUngroup");
-
- items->parent = gtk_action_group_get_action (actions, "ObjectsParent");
- items->unparent = gtk_action_group_get_action (actions, "ObjectsUnparent");
- items->unparent_children = gtk_action_group_get_action (actions, "ObjectsUnparentchildren");
-
- items->align_h_l = gtk_action_group_get_action (actions, "ObjectsAlignLeft");
- items->align_h_c = gtk_action_group_get_action (actions, "ObjectsAlignCenter");
- items->align_h_r = gtk_action_group_get_action (actions, "ObjectsAlignRight");
- items->align_h_e = gtk_action_group_get_action (actions, "ObjectsAlignSpreadouthorizontally");
- items->align_h_a = gtk_action_group_get_action (actions, "ObjectsAlignAdjacent");
- items->align_v_t = gtk_action_group_get_action (actions, "ObjectsAlignTop");
- items->align_v_c = gtk_action_group_get_action (actions, "ObjectsAlignMiddle");
- items->align_v_b = gtk_action_group_get_action (actions, "ObjectsAlignBottom");
- items->align_v_e = gtk_action_group_get_action (actions, "ObjectsAlignSpreadoutvertically");
- items->align_v_a = gtk_action_group_get_action (actions, "ObjectsAlignStacked");
-
- items->properties = gtk_action_group_get_action (actions, "ObjectsProperties");
-
- items->select_all = gtk_action_group_get_action (actions, "SelectAll");
- items->select_none = gtk_action_group_get_action (actions, "SelectNone");
- items->select_invert = gtk_action_group_get_action (actions, "SelectInvert");
- items->select_transitive = gtk_action_group_get_action (actions, "SelectTransitive");
- items->select_connected = gtk_action_group_get_action (actions, "SelectConnected");
- items->select_same_type = gtk_action_group_get_action (actions, "SelectSametype");
-
- items->select_replace = gtk_action_group_get_action (actions, "SelectReplace");
- items->select_union = gtk_action_group_get_action (actions, "SelectUnion");
- items->select_intersection = gtk_action_group_get_action (actions, "SelectIntersection");
- items->select_remove = gtk_action_group_get_action (actions, "SelectRemove");
- items->select_inverse = gtk_action_group_get_action (actions, "SelectInverse");
-}
-
static void
plugin_callback (GtkWidget *widget, gpointer data)
{
Modified: trunk/app/menus.h
==============================================================================
--- trunk/app/menus.h (original)
+++ trunk/app/menus.h Sat Jan 31 14:46:25 2009
@@ -29,66 +29,6 @@
extern const struct zoom_pair zooms[10];
-/* all the menu items that can be updated */
-struct _UpdatableMenuItems
-{
- GtkAction *undo;
- GtkAction *redo;
-
- GtkAction *copy;
- GtkAction *cut;
- GtkAction *paste;
- GtkAction *edit_delete;
- GtkAction *edit_duplicate;
- GtkAction *copy_text;
- GtkAction *cut_text;
- GtkAction *paste_text;
-
- GtkAction *send_to_back;
- GtkAction *bring_to_front;
- GtkAction *send_backwards;
- GtkAction *bring_forwards;
-
- GtkAction *objects_layer_above;
- GtkAction *objects_layer_below;
-
- GtkAction *group;
- GtkAction *ungroup;
-
- GtkAction *parent;
- GtkAction *unparent;
- GtkAction *unparent_children;
-
- GtkAction *align_h_l;
- GtkAction *align_h_c;
- GtkAction *align_h_r;
- GtkAction *align_h_e;
- GtkAction *align_h_a;
-
- GtkAction *align_v_t;
- GtkAction *align_v_c;
- GtkAction *align_v_b;
- GtkAction *align_v_e;
- GtkAction *align_v_a;
-
- GtkAction *properties;
-
- GtkAction *select_all;
- GtkAction *select_none;
- GtkAction *select_invert;
- GtkAction *select_transitive;
- GtkAction *select_connected;
- GtkAction *select_same_type;
-
- GtkAction *select_replace;
- GtkAction *select_union;
- GtkAction *select_intersection;
- GtkAction *select_remove;
- GtkAction *select_inverse;
-};
-
-typedef struct _UpdatableMenuItems UpdatableMenuItems;
-
void
integrated_ui_toolbar_set_zoom_text (GtkToolbar *toolbar, const gchar * text);
@@ -105,7 +45,6 @@
GtkWidget * menus_get_display_popup (void);
GtkAccelGroup * menus_get_display_accels (void);
GtkWidget * menus_create_display_menubar (GtkUIManager **ui_manager, GtkActionGroup **actions);
-void menus_initialize_updatable_items (UpdatableMenuItems *items, GtkActionGroup *actions);
GtkAccelGroup * menus_get_accel_group (void);
GtkActionGroup * menus_get_action_group (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]