Merge lp:~dbarth/indicator-me/entry-hint into lp:indicator-me
- entry-hint
- Merge into trunk
Proposed by
David Barth
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 104 | ||||
Proposed branch: | lp:~dbarth/indicator-me/entry-hint | ||||
Merge into: | lp:indicator-me | ||||
Diff against target: |
368 lines (+189/-27) 5 files modified
src/dbus-shared-names.h (+1/-0) src/indicator-me.c (+122/-25) src/me-service-gwibber.c (+62/-2) src/me-service-gwibber.h (+1/-0) src/me-service.c (+3/-0) |
||||
To merge this branch: | bzr merge lp:~dbarth/indicator-me/entry-hint | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Needs Information | ||
Cody Russell (community) | Approve | ||
Review via email: mp+35595@code.launchpad.net |
Commit message
Description of the change
Add a hint field to the broadcast field. The hint is computed from the list of protocols associated with accounts configured for broadcasting.
To post a comment you must log in.
- 108. By David Barth
-
Fix the entry hint to be shown at the right time
Revision history for this message
Cody Russell (bratsche) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/dbus-shared-names.h' | |||
2 | --- src/dbus-shared-names.h 2010-03-11 12:20:48 +0000 | |||
3 | +++ src/dbus-shared-names.h 2010-09-16 14:51:54 +0000 | |||
4 | @@ -32,6 +32,7 @@ | |||
5 | 32 | 32 | ||
6 | 33 | #define DBUSMENU_ENTRY_MENUITEM_TYPE "x-canonical-entry-item" | 33 | #define DBUSMENU_ENTRY_MENUITEM_TYPE "x-canonical-entry-item" |
7 | 34 | #define DBUSMENU_ENTRY_MENUITEM_PROP_TEXT "text" | 34 | #define DBUSMENU_ENTRY_MENUITEM_PROP_TEXT "text" |
8 | 35 | #define DBUSMENU_ENTRY_MENUITEM_PROP_HINT "hint" | ||
9 | 35 | 36 | ||
10 | 36 | #define DBUSMENU_ABOUT_ME_MENUITEM_TYPE "x-canonical-about-me-item" | 37 | #define DBUSMENU_ABOUT_ME_MENUITEM_TYPE "x-canonical-about-me-item" |
11 | 37 | #define DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME "name" | 38 | #define DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME "name" |
12 | 38 | 39 | ||
13 | === modified file 'src/indicator-me.c' | |||
14 | --- src/indicator-me.c 2010-03-31 22:07:27 +0000 | |||
15 | +++ src/indicator-me.c 2010-09-16 14:51:54 +0000 | |||
16 | @@ -254,11 +254,112 @@ | |||
17 | 254 | } | 254 | } |
18 | 255 | 255 | ||
19 | 256 | static void | 256 | static void |
20 | 257 | entry_hint_set_shown (GtkWidget *widget, gboolean flag) | ||
21 | 258 | { | ||
22 | 259 | g_object_set_data (G_OBJECT (widget), | ||
23 | 260 | DBUSMENU_ENTRY_MENUITEM_PROP_HINT "_shown", | ||
24 | 261 | GUINT_TO_POINTER (flag)); | ||
25 | 262 | } | ||
26 | 263 | |||
27 | 264 | |||
28 | 265 | static void | ||
29 | 266 | entry_set_style (GtkEntry *entry, GtkStateType state) | ||
30 | 267 | { | ||
31 | 268 | GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (entry)); | ||
32 | 269 | GdkColor *color = &style->text[state]; | ||
33 | 270 | gtk_widget_modify_text (GTK_WIDGET (entry), GTK_STATE_NORMAL, color); | ||
34 | 271 | } | ||
35 | 272 | |||
36 | 273 | static void | ||
37 | 274 | entry_maybe_show_hint (GtkEntry *entry) | ||
38 | 275 | { | ||
39 | 276 | g_return_if_fail (GTK_IS_ENTRY (entry)); | ||
40 | 277 | |||
41 | 278 | const gchar *hint = g_object_get_data (G_OBJECT (entry), | ||
42 | 279 | DBUSMENU_ENTRY_MENUITEM_PROP_HINT); | ||
43 | 280 | if (gtk_entry_get_text_length (entry) > 0 || | ||
44 | 281 | GTK_WIDGET_HAS_FOCUS (entry)) { | ||
45 | 282 | g_debug ("%s, the hint shouldn't be shown atm", __func__); | ||
46 | 283 | |||
47 | 284 | entry_set_style (entry, GTK_STATE_NORMAL); | ||
48 | 285 | entry_hint_set_shown (GTK_WIDGET (entry), FALSE); | ||
49 | 286 | |||
50 | 287 | } else { | ||
51 | 288 | g_debug ("%s, nothing in the entry or not focused, so setting the hint to: %s", __func__, hint); | ||
52 | 289 | |||
53 | 290 | gtk_entry_set_text (entry, hint); | ||
54 | 291 | entry_set_style (entry, GTK_STATE_INSENSITIVE); | ||
55 | 292 | |||
56 | 293 | entry_hint_set_shown (GTK_WIDGET (entry), TRUE); | ||
57 | 294 | } | ||
58 | 295 | } | ||
59 | 296 | |||
60 | 297 | |||
61 | 298 | static void | ||
62 | 299 | entry_set_hint (GtkEntry *entry, const char *hint) | ||
63 | 300 | { | ||
64 | 301 | g_debug ("entry hint: %s", hint); | ||
65 | 302 | g_object_set_data_full (G_OBJECT (entry), DBUSMENU_ENTRY_MENUITEM_PROP_HINT, | ||
66 | 303 | g_strdup (hint), (GDestroyNotify) g_free); | ||
67 | 304 | entry_maybe_show_hint (entry); | ||
68 | 305 | } | ||
69 | 306 | |||
70 | 307 | static gboolean | ||
71 | 308 | entry_hint_is_shown (GtkWidget *widget) | ||
72 | 309 | { | ||
73 | 310 | gboolean shown = GPOINTER_TO_UINT | ||
74 | 311 | (g_object_get_data (G_OBJECT (widget), | ||
75 | 312 | DBUSMENU_ENTRY_MENUITEM_PROP_HINT "_shown")); | ||
76 | 313 | |||
77 | 314 | return shown; | ||
78 | 315 | } | ||
79 | 316 | |||
80 | 317 | static gboolean | ||
81 | 318 | entry_focus_grab_cb (GtkWidget *widget, GdkEventFocus *event) | ||
82 | 319 | { | ||
83 | 320 | GtkEntry *entry = GTK_ENTRY (widget); | ||
84 | 321 | GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (entry)); | ||
85 | 322 | gboolean select_on_focus; | ||
86 | 323 | |||
87 | 324 | g_debug ("%s", __func__); | ||
88 | 325 | |||
89 | 326 | if (entry_hint_is_shown (GTK_WIDGET (entry))) { | ||
90 | 327 | /* override select-on-focus */ | ||
91 | 328 | g_object_get (settings, "gtk-entry-select-on-focus", &select_on_focus, NULL); | ||
92 | 329 | g_object_set (settings, "gtk-entry-select-on-focus", FALSE, NULL); | ||
93 | 330 | gtk_entry_set_text (entry, ""); | ||
94 | 331 | g_object_set (settings, "gtk-entry-select-on-focus", select_on_focus, NULL); | ||
95 | 332 | } | ||
96 | 333 | |||
97 | 334 | entry_set_style (entry, GTK_STATE_NORMAL); | ||
98 | 335 | entry_hint_set_shown (GTK_WIDGET (entry), FALSE); | ||
99 | 336 | |||
100 | 337 | return FALSE; | ||
101 | 338 | } | ||
102 | 339 | |||
103 | 340 | static gboolean | ||
104 | 341 | entry_focus_ungrab_cb (GtkWidget *widget, GdkEventFocus *event) | ||
105 | 342 | { | ||
106 | 343 | GtkEntry *entry = GTK_ENTRY (widget); | ||
107 | 344 | |||
108 | 345 | g_debug ("%s", __func__); | ||
109 | 346 | |||
110 | 347 | entry_maybe_show_hint (entry); | ||
111 | 348 | |||
112 | 349 | return FALSE; | ||
113 | 350 | } | ||
114 | 351 | |||
115 | 352 | static void | ||
116 | 257 | entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GValue *value, GtkEntry *entry) | 353 | entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GValue *value, GtkEntry *entry) |
117 | 258 | { | 354 | { |
118 | 355 | g_return_if_fail (GTK_IS_ENTRY (entry)); | ||
119 | 356 | |||
120 | 259 | if (g_strcmp0 (prop, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT) == 0) { | 357 | if (g_strcmp0 (prop, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT) == 0) { |
121 | 260 | gtk_entry_set_text (entry, g_value_get_string (value)); | 358 | gtk_entry_set_text (entry, g_value_get_string (value)); |
122 | 261 | } | 359 | } |
123 | 360 | if (g_strcmp0 (prop, DBUSMENU_ENTRY_MENUITEM_PROP_HINT) == 0) { | ||
124 | 361 | entry_set_hint (entry, g_value_get_string (value)); | ||
125 | 362 | } | ||
126 | 262 | } | 363 | } |
127 | 263 | 364 | ||
128 | 264 | static void | 365 | static void |
129 | @@ -277,31 +378,6 @@ | |||
130 | 277 | } | 378 | } |
131 | 278 | 379 | ||
132 | 279 | static gboolean | 380 | static gboolean |
133 | 280 | menu_visibility_changed (GtkWidget *widget, | ||
134 | 281 | IdoEntryMenuItem *menuitem) | ||
135 | 282 | { | ||
136 | 283 | if (GTK_IS_WIDGET (widget) | ||
137 | 284 | && IDO_IS_ENTRY_MENU_ITEM (menuitem)) | ||
138 | 285 | gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), GTK_WIDGET (menuitem)); | ||
139 | 286 | |||
140 | 287 | return FALSE; | ||
141 | 288 | } | ||
142 | 289 | |||
143 | 290 | static void | ||
144 | 291 | entry_parent_changed (GtkWidget *widget, | ||
145 | 292 | gpointer user_data) | ||
146 | 293 | { | ||
147 | 294 | GtkWidget *parent = gtk_widget_get_parent (widget); | ||
148 | 295 | |||
149 | 296 | if (parent && GTK_IS_MENU_SHELL (parent)) | ||
150 | 297 | { | ||
151 | 298 | g_signal_connect (parent, | ||
152 | 299 | "map", G_CALLBACK (menu_visibility_changed), | ||
153 | 300 | widget); | ||
154 | 301 | } | ||
155 | 302 | } | ||
156 | 303 | |||
157 | 304 | static gboolean | ||
158 | 305 | new_entry_item (DbusmenuMenuitem * newitem, | 381 | new_entry_item (DbusmenuMenuitem * newitem, |
159 | 306 | DbusmenuMenuitem * parent, | 382 | DbusmenuMenuitem * parent, |
160 | 307 | DbusmenuClient * client) | 383 | DbusmenuClient * client) |
161 | @@ -314,14 +390,27 @@ | |||
162 | 314 | GtkEntry *entry = GTK_ENTRY(ido_entry_menu_item_get_entry (ido)); | 390 | GtkEntry *entry = GTK_ENTRY(ido_entry_menu_item_get_entry (ido)); |
163 | 315 | if (dbusmenu_menuitem_property_get (newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT) != NULL) | 391 | if (dbusmenu_menuitem_property_get (newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT) != NULL) |
164 | 316 | gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT)); | 392 | gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT)); |
165 | 393 | if (dbusmenu_menuitem_property_get (newitem, DBUSMENU_ENTRY_MENUITEM_PROP_HINT) != NULL) { | ||
166 | 394 | entry_set_hint (entry, dbusmenu_menuitem_property_get (newitem, DBUSMENU_ENTRY_MENUITEM_PROP_HINT)); | ||
167 | 395 | } | ||
168 | 396 | |||
169 | 317 | gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */ | 397 | gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */ |
170 | 318 | gtk_entry_set_max_length (entry, 140); /* enforce current gwibber limit */ | 398 | gtk_entry_set_max_length (entry, 140); /* enforce current gwibber limit */ |
171 | 319 | 399 | ||
172 | 400 | /* override select-on-focus */ | ||
173 | 401 | GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (entry)); | ||
174 | 402 | g_object_set (settings, "gtk-entry-select-on-focus", FALSE, NULL); | ||
175 | 403 | |||
176 | 320 | ido_entry = ido; | 404 | ido_entry = ido; |
177 | 321 | 405 | ||
178 | 406 | #if 0 | ||
179 | 407 | /* this is dangerous: it leaves the signal connected even if the dbusmenu | ||
180 | 408 | object is disposed, for example if the service quits | ||
181 | 409 | */ | ||
182 | 322 | g_signal_connect (ido, | 410 | g_signal_connect (ido, |
183 | 323 | "notify::parent", G_CALLBACK (entry_parent_changed), | 411 | "notify::parent", G_CALLBACK (entry_parent_changed), |
184 | 324 | NULL); | 412 | NULL); |
185 | 413 | #endif | ||
186 | 325 | 414 | ||
187 | 326 | dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(ido), parent); | 415 | dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(ido), parent); |
188 | 327 | /* disconnect the activate signal that newitem_base connected with the wrong | 416 | /* disconnect the activate signal that newitem_base connected with the wrong |
189 | @@ -333,6 +422,14 @@ | |||
190 | 333 | g_signal_connect (DBUSMENU_MENUITEM (newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK (entry_prop_change_cb), entry); | 422 | g_signal_connect (DBUSMENU_MENUITEM (newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK (entry_prop_change_cb), entry); |
191 | 334 | g_signal_connect (GTK_ENTRY (entry), "activate", G_CALLBACK (entry_activate_cb), newitem); | 423 | g_signal_connect (GTK_ENTRY (entry), "activate", G_CALLBACK (entry_activate_cb), newitem); |
192 | 335 | 424 | ||
193 | 425 | g_signal_connect (entry, | ||
194 | 426 | "grab-focus", G_CALLBACK (entry_focus_grab_cb), | ||
195 | 427 | entry); | ||
196 | 428 | |||
197 | 429 | g_signal_connect (entry, | ||
198 | 430 | "grab-broken-event", G_CALLBACK (entry_focus_ungrab_cb), | ||
199 | 431 | entry); | ||
200 | 432 | |||
201 | 336 | return TRUE; | 433 | return TRUE; |
202 | 337 | } | 434 | } |
203 | 338 | 435 | ||
204 | 339 | 436 | ||
205 | === modified file 'src/me-service-gwibber.c' | |||
206 | --- src/me-service-gwibber.c 2010-08-17 14:43:36 +0000 | |||
207 | +++ src/me-service-gwibber.c 2010-09-16 14:51:54 +0000 | |||
208 | @@ -22,7 +22,10 @@ | |||
209 | 22 | 22 | ||
210 | 23 | #include "me-service-gwibber.h" | 23 | #include "me-service-gwibber.h" |
211 | 24 | 24 | ||
212 | 25 | #include <glib/gi18n.h> | ||
213 | 26 | |||
214 | 25 | #include <glib.h> | 27 | #include <glib.h> |
215 | 28 | #include <glib/gprintf.h> | ||
216 | 26 | 29 | ||
217 | 27 | #include <gwibber.h> | 30 | #include <gwibber.h> |
218 | 28 | 31 | ||
219 | @@ -34,6 +37,7 @@ | |||
220 | 34 | GwibberAccounts * me_gwibber_accounts; | 37 | GwibberAccounts * me_gwibber_accounts; |
221 | 35 | int status; | 38 | int status; |
222 | 36 | gboolean has_configured_accounts; | 39 | gboolean has_configured_accounts; |
223 | 40 | gchar * accounts_string; | ||
224 | 37 | }; | 41 | }; |
225 | 38 | 42 | ||
226 | 39 | /* Signals */ | 43 | /* Signals */ |
227 | @@ -89,6 +93,7 @@ | |||
228 | 89 | priv->me_gwibber_accounts = NULL; | 93 | priv->me_gwibber_accounts = NULL; |
229 | 90 | priv->status = ME_GWIBBER_SERVICE_STATUS_NOT_RUNNING; | 94 | priv->status = ME_GWIBBER_SERVICE_STATUS_NOT_RUNNING; |
230 | 91 | priv->has_configured_accounts = FALSE; | 95 | priv->has_configured_accounts = FALSE; |
231 | 96 | priv->accounts_string = NULL; | ||
232 | 92 | 97 | ||
233 | 93 | setup_service_proxies(self); | 98 | setup_service_proxies(self); |
234 | 94 | return; | 99 | return; |
235 | @@ -109,6 +114,11 @@ | |||
236 | 109 | priv->me_gwibber_accounts = NULL; | 114 | priv->me_gwibber_accounts = NULL; |
237 | 110 | } | 115 | } |
238 | 111 | 116 | ||
239 | 117 | if (priv->accounts_string != NULL) { | ||
240 | 118 | g_free(priv->accounts_string); | ||
241 | 119 | priv->accounts_string = NULL; | ||
242 | 120 | } | ||
243 | 121 | |||
244 | 112 | G_OBJECT_CLASS (me_gwibber_service_parent_class)->dispose (object); | 122 | G_OBJECT_CLASS (me_gwibber_service_parent_class)->dispose (object); |
245 | 113 | return; | 123 | return; |
246 | 114 | } | 124 | } |
247 | @@ -140,32 +150,72 @@ | |||
248 | 140 | 150 | ||
249 | 141 | if (priv->me_gwibber_accounts == NULL) { | 151 | if (priv->me_gwibber_accounts == NULL) { |
250 | 142 | g_warning ("no accounts, can't query for accounts"); | 152 | g_warning ("no accounts, can't query for accounts"); |
252 | 143 | return; | 153 | goto reset_accounts_string; |
253 | 144 | } | 154 | } |
254 | 145 | 155 | ||
255 | 146 | accounts_table = gwibber_accounts_list (priv->me_gwibber_accounts); | 156 | accounts_table = gwibber_accounts_list (priv->me_gwibber_accounts); |
256 | 147 | if (accounts_table == NULL) { | 157 | if (accounts_table == NULL) { |
257 | 148 | g_warning ("failed to get accounts list"); | 158 | g_warning ("failed to get accounts list"); |
259 | 149 | return; | 159 | goto reset_accounts_string; |
260 | 150 | } | 160 | } |
261 | 151 | 161 | ||
262 | 152 | g_hash_table_iter_init (&accounts_iter, accounts_table); | 162 | g_hash_table_iter_init (&accounts_iter, accounts_table); |
263 | 153 | 163 | ||
264 | 154 | priv->has_configured_accounts = FALSE; | 164 | priv->has_configured_accounts = FALSE; |
265 | 165 | GList *list = NULL; | ||
266 | 155 | 166 | ||
267 | 156 | while (g_hash_table_iter_next (&accounts_iter, &account, &account_table)) { | 167 | while (g_hash_table_iter_next (&accounts_iter, &account, &account_table)) { |
268 | 157 | send_enabled = check_account_send_enabled (account_table); | 168 | send_enabled = check_account_send_enabled (account_table); |
269 | 158 | if (send_enabled) { | 169 | if (send_enabled) { |
270 | 159 | priv->has_configured_accounts = TRUE; | 170 | priv->has_configured_accounts = TRUE; |
271 | 171 | GValue *value = g_hash_table_lookup (account_table, "service"); | ||
272 | 172 | if (value != NULL) | ||
273 | 173 | list = g_list_append (list, | ||
274 | 174 | g_strdup (g_value_get_string (value))); | ||
275 | 160 | } | 175 | } |
276 | 161 | } | 176 | } |
277 | 162 | 177 | ||
278 | 178 | if (priv->accounts_string != NULL) { | ||
279 | 179 | g_free(priv->accounts_string); | ||
280 | 180 | priv->accounts_string = NULL; | ||
281 | 181 | } | ||
282 | 182 | |||
283 | 183 | guint len = g_list_length (list); | ||
284 | 184 | if (len > 0) { | ||
285 | 185 | GList *item0 = g_list_nth (list, 0); | ||
286 | 186 | GList *item1 = g_list_nth (list, 1); | ||
287 | 187 | if (len == 1) | ||
288 | 188 | priv->accounts_string = g_strconcat (_("Post to: "), | ||
289 | 189 | item0->data, | ||
290 | 190 | "...", NULL); | ||
291 | 191 | else if (len < 3) | ||
292 | 192 | priv->accounts_string = g_strconcat (_("Post to: "), | ||
293 | 193 | item0->data, | ||
294 | 194 | ", ", | ||
295 | 195 | item1->data, | ||
296 | 196 | "...", NULL); | ||
297 | 197 | else | ||
298 | 198 | priv->accounts_string = g_strdup (_("Post to: multiple networks...")); | ||
299 | 199 | g_debug ("accounts_string: %s", priv->accounts_string); | ||
300 | 200 | } | ||
301 | 201 | |||
302 | 202 | g_list_foreach (list, (GFunc) g_free, NULL); | ||
303 | 203 | g_list_free (list); | ||
304 | 204 | |||
305 | 163 | g_signal_emit (G_OBJECT (self), | 205 | g_signal_emit (G_OBJECT (self), |
306 | 164 | ME_GWIBBER_SERVICE_SIGNAL_STATUS_CHANGED_ID, | 206 | ME_GWIBBER_SERVICE_SIGNAL_STATUS_CHANGED_ID, |
307 | 165 | 0, priv->status, TRUE); | 207 | 0, priv->status, TRUE); |
308 | 166 | 208 | ||
309 | 167 | g_hash_table_destroy(accounts_table); | 209 | g_hash_table_destroy(accounts_table); |
310 | 210 | |||
311 | 168 | return; | 211 | return; |
312 | 212 | |||
313 | 213 | reset_accounts_string: | ||
314 | 214 | |||
315 | 215 | if (priv->accounts_string != NULL) { | ||
316 | 216 | g_free(priv->accounts_string); | ||
317 | 217 | priv->accounts_string = NULL; | ||
318 | 218 | } | ||
319 | 169 | } | 219 | } |
320 | 170 | 220 | ||
321 | 171 | static void | 221 | static void |
322 | @@ -300,3 +350,13 @@ | |||
323 | 300 | 350 | ||
324 | 301 | return priv->has_configured_accounts; | 351 | return priv->has_configured_accounts; |
325 | 302 | } | 352 | } |
326 | 353 | |||
327 | 354 | const gchar * | ||
328 | 355 | me_gwibber_service_get_accounts_string (MeGwibberService *self) | ||
329 | 356 | { | ||
330 | 357 | g_return_val_if_fail (IS_ME_GWIBBER_SERVICE (self), FALSE); | ||
331 | 358 | |||
332 | 359 | MeGwibberServicePrivate * priv = ME_GWIBBER_SERVICE_GET_PRIVATE(self); | ||
333 | 360 | |||
334 | 361 | return priv->accounts_string; | ||
335 | 362 | } | ||
336 | 303 | 363 | ||
337 | === modified file 'src/me-service-gwibber.h' | |||
338 | --- src/me-service-gwibber.h 2010-08-16 15:11:05 +0000 | |||
339 | +++ src/me-service-gwibber.h 2010-09-16 14:51:54 +0000 | |||
340 | @@ -68,6 +68,7 @@ | |||
341 | 68 | MeGwibberService * me_gwibber_service_get (void); | 68 | MeGwibberService * me_gwibber_service_get (void); |
342 | 69 | void me_gwibber_service_send (MeGwibberService *self, const gchar *msg); | 69 | void me_gwibber_service_send (MeGwibberService *self, const gchar *msg); |
343 | 70 | gboolean me_gwibber_service_has_configured_accounts (MeGwibberService *self); | 70 | gboolean me_gwibber_service_has_configured_accounts (MeGwibberService *self); |
344 | 71 | const gchar * me_gwibber_service_get_accounts_string (MeGwibberService *self); | ||
345 | 71 | 72 | ||
346 | 72 | G_END_DECLS | 73 | G_END_DECLS |
347 | 73 | 74 | ||
348 | 74 | 75 | ||
349 | === modified file 'src/me-service.c' | |||
350 | --- src/me-service.c 2010-09-09 13:26:05 +0000 | |||
351 | +++ src/me-service.c 2010-09-16 14:51:54 +0000 | |||
352 | @@ -189,6 +189,8 @@ | |||
353 | 189 | if (! dbusmenu_menuitem_property_get_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE)) | 189 | if (! dbusmenu_menuitem_property_get_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE)) |
354 | 190 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); | 190 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); |
355 | 191 | 191 | ||
356 | 192 | dbusmenu_menuitem_property_set (broadcast_field, DBUSMENU_ENTRY_MENUITEM_PROP_HINT, me_gwibber_service_get_accounts_string (instance)); | ||
357 | 193 | |||
358 | 192 | return; | 194 | return; |
359 | 193 | } | 195 | } |
360 | 194 | 196 | ||
361 | @@ -409,6 +411,7 @@ | |||
362 | 409 | #endif | 411 | #endif |
363 | 410 | 412 | ||
364 | 411 | broadcast_field = DBUSMENU_MENUITEM (entry_menu_item_new()); | 413 | broadcast_field = DBUSMENU_MENUITEM (entry_menu_item_new()); |
365 | 414 | dbusmenu_menuitem_property_set (broadcast_field, DBUSMENU_ENTRY_MENUITEM_PROP_HINT, _("Post message...")); | ||
366 | 412 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); | 415 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); |
367 | 413 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); | 416 | dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |
368 | 414 | dbusmenu_menuitem_child_append(root, broadcast_field); | 417 | dbusmenu_menuitem_child_append(root, broadcast_field); |
A few concerns.
* This patch adds several translatable strings. So I don't think it can land for Maverick.
* And this comment:
179 + /* this is dangerous: it leaves the signal connected even if the dbusmenu
180 + object is disposed, for example if the service quits
181 + */
We should just remove the signal handler on distruction instead of not having it, or delete the code entirely if it's not needed.
*