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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Nov 7 15:27:35 EET 2008
Author: rabinovich
Date: 2008-11-07 15:27:32 +0200 (Fri, 07 Nov 2008)
New Revision: 16607

Modified:
   projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c
Log:
added edit-mode property

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-11-07 11:21:30 UTC (rev 16606)
+++ projects/haf/branches/hildon-fm/fremantle/hildon-fm/hildon-file-selection.c	2008-11-07 13:27:32 UTC (rev 16607)
@@ -130,6 +130,7 @@
     PROP_PANE_POSITION,
     PROP_DRAGGING,
     PROP_SHOW_FILES, /* show or not show the files in the content pane */
+    PROP_EDIT_MODE
 };
 
 struct _HildonFileSelectionPrivate {
@@ -195,6 +196,7 @@
     /* set this flag to FALSE, files will be filtered out in content pane, used
        in for example, folder chooser dialog and some other similar dialogs */
     gboolean show_files;
+    gboolean edit_mode;
 };
 
 #if 0
@@ -966,6 +968,9 @@
     case PROP_SHOW_FILES:
       priv->show_files = g_value_get_boolean(value);
       break;
+    case PROP_EDIT_MODE:
+      priv->edit_mode = g_value_get_boolean(value);
+      break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
         break;
@@ -1018,6 +1023,9 @@
     case PROP_SHOW_FILES:
         g_value_set_boolean(value, priv->show_files);
         break;
+    case PROP_EDIT_MODE:
+        g_value_set_boolean(value, priv->edit_mode);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
         break;
@@ -1264,6 +1272,12 @@
                            "show the files in the content pane "
                            "if this property is TRUE (TRUE by default)",
                            TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+    g_object_class_install_property(object, PROP_EDIT_MODE,
+      g_param_spec_boolean("edit-mode", "Edit Mode",
+                           "create GtkTreeView in Edit Mode "
+                           "if this property is TRUE (FALSE by default)",
+                           FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 }
 
 static gboolean
@@ -2319,7 +2333,15 @@
     GtkCellRenderer *renderer;
     GtkTreeView *tree;
 
-    self->priv->view[1] = gtk_tree_view_new();
+    //    self->priv->view[1] = gtk_tree_view_new();
+    if (self->priv->edit_mode) {
+        self->priv->view[1] = hildon_gtk_tree_view_new(HILDON_UI_MODE_EDIT);
+        gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(self->priv->view[1])), GTK_SELECTION_MULTIPLE);
+    } else {
+        self->priv->view[1] = hildon_gtk_tree_view_new(HILDON_UI_MODE_NORMAL);
+        gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(self->priv->view[1])), GTK_SELECTION_NONE);
+    }
+    
     tree = GTK_TREE_VIEW(self->priv->view[1]);
 
     gtk_tree_view_set_fixed_height_mode(tree, TRUE);


More information about the maemo-commits mailing list