Merge lp:~dbarth/indicator-me/ui-adjustments into lp:indicator-me

Proposed by David Barth
Status: Merged
Approved by: David Barth
Approved revision: 99
Merged at revision: 98
Proposed branch: lp:~dbarth/indicator-me/ui-adjustments
Merge into: lp:indicator-me
Diff against target: 158 lines (+59/-36)
1 file modified
src/me-service.c (+59/-36)
To merge this branch: bzr merge lp:~dbarth/indicator-me/ui-adjustments
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+33109@code.launchpad.net

Description of the change

UI changes:
1. remove the U1 menu item that doesn't fit into the me menu
2. remove the avatar that user testing found to be difficult to associate oneself with
3. provide a simple 'about me' entry at the bottom of the menu

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

+1

review: Approve
Revision history for this message
David Barth (dbarth) wrote :

fixed the parameter check you mentioned, thanks for the review.

100. By David Barth

fixing param check noticed by Jason

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/me-service.c'
--- src/me-service.c 2010-08-16 14:50:56 +0000
+++ src/me-service.c 2010-08-19 17:20:57 +0000
@@ -235,32 +235,40 @@
235 DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);235 DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);
236 g_return_if_fail(root != NULL);236 g_return_if_fail(root != NULL);
237237
238 DbusmenuMenuitem *im_accounts_mi = NULL;
239 DbusmenuMenuitem *tw_accounts_mi = NULL;
240 gboolean at_least_one = FALSE;
241
238 if (program_is_installed ("empathy-accounts")) {242 if (program_is_installed ("empathy-accounts")) {
239 DbusmenuMenuitem *im_accounts_mi = dbusmenu_menuitem_new();243 im_accounts_mi = dbusmenu_menuitem_new();
240 dbusmenu_menuitem_property_set(im_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,244 dbusmenu_menuitem_property_set(im_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,
241 _("Chat Accounts..."));245 _("Chat Accounts..."));
242 dbusmenu_menuitem_child_append(root, im_accounts_mi);
243 g_signal_connect(G_OBJECT(im_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,246 g_signal_connect(G_OBJECT(im_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
244 G_CALLBACK(spawn_on_activate_cb), "empathy-accounts");247 G_CALLBACK(spawn_on_activate_cb), "empathy-accounts");
248 at_least_one = TRUE;
245 }249 }
246250
247 if (program_is_installed ("gwibber-accounts")) {251 if (program_is_installed ("gwibber-accounts")) {
248 DbusmenuMenuitem *tw_accounts_mi = dbusmenu_menuitem_new();252 tw_accounts_mi = dbusmenu_menuitem_new();
249 dbusmenu_menuitem_property_set(tw_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,253 dbusmenu_menuitem_property_set(tw_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,
250 _("Broadcast Accounts..."));254 _("Broadcast Accounts..."));
251 dbusmenu_menuitem_child_append(root, tw_accounts_mi);
252 g_signal_connect(G_OBJECT(tw_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,255 g_signal_connect(G_OBJECT(tw_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
253 G_CALLBACK(spawn_on_activate_cb), "gwibber-accounts");256 G_CALLBACK(spawn_on_activate_cb), "gwibber-accounts");
254 }257 at_least_one = TRUE;
255258 }
256 if (program_is_installed ("ubuntuone-preferences")) {259
257 DbusmenuMenuitem *u1_accounts_mi = dbusmenu_menuitem_new();260 if (at_least_one) {
258 dbusmenu_menuitem_property_set(u1_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,261 DbusmenuMenuitem *separator = dbusmenu_menuitem_new();
259 _("Ubuntu One..."));262 dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE,
260 dbusmenu_menuitem_child_append(root, u1_accounts_mi);263 DBUSMENU_CLIENT_TYPES_SEPARATOR);
261 g_signal_connect(G_OBJECT(u1_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,264 dbusmenu_menuitem_child_append(root, separator);
262 G_CALLBACK(spawn_on_activate_cb), "ubuntuone-preferences");265
263 }266 if (im_accounts_mi)
267 dbusmenu_menuitem_child_append(root, im_accounts_mi);
268 if (tw_accounts_mi)
269 dbusmenu_menuitem_child_append(root, tw_accounts_mi);
270 }
271
264}272}
265273
266static gboolean274static gboolean
@@ -326,6 +334,8 @@
326}334}
327335
328336
337/* disabled for this release */
338#if 0
329static void339static void
330avatar_changed_cb (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, gpointer user_data)340avatar_changed_cb (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, gpointer user_data)
331{341{
@@ -342,7 +352,7 @@
342}352}
343353
344static void354static void
345build_user_item (DbusmenuMenuitem * root)355build_avatar_item (DbusmenuMenuitem * root)
346{356{
347 useritem = dbusmenu_menuitem_new();357 useritem = dbusmenu_menuitem_new();
348 dbusmenu_menuitem_property_set(useritem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME, g_get_real_name ());358 dbusmenu_menuitem_property_set(useritem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME, g_get_real_name ());
@@ -361,17 +371,15 @@
361371
362 g_free (filename);372 g_free (filename);
363373
364 gchar *gam = g_find_program_in_path("gnome-about-me");374 return;
365 if (gam != NULL) {375}
366 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);376#endif
367 g_signal_connect(G_OBJECT(useritem),
368 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
369 G_CALLBACK(spawn_on_activate_cb), "gnome-about-me");
370 g_free(gam);
371 }
372377
373 /* set the menu name */378static gboolean
374 display_mode_changed ();379build_menu (gpointer data)
380{
381 DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);
382 g_return_val_if_fail(DBUSMENU_IS_MENUITEM(root), FALSE);
375383
376 /* and receive display mode notifications to update it later */384 /* and receive display mode notifications to update it later */
377 GConfClient *context = gconf_client_get_default ();385 GConfClient *context = gconf_client_get_default ();
@@ -383,16 +391,10 @@
383 g_object_unref (context);391 g_object_unref (context);
384 }392 }
385393
386 return;394 /* disabled for this release */
387}395#if 0
388396 build_avatar_item(root);
389static gboolean397#endif
390build_menu (gpointer data)
391{
392 DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);
393 g_return_val_if_fail(root != NULL, FALSE);
394
395 build_user_item(root);
396398
397 broadcast_field = DBUSMENU_MENUITEM (entry_menu_item_new());399 broadcast_field = DBUSMENU_MENUITEM (entry_menu_item_new());
398 dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);400 dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
@@ -427,12 +429,33 @@
427 g_debug("Built %s", status_strings[i]);429 g_debug("Built %s", status_strings[i]);
428 }430 }
429431
432 build_accounts_menuitems(root);
433
434 /* add a standard "About Me..." menu item at the end of the menu */
430 DbusmenuMenuitem *separator = dbusmenu_menuitem_new();435 DbusmenuMenuitem *separator = dbusmenu_menuitem_new();
431 dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE,436 dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE,
432 DBUSMENU_CLIENT_TYPES_SEPARATOR);437 DBUSMENU_CLIENT_TYPES_SEPARATOR);
433 dbusmenu_menuitem_child_append(root, separator);438 dbusmenu_menuitem_child_append(root, separator);
434439
435 build_accounts_menuitems(root);440 useritem = dbusmenu_menuitem_new();
441 dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, _("About Me..."));
442 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
443 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
444 dbusmenu_menuitem_child_append(root, useritem);
445
446 gchar *gam = g_find_program_in_path("gnome-about-me");
447 if (gam != NULL) {
448 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
449 g_signal_connect(G_OBJECT(useritem),
450 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
451 G_CALLBACK(spawn_on_activate_cb), "gnome-about-me");
452 g_free(gam);
453 }
454
455 /* finally set the menu name and update items visibility according
456 to a gconf key
457 */
458 display_mode_changed ();
436459
437 return FALSE;460 return FALSE;
438}461}

Subscribers

People subscribed via source and target branches