Merge lp:~indicator-applet-developers/evolution-indicator/fix-preferences into lp:evolution-indicator

Proposed by Neil J. Patel
Status: Merged
Merged at revision: not available
Proposed branch: lp:~indicator-applet-developers/evolution-indicator/fix-preferences
Merge into: lp:evolution-indicator
Diff against target: None lines
To merge this branch: bzr merge lp:~indicator-applet-developers/evolution-indicator/fix-preferences
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+11351@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

This branch handles the changes to evolution-indicator to make it fit into the preferences mockup on https://wiki.ubuntu.com/MessagingMenu#Evolution.

It handles:

1. Moving the "When new mail arrives in blah" group to the top of the General page, and
2. Giving evolution-indicator an idea about how many accounts the user has configured, so it can amend the text in the '...Arrives In Inbox' text to '...Arrives In Any Inbox' if there is more than one account.

The work to make evolution-indicator show separate mailboxes in the messaging-menu will build on the code here (update_accounts will do much more, as will the accounts_changed callback).

The remaining work to the preferences window is out-of-scope for evolution-indicator, and rather needs to be a patch to evolution itself.

Revision history for this message
Neil J. Patel (njpatel) wrote :

The change to Makefile.in.in seems to be from autogen'ing with the karmic autotools. I haven't touched it specifically.

Revision history for this message
Ted Gould (ted) wrote :

Looks good to me.

  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/Makefile.in.in'
--- po/Makefile.in.in 2009-04-03 21:42:17 +0000
+++ po/Makefile.in.in 2009-09-08 10:18:17 +0000
@@ -56,7 +56,7 @@
5656
57PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)57PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
5858
59USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi)59USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
6060
61USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)61USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
6262
6363
=== modified file 'src/evolution-indicator.c'
--- src/evolution-indicator.c 2009-04-22 14:01:50 +0000
+++ src/evolution-indicator.c 2009-09-08 10:26:58 +0000
@@ -52,11 +52,16 @@
52#define SHOW_BUBBLE CONF_DIR"/show_bubble"52#define SHOW_BUBBLE CONF_DIR"/show_bubble"
53#define SHOW_NEW_IN_PANEL CONF_DIR"/show_new_messages_in_panel"53#define SHOW_NEW_IN_PANEL CONF_DIR"/show_new_messages_in_panel"
5454
55#define ACCOUNT_DIR "/apps/evolution/mail"
56#define ACCOUNTS ACCOUNT_DIR"/accounts"
57
55static EShell *evo_shell = NULL;58static EShell *evo_shell = NULL;
56static MailServer *mail_server = NULL;59static MailServer *mail_server = NULL;
57static GStaticMutex mlock = G_STATIC_MUTEX_INIT;60static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
58static GConfClient *client = NULL;61static GConfClient *client = NULL;
5962
63static gint n_accounts = 0;
64
60static NotifyNotification *notification = NULL;65static NotifyNotification *notification = NULL;
61static ca_context *canberra_cxt = NULL;66static ca_context *canberra_cxt = NULL;
62static ca_proplist *canberra_props = NULL;67static ca_proplist *canberra_props = NULL;
@@ -71,6 +76,7 @@
71static guint play_sound_id = 0;76static guint play_sound_id = 0;
72static guint show_bubble_id = 0;77static guint show_bubble_id = 0;
73static guint show_count_id = 0;78static guint show_count_id = 0;
79static guint accounts_id = 0;
7480
75static gint message_count = 0;81static gint message_count = 0;
7682
@@ -325,6 +331,47 @@
325 g_debug ("EI: Show Bubbles %s", show_bubble ? "true" : "false");331 g_debug ("EI: Show Bubbles %s", show_bubble ? "true" : "false");
326}332}
327333
334static void
335update_accounts (void)
336{
337 GSList *accounts;
338 GError *error = NULL;
339
340 accounts = gconf_client_get_list (client,
341 ACCOUNTS,
342 GCONF_VALUE_STRING,
343 &error);
344 if (accounts == NULL || error)
345 {
346 g_warning ("Unable to determine number of accounts, defaulting to '1' (%s)",
347 error ? error->message : "unknown");
348 if (error)
349 g_error_free (error);
350
351 /* We could have this as 0 too, as it won't effect anything. It just
352 * seems to make more sense to have it default at 1
353 */
354 n_accounts = 1;
355 }
356 else
357 {
358 n_accounts = g_slist_length (accounts);
359
360 g_slist_free (accounts);
361 }
362
363 g_debug ("Number of email accounts: %d", n_accounts);
364}
365
366static void
367on_accounts_changed (GConfClient *gclient,
368 guint id,
369 GConfEntry *entry,
370 gpointer data)
371{
372 update_accounts ();
373}
374
328int375int
329e_plugin_lib_enable (EPluginLib *ep, int enable)376e_plugin_lib_enable (EPluginLib *ep, int enable)
330{377{
@@ -379,13 +426,18 @@
379 show_bubble_id = gconf_client_notify_add (client, SHOW_BUBBLE, 426 show_bubble_id = gconf_client_notify_add (client, SHOW_BUBBLE,
380 show_bubble_changed, NULL, NULL, NULL);427 show_bubble_changed, NULL, NULL, NULL);
381428
382
383 show_count = gconf_client_get_bool (client, 429 show_count = gconf_client_get_bool (client,
384 SHOW_NEW_IN_PANEL, 430 SHOW_NEW_IN_PANEL,
385 NULL);431 NULL);
386 show_count_id = gconf_client_notify_add (client, SHOW_NEW_IN_PANEL, 432 show_count_id = gconf_client_notify_add (client, SHOW_NEW_IN_PANEL,
387 show_new_in_panel_changed, NULL, NULL, NULL);433 show_new_in_panel_changed, NULL, NULL, NULL);
388434
435 gconf_client_add_dir (client, ACCOUNT_DIR,GCONF_CLIENT_PRELOAD_NONE, NULL);
436 update_accounts ();
437 accounts_id = gconf_client_notify_add (client, ACCOUNTS,
438 on_accounts_changed, NULL,
439 NULL, NULL);
440
389 if (show_count)441 if (show_count)
390 {442 {
391 indicate_server_show (INDICATE_SERVER (mail_server));443 indicate_server_show (INDICATE_SERVER (mail_server));
@@ -397,6 +449,7 @@
397 gconf_client_notify_remove (client, play_sound_id);449 gconf_client_notify_remove (client, play_sound_id);
398 gconf_client_notify_remove (client, show_bubble_id);450 gconf_client_notify_remove (client, show_bubble_id);
399 gconf_client_notify_remove (client, show_count_id);451 gconf_client_notify_remove (client, show_count_id);
452 gconf_client_notify_remove (client, accounts_id);
400453
401 g_object_unref (client); client = NULL;454 g_object_unref (client); client = NULL;
402 g_object_unref (mail_server); mail_server = NULL;455 g_object_unref (mail_server); mail_server = NULL;
@@ -494,6 +547,8 @@
494547
495 frame = (GtkWidget*)data->parent->parent->parent;548 frame = (GtkWidget*)data->parent->parent->parent;
496549
550 gtk_box_reorder_child (GTK_BOX (frame->parent), frame, 0);
551
497 box = gtk_hbox_new (FALSE, 0);552 box = gtk_hbox_new (FALSE, 0);
498 gtk_frame_set_label_widget (GTK_FRAME (frame), box);553 gtk_frame_set_label_widget (GTK_FRAME (frame), box);
499 gtk_widget_show (frame);554 gtk_widget_show (frame);
@@ -506,7 +561,8 @@
506 label2 = gtk_label_new (" ");561 label2 = gtk_label_new (" ");
507562
508 combo = gtk_combo_box_new_text ();563 combo = gtk_combo_box_new_text ();
509 gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Inbox"));564 gtk_combo_box_append_text (GTK_COMBO_BOX (combo),
565 n_accounts > 1 ? _("Any Inbox") : _("Inbox"));
510 gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Any Folder"));566 gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Any Folder"));
511 gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 567 gtk_combo_box_set_active (GTK_COMBO_BOX (combo),
512 only_inbox ? 0 : 1);568 only_inbox ? 0 : 1);

Subscribers

People subscribed via source and target branches