From b82c8da3f4ace3aa62097f2c3ea2b92c7d553191 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 19 Oct 2009 16:44:59 -0500 Subject: Creating a connected property to check easily. --- src/libcustomindicator/custom-indicator.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libcustomindicator') diff --git a/src/libcustomindicator/custom-indicator.c b/src/libcustomindicator/custom-indicator.c index 314493f..d59e1c5 100644 --- a/src/libcustomindicator/custom-indicator.c +++ b/src/libcustomindicator/custom-indicator.c @@ -38,7 +38,8 @@ enum { PROP_STATUS, PROP_ICON_NAME, PROP_ATTENTION_ICON_NAME, - PROP_MENU + PROP_MENU, + PROP_CONNECTED }; /* The strings so that they can be slowly looked up. */ @@ -48,6 +49,7 @@ enum { #define PROP_ICON_NAME_S "icon-name" #define PROP_ATTENTION_ICON_NAME_S "attention-icon-name" #define PROP_MENU_S "menu" +#define PROP_CONNECTED_S "connected" /* Private macro, shhhh! */ #define CUSTOM_INDICATOR_GET_PRIVATE(o) \ @@ -125,6 +127,14 @@ custom_indicator_class_init (CustomIndicatorClass *klass) DBUSMENU_TYPE_SERVER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property(object_class, PROP_CONNECTED, + g_param_spec_boolean(PROP_CONNECTED_S, + "Whether we're conneced to a watcher", + "Pretty simple, true if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so.", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /* Signals */ /** -- cgit v1.2.3