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
1=== modified file 'po/Makefile.in.in'
2--- po/Makefile.in.in 2009-04-03 21:42:17 +0000
3+++ po/Makefile.in.in 2009-09-08 10:18:17 +0000
4@@ -56,7 +56,7 @@
5
6 PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
7
8-USER_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)
9+USER_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)
10
11 USE_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)
12
13
14=== modified file 'src/evolution-indicator.c'
15--- src/evolution-indicator.c 2009-04-22 14:01:50 +0000
16+++ src/evolution-indicator.c 2009-09-08 10:26:58 +0000
17@@ -52,11 +52,16 @@
18 #define SHOW_BUBBLE CONF_DIR"/show_bubble"
19 #define SHOW_NEW_IN_PANEL CONF_DIR"/show_new_messages_in_panel"
20
21+#define ACCOUNT_DIR "/apps/evolution/mail"
22+#define ACCOUNTS ACCOUNT_DIR"/accounts"
23+
24 static EShell *evo_shell = NULL;
25 static MailServer *mail_server = NULL;
26 static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
27 static GConfClient *client = NULL;
28
29+static gint n_accounts = 0;
30+
31 static NotifyNotification *notification = NULL;
32 static ca_context *canberra_cxt = NULL;
33 static ca_proplist *canberra_props = NULL;
34@@ -71,6 +76,7 @@
35 static guint play_sound_id = 0;
36 static guint show_bubble_id = 0;
37 static guint show_count_id = 0;
38+static guint accounts_id = 0;
39
40 static gint message_count = 0;
41
42@@ -325,6 +331,47 @@
43 g_debug ("EI: Show Bubbles %s", show_bubble ? "true" : "false");
44 }
45
46+static void
47+update_accounts (void)
48+{
49+ GSList *accounts;
50+ GError *error = NULL;
51+
52+ accounts = gconf_client_get_list (client,
53+ ACCOUNTS,
54+ GCONF_VALUE_STRING,
55+ &error);
56+ if (accounts == NULL || error)
57+ {
58+ g_warning ("Unable to determine number of accounts, defaulting to '1' (%s)",
59+ error ? error->message : "unknown");
60+ if (error)
61+ g_error_free (error);
62+
63+ /* We could have this as 0 too, as it won't effect anything. It just
64+ * seems to make more sense to have it default at 1
65+ */
66+ n_accounts = 1;
67+ }
68+ else
69+ {
70+ n_accounts = g_slist_length (accounts);
71+
72+ g_slist_free (accounts);
73+ }
74+
75+ g_debug ("Number of email accounts: %d", n_accounts);
76+}
77+
78+static void
79+on_accounts_changed (GConfClient *gclient,
80+ guint id,
81+ GConfEntry *entry,
82+ gpointer data)
83+{
84+ update_accounts ();
85+}
86+
87 int
88 e_plugin_lib_enable (EPluginLib *ep, int enable)
89 {
90@@ -379,13 +426,18 @@
91 show_bubble_id = gconf_client_notify_add (client, SHOW_BUBBLE,
92 show_bubble_changed, NULL, NULL, NULL);
93
94-
95 show_count = gconf_client_get_bool (client,
96 SHOW_NEW_IN_PANEL,
97 NULL);
98 show_count_id = gconf_client_notify_add (client, SHOW_NEW_IN_PANEL,
99 show_new_in_panel_changed, NULL, NULL, NULL);
100
101+ gconf_client_add_dir (client, ACCOUNT_DIR,GCONF_CLIENT_PRELOAD_NONE, NULL);
102+ update_accounts ();
103+ accounts_id = gconf_client_notify_add (client, ACCOUNTS,
104+ on_accounts_changed, NULL,
105+ NULL, NULL);
106+
107 if (show_count)
108 {
109 indicate_server_show (INDICATE_SERVER (mail_server));
110@@ -397,6 +449,7 @@
111 gconf_client_notify_remove (client, play_sound_id);
112 gconf_client_notify_remove (client, show_bubble_id);
113 gconf_client_notify_remove (client, show_count_id);
114+ gconf_client_notify_remove (client, accounts_id);
115
116 g_object_unref (client); client = NULL;
117 g_object_unref (mail_server); mail_server = NULL;
118@@ -494,6 +547,8 @@
119
120 frame = (GtkWidget*)data->parent->parent->parent;
121
122+ gtk_box_reorder_child (GTK_BOX (frame->parent), frame, 0);
123+
124 box = gtk_hbox_new (FALSE, 0);
125 gtk_frame_set_label_widget (GTK_FRAME (frame), box);
126 gtk_widget_show (frame);
127@@ -506,7 +561,8 @@
128 label2 = gtk_label_new (" ");
129
130 combo = gtk_combo_box_new_text ();
131- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Inbox"));
132+ gtk_combo_box_append_text (GTK_COMBO_BOX (combo),
133+ n_accounts > 1 ? _("Any Inbox") : _("Inbox"));
134 gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Any Folder"));
135 gtk_combo_box_set_active (GTK_COMBO_BOX (combo),
136 only_inbox ? 0 : 1);

Subscribers

People subscribed via source and target branches