← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-application/x-label-branch into lp:indicator-application

 

Ted Gould has proposed merging lp:~ted/indicator-application/x-label-branch into lp:indicator-application.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)


Moving the label attributes to the "X" namespace as the KDE folks aren't interested in it.  Hopefully they'll realize how cool it is later ;)
-- 
https://code.launchpad.net/~ted/indicator-application/x-label-branch/+merge/32374
Your team ayatana-commits is subscribed to branch lp:indicator-application.
=== modified file 'src/app-indicator.c'
--- src/app-indicator.c	2010-08-05 21:43:15 +0000
+++ src/app-indicator.c	2010-08-11 19:43:43 +0000
@@ -92,6 +92,7 @@
 	NEW_ATTENTION_ICON,
 	NEW_STATUS,
 	NEW_LABEL,
+	X_NEW_LABEL,
 	CONNECTION_CHANGED,
     NEW_ICON_THEME_PATH,
 	LAST_SIGNAL
@@ -112,7 +113,9 @@
 	PROP_MENU,
 	PROP_CONNECTED,
 	PROP_LABEL,
-	PROP_LABEL_GUIDE
+	PROP_LABEL_GUIDE,
+	PROP_X_LABEL,
+	PROP_X_LABEL_GUIDE
 };
 
 /* The strings so that they can be slowly looked up. */
@@ -126,11 +129,16 @@
 #define PROP_CONNECTED_S             "connected"
 #define PROP_LABEL_S                 "label"
 #define PROP_LABEL_GUIDE_S           "label-guide"
+#define PROP_X_LABEL_S               "x-ayatana-label"
+#define PROP_X_LABEL_GUIDE_S         "x-ayatana-label-guide"
 
 /* Private macro, shhhh! */
 #define APP_INDICATOR_GET_PRIVATE(o) \
                              (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate))
 
+/* Signal wrapper */
+#define APP_INDICATOR_SIGNAL_X_NEW_LABEL ("x-ayatana-" APP_INDICATOR_SIGNAL_NEW_LABEL)
+
 /* Default Path */
 #define DEFAULT_ITEM_PATH   "/org/ayatana/NotificationItem"
 
@@ -331,6 +339,32 @@
 	                                                     NULL,
 	                                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+	/**
+		AppIndicator:x-ayatana-label:
+
+		Wrapper for #AppIndicator:label.  Please use that in all of your
+		code.
+	*/
+	g_object_class_install_property(object_class,
+	                                PROP_X_LABEL,
+	                                g_param_spec_string (PROP_X_LABEL_S,
+	                                                     "A wrapper, please don't use.",
+	                                                     "A wrapper, please don't use.",
+	                                                     NULL,
+	                                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+	/**
+		AppIndicator:x-ayatana-label-guide:
+
+		Wrapper for #AppIndicator:label-guide.  Please use that in all of your
+		code.
+	*/
+	g_object_class_install_property(object_class,
+	                                PROP_X_LABEL_GUIDE,
+	                                g_param_spec_string (PROP_X_LABEL_GUIDE_S,
+	                                                     "A wrapper, please don't use.",
+	                                                     "A wrapper, please don't use.",
+	                                                     NULL,
+	                                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	/* Signals */
 
@@ -396,6 +430,23 @@
 	                                    G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
 
 	/**
+		AppIndicator::x-ayatana-new-label:
+		@arg0: The #AppIndicator object
+		@arg1: The string for the label
+		@arg1: The string for the guide
+
+		Wrapper for #AppIndicator::new-label, please don't use this signal
+		use the other one.
+	*/
+	signals[X_NEW_LABEL] = g_signal_new (APP_INDICATOR_SIGNAL_X_NEW_LABEL,
+	                                    G_TYPE_FROM_CLASS(klass),
+	                                    G_SIGNAL_RUN_LAST,
+	                                    G_STRUCT_OFFSET (AppIndicatorClass, new_label),
+	                                    NULL, NULL,
+	                                    _application_service_marshal_VOID__STRING_STRING,
+	                                    G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
+
+	/**
 		AppIndicator::connection-changed:
 		@arg0: The #AppIndicator object
 		@arg1: Whether we're connected or not
@@ -658,6 +709,7 @@
           check_connect (self);
           break;
 
+		case PROP_X_LABEL:
 		case PROP_LABEL: {
 		  gchar * oldlabel = priv->label;
 		  priv->label = g_value_dup_string(value);
@@ -676,6 +728,7 @@
 		  }
 		  break;
 		}
+		case PROP_X_LABEL_GUIDE:
 		case PROP_LABEL_GUIDE: {
 		  gchar * oldguide = priv->label_guide;
 		  priv->label_guide = g_value_dup_string(value);
@@ -752,10 +805,12 @@
           g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE);
           break;
 
+		case PROP_X_LABEL:
         case PROP_LABEL:
           g_value_set_string (value, priv->label);
           break;
 
+        case PROP_X_LABEL_GUIDE:
         case PROP_LABEL_GUIDE:
           g_value_set_string (value, priv->label_guide);
           break;
@@ -779,6 +834,10 @@
 	              priv->label != NULL ? priv->label : "",
 	              priv->label_guide != NULL ? priv->label_guide : "",
 	              TRUE);
+	g_signal_emit(G_OBJECT(self), signals[X_NEW_LABEL], 0,
+	              priv->label != NULL ? priv->label : "",
+	              priv->label_guide != NULL ? priv->label_guide : "",
+	              TRUE);
 
 	priv->label_change_idle = 0;
 

=== modified file 'src/application-service-appstore.c'
--- src/application-service-appstore.c	2010-08-05 21:54:12 +0000
+++ src/application-service-appstore.c	2010-08-11 19:43:43 +0000
@@ -45,13 +45,13 @@
 #define NOTIFICATION_ITEM_PROP_AICON_NAME       "AttentionIconName"
 #define NOTIFICATION_ITEM_PROP_ICON_THEME_PATH  "IconThemePath"
 #define NOTIFICATION_ITEM_PROP_MENU             "Menu"
-#define NOTIFICATION_ITEM_PROP_LABEL            "Label"
-#define NOTIFICATION_ITEM_PROP_LABEL_GUIDE      "LabelGuide"
+#define NOTIFICATION_ITEM_PROP_LABEL            "XAyatanaLabel"
+#define NOTIFICATION_ITEM_PROP_LABEL_GUIDE      "XAyatanaLabelGuide"
 
 #define NOTIFICATION_ITEM_SIG_NEW_ICON               "NewIcon"
 #define NOTIFICATION_ITEM_SIG_NEW_AICON              "NewAttentionIcon"
 #define NOTIFICATION_ITEM_SIG_NEW_STATUS             "NewStatus"
-#define NOTIFICATION_ITEM_SIG_NEW_LABEL              "NewLabel"
+#define NOTIFICATION_ITEM_SIG_NEW_LABEL              "XAyatanaNewLabel"
 #define NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH    "NewIconThemePath"
 
 /* Private Stuff */

=== modified file 'src/notification-item.xml'
--- src/notification-item.xml	2010-08-10 14:04:41 +0000
+++ src/notification-item.xml	2010-08-11 19:43:43 +0000
@@ -12,8 +12,8 @@
 		     to find the icons specified above. -->
 		<property name="IconThemePath" type="s" access="read" />
 		<property name="Menu" type="o" access="read" />
-		<property name="Label" type="s" access="read" />
-		<property name="LabelGuide" type="s" access="read" />
+		<property name="XAyatanaLabel" type="s" access="read" />
+		<property name="XAyatanaLabelGuide" type="s" access="read" />
 
 <!-- Methods -->
 		<!-- None currently -->
@@ -29,7 +29,7 @@
 		<signal name="NewStatus">
 			<arg type="s" name="status" direction="out" />
 		</signal>
-		<signal name="NewLabel">
+		<signal name="XAyatanaNewLabel">
 			<arg type="s" name="label" direction="out" />
 			<arg type="s" name="guide" direction="out" />
 		</signal>


Follow ups