[maemo-commits] [maemo-commits] r8511 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . src

From: www-data at stage.maemo.org www-data at stage.maemo.org
Date: Thu Nov 30 18:04:18 EET 2006
Author: lucasr
Date: 2006-11-30 18:04:17 +0200 (Thu, 30 Nov 2006)
New Revision: 8511

Modified:
   projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.c
   projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.h
Log:
2006-11-30  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hd-select-plugins-dialog.[ch], src/hd-desktop.c: don't clear
	container configuration file if canceling on plugin selection dialog.


Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-30 15:41:51 UTC (rev 8510)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/ChangeLog	2006-11-30 16:04:17 UTC (rev 8511)
@@ -1,3 +1,8 @@
+2006-11-30  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* src/hd-select-plugins-dialog.[ch], src/hd-desktop.c: don't clear
+	container configuration file if canceling on plugin selection dialog.
+
 2006-11-30  Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildonhome/hildon-home-area.c: fixes to correctly save

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2006-11-30 15:41:51 UTC (rev 8510)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-desktop.c	2006-11-30 16:04:17 UTC (rev 8511)
@@ -235,6 +235,7 @@
   GList *loaded_plugins = NULL;
   GList *selected_plugins = NULL;
   HDDesktopPrivate *priv;
+  gint response;
 
   g_return_if_fail (user_data != NULL);
   g_return_if_fail (HD_IS_DESKTOP (user_data));
@@ -249,18 +250,20 @@
 
   plugin_dir = hildon_desktop_window_get_plugin_dir (window);
 
-  selected_plugins = hd_select_plugins_dialog_run (loaded_plugins, 
-                                                   plugin_dir);
+  response = hd_select_plugins_dialog_run (loaded_plugins, 
+                                           plugin_dir,
+                                           &selected_plugins);
 
-  hd_plugin_manager_sync (HD_PLUGIN_MANAGER (priv->pm),
-                          selected_plugins,
-                          window->container);
+  if (response == GTK_RESPONSE_OK)
+  {
+    hd_plugin_manager_sync (HD_PLUGIN_MANAGER (priv->pm),
+                            selected_plugins,
+                            window->container);
+  }
 
-/*  hd_desktop_plugin_list_to_conf (selected_plugins, config_file); */
-
-  g_free (config_file);
   g_list_free (selected_plugins);
   g_list_free (loaded_plugins);
+  g_free (config_file);
 }
 
 static gboolean

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.c
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.c	2006-11-30 15:41:51 UTC (rev 8510)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.c	2006-11-30 16:04:17 UTC (rev 8511)
@@ -210,9 +210,10 @@
   return store;
 }
 
-GList *
+gint
 hd_select_plugins_dialog_run (GList *loaded_plugins,
-                              const gchar *plugin_dir)
+                              const gchar *plugin_dir,
+                              GList **selected_plugins)
 {
   GtkWidget        *dialog;
   GtkWidget        *scrollwindow;
@@ -220,14 +221,13 @@
   GtkCellRenderer  *cell_renderer;
   GtkListStore     *plugin_list;
   gint              response;
-  GList            *selected_plugins = NULL;
 
   plugin_list = hd_select_plugins_dialog_get_store (loaded_plugins, 
                                                     plugin_dir);
 
   if (!plugin_list)
   {
-    return NULL;
+    return GTK_RESPONSE_CANCEL;
   }
 
   dialog = gtk_dialog_new_with_buttons (HD_SELECT_PLUGINS_DIALOG_TITLE,
@@ -298,14 +298,14 @@
   switch (response)
   {
     case GTK_RESPONSE_OK:
-      selected_plugins = hd_select_plugins_dialog_get_selected (plugin_list);
+      *selected_plugins = hd_select_plugins_dialog_get_selected (plugin_list);
       break;
   }
 
   gtk_widget_destroy (dialog);
   g_object_unref (plugin_list);
 
-  return selected_plugins;
+  return response;
 }
 
 

Modified: projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.h
===================================================================
--- projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.h	2006-11-30 15:41:51 UTC (rev 8510)
+++ projects/haf/branches/maemo-af-desktop/hildon-desktop/src/hd-select-plugins-dialog.h	2006-11-30 16:04:17 UTC (rev 8511)
@@ -28,7 +28,8 @@
 
 #include <gtk/gtk.h>
 
-GList*   hd_select_plugins_dialog_run  (GList *loaded_plugins,
-                                        const gchar *plugin_dir);
+gint   hd_select_plugins_dialog_run  (GList *loaded_plugins,
+                                      const gchar *plugin_dir,
+                                      GList **selected_plugins);
 
 #endif


More information about the maemo-commits mailing list