From: tanya Date: Tue, 8 Jun 2010 14:10:39 +0000 (+0300) Subject: added delay after dbus event X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=a433cd489fb13ad367a04017131c5d5897eb8899;p=livewp added delay after dbus event --- diff --git a/applet/data/theme/Modern/stend0.png b/applet/data/theme/Modern/stend0.png index 0844c7e..701ba1d 100755 Binary files a/applet/data/theme/Modern/stend0.png and b/applet/data/theme/Modern/stend0.png differ diff --git a/applet/src/livewp-actor.c b/applet/src/livewp-actor.c index 9148b57..83ce172 100644 --- a/applet/src/livewp-actor.c +++ b/applet/src/livewp-actor.c @@ -125,7 +125,7 @@ int get_notify_count(gchar *notify_type) if (rc){ fprintf(stderr, "error open db %d %s\n", rc, sqlite3_errmsg(db)); }else { - snprintf(sql, sizeof(sql)-1, "select count(id) from notifications where icon_name='general_%s'", notify_type); + snprintf(sql, sizeof(sql)-1, "select count(id) from notifications where icon_name='%s'", notify_type); rc = sqlite3_prepare(db, sql, sizeof(sql)-1, &res, NULL); if (rc != SQLITE_OK){ fprintf(stderr, "error prepare %d %s\n", rc, sql); @@ -147,11 +147,11 @@ gchar * read_notification() gint count = 0; fprintf(stderr, "read notification \n"); - count = get_notify_count("missed"); + count = get_notify_count("general_missed"); if (count > 0){ message = g_strdup_printf("%s: %d", _("Missed calls"), count); } - count = get_notify_count("sms"); + count = get_notify_count("general_sms"); if (count > 0){ if (message){ message = g_strdup_printf("%s \n%s: %d", message, _("Missed sms"), count); @@ -159,7 +159,7 @@ gchar * read_notification() message = g_strdup_printf("%s: %d", _("Missed sms"), count); } } - count = get_notify_count("chat"); + count = get_notify_count("general_chat"); if (count > 0){ if (message){ message = g_strdup_printf("%s \n%s: %d", message, _("Missed chat"), count); @@ -167,7 +167,7 @@ gchar * read_notification() message = g_strdup_printf("%s: %d", _("Missed chat"), count); } } - count = get_notify_count("mail"); + count = get_notify_count("qgn_list_messagin"); if (count > 0){ if (message){ message = g_strdup_printf("%s \n%s: %d", message, _("Missed mail"), count); @@ -175,6 +175,7 @@ gchar * read_notification() message = g_strdup_printf("%s: %d", _("Missed mail"), count); } } + fprintf(stderr, "notify=%s\n", message); return message; } @@ -186,7 +187,7 @@ change_billboard(Actor * actor, AWallpaperPlugin *desktop_plugin) PangoFontDescription *pfd = NULL; fprintf(stderr, "change_billboard\n"); - if (desktop_plugin->priv->scene->notification){ + if (desktop_plugin->priv->scene->notification < time(NULL)){ message = read_notification(); label = actor->image; mes = g_markup_printf_escaped("%s", "#FFFFFF", "#000000", diff --git a/applet/src/livewp-common.h b/applet/src/livewp-common.h index 9416a41..8dcdd1c 100644 --- a/applet/src/livewp-common.h +++ b/applet/src/livewp-common.h @@ -60,7 +60,7 @@ struct _Scene gint wind_orientation; // +/- 1 double wind_angle; // [-1 .. 1] guint seed; /* init value for random */ - gboolean notification; + guint notification; }; typedef struct _AWallpaperPlugin AWallpaperPlugin; typedef struct _AWallpaperPluginClass AWallpaperPluginClass; diff --git a/applet/src/livewp-dbus.c b/applet/src/livewp-dbus.c index 8c5871f..879a8e1 100644 --- a/applet/src/livewp-dbus.c +++ b/applet/src/livewp-dbus.c @@ -154,12 +154,12 @@ get_livewp_signal_cb(DBusConnection *conn, DBusMessage *msg, Animation_Wallpaper if (dbus_message_is_method_call(msg, NOTIFY_SIGNAL_INTERFACE, NOTIFY_MEMBER)){ fprintf(stderr,"read notifications.db notify\n"); //read_notification(priv->desktop_plugin); - priv->scene->notification = TRUE; + priv->scene->notification = time(NULL) + 20; } if (dbus_message_is_signal(msg, NOTIFY_SIGNAL_INTERFACE, CLOSENOTIFY_MEMBER)){ fprintf(stderr,"read notifications.db close notify\n"); //read_notification(priv->desktop_plugin); - priv->scene->notification = TRUE; + priv->scene->notification = time(NULL) + 20; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;