Merge lp:~ken-vandine/indicator-me/remove_about_me into lp:indicator-me
- remove_about_me
- Merge into trunk
Proposed by
Ken VanDine
Status: | Merged |
---|---|
Approved by: | Ted Gould |
Approved revision: | 151 |
Merged at revision: | 151 |
Proposed branch: | lp:~ken-vandine/indicator-me/remove_about_me |
Merge into: | lp:indicator-me |
Diff against target: |
603 lines (+0/-501) 6 files modified
src/Makefile.am (+0/-2) src/about-me-menu-item.c (+0/-313) src/about-me-menu-item.h (+0/-66) src/dbus-shared-names.h (+0/-1) src/indicator-me.c (+0/-48) src/me-service.c (+0/-71) |
To merge this branch: | bzr merge lp:~ken-vandine/indicator-me/remove_about_me |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ted Gould (community) | Approve | ||
Review via email: mp+66023@code.launchpad.net |
Commit message
Description of the change
Removed the about me menu, it doesn't exist in oneiric.
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/Makefile.am' |
2 | --- src/Makefile.am 2011-02-17 15:58:10 +0000 |
3 | +++ src/Makefile.am 2011-06-27 16:40:07 +0000 |
4 | @@ -8,8 +8,6 @@ |
5 | melibdir = $(INDICATORDIR) |
6 | melib_LTLIBRARIES = libme.la |
7 | libme_la_SOURCES = \ |
8 | - about-me-menu-item.c \ |
9 | - about-me-menu-item.h \ |
10 | indicator-me.c \ |
11 | dbus-shared-names.h \ |
12 | gen-me-service.xml.h \ |
13 | |
14 | === removed file 'src/about-me-menu-item.c' |
15 | --- src/about-me-menu-item.c 2010-04-14 14:52:10 +0000 |
16 | +++ src/about-me-menu-item.c 1970-01-01 00:00:00 +0000 |
17 | @@ -1,313 +0,0 @@ |
18 | -/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ |
19 | -/* |
20 | - * Copyright 2010 Canonical, Ltd. |
21 | - * |
22 | - * This program is free software: you can redistribute it and/or modify it |
23 | - * under the terms of either or both of the following licenses: |
24 | - * |
25 | - * 1) the GNU Lesser General Public License version 3, as published by the |
26 | - * Free Software Foundation; and/or |
27 | - * 2) the GNU Lesser General Public License version 2.1, as published by |
28 | - * the Free Software Foundation. |
29 | - * |
30 | - * This program is distributed in the hope that it will be useful, but |
31 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
32 | - * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
33 | - * PURPOSE. See the applicable version of the GNU Lesser General Public |
34 | - * License for more details. |
35 | - * |
36 | - * You should have received a copy of both the GNU Lesser General Public |
37 | - * License version 3 and version 2.1 along with this program. If not, see |
38 | - * <http://www.gnu.org/licenses/> |
39 | - * |
40 | - * Authors: |
41 | - * David Barth <david.barth@canonical.com> |
42 | - * Cody Russell <crussell@canonical.com> |
43 | - */ |
44 | - |
45 | -#include <sys/types.h> |
46 | -#include <sys/stat.h> |
47 | -#include <unistd.h> |
48 | - |
49 | -#include <glib/gstdio.h> |
50 | - |
51 | -#include <gtk/gtk.h> |
52 | -#include "about-me-menu-item.h" |
53 | - |
54 | -static GObject* about_me_menu_item_constructor (GType type, |
55 | - guint n_construct_properties, |
56 | - GObjectConstructParam *construct_params); |
57 | -static void about_me_menu_item_set_property (GObject *object, |
58 | - guint prop_id, |
59 | - const GValue *value, |
60 | - GParamSpec *pspec); |
61 | -static void about_me_menu_item_get_property (GObject *object, |
62 | - guint prop_id, |
63 | - GValue *value, |
64 | - GParamSpec *pspec); |
65 | - |
66 | -struct _AboutMeMenuItemPrivate { |
67 | - GtkWidget *label; |
68 | - GtkWidget *image; |
69 | - GtkWidget *hbox; |
70 | - gchar *realname; |
71 | -}; |
72 | - |
73 | -enum { |
74 | - PROP_0, |
75 | - PROP_REALNAME |
76 | -}; |
77 | - |
78 | -G_DEFINE_TYPE (AboutMeMenuItem, about_me_menu_item, GTK_TYPE_MENU_ITEM) |
79 | - |
80 | -#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ABOUT_ME_TYPE_MENU_ITEM, AboutMeMenuItemPrivate)) |
81 | - |
82 | -static void |
83 | -about_me_menu_item_class_init (AboutMeMenuItemClass *item_class) |
84 | -{ |
85 | - GObjectClass *gobject_class = G_OBJECT_CLASS (item_class); |
86 | - |
87 | - gobject_class->constructor = about_me_menu_item_constructor; |
88 | - gobject_class->set_property = about_me_menu_item_set_property; |
89 | - gobject_class->get_property = about_me_menu_item_get_property; |
90 | - |
91 | - g_object_class_install_property (gobject_class, |
92 | - PROP_REALNAME, |
93 | - g_param_spec_string ("realname", |
94 | - "Realname", |
95 | - "The \"Realname\" for the user", |
96 | - NULL, |
97 | - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); |
98 | - |
99 | - g_type_class_add_private (gobject_class, sizeof (AboutMeMenuItemPrivate)); |
100 | -} |
101 | - |
102 | -static void |
103 | -about_me_menu_item_init (AboutMeMenuItem *self) |
104 | -{ |
105 | - AboutMeMenuItemPrivate *priv = GET_PRIVATE (self); |
106 | - |
107 | - priv->label = NULL; |
108 | - priv->image = NULL; |
109 | - priv->realname = NULL; |
110 | -} |
111 | - |
112 | -static void |
113 | -about_me_menu_item_set_property (GObject *object, |
114 | - guint prop_id, |
115 | - const GValue *value, |
116 | - GParamSpec *pspec) |
117 | -{ |
118 | - AboutMeMenuItem *menu_item = ABOUT_ME_MENU_ITEM (object); |
119 | - AboutMeMenuItemPrivate *priv = GET_PRIVATE (menu_item); |
120 | - |
121 | - switch (prop_id) |
122 | - { |
123 | - case PROP_REALNAME: |
124 | - g_assert (priv->realname == NULL); |
125 | - priv->realname = g_strdup (g_value_get_string (value)); |
126 | - break; |
127 | - |
128 | - default: |
129 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
130 | - break; |
131 | - } |
132 | -} |
133 | - |
134 | -static void |
135 | -about_me_menu_item_get_property (GObject *object, |
136 | - guint prop_id, |
137 | - GValue *value, |
138 | - GParamSpec *pspec) |
139 | -{ |
140 | - AboutMeMenuItem *menu_item = ABOUT_ME_MENU_ITEM (object); |
141 | - AboutMeMenuItemPrivate *priv = GET_PRIVATE (menu_item); |
142 | - |
143 | - switch (prop_id) |
144 | - { |
145 | - case PROP_REALNAME: |
146 | - g_value_set_string (value, priv->realname); |
147 | - break; |
148 | - |
149 | - default: |
150 | - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
151 | - break; |
152 | - } |
153 | -} |
154 | - |
155 | -#define DEFAULT_PIXELS_PER_EM 10.0f |
156 | - |
157 | -static gdouble |
158 | -get_pixels_per_em (GtkWidget *widget) |
159 | -{ |
160 | - g_return_val_if_fail (GTK_IS_WIDGET (widget), DEFAULT_PIXELS_PER_EM); |
161 | - |
162 | - /* Note: taken from indicator-session */ |
163 | - GtkStyle * style = gtk_widget_get_style(widget); |
164 | - |
165 | - PangoLayout * layout = pango_layout_new(gtk_widget_get_pango_context(widget)); |
166 | - pango_layout_set_text(layout, "M", -1); |
167 | - pango_layout_set_font_description(layout, style->font_desc); |
168 | - |
169 | - gint width; |
170 | - pango_layout_get_pixel_size(layout, &width, NULL); |
171 | - |
172 | - gint point = pango_font_description_get_size(style->font_desc); |
173 | - gdouble dpi = gdk_screen_get_resolution(gdk_screen_get_default()); |
174 | - |
175 | - return ((point * dpi) / 72.0f) / PANGO_SCALE; |
176 | -} |
177 | - |
178 | - |
179 | -/* from n-osd */ |
180 | -static GdkPixbuf* |
181 | -load_icon (const gchar* filename, |
182 | - gint icon_size) |
183 | -{ |
184 | - GdkPixbuf* buffer = NULL; |
185 | - GdkPixbuf* pixbuf = NULL; |
186 | - GtkIconTheme* theme = NULL; |
187 | - GError* error = NULL; |
188 | - |
189 | - /* sanity check */ |
190 | - g_return_val_if_fail (filename, NULL); |
191 | - |
192 | - theme = gtk_icon_theme_get_default (); |
193 | - buffer = gtk_icon_theme_load_icon (theme, |
194 | - filename, |
195 | - icon_size, |
196 | - GTK_ICON_LOOKUP_FORCE_SVG | |
197 | - GTK_ICON_LOOKUP_GENERIC_FALLBACK | |
198 | - GTK_ICON_LOOKUP_FORCE_SIZE, |
199 | - &error); |
200 | - if (error) |
201 | - { |
202 | - g_print ("loading icon '%s' caused error: '%s'", |
203 | - filename, |
204 | - error->message); |
205 | - g_error_free (error); |
206 | - error = NULL; |
207 | - pixbuf = NULL; |
208 | - } |
209 | - else |
210 | - { |
211 | - /* copy and unref buffer so on an icon-theme change old |
212 | - ** icons are not kept in memory due to dangling |
213 | - ** references, this also makes sure we do not need to |
214 | - ** connect to GtkWidget::style-set signal for the |
215 | - ** GdkPixbuf we get from gtk_icon_theme_load_icon() */ |
216 | - pixbuf = gdk_pixbuf_copy (buffer); |
217 | - g_object_unref (buffer); |
218 | - } |
219 | - |
220 | - return pixbuf; |
221 | -} |
222 | - |
223 | -gboolean |
224 | -about_me_menu_item_load_avatar (AboutMeMenuItem *self, const gchar *file) |
225 | -{ |
226 | - g_return_val_if_fail (ABOUT_IS_ME_MENU_ITEM (self), FALSE); |
227 | - |
228 | - AboutMeMenuItemPrivate *priv = GET_PRIVATE (self); |
229 | - |
230 | - g_debug ("loading avatar from file %s", file); |
231 | - |
232 | - struct stat buf; |
233 | - if (! (g_stat (file, &buf) == 0 && buf.st_size > 0)) { |
234 | - g_warning ("%s: not found or empty", file); |
235 | - return FALSE; |
236 | - } |
237 | - |
238 | - if (buf.st_size > 1024*1024) { |
239 | - g_warning ("avatar file too large (%lld)", (long long)buf.st_size); |
240 | - return FALSE; |
241 | - } |
242 | - |
243 | - GError *error = NULL; |
244 | - int size = get_pixels_per_em (priv->image) * 3; |
245 | - |
246 | - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_scale (file, -1, size, TRUE, |
247 | - &error); |
248 | - if (pixbuf == NULL) { |
249 | - if (error != NULL) { |
250 | - g_warning ("Couldn't read file %s: %s", file, error->message); |
251 | - g_error_free (error); |
252 | - } |
253 | - return FALSE; |
254 | - } |
255 | - |
256 | - gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), pixbuf); |
257 | - |
258 | - g_object_unref (pixbuf); |
259 | - |
260 | - return TRUE; |
261 | -} |
262 | - |
263 | -static void |
264 | -image_size_allocate (GtkWidget *widget, |
265 | - GtkAllocation *allocation, |
266 | - gpointer user_data) |
267 | -{ |
268 | - gint max = MAX (allocation->width, allocation->height); |
269 | - |
270 | - gtk_widget_set_size_request (widget, max, max); |
271 | -} |
272 | - |
273 | -static GObject* |
274 | -about_me_menu_item_constructor (GType type, |
275 | - guint n_construct_properties, |
276 | - GObjectConstructParam *construct_params) |
277 | -{ |
278 | - GObject *object; |
279 | - GtkWidget *hbox; |
280 | - GtkWidget *align; |
281 | - AboutMeMenuItemPrivate *priv; |
282 | - object = G_OBJECT_CLASS (about_me_menu_item_parent_class)->constructor (type, |
283 | - n_construct_properties, |
284 | - construct_params); |
285 | - |
286 | - priv = GET_PRIVATE (object); |
287 | - |
288 | - GtkWidget *frame = gtk_frame_new (NULL); |
289 | - gdouble pixels_per_em = get_pixels_per_em (frame); |
290 | - GdkPixbuf *pixbuf = load_icon ("stock_person-panel", pixels_per_em * 3); |
291 | - if (pixbuf == NULL) |
292 | - pixbuf = load_icon ("stock_person", pixels_per_em * 3); |
293 | - priv->image = gtk_image_new_from_pixbuf (pixbuf); |
294 | - g_signal_connect (frame, "size-allocate", G_CALLBACK (image_size_allocate), NULL); |
295 | - gtk_misc_set_padding (GTK_MISC (priv->image), 2, 2); |
296 | - gtk_container_add (GTK_CONTAINER (frame), priv->image); |
297 | - |
298 | - align = gtk_alignment_new (0, 0.3, 0, 0); |
299 | - priv->label = gtk_label_new (priv->realname); |
300 | - gtk_misc_set_padding (GTK_MISC (priv->label), 2, 2); |
301 | - gtk_container_add (GTK_CONTAINER (align), priv->label); |
302 | - |
303 | - hbox = gtk_hbox_new (FALSE, 0); |
304 | - gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); |
305 | - gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, TRUE, DEFAULT_PIXELS_PER_EM); |
306 | - |
307 | - gtk_container_add (GTK_CONTAINER (object), hbox); |
308 | - gtk_widget_show_all (GTK_WIDGET(object)); |
309 | - |
310 | - priv->hbox = hbox; |
311 | - |
312 | - return object; |
313 | -} |
314 | - |
315 | -/** |
316 | - * about_me_menu_item_new: |
317 | - * @realname: the name to display in the new menu item. |
318 | - * @returns: a new #AboutMeMenuItem. |
319 | - * |
320 | - * Creates a new #AboutMeMenuItem with a name. |
321 | - **/ |
322 | -GtkWidget* |
323 | -about_me_menu_item_new (const gchar *realname) |
324 | -{ |
325 | - return g_object_new (ABOUT_ME_TYPE_MENU_ITEM, |
326 | - "realname", realname, |
327 | - NULL); |
328 | -} |
329 | - |
330 | -#define __ABOUT_ME_MENU_ITEM_C__ |
331 | |
332 | === removed file 'src/about-me-menu-item.h' |
333 | --- src/about-me-menu-item.h 2011-06-22 18:29:03 +0000 |
334 | +++ src/about-me-menu-item.h 1970-01-01 00:00:00 +0000 |
335 | @@ -1,66 +0,0 @@ |
336 | -/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */ |
337 | -/* |
338 | - * Copyright 2010 Canonical, Ltd. |
339 | - * |
340 | - * This program is free software: you can redistribute it and/or modify it |
341 | - * under the terms of either or both of the following licenses: |
342 | - * |
343 | - * 1) the GNU Lesser General Public License version 3, as published by the |
344 | - * Free Software Foundation; and/or |
345 | - * 2) the GNU Lesser General Public License version 2.1, as published by |
346 | - * the Free Software Foundation. |
347 | - * |
348 | - * This program is distributed in the hope that it will be useful, but |
349 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
350 | - * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR |
351 | - * PURPOSE. See the applicable version of the GNU Lesser General Public |
352 | - * License for more details. |
353 | - * |
354 | - * You should have received a copy of both the GNU Lesser General Public |
355 | - * License version 3 and version 2.1 along with this program. If not, see |
356 | - * <http://www.gnu.org/licenses/> |
357 | - * |
358 | - * Authors: |
359 | - * David Barth <david.barth@canonical.com> |
360 | - * Cody Russell <crussell@canonical.com> |
361 | - */ |
362 | - |
363 | -#ifndef __ABOUT_ME_MENU_ITEM_H__ |
364 | -#define __ABOUT_ME_MENU_ITEM_H__ |
365 | - |
366 | -#include <gtk/gtk.h> |
367 | - |
368 | -G_BEGIN_DECLS |
369 | - |
370 | -#define ABOUT_ME_TYPE_MENU_ITEM (about_me_menu_item_get_type ()) |
371 | -#define ABOUT_ME_MENU_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ABOUT_ME_TYPE_MENU_ITEM, AboutMeMenuItem)) |
372 | -#define ABOUT_ME_MENU_ITEM_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), ABOUT_ME_TYPE_MENU_ITEM, AboutMeMenuItemClass)) |
373 | -#define ABOUT_IS_ME_MENU_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ABOUT_ME_TYPE_MENU_ITEM)) |
374 | -#define ABOUT_IS_ME_MENU_ITEM_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), ABOUT_ME_TYPE_MENU_ITEM)) |
375 | -#define ABOUT_ME_MENU_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ABOUT_ME_TYPE_MENU_ITEM, AboutMeMenuItemClass)) |
376 | - |
377 | - |
378 | -typedef struct _AboutMeMenuItem AboutMeMenuItem; |
379 | -typedef struct _AboutMeMenuItemClass AboutMeMenuItemClass; |
380 | -typedef struct _AboutMeMenuItemPrivate AboutMeMenuItemPrivate; |
381 | - |
382 | -struct _AboutMeMenuItem |
383 | -{ |
384 | - GtkMenuItem parent_instance; |
385 | - |
386 | - AboutMeMenuItemPrivate *priv; |
387 | -}; |
388 | - |
389 | -struct _AboutMeMenuItemClass |
390 | -{ |
391 | - GtkMenuItemClass parent_class; |
392 | -}; |
393 | - |
394 | - |
395 | -GType about_me_menu_item_get_type (void) G_GNUC_CONST; |
396 | -GtkWidget *about_me_menu_item_new (const gchar *name); |
397 | -gboolean about_me_menu_item_load_avatar (AboutMeMenuItem *self, const gchar *file); |
398 | - |
399 | -G_END_DECLS |
400 | - |
401 | -#endif /* __ABOUT_ME_MENU_ITEM_H__ */ |
402 | |
403 | === modified file 'src/dbus-shared-names.h' |
404 | --- src/dbus-shared-names.h 2011-01-14 21:30:09 +0000 |
405 | +++ src/dbus-shared-names.h 2011-06-27 16:40:07 +0000 |
406 | @@ -34,7 +34,6 @@ |
407 | #define DBUSMENU_ENTRY_MENUITEM_PROP_TEXT "text" |
408 | #define DBUSMENU_ENTRY_MENUITEM_PROP_HINT "hint" |
409 | |
410 | -#define DBUSMENU_ABOUT_ME_MENUITEM_TYPE "x-canonical-about-me-item" |
411 | #define DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME "name" |
412 | #define DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON "icon" |
413 | |
414 | |
415 | === modified file 'src/indicator-me.c' |
416 | --- src/indicator-me.c 2011-06-22 18:29:03 +0000 |
417 | +++ src/indicator-me.c 2011-06-27 16:40:07 +0000 |
418 | @@ -41,8 +41,6 @@ |
419 | #include <libindicator/indicator-image-helper.h> |
420 | #include <libido/idoentrymenuitem.h> |
421 | |
422 | -#include "about-me-menu-item.h" |
423 | - |
424 | #include "dbus-shared-names.h" |
425 | #include "gen-me-service.xml.h" |
426 | |
427 | @@ -101,10 +99,6 @@ |
428 | DbusmenuMenuitem * parent, |
429 | DbusmenuClient * client, |
430 | gpointer user_data); |
431 | -static gboolean new_about_me_item (DbusmenuMenuitem * newitem, |
432 | - DbusmenuMenuitem * parent, |
433 | - DbusmenuClient * client, |
434 | - gpointer user_data); |
435 | static void entry_activate_cb (GtkEntry *entry, DbusmenuMenuitem *mi); |
436 | static void entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GVariant *value, GtkEntry *entry); |
437 | static gboolean entry_hint_is_shown (GtkWidget *widget); |
438 | @@ -665,47 +659,6 @@ |
439 | return TRUE; |
440 | } |
441 | |
442 | -/* Whenever we have a property change on a DbusmenuMenuitem |
443 | - we need to be responsive to that. */ |
444 | -static void |
445 | -about_me_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * value, AboutMeMenuItem *item) |
446 | -{ |
447 | - g_return_if_fail (ABOUT_IS_ME_MENU_ITEM (item)); |
448 | - |
449 | - if (!g_strcmp0(prop, DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON)) { |
450 | - /* reload the avatar icon */ |
451 | - about_me_menu_item_load_avatar (item, g_variant_get_string(value, NULL)); |
452 | - } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_VISIBLE)) { |
453 | - /* normal, ignore */ |
454 | - } else { |
455 | - g_warning("Indicator Item property '%s' unknown", prop); |
456 | - } |
457 | - |
458 | - return; |
459 | -} |
460 | - |
461 | -static gboolean |
462 | -new_about_me_item (DbusmenuMenuitem * newitem, |
463 | - DbusmenuMenuitem * parent, |
464 | - DbusmenuClient * client, |
465 | - gpointer user_data) |
466 | -{ |
467 | - g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE); |
468 | - g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); |
469 | - /* Note: not checking parent, it's reasonable for it to be NULL */ |
470 | - |
471 | - const gchar *name = dbusmenu_menuitem_property_get (newitem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME); |
472 | - AboutMeMenuItem *about = ABOUT_ME_MENU_ITEM (about_me_menu_item_new (name)); |
473 | - if (about != NULL) { |
474 | - dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(about), parent); |
475 | - const gchar *avatar = dbusmenu_menuitem_property_get (newitem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON); |
476 | - about_me_menu_item_load_avatar (about, avatar); |
477 | - g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(about_me_prop_change_cb), about); |
478 | - } |
479 | - |
480 | - return TRUE; |
481 | -} |
482 | - |
483 | /* Builds the dbusmenu for the service. */ |
484 | static GtkMenu * |
485 | get_menu (IndicatorObject * io) |
486 | @@ -714,7 +667,6 @@ |
487 | DbusmenuGtkClient * client = dbusmenu_gtkmenu_get_client(menu); |
488 | |
489 | dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_ENTRY_MENUITEM_TYPE, new_entry_item); |
490 | - dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_ABOUT_ME_MENUITEM_TYPE, new_about_me_item); |
491 | |
492 | return GTK_MENU (menu); |
493 | } |
494 | |
495 | === modified file 'src/me-service.c' |
496 | --- src/me-service.c 2011-04-18 04:00:53 +0000 |
497 | +++ src/me-service.c 2011-06-27 16:40:07 +0000 |
498 | @@ -88,7 +88,6 @@ |
499 | static GMainLoop * mainloop = NULL; |
500 | static StatusServiceDbus * dbus_interface = NULL; |
501 | static StatusProviderStatus global_status = STATUS_PROVIDER_STATUS_DISCONNECTED; |
502 | -static GFileMonitor *avatar_monitor = NULL; |
503 | static DbusmenuMenuitem *broadcast_field = NULL; |
504 | static DbusmenuMenuitem * useritem = NULL; |
505 | static GSettings *gsettings = NULL; |
506 | @@ -341,48 +340,6 @@ |
507 | (value == 0) ? FALSE : TRUE); |
508 | } |
509 | |
510 | - |
511 | -/* disabled for this release */ |
512 | -#if 0 |
513 | -static void |
514 | -avatar_changed_cb (GFileMonitor * monitor, GFile * file, GFile * other_file, GFileMonitorEvent event_type, gpointer user_data) |
515 | -{ |
516 | - g_debug("avatar changed!"); |
517 | - |
518 | - g_return_if_fail (DBUSMENU_IS_MENUITEM (user_data)); |
519 | - |
520 | - DbusmenuMenuitem *mi = DBUSMENU_MENUITEM (user_data); |
521 | - |
522 | - /* whatever happened, we just update the icon property |
523 | - and let the indicator reload the image */ |
524 | - gchar * path = g_file_get_path (file); |
525 | - dbusmenu_menuitem_property_set (mi, DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON, path); |
526 | -} |
527 | - |
528 | -static void |
529 | -build_avatar_item (DbusmenuMenuitem * root) |
530 | -{ |
531 | - useritem = dbusmenu_menuitem_new(); |
532 | - dbusmenu_menuitem_property_set(useritem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_NAME, g_get_real_name ()); |
533 | - dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); |
534 | - dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |
535 | - dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_ABOUT_ME_MENUITEM_TYPE); |
536 | - dbusmenu_menuitem_child_append(root, useritem); |
537 | - |
538 | - /* avatar icon */ |
539 | - gchar *filename = g_build_filename (g_get_home_dir (), ".face", NULL); |
540 | - dbusmenu_menuitem_property_set (useritem, DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON, filename); |
541 | - GFile *file = g_file_new_for_path (filename); |
542 | - avatar_monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, NULL); |
543 | - if (avatar_monitor != NULL) |
544 | - g_signal_connect (G_OBJECT (avatar_monitor), "changed", G_CALLBACK (avatar_changed_cb), useritem); |
545 | - |
546 | - g_free (filename); |
547 | - |
548 | - return; |
549 | -} |
550 | -#endif |
551 | - |
552 | #define GSETTINGS_SCHEMA "com.canonical.indicator.me" |
553 | #define GSETTINGS_DISPLAY "display" |
554 | |
555 | @@ -392,10 +349,6 @@ |
556 | DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data); |
557 | g_return_val_if_fail(DBUSMENU_IS_MENUITEM(root), FALSE); |
558 | |
559 | - /* disabled for this release */ |
560 | -#if 0 |
561 | - build_avatar_item(root); |
562 | -#endif |
563 | |
564 | broadcast_field = DBUSMENU_MENUITEM (entry_menu_item_new()); |
565 | dbusmenu_menuitem_property_set (broadcast_field, DBUSMENU_ENTRY_MENUITEM_PROP_HINT, _("Post message...")); |
566 | @@ -433,27 +386,6 @@ |
567 | |
568 | build_accounts_menuitems(root); |
569 | |
570 | - /* add a standard "About Me..." menu item at the end of the menu */ |
571 | - DbusmenuMenuitem *separator = dbusmenu_menuitem_new(); |
572 | - dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, |
573 | - DBUSMENU_CLIENT_TYPES_SEPARATOR); |
574 | - dbusmenu_menuitem_child_append(root, separator); |
575 | - |
576 | - useritem = dbusmenu_menuitem_new(); |
577 | - dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, _("About Me...")); |
578 | - dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); |
579 | - dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); |
580 | - dbusmenu_menuitem_child_append(root, useritem); |
581 | - |
582 | - gchar *gam = g_find_program_in_path("gnome-about-me"); |
583 | - if (gam != NULL) { |
584 | - dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); |
585 | - g_signal_connect(G_OBJECT(useritem), |
586 | - DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, |
587 | - G_CALLBACK(spawn_on_activate_cb), "gnome-about-me"); |
588 | - g_free(gam); |
589 | - } |
590 | - |
591 | /* finally set the menu name and update items visibility according |
592 | to a gsettings key and receive display mode notifications to update it |
593 | later */ |
594 | @@ -470,9 +402,6 @@ |
595 | { |
596 | g_debug("Service shutting down"); |
597 | |
598 | - if (avatar_monitor != NULL) |
599 | - g_object_unref (avatar_monitor); |
600 | - |
601 | g_main_loop_quit(mainloop); |
602 | return; |
603 | } |