Merge lp://qastaging/~indicator-applet-developers/indicator-me/lucid into lp://qastaging/~ubuntu-desktop/indicator-me/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~indicator-applet-developers/indicator-me/lucid
Merge into: lp://qastaging/~ubuntu-desktop/indicator-me/ubuntu
Diff against target: 683 lines (+473/-18)
12 files modified
Makefile.am (+1/-0)
configure.ac (+8/-6)
debian/changelog (+22/-0)
debian/control (+4/-3)
src/Makefile.am (+4/-0)
src/dbus-shared-names.h (+3/-0)
src/entry-menu-item.c (+136/-0)
src/entry-menu-item.h (+62/-0)
src/indicator-me.c (+54/-3)
src/me-service-gwibber.c (+85/-0)
src/me-service-gwibber.h (+35/-0)
src/me-service.c (+59/-6)
To merge this branch: bzr merge lp://qastaging/~indicator-applet-developers/indicator-me/lucid
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+18661@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

0.2.2

104. By Ted Gould

* Upstream Release 0.2.3
 * Fix for the signal prototype change in dbusmenu 0.2.2

105. By Ted Gould

releasing version 0.2.3-0ubuntu1~ppa1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile.am'
--- Makefile.am 2010-01-21 17:12:02 +0000
+++ Makefile.am 2010-02-05 01:56:12 +0000
@@ -3,6 +3,7 @@
3 src \3 src \
4 data \4 data \
5 po5 po
6EXTRA_DIST = autogen.sh
67
7DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall8DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
89
910
=== modified file 'configure.ac'
--- configure.ac 2010-01-21 17:12:02 +0000
+++ configure.ac 2010-02-05 01:56:12 +0000
@@ -1,11 +1,11 @@
11
2AC_INIT(indicator-me, 0.2.1, ted@canonical.com)2AC_INIT(indicator-me, 0.2.3, ted@canonical.com)
3AC_COPYRIGHT([Copyright 2009,2010 Canonical])3AC_COPYRIGHT([Copyright 2009, 2010 Canonical])
44
5AC_PREREQ(2.53)5AC_PREREQ(2.53)
66
7AM_CONFIG_HEADER(config.h)7AM_CONFIG_HEADER(config.h)
8AM_INIT_AUTOMAKE(indicator-me, 0.2.1)8AM_INIT_AUTOMAKE(indicator-me, 0.2.3)
99
10AM_MAINTAINER_MODE10AM_MAINTAINER_MODE
1111
@@ -28,13 +28,15 @@
2828
29GTK_REQUIRED_VERSION=2.1229GTK_REQUIRED_VERSION=2.12
30INDICATOR_REQUIRED_VERSION=0.3.030INDICATOR_REQUIRED_VERSION=0.3.0
31DBUSMENUGTK_REQUIRED_VERSION=0.2.031DBUSMENUGTK_REQUIRED_VERSION=0.2.2
32DBUSMENUGLIB_REQUIRED_VERSION=0.2.032DBUSMENUGLIB_REQUIRED_VERSION=0.2.2
33TELEPATHYGLIB_REQUIRED_VERSION=0.9.033TELEPATHYGLIB_REQUIRED_VERSION=0.9.0
34INDICATOR_DISPLAY_OBJECTS=0.1
3435
35PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION36PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
36 indicator >= $INDICATOR_REQUIRED_VERSION37 indicator >= $INDICATOR_REQUIRED_VERSION
37 dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION)38 libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS
39 dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION)
38PKG_CHECK_MODULES(MESERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION40PKG_CHECK_MODULES(MESERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
39 indicator >= $INDICATOR_REQUIRED_VERSION41 indicator >= $INDICATOR_REQUIRED_VERSION
40 telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)42 telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)
4143
=== modified file 'debian/changelog'
--- debian/changelog 2010-01-21 20:53:36 +0000
+++ debian/changelog 2010-02-05 01:56:12 +0000
@@ -1,3 +1,25 @@
1indicator-me (0.2.3-0ubuntu1~ppa1) lucid; urgency=low
2
3 * Upstream Release 0.2.3
4 * Fix for the signal prototype change in dbusmenu 0.2.2
5
6 -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 17:54:53 -0800
7
8indicator-me (0.2.2-0ubuntu1~ppa2) lucid; urgency=low
9
10 * debian/control: Adding in ido
11
12 -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 17:24:43 -0800
13
14indicator-me (0.2.2-0ubuntu1~ppa1) lucid; urgency=low
15
16 * Upstream Release 0.2.2
17 * Basic Gwibber support
18 * autogen.sh in tarball
19 * debian/control: dbusmenu* to version 0.2.2
20
21 -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 17:20:38 -0800
22
1indicator-me (0.2.1-0ubuntu1) lucid; urgency=low23indicator-me (0.2.1-0ubuntu1) lucid; urgency=low
224
3 * Upstream Merge25 * Upstream Merge
426
=== modified file 'debian/control'
--- debian/control 2010-01-11 14:33:32 +0000
+++ debian/control 2010-02-05 01:56:12 +0000
@@ -9,10 +9,11 @@
9 gnome-doc-utils,9 gnome-doc-utils,
10 scrollkeeper,10 scrollkeeper,
11 libindicator-dev (>= 0.3.0),11 libindicator-dev (>= 0.3.0),
12 libdbusmenu-glib-dev (>= 0.2.0),12 libdbusmenu-glib-dev (>= 0.2.2),
13 libdbusmenu-gtk-dev (>= 0.2.0),13 libdbusmenu-gtk-dev (>= 0.2.2),
14 intltool,14 intltool,
15 libtelepathy-glib-dev (>= 0.9.0)15 libtelepathy-glib-dev (>= 0.9.0),
16 libido-0.1-dev
16Standards-Version: 3.8.317Standards-Version: 3.8.3
17Homepage: https://launchpad.net/indicator-me18Homepage: https://launchpad.net/indicator-me
18Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-me/ubuntu19Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-me/ubuntu
1920
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2010-01-21 17:12:02 +0000
+++ src/Makefile.am 2010-02-05 01:56:12 +0000
@@ -20,10 +20,14 @@
20################20################
2121
22indicator_me_service_SOURCES = \22indicator_me_service_SOURCES = \
23 entry-menu-item.c \
24 entry-menu-item.h \
23 me-service.c \25 me-service.c \
24 me-service-dbus.h \26 me-service-dbus.h \
25 me-service-dbus.c \27 me-service-dbus.c \
26 me-service-server.h \28 me-service-server.h \
29 me-service-gwibber.c \
30 me-service-gwibber.h \
27 status-provider.h \31 status-provider.h \
28 status-provider.c \32 status-provider.c \
29 status-provider-mc5.h \33 status-provider-mc5.h \
3034
=== modified file 'src/dbus-shared-names.h'
--- src/dbus-shared-names.h 2010-01-03 05:41:48 +0000
+++ src/dbus-shared-names.h 2010-02-05 01:56:12 +0000
@@ -30,4 +30,7 @@
30#define INDICATOR_ME_SERVICE_DBUS_OBJECT "/org/ayatana/indicator/me/service"30#define INDICATOR_ME_SERVICE_DBUS_OBJECT "/org/ayatana/indicator/me/service"
31#define INDICATOR_ME_SERVICE_DBUS_INTERFACE "org.ayatana.indicator.me.service"31#define INDICATOR_ME_SERVICE_DBUS_INTERFACE "org.ayatana.indicator.me.service"
3232
33#define ENTRY_MENUITEM_TYPE "x-canonical-entry-item"
34#define ENTRY_MENUITEM_PROP_TEXT "text"
35
33#endif /* __DBUS_SHARED_NAMES_H__ */36#endif /* __DBUS_SHARED_NAMES_H__ */
3437
=== added file 'src/entry-menu-item.c'
--- src/entry-menu-item.c 1970-01-01 00:00:00 +0000
+++ src/entry-menu-item.c 2010-02-05 01:56:12 +0000
@@ -0,0 +1,136 @@
1/*
2An indicator to show information that is in messaging applications
3that the user is using.
4
5Copyright 2010 Canonical Ltd.
6
7Authors:
8 David Barth <david.barth@canonical.com>
9 Ted Gould <ted@canonical.com>
10
11This program is free software: you can redistribute it and/or modify it
12under the terms of the GNU General Public License version 3, as published
13by the Free Software Foundation.
14
15This program is distributed in the hope that it will be useful, but
16WITHOUT ANY WARRANTY; without even the implied warranties of
17MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
18PURPOSE. See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License along
21with this program. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
28#include <gdk/gdk.h>
29#include <glib/gi18n.h>
30#include "entry-menu-item.h"
31#include "dbus-shared-names.h"
32
33#include "me-service-gwibber.h"
34
35#include <libdbusmenu-glib/client.h>
36#include <libdbusmenu-glib/server.h>
37#include <libdbusmenu-glib/menuitem.h>
38
39enum {
40 LAST_SIGNAL
41};
42
43/* static guint signals[LAST_SIGNAL] = { }; */
44
45typedef struct _EntryMenuItemPrivate EntryMenuItemPrivate;
46struct _EntryMenuItemPrivate
47{
48 void * placeholder;
49};
50
51#define ENTRY_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ENTRY_MENU_ITEM_TYPE, EntryMenuItemPrivate))
52
53/* Prototypes */
54static void entry_menu_item_class_init (EntryMenuItemClass *klass);
55static void entry_menu_item_init (EntryMenuItem *self);
56static void entry_menu_item_dispose (GObject *object);
57static void entry_menu_item_finalize (GObject *object);
58static void handle_event (DbusmenuMenuitem *mi, const gchar *name,
59 const GValue *value, guint timestamp);
60
61G_DEFINE_TYPE (EntryMenuItem, entry_menu_item, DBUSMENU_TYPE_MENUITEM);
62
63static void
64entry_menu_item_class_init (EntryMenuItemClass *klass)
65{
66 GObjectClass *object_class = G_OBJECT_CLASS (klass);
67
68 g_type_class_add_private (klass, sizeof (EntryMenuItemPrivate));
69
70 object_class->dispose = entry_menu_item_dispose;
71 object_class->finalize = entry_menu_item_finalize;
72
73 DbusmenuMenuitemClass *mclass = DBUSMENU_MENUITEM_CLASS(klass);
74 mclass->handle_event = handle_event;
75
76 return;
77}
78
79static void
80entry_menu_item_init (EntryMenuItem *self)
81{
82 g_debug("Building new Entry Menu Item");
83 /* EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self); */
84
85 return;
86}
87
88static void
89entry_menu_item_dispose (GObject *object)
90{
91 /* EntryMenuItem * self = ENTRY_MENU_ITEM(object);
92 EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self); */
93
94 G_OBJECT_CLASS (entry_menu_item_parent_class)->dispose (object);
95}
96
97static void
98entry_menu_item_finalize (GObject *object)
99{
100 /*
101 EntryMenuItem * self = ENTRY_MENU_ITEM(object);
102 EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self);
103 */
104
105 G_OBJECT_CLASS (entry_menu_item_parent_class)->finalize (object);
106
107 return;
108}
109
110EntryMenuItem *
111entry_menu_item_new ()
112{
113 EntryMenuItem * self = g_object_new(ENTRY_MENU_ITEM_TYPE, NULL);
114 /* EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self); */
115
116 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_TYPE, ENTRY_MENUITEM_TYPE);
117
118 return self;
119}
120
121/* When the entry menu item is clicked on it emits a dbus signal
122 for the corresponding bottom-half service to act upon */
123static void
124handle_event (DbusmenuMenuitem *mi, const gchar *name,
125 const GValue *value, guint timestamp)
126{
127 /* EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self); */
128
129 g_debug ("handle_event");
130 if (g_strcmp0 (name, "send") == 0) {
131 gwibber_send (g_value_get_string (value));
132 dbusmenu_menuitem_property_set (mi, ENTRY_MENUITEM_PROP_TEXT, "");
133 }
134
135 return;
136}
0137
=== added file 'src/entry-menu-item.h'
--- src/entry-menu-item.h 1970-01-01 00:00:00 +0000
+++ src/entry-menu-item.h 2010-02-05 01:56:12 +0000
@@ -0,0 +1,62 @@
1/*
2An indicator to show information that is in messaging applications
3that the user is using.
4
5Copyright 2010 Canonical Ltd.
6
7Authors:
8 David Barth <david.barth@canonical.com>
9 Ted Gould <ted@canonical.com>
10
11This program is free software: you can redistribute it and/or modify it
12under the terms of the GNU General Public License version 3, as published
13by the Free Software Foundation.
14
15This program is distributed in the hope that it will be useful, but
16WITHOUT ANY WARRANTY; without even the implied warranties of
17MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
18PURPOSE. See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License along
21with this program. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#ifndef __ENTRY_MENU_ITEM_H__
25#define __ENTRY_MENU_ITEM_H__
26
27#include <glib.h>
28#include <glib-object.h>
29
30#include <libdbusmenu-glib/menuitem.h>
31
32G_BEGIN_DECLS
33
34#define ENTRY_MENU_ITEM_TYPE (entry_menu_item_get_type ())
35#define ENTRY_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENTRY_MENU_ITEM_TYPE, EntryMenuItem))
36#define ENTRY_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENTRY_MENU_ITEM_TYPE, EntryMenuItemClass))
37#define IS_ENTRY_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENTRY_MENU_ITEM_TYPE))
38#define IS_ENTRY_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENTRY_MENU_ITEM_TYPE))
39#define ENTRY_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENTRY_MENU_ITEM_TYPE, EntryMenuItemClass))
40
41#define ENTRY_MENU_ITEM_SIGNAL_ACTIVATE "activate"
42#define ENTRY_MENUITEM_PROP_TEXT "text"
43
44typedef struct _EntryMenuItem EntryMenuItem;
45typedef struct _EntryMenuItemClass EntryMenuItemClass;
46
47struct _EntryMenuItemClass {
48 DbusmenuMenuitemClass parent_class;
49};
50
51struct _EntryMenuItem {
52 DbusmenuMenuitem parent;
53};
54
55GType entry_menu_item_get_type (void);
56EntryMenuItem * entry_menu_item_new ();
57const gchar * entry_menu_item_get_text (EntryMenuItem * appitem);
58
59G_END_DECLS
60
61#endif /* __ENTRY_MENU_ITEM_H__ */
62
063
=== modified file 'src/indicator-me.c'
--- src/indicator-me.c 2010-01-03 05:42:47 +0000
+++ src/indicator-me.c 2010-02-05 01:56:12 +0000
@@ -23,6 +23,7 @@
23#include <glib.h>23#include <glib.h>
24#include <glib-object.h>24#include <glib-object.h>
25#include <gtk/gtk.h>25#include <gtk/gtk.h>
26#include <libdbusmenu-glib/menuitem.h>
26#include <libdbusmenu-gtk/menu.h>27#include <libdbusmenu-gtk/menu.h>
2728
28#include <dbus/dbus-glib.h>29#include <dbus/dbus-glib.h>
@@ -31,6 +32,7 @@
31#include <libindicator/indicator.h>32#include <libindicator/indicator.h>
32#include <libindicator/indicator-object.h>33#include <libindicator/indicator-object.h>
33#include <libindicator/indicator-service-manager.h>34#include <libindicator/indicator-service-manager.h>
35#include <libido/idoentrymenuitem.h>
3436
35#include "dbus-shared-names.h"37#include "dbus-shared-names.h"
36#include "me-service-client.h"38#include "me-service-client.h"
@@ -201,11 +203,60 @@
201 return;203 return;
202}204}
203205
206static void
207entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GValue *value, GtkEntry *entry)
208{
209 if (g_strcmp0 (prop, ENTRY_MENUITEM_PROP_TEXT) == 0) {
210 gtk_entry_set_text (entry, g_value_get_string (value));
211 }
212}
213
214static void
215activate_cb (GtkEntry *entry, DbusmenuMenuitem *gmi)
216{
217 GValue value = { 0 };
218 g_value_init (&value, G_TYPE_STRING);
219 g_value_set_static_string (&value, gtk_entry_get_text (entry));
220
221 g_debug ("user typed: %s", g_value_get_string (&value));
222
223 dbusmenu_menuitem_handle_event (gmi, "send", &value, gtk_get_current_event_time());
224}
225
226static gboolean
227new_entry_item (DbusmenuMenuitem * newitem,
228 DbusmenuMenuitem * parent,
229 DbusmenuClient * client)
230{
231 g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
232 g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
233 /* Note: not checking parent, it's reasonable for it to be NULL */
234
235 IdoEntryMenuItem *ido = IDO_ENTRY_MENU_ITEM (ido_entry_menu_item_new ());
236 GtkEntry *entry = GTK_ENTRY(ido_entry_menu_item_get_entry (ido));
237 if (dbusmenu_menuitem_property_get (newitem, ENTRY_MENUITEM_PROP_TEXT) != NULL)
238 gtk_entry_set_text(entry, dbusmenu_menuitem_property_get(newitem, ENTRY_MENUITEM_PROP_TEXT));
239
240 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(ido), parent);
241 /* disconnect the activate signal that newitem_base connected with the wrong
242 widget, ie menuitem, and re-connect it with the /entry/ instead */
243 gulong signal_id = g_signal_handler_find (GTK_MENU_ITEM (ido), G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, parent);
244 g_signal_handler_disconnect(GTK_MENU_ITEM (ido), signal_id);
245
246 g_signal_connect (DBUSMENU_MENUITEM (newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK (entry_prop_change_cb), entry);
247 g_signal_connect (GTK_ENTRY (entry), "activate", G_CALLBACK (activate_cb), newitem);
248
249 return TRUE;
250}
251
204/* Builds the dbusmenu for the service. */252/* Builds the dbusmenu for the service. */
205static GtkMenu *253static GtkMenu *
206get_menu (IndicatorObject * io)254get_menu (IndicatorObject * io)
207{255{
208 return GTK_MENU(dbusmenu_gtkmenu_new(INDICATOR_ME_DBUS_NAME, INDICATOR_ME_DBUS_OBJECT));256 DbusmenuGtkMenu *menu = dbusmenu_gtkmenu_new(INDICATOR_ME_DBUS_NAME, INDICATOR_ME_DBUS_OBJECT);
257 DbusmenuGtkClient * client = dbusmenu_gtkmenu_get_client(menu);
258
259 dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), ENTRY_MENUITEM_TYPE, new_entry_item);
260
261 return GTK_MENU (menu);
209}262}
210
211
212263
=== added file 'src/me-service-gwibber.c'
--- src/me-service-gwibber.c 1970-01-01 00:00:00 +0000
+++ src/me-service-gwibber.c 2010-02-05 01:56:12 +0000
@@ -0,0 +1,85 @@
1/*
2
3Logic to send messages via gwibber
4
5Copyright 2010 Canonical Ltd.
6
7Authors:
8 David Barth <david.barth@canonical.com>
9
10This program is free software: you can redistribute it and/or modify it
11under the terms of the GNU General Public License version 3, as published
12by the Free Software Foundation.
13
14This program is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranties of
16MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
17PURPOSE. See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License along
20with this program. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#include <glib.h>
24#include <dbus/dbus-glib.h>
25
26#define GWIBBER_ADDRESS "com.Gwibber.Service"
27#define GWIBBER_OBJECT "/com/gwibber/Service"
28#define GWIBBER_INTERFACE "com.Gwibber.Service"
29
30static DBusGProxy * gwibber_proxy = NULL;
31
32/*
33 static */ void
34gwibber_response (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data)
35{
36 g_debug ("gwibber_send_response");
37
38 return;
39}
40
41static void
42setup_gwibber_proxy (void) {
43 DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
44 g_return_if_fail(bus != NULL);
45
46 if (gwibber_proxy == NULL) {
47 gwibber_proxy = dbus_g_proxy_new_for_name(bus,
48 GWIBBER_ADDRESS,
49 GWIBBER_OBJECT,
50 GWIBBER_INTERFACE);
51 }
52 g_return_if_fail (gwibber_proxy != NULL);
53
54 return;
55}
56
57void
58gwibber_send (const gchar *msg)
59{
60 setup_gwibber_proxy ();
61
62 if (gwibber_proxy == NULL) {
63 g_warning ("Can not get a gwibber proxy object");
64 }
65
66 GValue value = {0};
67 g_value_init(&value, G_TYPE_STRING);
68 g_value_set_string(&value, msg);
69
70 g_debug ("gwibber_send: %s\n", msg);
71
72 dbus_g_proxy_begin_call(gwibber_proxy,
73 "SendMessage",
74 gwibber_response,
75 NULL,
76 NULL,
77 G_TYPE_VALUE,
78 &value,
79 G_TYPE_INVALID);
80
81 g_value_unset(&value);
82
83 return;
84}
85
086
=== added file 'src/me-service-gwibber.h'
--- src/me-service-gwibber.h 1970-01-01 00:00:00 +0000
+++ src/me-service-gwibber.h 2010-02-05 01:56:12 +0000
@@ -0,0 +1,35 @@
1/*
2
3Logic to send messages via gwibber
4
5Copyright 2010 Canonical Ltd.
6
7Authors:
8 David Barth <david.barth@canonical.com>
9
10This program is free software: you can redistribute it and/or modify it
11under the terms of the GNU General Public License version 3, as published
12by the Free Software Foundation.
13
14This program is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranties of
16MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
17PURPOSE. See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License along
20with this program. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#ifndef __ME_SERVICE_GWIBBER_H__
24#define __ME_SERVICE_GWIBBER_H__
25
26#include <glib.h>
27
28G_BEGIN_DECLS
29
30void gwibber_send (const gchar *msg);
31
32G_END_DECLS
33
34#endif /* __ME_SERVICE_GWIBBER_H__ */
35
036
=== modified file 'src/me-service.c'
--- src/me-service.c 2010-01-21 17:12:02 +0000
+++ src/me-service.c 2010-02-05 01:56:12 +0000
@@ -46,6 +46,8 @@
46#include "status-provider-pidgin.h"46#include "status-provider-pidgin.h"
47#include "status-provider-telepathy.h"47#include "status-provider-telepathy.h"
4848
49#include "entry-menu-item.h"
50
49typedef StatusProvider * (*newfunc) (void);51typedef StatusProvider * (*newfunc) (void);
50#define STATUS_PROVIDER_CNT 352#define STATUS_PROVIDER_CNT 3
51static newfunc status_provider_newfuncs[STATUS_PROVIDER_CNT] = {53static newfunc status_provider_newfuncs[STATUS_PROVIDER_CNT] = {
@@ -108,7 +110,7 @@
108 StatusProviderStatus i;110 StatusProviderStatus i;
109 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {111 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
110 if (status_menuitems[i] == NULL) continue;112 if (status_menuitems[i] == NULL) continue;
111 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, FALSE);113 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
112 }114 }
113 }115 }
114116
@@ -118,7 +120,7 @@
118 StatusProviderStatus i;120 StatusProviderStatus i;
119 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {121 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
120 if (status_menuitems[i] == NULL) continue;122 if (status_menuitems[i] == NULL) continue;
121 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, TRUE);123 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
122 }124 }
123 }125 }
124 }126 }
@@ -127,7 +129,7 @@
127}129}
128130
129static void131static void
130status_menu_click (DbusmenuMenuitem * mi, gpointer data)132status_menu_click (DbusmenuMenuitem * mi, guint timestamp, gpointer data)
131{133{
132 StatusProviderStatus status = (StatusProviderStatus)GPOINTER_TO_INT(data);134 StatusProviderStatus status = (StatusProviderStatus)GPOINTER_TO_INT(data);
133 g_debug("Setting status: %d", status);135 g_debug("Setting status: %d", status);
@@ -139,6 +141,47 @@
139 return;141 return;
140}142}
141143
144static void
145accounts_click (DbusmenuMenuitem *mi, gpointer user_data)
146{
147 GError * error = NULL;
148
149 if (!g_spawn_command_line_async(user_data, &error)) {
150 g_warning("Unable to start %s: %s", (char *)user_data, error->message);
151 g_error_free(error);
152 }
153}
154
155static void
156build_accounts_menuitems (gpointer data)
157{
158 DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);
159 g_return_if_fail(root != NULL);
160
161 /* FIXME: find cmd line parameters with ken-vandine */
162 DbusmenuMenuitem *im_accounts_mi = dbusmenu_menuitem_new();
163 dbusmenu_menuitem_property_set(im_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,
164 _("Chat Accounts..."));
165 dbusmenu_menuitem_child_append(root, im_accounts_mi);
166 g_signal_connect(G_OBJECT(im_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
167 G_CALLBACK(accounts_click), "empathy -a");
168
169 DbusmenuMenuitem *tw_accounts_mi = dbusmenu_menuitem_new();
170 dbusmenu_menuitem_property_set(tw_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,
171 _("Broadcast Accounts..."));
172 dbusmenu_menuitem_child_append(root, tw_accounts_mi);
173 g_signal_connect(G_OBJECT(tw_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
174 G_CALLBACK(accounts_click), "gwibber-accounts");
175
176 DbusmenuMenuitem *u1_accounts_mi = dbusmenu_menuitem_new();
177 dbusmenu_menuitem_property_set(u1_accounts_mi, DBUSMENU_MENUITEM_PROP_LABEL,
178 _("Ubuntu One..."));
179 dbusmenu_menuitem_child_append(root, u1_accounts_mi);
180 g_signal_connect(G_OBJECT(u1_accounts_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
181 G_CALLBACK(accounts_click), "ubuntuone-client-preferences");
182
183}
184
142static gboolean185static gboolean
143build_providers (gpointer data)186build_providers (gpointer data)
144{187{
@@ -172,7 +215,7 @@
172 if (name[0] != '\0') {215 if (name[0] != '\0') {
173 DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();216 DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
174 dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name);217 dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name);
175 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_SENSITIVE, FALSE);218 dbusmenu_menuitem_property_set_bool(useritem, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
176 dbusmenu_menuitem_child_append(root, useritem);219 dbusmenu_menuitem_child_append(root, useritem);
177 }220 }
178221
@@ -192,6 +235,9 @@
192235
193 build_user_item(root);236 build_user_item(root);
194237
238 DbusmenuMenuitem *entry = DBUSMENU_MENUITEM (entry_menu_item_new());
239 dbusmenu_menuitem_child_append(root, entry);
240
195 StatusProviderStatus i;241 StatusProviderStatus i;
196 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {242 for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
197 if (i == STATUS_PROVIDER_STATUS_DISCONNECTED) {243 if (i == STATUS_PROVIDER_STATUS_DISCONNECTED) {
@@ -203,9 +249,9 @@
203 status_menuitems[i] = dbusmenu_menuitem_new();249 status_menuitems[i] = dbusmenu_menuitem_new();
204250
205 dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i]));251 dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i]));
206 dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]);252 dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ICON_NAME, status_icons[i]);
207 if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) {253 if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) {
208 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, FALSE);254 dbusmenu_menuitem_property_set_bool(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
209 }255 }
210 g_signal_connect(G_OBJECT(status_menuitems[i]), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i));256 g_signal_connect(G_OBJECT(status_menuitems[i]), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i));
211257
@@ -214,6 +260,13 @@
214 g_debug("Built %s", status_strings[i]);260 g_debug("Built %s", status_strings[i]);
215 }261 }
216262
263 DbusmenuMenuitem *separator = dbusmenu_menuitem_new();
264 dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE,
265 DBUSMENU_CLIENT_TYPES_SEPARATOR);
266 dbusmenu_menuitem_child_append(root, separator);
267
268 build_accounts_menuitems(root);
269
217 return FALSE;270 return FALSE;
218}271}
219272

Subscribers

People subscribed via source and target branches

to all changes: