~bratsche/indicator-me/disconnect-some-signals

« back to all changes in this revision

Viewing changes to src/me-service.c

  • Committer: David Barth
  • Date: 2010-08-17 15:02:12 UTC
  • mfrom: (96.1.9 indicator-me)
  • Revision ID: david.barth@canonical.com-20100817150212-dsr4tuz8npp3zqx3
libgwibber port, thanks to kenvandine\!

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
  /* STATUS_PROVIDER_STATUS_DISCONNECTED */"user-offline"
82
82
};
83
83
 
84
 
static GwibberService * gwibber = NULL;
 
84
static MeGwibberService * me_gwibber_service = NULL;
85
85
 
86
86
static DbusmenuMenuitem * root_menuitem = NULL;
87
87
static DbusmenuMenuitem * status_menuitems[STATUS_PROVIDER_STATUS_LAST] = {0};
170
170
}
171
171
 
172
172
static void
173
 
gwibber_status_update (GwibberService *instance, GwibberServiceStatus status, gpointer data) {
 
173
me_gwibber_status_update (MeGwibberService *instance, MeGwibberServiceStatus status, gpointer data) {
174
174
  g_return_if_fail (instance != NULL);
175
175
 
176
176
  g_debug ("gwibber service status changed to: %d", status);
180
180
    return;
181
181
  }
182
182
 
183
 
  if (! gwibber_service_has_configured_accounts (instance)) {
 
183
  if (! me_gwibber_service_has_configured_accounts (instance)) {
184
184
    g_debug ("no configured accounts detected, so hiding the broadcast field");
185
185
    dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
186
186
    return;
189
189
  if (! dbusmenu_menuitem_property_get_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE))
190
190
    dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
191
191
 
192
 
#if 0
193
 
  if (status == GWIBBER_SERVICE_STATUS_RUNNING) {
194
 
    g_debug ("enabling the broadcast field");
195
 
    dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
196
 
  } else {
197
 
    g_debug ("disabling the broadcast field");
198
 
    dbusmenu_menuitem_property_set_bool (broadcast_field, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
199
 
  }
200
 
#endif
201
 
 
202
192
  return;
203
193
}
204
194
 
287
277
 
288
278
        status_update();
289
279
 
290
 
  gwibber = gwibber_service_new ();
291
 
  if (gwibber != NULL) {
292
 
    g_signal_connect (G_OBJECT (gwibber), GWIBBER_SERVICE_SIGNAL_STATUS_CHANGED, G_CALLBACK (gwibber_status_update), NULL);
 
280
  me_gwibber_service = me_gwibber_service_get ();
 
281
  if (me_gwibber_service != NULL) {
 
282
    g_signal_connect (G_OBJECT (me_gwibber_service), ME_GWIBBER_SERVICE_SIGNAL_STATUS_CHANGED, G_CALLBACK (me_gwibber_status_update), NULL);
293
283
  }
294
284
 
295
285
  return FALSE;