[maemo-commits] [maemo-commits] r15878 - projects/haf/branches/hildon-fm/fremantle/hildon-fm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Aug 14 16:50:45 EEST 2008
Author: yangli
Date: 2008-08-14 16:45:59 +0300 (Thu, 14 Aug 2008)
New Revision: 15878

Modified:
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-chooser-dialog.c
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.h
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-system-model.c
Log:
changes on file chooser temporatory

Modified: projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-chooser-dialog.c
===================================================================
--- projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-chooser-dialog.c	2008-08-14 13:37:13 UTC (rev 15877)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-chooser-dialog.c	2008-08-14 13:45:59 UTC (rev 15878)
@@ -52,6 +52,7 @@
 #include <gtk/gtkimage.h>
 #include <gtk/gtklabel.h>
 #include <string.h>
+#include <hildon/hildon.h>
 #include <hildon/hildon-caption.h>
 #include <hildon/hildon-defines.h>
 #include <hildon/hildon-banner.h>
@@ -68,13 +69,22 @@
 
 #define HILDON_RESPONSE_FOLDER_BUTTON 12345
 #define HILDON_RESPONSE_FOLDER_CREATED 54321
+
+#define HILDON_RESPONSE_UP_BUTTON 12346
+#define HILDON_RESPONSE_PATH_BUTTON 64321
+
 /* Common height for filetrees. About 8 lines. Filetree sets default margins,
     so we need to take them into account. See #9962. */
 #define FILE_SELECTION_HEIGHT (8 * 30 + 2 * HILDON_MARGIN_DEFAULT)
 #define FILE_SELECTION_WIDTH_LIST 240   /* Width used in select folder
                                            mode */
+#define FILE_SELECTION_UPBUTTON_WIDTH 40 /* the width of the up level button */
+#define FILE_SELECTION_ADDRESS_HEIGHT FILE_SELECTION_HEIGHT/9
+
 #define FILE_SELECTION_WIDTH_TOTAL 590  /* Width for full filetree (both
                                            content and navigation pane) */
+#define FOLDER_CHANGE_DIALOG_WIDTH    400
+#define FOLDER_CHANGE_DIALOG_HEIGHT   600
 
 #ifdef DEBUG
 #define DBG(args...) fprintf (stderr, ## args)
@@ -118,6 +128,9 @@
 };
 
 struct _HildonFileChooserDialogPrivate {
+    GtkWidget *up_button;
+    GtkWidget *path_button;
+ 
     GtkWidget *action_button;
     GtkWidget *folder_button;
     GtkWidget *cancel_button;
@@ -129,6 +142,17 @@
     GtkWidget *entry_name;
     GtkWidget *eventbox_location;
     GtkWidget *hbox_location, *image_location, *title_location;
+    /* horizontal address box containing the up level button 
+       and the path button */
+    GtkWidget *hbox_address;
+    /* vertical box containing the address and the tree view */ 
+    GtkWidget *hbox_browser;
+    /* vertical box containing the new button and two dummy labels */ 
+    GtkWidget *vbox_new;
+    /* horizontal box containing the vbox_browser and the new button */ 
+    GtkWidget *hbox_whole;
+    /* fixed container for complexy dialog UI, folder change, move */
+    GtkWidget *fixed;
     GtkWidget *extensions_combo;
     GtkFileChooserAction action;
     GtkWidget *popup;
@@ -157,6 +181,12 @@
     gboolean show_upnp;
 };
 
+static void hildon_response_up_button_clicked(GtkWidget *widget,
+					      gpointer   data);
+
+static void hildon_response_path_button_clicked(GtkWidget *widget,
+					        gpointer   data);
+
 static void hildon_file_chooser_dialog_iface_init(GtkFileChooserIface *
                                                   iface);
 static GObject *
@@ -1102,11 +1132,45 @@
     case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
         gtk_widget_hide(priv->caption_control_name);
         gtk_widget_hide(priv->hbox_items);
-        gtk_widget_set_size_request(GTK_WIDGET(priv->filetree),
+
+	gtk_widget_set_size_request(GTK_WIDGET(self),
+                                    FOLDER_CHANGE_DIALOG_WIDTH,
+                                    FOLDER_CHANGE_DIALOG_HEIGHT);
+
+	gtk_widget_set_size_request(GTK_WIDGET(priv->hbox_browser),
                                     FILE_SELECTION_WIDTH_LIST,
-                                    FILE_SELECTION_HEIGHT);
-        gtk_widget_show(GTK_WIDGET(priv->filetree));
-        hildon_file_selection_hide_content_pane(priv->filetree);
+                                    FILE_SELECTION_HEIGHT + 
+				    FILE_SELECTION_ADDRESS_HEIGHT +
+				    HILDON_MARGIN_DEFAULT);
+
+	gtk_widget_set_size_request(GTK_WIDGET(priv->filetree),
+                                    FILE_SELECTION_WIDTH_LIST,
+				    FILE_SELECTION_HEIGHT);
+
+			/*gtk_widget_set_size_request(GTK_WIDGET(priv->up_button),
+                                    FILE_SELECTION_UPBUTTON_WIDTH,
+                                    FILE_SELECTION_ADDRESS_HEIGHT);
+	gtk_widget_set_size_request(GTK_WIDGET(priv->hbox_address),
+                                    FILE_SELECTION_WIDTH_LIST,
+                                    FILE_SELECTION_ADDRESS_HEIGHT);
+        gtk_widget_set_size_request(GTK_WIDGET(priv->path_button),
+				    FILE_SELECTION_WIDTH_LIST - FILE_SELECTION_UPBUTTON_WIDTH,
+				    FILE_SELECTION_ADDRESS_HEIGHT);*/
+	
+	gtk_widget_show(priv->hbox_address);
+	gtk_widget_show(GTK_WIDGET(priv->filetree));
+        gtk_widget_show_all(GTK_WIDGET(priv->hbox_browser));
+	hildon_file_selection_show_content_pane(priv->filetree);
+	hildon_file_selection_hide_navigation_pane(priv->filetree);
+
+	/*gchar *uri;
+	uri = g_malloc(100); //to be changed
+	get_current_tree_path(priv->filetree, uri);
+	gtk_button_set_label(GTK_BUTTON(priv->folder_button),
+			       uri);
+			       delete(uri);*/
+
+        //hildon_file_selection_hide_content_pane(priv->filetree);
         gtk_window_set_title(GTK_WINDOW(self), _("ckdg_ti_change_folder"));
         gtk_button_set_label(GTK_BUTTON(priv->action_button),
                              _("ckdg_bd_change_folder_ok"));
@@ -1120,8 +1184,8 @@
     case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
         hildon_caption_set_label(HILDON_CAPTION(priv->caption_control_name),
                                  _("ckdg_fi_new_folder_name"));
-		hildon_caption_set_label (HILDON_CAPTION (priv->caption_control_location),
-						 _("ckdg_fi_new_folder_location"));
+	hildon_caption_set_label (HILDON_CAPTION (priv->caption_control_location),
+				 _("ckdg_fi_new_folder_location"));
         gtk_widget_show_all(priv->caption_control_name);
         gtk_widget_hide(GTK_WIDGET(priv->filetree));
         _hildon_file_selection_realize_help(priv->filetree);
@@ -1474,6 +1538,7 @@
             }
             g_free(entry_text);
         }
+	printf("yang : here is ok\n");
         break;
     case HILDON_RESPONSE_FOLDER_BUTTON:
       g_signal_stop_emission_by_name(widget, "response");
@@ -1966,6 +2031,31 @@
                                           strlen(gtk_entry_get_text(GTK_ENTRY(widget))) > 0);
 }
 
+static void hildon_response_up_button_clicked( GtkWidget *widget,
+					       gpointer   data )
+{
+    g_print ("up button is clicked\n");
+}
+
+static void hildon_response_path_button_clicked( GtkWidget *widget,
+					         gpointer   data )
+
+{
+    g_return_if_fail(HILDON_IS_FILE_CHOOSER_DIALOG(data));
+    g_signal_emit_by_name(data, "response", GTK_RESPONSE_OK, NULL);
+
+    g_print ("path button is clicked\n");
+}
+
+static void hildon_response_folder_button_clicked( GtkWidget *widget,
+					         gpointer   data )
+{
+    g_return_if_fail(HILDON_IS_FILE_CHOOSER_DIALOG(data));
+    g_signal_emit_by_name(data, "response", HILDON_RESPONSE_FOLDER_BUTTON, NULL);
+
+    g_print ("folder button is clicked\n");
+}
+
 static void hildon_file_chooser_dialog_init(HildonFileChooserDialog * self)
 {
     GtkMenuShell *shell;
@@ -1973,7 +2063,9 @@
     HildonFileChooserDialogPrivate *priv;
     GtkBox *box;
     GtkWidget *eventbox, *label_items;
+    GtkWidget *label_up, *label_down;
     GtkSizeGroup *size_group;
+    GtkWidget *image = NULL;
 
     ULOG_INFO("Initializing");
 
@@ -1989,14 +2081,33 @@
     priv->should_show_location = TRUE;
     priv->stub_name = priv->ext_name = NULL;
     priv->action = GTK_FILE_CHOOSER_ACTION_OPEN;
-    priv->action_button =
+
+    image = gtk_image_new_from_stock(GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON);
+    priv->up_button = g_object_new(GTK_TYPE_BUTTON, "gtk-button-images", TRUE );
+    gtk_button_set_image(priv->up_button, image);
+    g_signal_connect (G_OBJECT (priv->up_button), "clicked",
+		      G_CALLBACK (hildon_response_up_button_clicked), NULL);
+    gtk_widget_show(priv->up_button);
+
+    priv->path_button = g_object_new(GTK_TYPE_BUTTON,  "label", "Nokia Nxxx/", NULL);
+    g_signal_connect (G_OBJECT (priv->path_button), "clicked",
+		      G_CALLBACK (hildon_response_path_button_clicked), self);
+    gtk_widget_show(priv->path_button);
+
+    priv->folder_button = g_object_new(GTK_TYPE_BUTTON, "label",  _("ckdg_bd_change_folder_new_folder"));
+    g_signal_connect (G_OBJECT (priv->folder_button), "clicked",
+		      G_CALLBACK (hildon_response_folder_button_clicked), self);
+    gtk_widget_show(priv->folder_button);
+
+
+    /*priv->action_button =
         gtk_dialog_add_button(GTK_DIALOG(self),
                               _("ckdg_bd_select_object_ok_open"),
-                              GTK_RESPONSE_OK);
-    priv->folder_button =
+                              GTK_RESPONSE_OK);*/
+    /*priv->folder_button =
         gtk_dialog_add_button(GTK_DIALOG(self),
                               _("ckdg_bd_change_folder_new_folder"),
-                              HILDON_RESPONSE_FOLDER_BUTTON);
+                              HILDON_RESPONSE_FOLDER_BUTTON);*/
     priv->cancel_button =
         gtk_dialog_add_button(GTK_DIALOG(self),
                               _("ckdg_bd_select_object_cancel"),
@@ -2022,6 +2133,7 @@
     priv->hbox_items = gtk_hbox_new(FALSE, HILDON_MARGIN_DEFAULT);
     priv->image_location = gtk_image_new();
     priv->title_location = gtk_label_new(NULL);
+
     gtk_misc_set_alignment(GTK_MISC(priv->title_location), 0.0f, 0.5f);
     gtk_box_pack_start(GTK_BOX(priv->hbox_location), priv->image_location,
                        FALSE, TRUE, 0);
@@ -2034,6 +2146,36 @@
     gtk_widget_add_events(eventbox, GDK_BUTTON_PRESS_MASK);
     g_object_set (G_OBJECT (eventbox), "can-focus", FALSE, NULL);
   
+    /* organize address area */
+    priv->hbox_address = gtk_hbox_new(FALSE, HILDON_MARGIN_DEFAULT);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_address), priv->up_button,
+                       FALSE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_address), priv->path_button,
+    TRUE, FALSE, 0);
+    /* organize the new button and centralized it */
+    priv->vbox_new = gtk_vbox_new(FALSE, HILDON_MARGIN_DEFAULT);
+    label_up = gtk_label_new("");
+    label_down = gtk_label_new("");
+    gtk_box_pack_start(GTK_BOX(priv->vbox_new), label_up,
+                       TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->vbox_new), priv->folder_button,
+                       FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->vbox_new), label_down,
+		       TRUE, TRUE, 0);
+    /* organize the folder browser */
+    priv->hbox_browser = gtk_hbox_new(FALSE, HILDON_MARGIN_DEFAULT);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_browser), GTK_WIDGET(priv->filetree),
+                       TRUE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_browser), priv->vbox_new,
+      FALSE, FALSE, 0);
+    gtk_widget_show(priv->filetree);
+    /* organize the box containing the vbox_browser and a new button */
+    /*priv->hbox_whole = gtk_hbox_new(FALSE, HILDON_MARGIN_DEFAULT);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_whole), priv->vbox_browser,
+                       FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(priv->hbox_whole), priv->vbox_new,
+    TRUE, FALSE, 0);*/
+
     priv->caption_control_location =
       hildon_caption_new(size_group, _("sfil_fi_save_objects_items"),
 			 eventbox, NULL,
@@ -2147,8 +2289,13 @@
        "pane-position", get_global_pane_position (),
       NULL);
 
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(obj)->vbox), 
+			       priv->hbox_address, FALSE, TRUE, 0);
+    /*gtk_box_pack_start(GTK_BOX(GTK_DIALOG(obj)->vbox), 
+      priv->hbox_browser, TRUE, FALSE, 0);*/
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(obj)->vbox),
-                       GTK_WIDGET(priv->filetree), TRUE, TRUE, 0);
+      GTK_WIDGET(priv->filetree), TRUE, TRUE, 0);
+
     g_signal_connect(priv->filetree, "content-pane-context-menu",
                      G_CALLBACK(hildon_file_chooser_dialog_context), priv);
     g_signal_connect_swapped(priv->filetree, "selection-changed",
@@ -2190,7 +2337,6 @@
                                           GtkFileChooserAction action)
 {
     GtkWidget *dialog;
-
     dialog =
         g_object_new(HILDON_TYPE_FILE_CHOOSER_DIALOG, "action", action,
                      NULL);
@@ -2220,7 +2366,7 @@
 {
     GtkWidget *dialog;
     va_list args;
-
+ 
     va_start(args, first_property);
     dialog =
         GTK_WIDGET(g_object_new_valist

Modified: projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c
===================================================================
--- projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c	2008-08-14 13:37:13 UTC (rev 15877)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c	2008-08-14 13:45:59 UTC (rev 15878)
@@ -50,7 +50,7 @@
 #include "hildon-file-selection.h"
 #include <hildon/hildon-banner.h>
 #include <hildon/hildon-defines.h>
-
+#include <hildon/hildon.h>
 #include "hildon-file-common-private.h"
 
 /* I wonder where does that additional +2 come from.
@@ -191,6 +191,10 @@
     gchar **drag_data_uris;
 
     gchar *cursor_goal_uri;
+    
+    /* 1: use pannable area widget 
+       0: use scrolled wnidow widget */
+    gboolean pannable_flag;
 };
 
 #if 0
@@ -1433,7 +1437,7 @@
   GtkTreePath *sort_path = NULL;
   gboolean found = FALSE;
 
-  GDK_THREADS_ENTER();
+  //GDK_THREADS_ENTER();
 
   self = HILDON_FILE_SELECTION(data);
   priv = self->priv;
@@ -1486,7 +1490,7 @@
   /* We have to return TRUE, because cancel removes the handler now */
   hildon_file_selection_cancel_delayed_select(priv);
 
-  GDK_THREADS_LEAVE();
+  //GDK_THREADS_LEAVE();
 
   return TRUE;
 }
@@ -3007,46 +3011,42 @@
     self->priv->mode = HILDON_FILE_SELECTION_MODE_THUMBNAILS;
 
     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(self), GTK_NO_WINDOW);
+    // yang : to be set up by caller
+    self->priv->pannable_flag = FALSE; 
+    if(self->priv->pannable_flag){
+      self->priv->scroll_dir = hildon_pannable_area_new();
+      self->priv->scroll_list = hildon_pannable_area_new();
+      self->priv->scroll_thumb = hildon_pannable_area_new();
+    }
+    else {
+      self->priv->scroll_dir = gtk_scrolled_window_new(NULL, NULL);
+      self->priv->scroll_list = gtk_scrolled_window_new(NULL, NULL);
+      self->priv->scroll_thumb = gtk_scrolled_window_new(NULL, NULL);
 
-    self->priv->scroll_dir = gtk_scrolled_window_new(NULL, NULL);
-    self->priv->scroll_list = gtk_scrolled_window_new(NULL, NULL);
-    self->priv->scroll_thumb = gtk_scrolled_window_new(NULL, NULL);
+      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
+				     (self->priv->scroll_dir),
+				     GTK_POLICY_AUTOMATIC,
+				     GTK_POLICY_AUTOMATIC);
+      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
+				     (self->priv->scroll_list),
+				     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
+				     (self->priv->scroll_thumb),
+				     GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+      gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
+					  (self->priv->scroll_dir),
+					  GTK_SHADOW_NONE);
+      gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
+					  (self->priv->scroll_list),
+					  GTK_SHADOW_NONE);
+      gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
+					  (self->priv->scroll_thumb),
+					  GTK_SHADOW_NONE);
+    }
+        
     self->priv->view_selector = gtk_hbox_new (FALSE, 0);
-    self->priv->hpaned = gtk_hpaned_new();
 
-    gtk_container_set_border_width(GTK_CONTAINER(self->priv->scroll_dir),
-        HILDON_MARGIN_DEFAULT);
-    gtk_container_set_border_width(GTK_CONTAINER(self->priv->view_selector),
-        HILDON_MARGIN_DEFAULT);
-
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
-                                   (self->priv->scroll_dir),
-                                   GTK_POLICY_AUTOMATIC,
-                                   GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
-                                   (self->priv->scroll_list),
-                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
-                                   (self->priv->scroll_thumb),
-                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
-                                        (self->priv->scroll_dir),
-                                        GTK_SHADOW_NONE);
-    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
-                                        (self->priv->scroll_list),
-                                        GTK_SHADOW_NONE);
-    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
-                                        (self->priv->scroll_thumb),
-                                        GTK_SHADOW_NONE);
-
-    gtk_paned_pack1(GTK_PANED(self->priv->hpaned),
-                    GTK_WIDGET(self->priv->scroll_dir), TRUE, FALSE);
-    gtk_paned_pack2(GTK_PANED(self->priv->hpaned),
-                    GTK_WIDGET(self->priv->view_selector), TRUE, FALSE);
-
-    gtk_widget_set_parent(self->priv->hpaned, GTK_WIDGET(self));
-
     self->priv->column_headers_visible = FALSE;
 
     /* This needs to exist before set properties are called */
@@ -3088,9 +3088,23 @@
       
       self->priv->view[3] = vbox;
       gtk_box_pack_start (GTK_BOX (self->priv->view_selector),
-			  self->priv->view[3], TRUE, TRUE, 0);
+      self->priv->view[3], TRUE, TRUE, 0);
     }
+    self->priv->hpaned = gtk_hpaned_new();
 
+    gtk_container_set_border_width(GTK_CONTAINER(self->priv->scroll_dir),
+        HILDON_MARGIN_DEFAULT);
+    gtk_container_set_border_width(GTK_CONTAINER(self->priv->view_selector),
+        HILDON_MARGIN_DEFAULT);
+
+    gtk_paned_pack1(GTK_PANED(self->priv->hpaned),
+                    GTK_WIDGET(self->priv->scroll_dir), TRUE, FALSE);
+
+    gtk_paned_pack2(GTK_PANED(self->priv->hpaned),
+                    GTK_WIDGET(self->priv->view_selector), TRUE, FALSE);
+
+    gtk_widget_set_parent(self->priv->hpaned, GTK_WIDGET(self));
+
     g_signal_connect(self, "grab-notify",
       G_CALLBACK(hildon_file_selection_check_scroll), NULL);
 }
@@ -3133,15 +3147,24 @@
     hildon_file_selection_create_dir_view(self);
     hildon_file_selection_create_list_view(self);
     hildon_file_selection_create_thumbnail_view(self);
+    printf("prepare to enter pannarea attached \n");
 
-    gtk_container_add(GTK_CONTAINER(priv->scroll_dir), priv->dir_tree);
-    gtk_container_add(GTK_CONTAINER(priv->scroll_list), priv->view[0]);
-    gtk_container_add(GTK_CONTAINER(priv->scroll_thumb), priv->view[1]);
+    if(self->priv->pannable_flag){
+      printf("pannarea attached \n");
+      gtk_container_add(HILDON_PANNABLE_AREA(priv->scroll_dir), GTK_WIDGET(priv->dir_tree));
+      gtk_container_add(HILDON_PANNABLE_AREA(priv->scroll_list), GTK_WIDGET(priv->view[0]));
+      gtk_container_add(HILDON_PANNABLE_AREA(priv->scroll_thumb), GTK_WIDGET(priv->view[1]));
+    }
+    else{
+      gtk_container_add(GTK_CONTAINER(priv->scroll_dir), priv->dir_tree);
+      gtk_container_add(GTK_CONTAINER(priv->scroll_list), priv->view[0]);
+      gtk_container_add(GTK_CONTAINER(priv->scroll_thumb), priv->view[1]);
+    }
 
     gtk_box_pack_start (GTK_BOX (self->priv->view_selector),
 			self->priv->scroll_list, TRUE, TRUE, 0);
     gtk_box_pack_start (GTK_BOX (self->priv->view_selector),
-			self->priv->scroll_thumb, TRUE, TRUE, 0);
+      self->priv->scroll_thumb, TRUE, TRUE, 0);
 
     /* Also the views of the navigation pane are trees (and this is
        needed). Let's deny expanding */
@@ -3197,7 +3220,7 @@
                              (hildon_file_selection_check_close_load_banner),
                              self, 0);
     g_signal_connect_object(priv->main_model, "device-disconnected",
-      G_CALLBACK(hildon_file_selection_check_location), self, 0);
+    G_CALLBACK(hildon_file_selection_check_location), self, 0);
 
     hildon_file_selection_set_select_multiple(self, FALSE);
 
@@ -3433,9 +3456,8 @@
     g_return_val_if_fail(folder != NULL, FALSE);
 
     ULOG_INFO_F("Setting folder to %s", (const char *) folder);
-
+    
     file_system_model = HILDON_FILE_SYSTEM_MODEL(self->priv->main_model);
-
     if (hildon_file_system_model_load_path (file_system_model,
                                             folder, &main_iter))
     {
@@ -3447,7 +3469,6 @@
         ULOG_INFO_F("Directory changed successfully");
         return TRUE;
     }
-
     ULOG_INFO_F("Directory change failed");
     return FALSE;
 }
@@ -3941,6 +3962,18 @@
 }
 
 /**
+ * hildon_file_selection_hide_navigation_pane:
+ * @self: a pointer to #HildonFileSelection
+ *
+ * Hides the content pane. This is used in certain file management dialogs.
+ */
+void hildon_file_selection_hide_navigation_pane(HildonFileSelection * self)
+{
+    g_return_if_fail(HILDON_IS_FILE_SELECTION(self));
+    gtk_widget_hide(self->priv->scroll_dir);
+}
+
+/**
  * hildon_file_selection_show_content_pane:
  * @self: a pointer to #HildonFileSelection
  *
@@ -4407,14 +4440,14 @@
 {
   struct idle_cursor_data *c = (struct idle_cursor_data *)data;
 
-  GDK_THREADS_ENTER ();
+  //GDK_THREADS_ENTER ();
   if (c->stubbornly)
     hildon_file_selection_set_cursor_stubbornly (c->self, c->view, c->path);
   else
     gtk_tree_view_set_cursor (c->view, c->path, NULL, FALSE);
 
   gtk_tree_path_free (c->path);
-  GDK_THREADS_LEAVE ();
+  //GDK_THREADS_LEAVE ();
   g_free (c);
 
   return FALSE;
@@ -4685,3 +4718,20 @@
   return ret;
 }
 
+void get_current_tree_path(HildonFileSelection *self, char* uri)
+{
+  HildonFileSelectionPrivate *priv = self->priv;
+  GtkTreeSelection *selection =
+    gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->dir_tree));
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (gtk_tree_selection_get_selected (selection, &model, &iter)){
+      char *device;
+
+      gtk_tree_model_get (model, &iter,
+			  HILDON_FILE_SYSTEM_MODEL_COLUMN_URI, &uri,
+			  -1);
+  }
+}
+

Modified: projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.h
===================================================================
--- projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.h	2008-08-14 13:37:13 UTC (rev 15877)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.h	2008-08-14 13:45:59 UTC (rev 15878)
@@ -205,6 +205,8 @@
 
 HildonFileSelectionPane hildon_file_selection_get_active_pane(HildonFileSelection *self);
 
+void hildon_file_selection_hide_navigation_pane(HildonFileSelection * self);
+
 void hildon_file_selection_hide_content_pane(HildonFileSelection * self);
 void hildon_file_selection_show_content_pane(HildonFileSelection * self);
 
@@ -220,5 +222,7 @@
 void hildon_file_selection_move_cursor_to_uri (HildonFileSelection *self,
 					       const gchar *uri);
 
+void get_current_tree_path(HildonFileSelection *self, char* uri);
+
 G_END_DECLS
 #endif

Modified: projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-system-model.c
===================================================================
--- projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-system-model.c	2008-08-14 13:37:13 UTC (rev 15877)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-system-model.c	2008-08-14 13:45:59 UTC (rev 15878)
@@ -1166,7 +1166,7 @@
 
   dfa_clos *c = (dfa_clos *)data;
   
-  GDK_THREADS_ENTER ();
+  //GDK_THREADS_ENTER ();
   
   node = hildon_file_system_model_search_folder (c->monitor);
   if (node)
@@ -1177,7 +1177,7 @@
       hildon_file_system_model_files_added (c->monitor, c->paths, c->data);
     }
 
-  GDK_THREADS_LEAVE ();
+  //GDK_THREADS_LEAVE ();
 
   g_object_unref (c->monitor);
   gtk_file_paths_free (c->paths);
@@ -1474,7 +1474,7 @@
   GNode *node;
 
   g_object_unref (handle);
-
+  printf("yang hello here\n");
   /* When the operation has been cancelled, handle_data->node is no
      longer valid.
    */
@@ -1542,7 +1542,6 @@
   /* The following has to be done last since it might do anything to
      model_node, including loading it again.
   */
-
   if (gtk_file_folder_is_finished_loading (folder))
     {
       GSList *children = NULL;
@@ -1565,7 +1564,9 @@
 	  if (model_node->location
 	      && HILDON_IS_FILE_SYSTEM_ROOT (model_node->location))
 	    model->priv->first_root_scan_completed = TRUE;
+	  printf("yang : step completed");
 
+
           hildon_file_system_model_folder_finished_loading
             (model_node->folder, model);
           gtk_file_paths_free (children);
@@ -1589,7 +1590,6 @@
   g_assert(node != NULL && path != NULL);
   model_node = node->data;
   g_assert(model_node != NULL);
-
   /* Folder already exists or we have already asked for it.
    */
   if (model_node->folder || model_node->get_folder_handle)
@@ -2606,7 +2606,7 @@
 
       file_path = gtk_file_system_filename_to_path(priv->filesystem,
                     priv->alternative_root_dir);
-
+     
       priv->first_root_scan_completed = TRUE;
 
       if (priv->multiroot)
@@ -2837,18 +2837,17 @@
     g_return_val_if_fail(iter != NULL, FALSE);
 
     DBG ("LOAD %s\n", (char *)path);
-
     /* Block until the first scanning of the root folder is complete
        so that we know about all memory cards, usb mass storage
        devices, etc.
     */
-    while (!priv->first_root_scan_completed)
+      while (!priv->first_root_scan_completed)
       {
 	DBG ("+");
 	gtk_main_iteration();
       }
     DBG ("DONE\n");
-
+  
     /* Let's see if given path is already in the tree */
     if (hildon_file_system_model_search_path(model, path, iter,
                                              NULL, TRUE))


More information about the maemo-commits mailing list