Make this public again, since it's occasionally useful. (#121128, Marco

2003-09-01  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
	this public again, since it's occasionally useful.  (#121128,
	Marco Pesenti Gritti)

	* gtk/gtkaction.c: Add an "is_important" property and propagate
	it to toolitem proxies.  (#121058, Marco Pesenti Gritti)
This commit is contained in:
Matthias Clasen 2003-08-31 23:36:37 +00:00 committed by Matthias Clasen
parent 53257cbd27
commit 7cddc693b0
10 changed files with 106 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
this public again, since it's occasionally useful. (#121128,
Marco Pesenti Gritti)
* gtk/gtkaction.c: Add an "is_important" property and propagate
it to toolitem proxies. (#121058, Marco Pesenti Gritti)
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the

View File

@ -1,3 +1,12 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
this public again, since it's occasionally useful. (#121128,
Marco Pesenti Gritti)
* gtk/gtkaction.c: Add an "is_important" property and propagate
it to toolitem proxies. (#121058, Marco Pesenti Gritti)
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the

View File

@ -1,3 +1,12 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
this public again, since it's occasionally useful. (#121128,
Marco Pesenti Gritti)
* gtk/gtkaction.c: Add an "is_important" property and propagate
it to toolitem proxies. (#121058, Marco Pesenti Gritti)
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the

View File

@ -1,3 +1,12 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
this public again, since it's occasionally useful. (#121128,
Marco Pesenti Gritti)
* gtk/gtkaction.c: Add an "is_important" property and propagate
it to toolitem proxies. (#121058, Marco Pesenti Gritti)
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the

View File

@ -1,3 +1,12 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkuimanager.[ch] (gtk_ui_manager_ensure_update): Make
this public again, since it's occasionally useful. (#121128,
Marco Pesenti Gritti)
* gtk/gtkaction.c: Add an "is_important" property and propagate
it to toolitem proxies. (#121058, Marco Pesenti Gritti)
Mon Sep 1 00:32:30 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* tests/testtoolbar.c (main): connect to "delete_event" so the

View File

@ -1,3 +1,7 @@
2003-09-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtk-sections.txt: Add gtk_ui_manager_ensure_update.
2003-08-31 Matthias Clasen <maclas@gmx.de>
* gtk/Makefile.am (IGNORE_HFILES): Add gtktoggleactionprivate.h

View File

@ -1735,6 +1735,7 @@ gtk_ui_manager_add_ui_from_string
gtk_ui_manager_add_ui_from_file
gtk_ui_manager_remove_ui
gtk_ui_manager_get_ui
gtk_ui_manager_ensure_update
<SUBSECTION Standard>
GTK_TYPE_UI_MANAGER
GTK_UI_MANAGER

View File

@ -51,10 +51,11 @@ struct _GtkActionPrivate
gchar *tooltip;
gchar *stock_id; /* icon */
guint sensitive : 1;
guint visible : 1;
guint label_set : 1; /* these two used so we can set label */
guint sensitive : 1;
guint visible : 1;
guint label_set : 1; /* these two used so we can set label */
guint short_label_set : 1; /* based on stock id */
guint is_important : 1;
/* accelerator */
GQuark accel_quark;
@ -77,6 +78,7 @@ enum
PROP_SHORT_LABEL,
PROP_TOOLTIP,
PROP_STOCK_ID,
PROP_IS_IMPORTANT,
PROP_SENSITIVE,
PROP_VISIBLE,
};
@ -196,6 +198,13 @@ gtk_action_class_init (GtkActionClass *klass)
_("The stock icon displayed in widgets representing this action."),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_IS_IMPORTANT,
g_param_spec_boolean ("is_important",
_("Is important"),
_("Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode"),
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SENSITIVE,
g_param_spec_boolean ("sensitive",
@ -203,7 +212,6 @@ gtk_action_class_init (GtkActionClass *klass)
_("Whether the action is enabled."),
TRUE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
@ -212,6 +220,7 @@ gtk_action_class_init (GtkActionClass *klass)
TRUE,
G_PARAM_READWRITE));
/**
* GtkAction::activate:
* @action: the #GtkAction
@ -242,6 +251,7 @@ gtk_action_init (GtkAction *action)
action->private_data->short_label = NULL;
action->private_data->tooltip = NULL;
action->private_data->stock_id = NULL;
action->private_data->is_important = FALSE;
action->private_data->sensitive = TRUE;
action->private_data->visible = TRUE;
@ -348,6 +358,9 @@ gtk_action_set_property (GObject *object,
g_object_notify (object, "short_label");
}
break;
case PROP_IS_IMPORTANT:
action->private_data->is_important = g_value_get_boolean (value);
break;
case PROP_SENSITIVE:
action->private_data->sensitive = g_value_get_boolean (value);
break;
@ -387,6 +400,9 @@ gtk_action_get_property (GObject *object,
case PROP_STOCK_ID:
g_value_set_string (value, action->private_data->stock_id);
break;
case PROP_IS_IMPORTANT:
g_value_set_boolean (value, action->private_data->is_important);
break;
case PROP_SENSITIVE:
g_value_set_boolean (value, action->private_data->sensitive);
break;
@ -593,18 +609,21 @@ connect_proxy (GtkAction *action,
{
/* toolbar button specific synchronisers ... */
/* synchronise the label */
g_object_set (G_OBJECT (proxy),
"label", action->private_data->short_label,
"use_underline", TRUE,
"stock_id", action->private_data->stock_id,
"is_important", action->private_data->is_important,
NULL);
g_signal_connect_object (action, "notify::short_label",
G_CALLBACK (gtk_action_sync_short_label),
proxy, 0);
g_object_set (G_OBJECT (proxy), "stock_id", action->private_data->stock_id, NULL);
proxy, 0);
g_signal_connect_object (action, "notify::stock_id",
G_CALLBACK (gtk_action_sync_property), proxy, 0);
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (action, "notify::is_important",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
g_signal_connect_object (proxy, "create_menu_proxy",
G_CALLBACK (gtk_action_create_menu_proxy),

View File

@ -134,7 +134,6 @@ static void gtk_ui_manager_node_prepend_ui_reference (GtkUIManagerNode *node,
GQuark action_quark);
static void gtk_ui_manager_node_remove_ui_reference (GtkUIManagerNode *node,
guint merge_id);
static void gtk_ui_manager_ensure_update (GtkUIManager *self);
enum
@ -1794,7 +1793,32 @@ gtk_ui_manager_queue_update (GtkUIManager *self)
self->private_data->update_tag = g_idle_add ((GSourceFunc)do_updates, self);
}
static void
/**
* gtk_ui_manager_ensure_update:
* @self: a #GtkUIManager
*
* Makes sure that all pending updates to the UI have been completed.
*
* This may occasionally be necessary, since #GtkUIManager updates the
* UI in an idle function. A typical example where this function is
* useful is to enforce that the menubar and toolbar have been added to
* the main window before showing it:
* <informalexample>
* <programlisting>
* gtk_container_add (GTK_CONTAINER (window), vbox);
* g_signal_connect (merge, "add_widget",
* G_CALLBACK (add_widget), vbox);
* gtk_ui_manager_add_ui_from_file (merge, "my-menus");
* gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
* gtk_ui_manager_ensure_update (merge);
* gtk_widget_show (window);
* </programlisting>
* </informalexample>
*
* Since: 2.4
**/
void
gtk_ui_manager_ensure_update (GtkUIManager *self)
{
if (self->private_data->update_tag != 0)

View File

@ -79,8 +79,6 @@ void gtk_ui_manager_set_add_tearoffs (GtkUIManager *self,
gboolean add_tearoffs);
gboolean gtk_ui_manager_get_add_tearoffs (GtkUIManager *self);
/* these two functions will dirty all merge nodes, as they may need to
* be connected up to different actions */
void gtk_ui_manager_insert_action_group (GtkUIManager *self,
GtkActionGroup *action_group,
gint pos);
@ -109,4 +107,6 @@ void gtk_ui_manager_remove_ui (GtkUIManager *self,
gchar *gtk_ui_manager_get_ui (GtkUIManager *self);
void gtk_ui_manager_ensure_update (GtkUIManager *self);
#endif /* __GTK_UI_MANAGER_H__ */