aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-05-31 18:50:09 -0400
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-05-31 18:50:09 -0400
commit03dc54fbc259422813dc790c1d7f39757cb9b7ec (patch)
treeacbb6ffb8bc609b15fe50c179ec61dcdab3e5e22 /src
parentcb6475e58a7af64db828471962d2400cda841395 (diff)
downloadayatana-ido-03dc54fbc259422813dc790c1d7f39757cb9b7ec.tar.gz
ayatana-ido-03dc54fbc259422813dc790c1d7f39757cb9b7ec.tar.bz2
ayatana-ido-03dc54fbc259422813dc790c1d7f39757cb9b7ec.zip
Add ido_action_helper_change_state
Diffstat (limited to 'src')
-rw-r--r--src/idoactionhelper.c25
-rw-r--r--src/idoactionhelper.h3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/idoactionhelper.c b/src/idoactionhelper.c
index fdd9479..f0e300b 100644
--- a/src/idoactionhelper.c
+++ b/src/idoactionhelper.c
@@ -401,3 +401,28 @@ ido_action_helper_activate (IdoActionHelper *helper)
if (helper->actions && helper->action_name)
g_action_group_activate_action (helper->actions, helper->action_name, helper->action_target);
}
+
+/**
+ * ido_action_helper_change_action_state:
+ * @helper: an #IdoActionHelper
+ * @state: the proposed new state of the action
+ *
+ * Requests changing the state of the action that is associated with
+ * @helper to @state.
+ *
+ * If @state is floating, it is consumed.
+ */
+void
+ido_action_helper_change_action_state (IdoActionHelper *helper,
+ GVariant *state)
+{
+ g_return_if_fail (IDO_IS_ACTION_HELPER (helper));
+ g_return_if_fail (state != NULL);
+
+ g_variant_ref_sink (state);
+
+ if (helper->actions && helper->action_name)
+ g_action_group_change_action_state (helper->actions, helper->action_name, state);
+
+ g_variant_unref (state);
+}
diff --git a/src/idoactionhelper.h b/src/idoactionhelper.h
index 22cdcae..27dafb7 100644
--- a/src/idoactionhelper.h
+++ b/src/idoactionhelper.h
@@ -41,4 +41,7 @@ GVariant * ido_action_helper_get_action_target (IdoActionHelper *helper
void ido_action_helper_activate (IdoActionHelper *helper);
+void ido_action_helper_change_action_state (IdoActionHelper *helper,
+ GVariant *state);
+
#endif