ms = tvb.tv_usec;
sec = tvb.tv_sec;
-// fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
-
+
if (!actor->visible){
actor->visible = TRUE;
if (scene.daytime == TIME_NIGHT){
Actor *actor;
gboolean stop_flag = TRUE;
- if (!desktop_plugin->priv->visible)
- return TRUE;
+ if (!desktop_plugin->priv->visible || !desktop_plugin->priv->rich_animation){
+ desktop_plugin->priv->short_timer = 0;
+ return FALSE;
+ }
now = time(NULL);
//scene.daytime = daytime;
Actor *actor;
/* TODO remove timeout */
- if (!desktop_plugin->priv->visible)
- return TRUE;
+ if (!desktop_plugin->priv->visible){
+ desktop_plugin->priv->short_timer = 0;
+ return FALSE;
+ }
//fprintf(stderr, "timer daytime=%d\n", daytime);
if (scene.daytime != daytime){
tmp = scene.actors;
&& desktop_plugin->priv->short_timer == 0){
actor->time_start_animation = now;
/* fprintf(stderr, "start short timer act = %s %d\n", actor->name, now); */
- desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, (GtkFunction)short_timeout, desktop_plugin);
+ if (desktop_plugin->priv->rich_animation)
+ desktop_plugin->priv->short_timer = g_timeout_add(SHORT_TIMER, (GtkFunction)short_timeout, desktop_plugin);
}
tmp = g_slist_next(tmp);
}
GParamSpec *spec,
AWallpaperPlugin *desktop_plugin)
{
- gboolean visible;
- g_object_get (object, "is-on-current-desktop", &visible, NULL);
- if (visible)
+ gboolean visible;
+ g_object_get (object, "is-on-current-desktop", &visible, NULL);
+ if (visible){
desktop_plugin->priv->visible = TRUE;
- else
+ desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
+ }else
desktop_plugin->priv->visible = FALSE;
/* fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
}
/*******************************************************************************/
GtkWidget *
-create_rich_animation_button (void)
+create_rich_animation_button (gboolean active)
{
GtkWidget *button;
button = hildon_check_button_new (HILDON_SIZE_AUTO);
gtk_button_set_label (GTK_BUTTON (button), _("Rich Animation"));
-// g_signal_connect (button, "toggled", G_CALLBACK (button_toggled), NULL);
+ hildon_check_button_set_active(button, active);
return button;
}
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
theme_button, TRUE, TRUE, 5);
/* Create rich animation button */
- rich_animation_button = create_rich_animation_button();
+ rich_animation_button = create_rich_animation_button(priv->rich_animation);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
rich_animation_button, TRUE, TRUE, 5);
gtk_widget_show (theme_button);
+ gtk_widget_show (rich_animation_button);
gtk_widget_show (window);
gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
save_button = gtk_dialog_add_button(GTK_DIALOG(window), _("Save"), GTK_RESPONSE_YES);