fixed number of view
authorvlad <vlad@vlanout.(none)>
Sun, 25 Jul 2010 20:57:23 +0000 (23:57 +0300)
committervlad <vlad@vlanout.(none)>
Sun, 25 Jul 2010 20:57:23 +0000 (23:57 +0300)
applet/src/livewp-dbus.c
applet/src/livewp-home-widget.c
applet/src/livewp-settings.c

index 5482a38..b799307 100644 (file)
@@ -153,7 +153,6 @@ get_livewp_signal_cb(DBusConnection *conn, DBusMessage *msg, Animation_Wallpaper
         }
     }
 #if  defined APPLICATION
-    fprintf(stderr, "VIEW %i\n", priv->view);
     if ((priv->view == 1 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW1))||
         (priv->view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW2))||   
         (priv->view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_STOP_LIVEBG_ON_VIEW3))||   
index e398289..f5e1440 100644 (file)
@@ -534,8 +534,7 @@ fprintf(stderr,"lw_applet_finalize\n");
 */    
      
      if (priv){
-            livewp_deinitialize_dbus(priv);
-            switch (priv->view){
+            switch (priv->view + 1){
                case 1: send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE, 
                                          LIVEWP_SIGNAL_PATH, LIVEWP_STOP_LIVEBG_ON_VIEW1);
                        break;
@@ -550,13 +549,12 @@ fprintf(stderr,"lw_applet_finalize\n");
                        break;
             }
      }
+     livewp_deinitialize_dbus(priv);
      while (TRUE){
-        fprintf(stderr,"checking true\n");
          wpid = wait(&status);
         if (wpid == priv->pid)
             break;
      }
-     fprintf(stderr,"out from applet\n");
 }
 
 static void
index 948ca5f..f74e137 100644 (file)
@@ -318,10 +318,10 @@ check_applet_state(gint number){
     GKeyFile *gkey_file = NULL;
     gchar *str = NULL;
     gboolean result = FALSE;
-    if (number > 3 || number < 0)
+    if (number > 4 || number < 1)
         return FALSE;
 
-    str = g_strdup_printf("livewp-home-widget.desktop-%i",number);
+    str = g_strdup_printf("livewp-home-widget.desktop-%i", (number - 1));
     config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
     
     gkey_file = hd_config_file_load_file(config_file, FALSE);
@@ -359,9 +359,9 @@ start_applet(gint number){
     GKeyFile *gkey_file = NULL;
     gchar *str = NULL;
 
-    if (number > 3 || number < 0)
+    if (number > 4 || number < 1)
         return;
-    str = g_strdup_printf("livewp-home-widget.desktop-%i",number);
+    str = g_strdup_printf("livewp-home-widget.desktop-%i",(number - 1));
     config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
     
     gkey_file = hd_config_file_load_file(config_file, FALSE);
@@ -382,9 +382,9 @@ stop_applet(gint number){
     GKeyFile *gkey_file = NULL;
     gchar *str = NULL;
 
-    if (number > 3 || number < 0)
+    if (number > 4 || number < 1)
         return;
-    str = g_strdup_printf("livewp-home-widget.desktop-%i",number);
+    str = g_strdup_printf("livewp-home-widget.desktop-%i", (number - 1));
     config_file = hd_config_file_new(NULL, "/home/user/.config/hildon-desktop/", "home.plugins");
     
     gkey_file = hd_config_file_load_file(config_file, FALSE);