aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-03 14:47:42 -0500
committerTed Gould <ted@gould.cx>2010-08-03 14:47:42 -0500
commite541156e92220917a58ff8abce1cfa235dc343f1 (patch)
treea0dddce886e26a0af8570c0f446e51275cdac6d2
parent44e84ede3da7d4a7e45c8c5b674a21703811e15c (diff)
downloadayatana-indicator-application-e541156e92220917a58ff8abce1cfa235dc343f1.tar.gz
ayatana-indicator-application-e541156e92220917a58ff8abce1cfa235dc343f1.tar.bz2
ayatana-indicator-application-e541156e92220917a58ff8abce1cfa235dc343f1.zip
Adding the label and guide fields to the private struct and tying that into the properties.
-rw-r--r--src/app-indicator.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index 98e90ae..29149ae 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -72,6 +72,8 @@ struct _AppIndicatorPrivate {
gchar * icon_path;
DbusmenuServer *menuservice;
GtkWidget *menu;
+ gchar * label;
+ gchar * label_guide;
GtkStatusIcon * status_icon;
gint fallback_timer;
@@ -407,6 +409,8 @@ app_indicator_init (AppIndicator *self)
priv->icon_path = NULL;
priv->menu = NULL;
priv->menuservice = NULL;
+ priv->label = NULL;
+ priv->label_guide = NULL;
priv->watcher_proxy = NULL;
priv->connection = NULL;
@@ -530,6 +534,16 @@ app_indicator_finalize (GObject *object)
g_free(priv->icon_path);
priv->icon_path = NULL;
}
+
+ if (priv->label != NULL) {
+ g_free(priv->label);
+ priv->label = NULL;
+ }
+
+ if (priv->label_guide != NULL) {
+ g_free(priv->label_guide);
+ priv->label_guide = NULL;
+ }
G_OBJECT_CLASS (app_indicator_parent_class)->finalize (object);
return;
@@ -602,6 +616,33 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu
priv->icon_path = g_value_dup_string(value);
break;
+ case PROP_LABEL: {
+ gchar * oldlabel = priv->label;
+ priv->label = g_value_dup_string(value);
+
+ if (g_strcmp0(oldlabel, priv->label) != 0) {
+ // TODO: signal change
+ }
+
+ if (oldlabel != NULL) {
+ g_free(oldlabel);
+ }
+ break;
+ }
+ case PROP_LABEL_GUIDE: {
+ gchar * oldguide = priv->label_guide;
+ priv->label_guide = g_value_dup_string(value);
+
+ if (g_strcmp0(oldguide, priv->label_guide) != 0) {
+ // TODO: signal change
+ }
+
+ if (oldguide != NULL) {
+ g_free(oldguide);
+ }
+ break;
+ }
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -659,6 +700,14 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa
g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE);
break;
+ case PROP_LABEL:
+ g_value_set_string (value, priv->label);
+ break;
+
+ case PROP_LABEL_GUIDE:
+ g_value_set_string (value, priv->label_guide);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;