summaryrefslogtreecommitdiff
path: root/gtk/gtkcheckmenuitem.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <william.jon.mccann@gmail.com>2013-06-28 11:27:19 -0400
committerWilliam Jon McCann <william.jon.mccann@gmail.com>2013-06-30 11:19:50 -0400
commitc96a1c49802468bd0c7b7ad44782e864bdaaf430 (patch)
tree13f309f9c852b765f7e144146a7db20bcd060b50 /gtk/gtkcheckmenuitem.c
parent32ce8fa60ab1973f7003162ddf321fcb1d5d3b92 (diff)
downloadgtk+-c96a1c49802468bd0c7b7ad44782e864bdaaf430.tar.gz
Deprecate GtkAction and GtkUIManager
It is recommended to use GAction et al and GtkBuilder.
Diffstat (limited to 'gtk/gtkcheckmenuitem.c')
-rw-r--r--gtk/gtkcheckmenuitem.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index 4198660135..64167a0284 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -95,9 +95,11 @@ static void gtk_check_menu_item_sync_action_properties (GtkActivatable
static GtkActivatableIface *parent_activatable_iface;
static guint check_menu_item_signals[LAST_SIGNAL] = { 0 };
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_ITEM,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
gtk_check_menu_item_activatable_interface_init))
+G_GNUC_END_IGNORE_DEPRECATIONS;
static void
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
@@ -192,11 +194,14 @@ gtk_check_menu_item_update (GtkActivatable *activatable,
const gchar *property_name)
{
GtkCheckMenuItem *check_menu_item;
+ gboolean use_action_appearance;
check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
parent_activatable_iface->update (activatable, action, property_name);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (strcmp (property_name, "active") == 0)
{
gtk_action_block_activate (action);
@@ -204,12 +209,19 @@ gtk_check_menu_item_update (GtkActivatable *activatable,
gtk_action_unblock_activate (action);
}
- if (!gtk_activatable_get_use_action_appearance (activatable))
+ use_action_appearance = gtk_activatable_get_use_action_appearance (activatable);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ if (!use_action_appearance)
return;
if (strcmp (property_name, "draw-as-radio") == 0)
- gtk_check_menu_item_set_draw_as_radio (check_menu_item,
- gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
+ {
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ gtk_check_menu_item_set_draw_as_radio (check_menu_item,
+ gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ }
}
static void
@@ -217,23 +229,35 @@ gtk_check_menu_item_sync_action_properties (GtkActivatable *activatable,
GtkAction *action)
{
GtkCheckMenuItem *check_menu_item;
+ gboolean use_action_appearance;
+ gboolean is_toggle_action;
check_menu_item = GTK_CHECK_MENU_ITEM (activatable);
parent_activatable_iface->sync_action_properties (activatable, action);
- if (!GTK_IS_TOGGLE_ACTION (action))
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ is_toggle_action = GTK_IS_TOGGLE_ACTION (action);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ if (!is_toggle_action)
return;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_action_block_activate (action);
+
gtk_check_menu_item_set_active (check_menu_item, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
gtk_action_unblock_activate (action);
-
- if (!gtk_activatable_get_use_action_appearance (activatable))
+ use_action_appearance = gtk_activatable_get_use_action_appearance (activatable);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ if (!use_action_appearance)
return;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_check_menu_item_set_draw_as_radio (check_menu_item,
gtk_toggle_action_get_draw_as_radio (GTK_TOGGLE_ACTION (action)));
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
/**