[frogr] Use GtkActionGroup to update sensitiveness in the toolbar and context menu
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Use GtkActionGroup to update sensitiveness in the toolbar and context menu
- Date: Tue, 27 Nov 2012 10:49:52 +0000 (UTC)
commit 1ad4864540b57748dcf1c98d1cc3a5142ad5eccb
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Sun Nov 25 09:57:08 2012 +0100
Use GtkActionGroup to update sensitiveness in the toolbar and context menu
data/gtkbuilder/frogr-main-view.xml | 196 +++++++++++++++++++++--------------
src/frogr-main-view.c | 108 +++++++------------
2 files changed, 161 insertions(+), 143 deletions(-)
---
diff --git a/data/gtkbuilder/frogr-main-view.xml b/data/gtkbuilder/frogr-main-view.xml
index e9d458d..d4a4d42 100644
--- a/data/gtkbuilder/frogr-main-view.xml
+++ b/data/gtkbuilder/frogr-main-view.xml
@@ -1,95 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
- <object class="GtkAction" id="open-project">
- <property name="label" translatable="yes">_Open Projectâ</property>
- <property name="stock_id">gtk-open</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="save-project">
- <property name="label" translatable="yes">_Save Project</property>
- <property name="stock_id">gtk-save</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="save-project-as">
- <property name="label" translatable="yes">Save Project _Asâ</property>
- <property name="stock_id">gtk-save-as</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="load-pictures">
- <property name="label" translatable="yes">_Load Picturesâ</property>
- <property name="stock_id">gtk-add</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="add-tags">
- <property name="label" translatable="yes">Add _Tagsâ</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="add-to-group">
- <property name="label" translatable="yes">Add to _Groupâ</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="add-to-new-set">
- <property name="label" translatable="yes">_Create New Setâ</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="add-to-set">
- <property name="label" translatable="yes">Add to _Existing Setâ</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="edit-details">
- <property name="label" translatable="yes">Edit _Detailsâ</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
- </object>
- <object class="GtkAction" id="open-in-external-viewer">
- <property name="label" translatable="yes">Open in E_xternal Viewer</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ <requires lib="gtk+" version="2.24"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkActionGroup" id="file-actions">
+ <child>
+ <object class="GtkAction" id="open-project">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="save-project">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="save-project-as">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="load-pictures">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
</object>
- <object class="GtkAction" id="remove-pictures">
- <property name="label" translatable="yes">_Remove Pictures</property>
- <property name="stock_id">gtk-remove</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ <object class="GtkActionGroup" id="pictures-actions">
+ <child>
+ <object class="GtkAction" id="upload-all">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
</object>
- <object class="GtkAction" id="upload-all">
- <property name="label" translatable="yes">_Upload All</property>
- <property name="stock_id">gtk-go-up</property>
- <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ <object class="GtkActionGroup" id="selection-actions">
+ <child>
+ <object class="GtkAction" id="add-tags">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="add-to-group">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="add-to-new-set">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="add-to-set">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="edit-details">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="open-in-external-viewer">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkAction" id="remove-pictures">
+ <signal name="activate" handler="_on_gtk_action_activated" swapped="no"/>
+ </object>
+ </child>
</object>
<object class="GtkMenu" id="ctxt_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="edit_details_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">edit-details</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">edit-details</property>
+ <property name="label" translatable="yes">Edit _Detailsâ</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="add_tags_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">add-tags</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">add-tags</property>
<property name="label" translatable="yes">Add _Tagsâ</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="add_to_group_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">add-to-group</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">add-to-group</property>
- <property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Add to _Groupâ</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="add_to_set_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Add to _Set</property>
<property name="use_underline">True</property>
<child type="submenu">
@@ -98,18 +114,22 @@
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="create_new_set_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">add-to-new-set</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">add-to-new-set</property>
<property name="label" translatable="yes">_Create New Setâ</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="add_to_existing_set_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">add-to-set</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">add-to-set</property>
+ <property name="label" translatable="yes">Add to _Existing Setâ</property>
+ <property name="use_underline">True</property>
</object>
</child>
</object>
@@ -118,30 +138,36 @@
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separator1">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="open_in_external_viewer_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">open-in-external-viewer</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">open-in-external-viewer</property>
+ <property name="label" translatable="yes">Open in E_xternal Viewer</property>
+ <property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="menuitem7">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="remove_pictures_ctxt_menu_item">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">remove-pictures</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">remove-pictures</property>
+ <property name="label" translatable="yes">_Remove Pictures</property>
+ <property name="use_underline">True</property>
</object>
</child>
</object>
@@ -154,11 +180,13 @@
<property name="can_focus">False</property>
<child>
<object class="GtkToolButton" id="open_project_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">open-project</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">open-project</property>
<property name="label" translatable="yes">Open Project</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-open</property>
</object>
<packing>
<property name="expand">False</property>
@@ -167,11 +195,13 @@
</child>
<child>
<object class="GtkToolButton" id="save_project_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">save-project</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">save-project</property>
<property name="label" translatable="yes">Save Project</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-save</property>
</object>
<packing>
<property name="expand">False</property>
@@ -180,11 +210,13 @@
</child>
<child>
<object class="GtkToolButton" id="save_project_as_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">save-project-as</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">save-project-as</property>
<property name="label" translatable="yes">Save Project Asâ</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-save-as</property>
</object>
<packing>
<property name="expand">False</property>
@@ -193,18 +225,23 @@
</child>
<child>
<object class="GtkSeparatorToolItem" id="separator10">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
</child>
<child>
<object class="GtkToolButton" id="add_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">load-pictures</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">load-pictures</property>
- <property name="label" translatable="yes">Add</property>
+ <property name="label" translatable="yes">Load Pictures</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-add</property>
</object>
<packing>
<property name="expand">False</property>
@@ -213,11 +250,13 @@
</child>
<child>
<object class="GtkToolButton" id="remove_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">remove-pictures</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">remove-pictures</property>
- <property name="label" translatable="yes">Remove</property>
+ <property name="label" translatable="yes">Remove Pictures</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-remove</property>
</object>
<packing>
<property name="expand">False</property>
@@ -226,18 +265,23 @@
</child>
<child>
<object class="GtkSeparatorToolItem" id="separator11">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
</child>
<child>
<object class="GtkToolButton" id="upload_button">
+ <property name="use_action_appearance">False</property>
+ <property name="related_action">upload-all</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="related_action">upload-all</property>
- <property name="label" translatable="yes">Upload</property>
+ <property name="label" translatable="yes">Upload All</property>
<property name="use_underline">True</property>
+ <property name="stock_id">gtk-go-up</property>
</object>
<packing>
<property name="expand">False</property>
@@ -255,9 +299,9 @@
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
- <property name="hscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
<child>
<object class="GtkIconView" id="icon_view">
<property name="visible">True</property>
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 45597d8..7cd75be 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -124,18 +124,9 @@ typedef struct _FrogrMainViewPrivate {
GtkBuilder *builder;
/* For the toolbar and the contextual menu */
- GtkAction *open_project_action;
- GtkAction *save_project_action;
- GtkAction *save_project_as_action;
- GtkAction *load_pictures_action;
- GtkAction *remove_pictures_action;
- GtkAction *upload_pictures_action;
- GtkAction *open_in_external_viewer_action;
- GtkAction *add_tags_action;
- GtkAction *edit_details_action;
- GtkAction *add_to_group_action;
- GtkAction *add_to_new_set_action;
- GtkAction *add_to_set_action;
+ GtkActionGroup *file_actions;
+ GtkActionGroup *pictures_actions;
+ GtkActionGroup *selection_actions;
} FrogrMainViewPrivate;
@@ -281,7 +272,6 @@ static gchar *_craft_state_description (FrogrMainView *mainview);
static void _update_sensitiveness (FrogrMainView *self);
static void _update_sensitiveness_for_action (FrogrMainView *self,
const gchar *name,
- GtkAction *gtk_action,
gboolean value);
static void _update_ui (FrogrMainView *self);
@@ -413,31 +403,10 @@ _initialize_ui (FrogrMainView *self)
status_bar = GTK_WIDGET (gtk_builder_get_object (builder, "status_bar"));
priv->status_bar = status_bar;
- /* Get actions from GtkBuilder for the toolbar and the context menu */
- priv->open_project_action =
- GTK_ACTION (gtk_builder_get_object (builder, "open-project"));
- priv->save_project_action =
- GTK_ACTION (gtk_builder_get_object (builder, "save-project"));
- priv->save_project_as_action =
- GTK_ACTION (gtk_builder_get_object (builder, "save-project-as"));
- priv->load_pictures_action =
- GTK_ACTION (gtk_builder_get_object (builder, "load-pictures"));
- priv->remove_pictures_action =
- GTK_ACTION (gtk_builder_get_object (builder, "remove-pictures"));
- priv->upload_pictures_action =
- GTK_ACTION (gtk_builder_get_object (builder, "upload_all"));
- priv->open_in_external_viewer_action =
- GTK_ACTION (gtk_builder_get_object (builder, "open-in-external-viewer"));
- priv->add_tags_action =
- GTK_ACTION (gtk_builder_get_object (builder, "add-tags"));
- priv->edit_details_action =
- GTK_ACTION (gtk_builder_get_object (builder, "edit-details"));
- priv->add_to_group_action =
- GTK_ACTION (gtk_builder_get_object (builder, "add-to-group"));
- priv->add_to_set_action =
- GTK_ACTION (gtk_builder_get_object (builder, "add-to-set"));
- priv->add_to_new_set_action =
- GTK_ACTION (gtk_builder_get_object (builder, "add-to-new-set"));
+ /* Get action groups from GtkBuilder for the toolbar and the context menu */
+ priv->file_actions = GTK_ACTION_GROUP (gtk_builder_get_object (builder, "file-actions"));
+ priv->pictures_actions = GTK_ACTION_GROUP (gtk_builder_get_object (builder, "pictures-actions"));
+ priv->selection_actions = GTK_ACTION_GROUP (gtk_builder_get_object (builder, "selection-actions"));
/* Init main model's state description */
_update_state_description (self);
@@ -2119,18 +2088,23 @@ _update_sensitiveness (FrogrMainView *self)
{
case FROGR_STATE_LOADING_PICTURES:
case FROGR_STATE_UPLOADING_PICTURES:
- _update_sensitiveness_for_action (self, ACTION_OPEN_PROJECT, priv->open_project_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT, priv->save_project_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT_AS, priv->save_project_as_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_LOAD_PICTURES, priv->load_pictures_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_REMOVE_PICTURES, priv->remove_pictures_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_UPLOAD_ALL, priv->upload_pictures_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_OPEN_IN_EXTERNAL_VIEWER, priv->open_in_external_viewer_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_ADD_TAGS, priv->add_tags_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_EDIT_DETAILS, priv->edit_details_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_GROUP, priv->add_to_group_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_SET, priv->add_to_set_action, FALSE);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_NEW_SET, priv->add_to_new_set_action, FALSE);
+
+ gtk_action_group_set_sensitive (priv->file_actions, FALSE);
+ gtk_action_group_set_sensitive (priv->pictures_actions, FALSE);
+ gtk_action_group_set_sensitive (priv->selection_actions, FALSE);
+
+ _update_sensitiveness_for_action (self, ACTION_OPEN_PROJECT, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT_AS, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_LOAD_PICTURES, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_REMOVE_PICTURES, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_UPLOAD_ALL, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_OPEN_IN_EXTERNAL_VIEWER, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TAGS, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_EDIT_DETAILS, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_GROUP, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_SET, FALSE);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_NEW_SET, FALSE);
/* gtk_widget_set_sensitive (priv->accounts_menu_item, FALSE); */
break;
@@ -2139,18 +2113,22 @@ _update_sensitiveness (FrogrMainView *self)
has_pics = (_n_pictures (self) > 0);
n_selected_pics = priv->n_selected_pictures;
- _update_sensitiveness_for_action (self, ACTION_OPEN_PROJECT, priv->open_project_action, TRUE);
- _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT, priv->save_project_action, TRUE);
- _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT_AS, priv->save_project_action, TRUE);
- _update_sensitiveness_for_action (self, ACTION_LOAD_PICTURES, priv->load_pictures_action, TRUE);
- _update_sensitiveness_for_action (self, ACTION_UPLOAD_ALL, priv->upload_pictures_action, has_pics);
- _update_sensitiveness_for_action (self, ACTION_REMOVE_PICTURES, priv->remove_pictures_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_OPEN_IN_EXTERNAL_VIEWER, priv->open_in_external_viewer_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_ADD_TAGS, priv->add_tags_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_EDIT_DETAILS, priv->edit_details_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_GROUP, priv->add_to_group_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_SET, priv->add_to_set_action, n_selected_pics);
- _update_sensitiveness_for_action (self, ACTION_ADD_TO_NEW_SET, priv->add_to_new_set_action, n_selected_pics);
+ gtk_action_group_set_sensitive (priv->file_actions, TRUE);
+ gtk_action_group_set_sensitive (priv->pictures_actions, has_pics);
+ gtk_action_group_set_sensitive (priv->selection_actions, n_selected_pics);
+
+ _update_sensitiveness_for_action (self, ACTION_OPEN_PROJECT, TRUE);
+ _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT, TRUE);
+ _update_sensitiveness_for_action (self, ACTION_SAVE_PROJECT_AS, TRUE);
+ _update_sensitiveness_for_action (self, ACTION_LOAD_PICTURES, TRUE);
+ _update_sensitiveness_for_action (self, ACTION_UPLOAD_ALL, has_pics);
+ _update_sensitiveness_for_action (self, ACTION_REMOVE_PICTURES, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_OPEN_IN_EXTERNAL_VIEWER, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TAGS, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_EDIT_DETAILS, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_GROUP, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_SET, n_selected_pics);
+ _update_sensitiveness_for_action (self, ACTION_ADD_TO_NEW_SET, n_selected_pics);
/* gtk_widget_set_sensitive (priv->accounts_menu_item, has_accounts); */
break;
@@ -2160,15 +2138,11 @@ _update_sensitiveness (FrogrMainView *self)
}
static void
-_update_sensitiveness_for_action (FrogrMainView *self, const gchar *name, GtkAction *gtk_action, gboolean value)
+_update_sensitiveness_for_action (FrogrMainView *self, const gchar *name, gboolean value)
{
GAction *action = NULL;
-
action = g_action_map_lookup_action (G_ACTION_MAP (self), name);
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), value);
-
- if (gtk_action)
- gtk_action_set_sensitive (gtk_action, value);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]