[gedit/wip/browser-menu] Better handling of sensitivity
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/browser-menu] Better handling of sensitivity
- Date: Thu, 18 Apr 2013 16:43:32 +0000 (UTC)
commit aacea6f8652d0eccc15a18a407d84f4e387d2ebb
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu Apr 18 18:27:51 2013 +0200
Better handling of sensitivity
plugins/filebrowser/gedit-file-browser-widget.c | 44 +++++++++++++++++++++++++
1 file changed, 44 insertions(+)
---
diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c
index 0c6862e..b6ff32f 100644
--- a/plugins/filebrowser/gedit-file-browser-widget.c
+++ b/plugins/filebrowser/gedit-file-browser-widget.c
@@ -924,6 +924,7 @@ static void
gedit_file_browser_widget_init (GeditFileBrowserWidget *obj)
{
GtkBuilder *builder;
+ GAction *action;
GError *error = NULL;
obj->priv = GEDIT_FILE_BROWSER_WIDGET_GET_PRIVATE (obj);
@@ -958,6 +959,15 @@ gedit_file_browser_widget_init (GeditFileBrowserWidget *obj)
G_N_ELEMENTS (browser_entries),
obj);
+ /* set initial sensitivity */
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "previous_location");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "next_location");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
+
gtk_widget_insert_action_group (GTK_WIDGET (obj),
"browser",
G_ACTION_GROUP (obj->priv->action_group));
@@ -1048,6 +1058,23 @@ update_sensitivity (GeditFileBrowserWidget *obj)
g_action_change_state (action,
g_variant_new_boolean (!(mode &
GEDIT_FILE_BROWSER_STORE_FILTER_MODE_HIDE_HIDDEN)));
+
+ /* sensitivity */
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "up");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "show_hidden");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "show_binary");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "bookmark_open");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
}
else if (GEDIT_IS_FILE_BOOKMARKS_STORE (model))
{
@@ -1056,6 +1083,23 @@ update_sensitivity (GeditFileBrowserWidget *obj)
"show_hidden");
g_action_change_state (action, g_variant_new_boolean (FALSE));
+
+ /* sensitivity */
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "up");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "show_hidden");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "show_binary");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
+
+ action = g_simple_action_group_lookup (obj->priv->action_group,
+ "bookmark_open");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
}
on_selection_changed (gtk_tree_view_get_selection
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]