[gtk+/wip/gapplication-2-22] Monitor sensitivity propery
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/gapplication-2-22] Monitor sensitivity propery
- Date: Thu, 20 May 2010 21:20:22 +0000 (UTC)
commit 06f01fae45de46f9cf4a4349512fdf6347754528
Author: Colin Walters <walters verbum org>
Date: Thu May 20 17:13:19 2010 -0400
Monitor sensitivity propery
gtk/gtkapplication.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 3edc4cd..36cc76d 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -107,6 +107,17 @@ gtk_application_new (int *argc,
return g_object_new (GTK_TYPE_APPLICATION, "appid", appid, NULL);
}
+static void
+on_action_sensitive (GtkAction *action,
+ GParamSpec *pspec,
+ GtkApplication *app)
+{
+
+ g_application_set_action_enabled (G_APPLICATION (app),
+ gtk_action_get_name (action),
+ gtk_action_get_sensitive (action));
+}
+
/**
* gtk_application_set_main_action_group:
* @app: A #GtkApplication
@@ -142,6 +153,7 @@ gtk_application_set_main_action_group (GtkApplication *app,
g_application_add_action (G_APPLICATION (app),
gtk_action_get_name (action),
gtk_action_get_tooltip (action));
+ g_signal_connect (action, "notify::sensitive", G_CALLBACK (on_action_sensitive), app);
}
g_list_free (actions);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]