diff options
author | Martin Szulecki | 2010-01-26 03:42:47 +0100 |
---|---|---|
committer | Martin Szulecki | 2010-01-26 03:42:47 +0100 |
commit | 0a19860397f04cca7af8722fda6ffec11bc5072e (patch) | |
tree | da0f2db11a347165d40f79082ceefcbaa42ac673 /src | |
parent | 220d319b4e38f59907457088069c279328999df2 (diff) | |
download | sbmanager-0a19860397f04cca7af8722fda6ffec11bc5072e.tar.gz sbmanager-0a19860397f04cca7af8722fda6ffec11bc5072e.tar.bz2 |
Show error dialog if connecting to sbservices fails with an error
This for instance shows the note that sbservices is only supported
in devices with OS 3.1+.
Diffstat (limited to 'src')
-rw-r--r-- | src/sbmanager.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c index d2130c4..23707bf 100644 --- a/src/sbmanager.c +++ b/src/sbmanager.c @@ -1182,6 +1182,12 @@ static gboolean gui_pages_init_cb(gpointer data) if (!sbc) sbc = device_sbs_new(app->uuid, &error); + if (error) { + g_printerr("%s", error->message); + g_error_free(error); + error = NULL; + } + if (sbc) { /* Load icon data */ if (device_sbs_get_iconstate(sbc, &iconstate, &error)) { @@ -1190,6 +1196,12 @@ static gboolean gui_pages_init_cb(gpointer data) } } + if (error) { + g_printerr("%s", error->message); + g_error_free(error); + error = NULL; + } + clutter_threads_add_timeout(500, (GSourceFunc)wait_icon_load_finished, NULL); return FALSE; @@ -1209,13 +1221,27 @@ static gboolean set_icon_state_cb(gpointer user_data) plist_t iconstate = gui_get_iconstate(); if (iconstate) { GError *error = NULL; + if (!sbc) sbc = device_sbs_new(app->uuid, &error); + + if (error) { + g_printerr("%s", error->message); + g_error_free(error); + error = NULL; + } + if (sbc) { device_sbs_set_iconstate(sbc, iconstate, &error); device_sbs_free(sbc); plist_free(iconstate); } + + if (error) { + g_printerr("%s", error->message); + g_error_free(error); + error = NULL; + } } return FALSE; } |