[gnome-photos] organize-collection-view: Add the add_collection method



commit 6d4511d113ae72774e5bb78b02acd44c6588106b
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Apr 27 18:09:30 2012 +0200

    organize-collection-view: Add the add_collection method

 src/photos-organize-collection-view.c |   15 +++++++++++++++
 src/photos-organize-collection-view.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-organize-collection-view.c b/src/photos-organize-collection-view.c
index c6af946..d9da603 100644
--- a/src/photos-organize-collection-view.c
+++ b/src/photos-organize-collection-view.c
@@ -193,3 +193,18 @@ photos_organize_collection_view_new (void)
                        "hexpand", TRUE,
                        NULL);
 }
+
+
+void
+photos_organize_collection_view_add_collection (PhotosOrganizeCollectionView *self)
+{
+  PhotosOrganizeCollectionViewPrivate *priv = self->priv;
+  GtkTreePath *path;
+
+  path = photos_organize_collection_model_add_placeholder (PHOTOS_ORGANIZE_COLLECTION_MODEL (priv->model));
+  if (path == NULL)
+    return;
+
+  g_object_set (priv->renderer_text, "editable", TRUE, NULL);
+  gtk_tree_view_set_cursor_on_cell (GTK_TREE_VIEW (self), path, priv->view_col, priv->renderer_text, TRUE);
+}
diff --git a/src/photos-organize-collection-view.h b/src/photos-organize-collection-view.h
index 4464003..48e8113 100644
--- a/src/photos-organize-collection-view.h
+++ b/src/photos-organize-collection-view.h
@@ -66,6 +66,8 @@ GType             photos_organize_collection_view_get_type               (void)
 
 GtkWidget        *photos_organize_collection_view_new                    (void);
 
+void              photos_organize_collection_view_add_collection         (PhotosOrganizeCollectionView *self);
+
 G_END_DECLS
 
 #endif /* PHOTOS_ORGANIZE_COLLECTION_VIEW_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]