Commit 6ba04830 authored by Tristan Van Berkom's avatar Tristan Van Berkom

- added a general launch_editor action signal handler. - hooked the


	* plugins/gtk+/glade-gtk.c:
	    - added a general launch_editor action signal handler.
	    - hooked the launch_editor action signal in the GtkMenuItem post_create function.
	    - hooked the launch_editor action signal in the GtkMenuBar post_create function.
	    - created a GtkMenu post_create function containing a hook for the launch_editor
	      action signal.
	  (bug 433055)

	* plugins/gtk+/gtk+.xml.in: 
	    - Added "launch_editor" action to GtkMenuItem.
	    - Added "launch_editor" action to GtkMenuBar.
	    - Added "launch_editor" action and post_create function to GtkMenu.
	  (bug 433055)


svn path=/trunk/; revision=1284
parent ca8fcea8
2007-04-26 Jeff Westerinen <jeff.westerinen@access-company.com>
* plugins/gtk+/glade-gtk.c:
- added a general launch_editor action signal handler.
- hooked the launch_editor action signal in the GtkMenuItem post_create function.
- hooked the launch_editor action signal in the GtkMenuBar post_create function.
- created a GtkMenu post_create function containing a hook for the launch_editor
action signal.
(bug 433055)
* plugins/gtk+/gtk+.xml.in:
- Added "launch_editor" action to GtkMenuItem.
- Added "launch_editor" action to GtkMenuBar.
- Added "launch_editor" action and post_create function to GtkMenu.
(bug 433055)
2007-04-29 Vincent Geddes <vincent.geddes@gmail.com>
* gladeui/glade-palette.c: Override GtkWidget::show_all to ensure
......
......@@ -3883,6 +3883,15 @@ glade_gtk_image_set_property (GladeWidgetAdaptor *adaptor,
id, value);
}
/* ----------------------------- menu callbacks ------------------------------ */
static gboolean
glade_gtk_menu_launch_editor_action (GladeWidget *gwidget, const gchar *data)
{
glade_widget_launch_editor (gwidget);
return TRUE;
}
/* ----------------------------- GtkMenuShell ------------------------------ */
void
glade_gtk_menu_shell_add_item (GladeWidgetAdaptor *adaptor,
......@@ -4266,6 +4275,9 @@ glade_gtk_menu_item_post_create (GladeWidgetAdaptor *adaptor,
gitem = glade_widget_get_from_gobject (object);
g_return_if_fail (GLADE_IS_WIDGET (gitem));
/* hook the launch_editor action signal for all items */
g_signal_connect (gitem, "action-activated::launch_editor", G_CALLBACK (glade_gtk_menu_launch_editor_action), NULL);
if (GTK_IS_SEPARATOR_MENU_ITEM (object)) return;
if (gtk_bin_get_child (GTK_BIN (object)) == NULL)
......@@ -4761,12 +4773,15 @@ glade_gtk_menu_bar_post_create (GladeWidgetAdaptor *adaptor,
GladeProject *project;
GladeWidget *gmenubar, *gitem, *gsubmenu;
if (reason != GLADE_CREATE_USER) return;
g_return_if_fail (GTK_IS_MENU_BAR (object));
gmenubar = glade_widget_get_from_gobject (object);
g_return_if_fail (GLADE_IS_WIDGET (gmenubar));
/* hook the launch_editor action signal for all reasons */
g_signal_connect (gmenubar, "action-activated::launch_editor", G_CALLBACK (glade_gtk_menu_launch_editor_action), NULL);
if (reason != GLADE_CREATE_USER) return;
project = glade_widget_get_project (gmenubar);
/* File */
......@@ -4809,6 +4824,22 @@ glade_gtk_menu_launch_editor (GladeWidgetAdaptor *adaptor, GObject *menu)
glade_gtk_menu_shell_launch_editor (menu, _("Menu Editor"));
}
void
glade_gtk_menu_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
GladeWidget *gmenu;
g_return_if_fail (GTK_IS_MENU (object));
gmenu = glade_widget_get_from_gobject (object);
g_return_if_fail (GLADE_IS_WIDGET (gmenu));
/* hook the launch_editor action signal for all reasons */
g_signal_connect (gmenu, "action-activated::launch_editor", G_CALLBACK (glade_gtk_menu_launch_editor_action), NULL);
}
/* ----------------------------- GtkToolBar ------------------------------ */
void
glade_gtk_toolbar_get_child_property (GladeWidgetAdaptor *adaptor,
......
......@@ -301,6 +301,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item" use-placeholders="False">
<action id="launch_editor" _name="Edit Menu Bar" stock="gtk-edit"/>
<post-create-function>glade_gtk_menu_item_post_create</post-create-function>
<get-children-function>glade_gtk_menu_item_get_children</get-children-function>
<set-property-function>glade_gtk_menu_item_set_property</set-property-function>
......@@ -364,6 +365,7 @@ embedded in another object</_tooltip>
</glade-widget-class>
<glade-widget-class name="GtkMenuBar" generic-name="menubar" _title="Menu Bar">
<action id="launch_editor" _name="Edit Menu Bar" stock="gtk-edit"/>
<post-create-function>glade_gtk_menu_bar_post_create</post-create-function>
<launch-editor-function>glade_gtk_menu_bar_launch_editor</launch-editor-function>
<!-- menubar is a container you can't add placeholders to it -->
......@@ -1019,8 +1021,9 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkCalendar" generic-name="calendar" _title="Calendar"/>
<glade-widget-class name="GtkMenu" generic-name="menu" _title="Popup Menu" toplevel="True">
<action id="launch_editor" _name="Edit Menu" stock="gtk-edit"/>
<!-- We do not want glade_gtk_container_post_create be executed -->
<post-create-function>empty</post-create-function>
<post-create-function>glade_gtk_menu_post_create</post-create-function>
<launch-editor-function>glade_gtk_menu_launch_editor</launch-editor-function>
</glade-widget-class>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment