~skypce/indicator-session/indicator-session

« back to all changes in this revision

Viewing changes to src/status-service.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher, Ted Gould
  • Date: 2009-09-04 11:46:25 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090904114625-5g05rhvko39xyi34
Tags: 0.1.1-0ubuntu1
* set bzr-builddeb merge mode to true for easy tarball build

[ Ted Gould ]
* Upstream update 0.1.1 for dbusmenu 0.1.2 (LP: #423975)
* debian/control: Increasing dbusmenu dep to 0.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <dbus/dbus-glib.h>
31
31
#include <dbus/dbus-glib-bindings.h>
32
32
 
 
33
#include <libdbusmenu-glib/client.h>
33
34
#include <libdbusmenu-glib/server.h>
34
35
#include <libdbusmenu-glib/menuitem.h>
35
36
 
88
89
        if (global_status != oldglobal) {
89
90
                g_debug("Global status changed to: %s", _(status_strings[global_status]));
90
91
 
91
 
                dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status]));
 
92
                dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
92
93
                status_service_dbus_set_status(dbus_interface, status_icons[global_status]);
93
94
        }
94
95
 
165
166
                while (*walker != '\0' && *walker != ',') { walker++; }
166
167
                *walker = '\0';
167
168
 
168
 
                DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
169
 
                dbusmenu_menuitem_property_set(useritem, "label", name);
170
 
                dbusmenu_menuitem_property_set(useritem, "sensitive", "false");
171
 
                dbusmenu_menuitem_child_append(root, useritem);
 
169
                if (name[0] != '\0') {
 
170
                        DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
 
171
                        dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name);
 
172
                        dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
 
173
                        dbusmenu_menuitem_child_append(root, useritem);
 
174
                }
172
175
 
173
176
                g_free(name);
174
177
        } else {
187
190
        build_user_item(root);
188
191
 
189
192
        status_menuitem = dbusmenu_menuitem_new();
190
 
        dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status]));
 
193
        dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
191
194
        dbusmenu_menuitem_child_append(root, status_menuitem);
192
195
 
193
196
        StatusProviderStatus i;
194
197
        for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
195
198
                DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
196
199
 
197
 
                dbusmenu_menuitem_property_set(mi, "label", _(status_strings[i]));
198
 
                dbusmenu_menuitem_property_set(mi, "icon", status_icons[i]);
 
200
                dbusmenu_menuitem_property_set(mi, "type", DBUSMENU_CLIENT_TYPES_IMAGE);
 
201
                dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i]));
 
202
                dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]);
199
203
                g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i));
200
204
 
201
205
                dbusmenu_menuitem_child_append(status_menuitem, mi);
204
208
        }
205
209
 
206
210
        DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
207
 
        dbusmenu_menuitem_property_set(mi, "label", _("Lock Screen"));
 
211
        dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
208
212
        g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), GINT_TO_POINTER(i));
209
213
        dbusmenu_menuitem_child_append(root, mi);
210
214