gconf_value_free(value);
}
/* get parameter one theme in all view */
+ priv->one_in_all_view = get_one_in_all_views_from_config();
+ return 0;
+}
+/*******************************************************************************/
+gboolean
+get_one_in_all_views_from_config(void){
+ GConfClient *gconf_client;
+ GConfValue *value = NULL;
+ gboolean result;
+
+ gconf_client = gconf_client_get_default();
+ if (!gconf_client) {
+ fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+ return FALSE;
+ }
+ /* get parameter one theme in all view */
value = gconf_client_get(gconf_client, GCONF_KEY_ONE_IN_ALL_VIEW, NULL);
if (value) {
- priv->one_in_all_view = gconf_value_get_bool(value);
+ result = gconf_value_get_bool(value);
gconf_value_free(value);
} else
- priv->one_in_all_view = FALSE;
-
- return 0;
+ result = FALSE;
+ return result;
}
-
/*******************************************************************************/
void
save_one_in_all_views_to_config(gboolean one_in_all_views){
gint current_active_view(void);
GSList * get_list_exthemes(void);
void save_one_in_all_views_to_config(gboolean one_in_all_views);
+gboolean get_one_in_all_views_from_config(void);
#endif
case 3: child_argv[1] = "4";
break;
}
-
- desktop_plugin->priv->pid = fork();
- if (desktop_plugin->priv->pid == 0){
- execvp("/usr/bin/livewp", child_argv);
- fprintf(stderr,"Problem with new process");
+ desktop_plugin->priv->one_in_all_view = get_one_in_all_views_from_config();
+ /* Check one theme in all view mode */
+ if (!desktop_plugin->priv->one_in_all_view ||
+ (desktop_plugin->priv->one_in_all_view && id == 0)){
+ /* Start a new process */
+ desktop_plugin->priv->pid = fork();
+ if (desktop_plugin->priv->pid == 0){
+ execvp("/usr/bin/livewp", child_argv);
+ fprintf(stderr,"Problem with new process");
+ }
}
desktop_plugin_visible_notify((GObject *)widget, NULL, desktop_plugin);
g_object_get (object, "is-on-current-desktop", &visible, NULL);
/* fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
if (priv){
- /*
- if (visible){
- send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
- LIVEWP_SIGNAL_PATH, LIVEWP_PLAY_LIVEBG_ON_VIEW);
- }else{
+ if (priv->one_in_all_view){
+ if (visible)
send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
- LIVEWP_SIGNAL_PATH, LIVEWP_PAUSE_LIVEBG_ON_VIEW);
- }
- */
-
+ LIVEWP_SIGNAL_PATH, LIVEWP_PLAY_LIVEBG_ON_VIEW1);
+ else{
+ /* start any application on current view */
+ if ((priv->view + 1) == current_active_view())
+ send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
+ LIVEWP_SIGNAL_PATH, LIVEWP_PAUSE_LIVEBG_ON_VIEW1);
+ }
+ return;
+ }
switch (priv->view + 1){
case 1: if (visible)
send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE,
LIVEWP_SIGNAL_PATH, LIVEWP_PAUSE_LIVEBG_ON_VIEW4);
break;
}
+
}
}
//gboolean long_timeout (AWallpaperPlugin *desktop_plugin);
void desktop_plugin_visible_notify (GObject *object, GParamSpec *spec, AWallpaperPlugin *desktop_plugin);
void send_dbus_signal (Animation_WallpaperPrivate *priv, const gchar *interface, const gchar *path, const gchar *member);
-
+gboolean get_one_in_all_views_from_config(void);
#endif
lw_main_settings(priv, NULL);
}
/*******************************************************************************/
+void
create_themes_buttons_hbox(Animation_WallpaperPrivate *priv){
GtkWidget *hbox = NULL;
GtkWidget *area_hbox = NULL;
window = gtk_dialog_new();
priv->window = window;
- one_in_all_view_button = priv->one_in_all_view;
+ one_in_all_view = priv->one_in_all_view;
gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(one_in_all_view_button)) != one_in_all_view){
save_one_in_all_views_to_config(hildon_check_button_get_active (HILDON_CHECK_BUTTON(one_in_all_view_button)));
if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(one_in_all_view_button))){
+ stop_applet(1);
stop_applet(2);
stop_applet(3);
stop_applet(4);
+ start_applet(1);
+ start_applet(2);
+ start_applet(3);
+ start_applet(4);
}
- send_dbus_signal (priv, LIVEWP_SIGNAL_INTERFACE, LIVEWP_SIGNAL_PATH, LIVEWP_RELOAD_CONFIG);
}
if (window)
gtk_widget_destroy(window);