[gnome-music/freeze-break: 61/107] Start editing New Playlist item on single click



commit 142f01b00c580e892dd457d9a7a541fc9a532f11
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Thu Aug 22 23:16:06 2013 +0800

    Start editing New Playlist item on single click

 data/PlaylistDialog.ui |    4 ++++
 gnomemusic/widgets.py  |   10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/data/PlaylistDialog.ui b/data/PlaylistDialog.ui
index 269e7db..5a547e5 100644
--- a/data/PlaylistDialog.ui
+++ b/data/PlaylistDialog.ui
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.15.2 on Thu Aug 22 16:04:08 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.10 -->
   <object class="GtkDialog" id="dialog1">
@@ -35,6 +36,7 @@
                 <property name="can_focus">True</property>
                 <property name="model">liststore1</property>
                 <property name="headers_visible">False</property>
+                <property name="activate_on_single_click">True</property>
                 <child internal-child="selection">
                   <object class="GtkTreeSelection" id="treeview-selection1"/>
                 </child>
@@ -83,6 +85,8 @@
     <columns>
       <!-- column-name playlist-name -->
       <column type="gchararray"/>
+      <!-- column-name editable -->
+      <column type="gboolean"/>
     </columns>
   </object>
 </interface>
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index c042603..bb63fbb 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -475,14 +475,14 @@ class PlaylistDialog():
         )
         cols.pack_start(type_renderer, True)
         cols.add_attribute(type_renderer, "text", 0)
+        cols.add_attribute(type_renderer, "editable", 1)
         self.view.append_column(cols)
 
     def populate(self, items):
         for playlist_name in items:
-            self.model.append([playlist_name])
-            # self.model.set(_iter, [0], )
+            self.model.append([playlist_name, False])
         add_playlist_iter = self.model.append()
-        self.model.set(add_playlist_iter, [0], [_("New Playlist")])
+        self.model.set(add_playlist_iter, [0, 1], [_("New Playlist"), True])
 
     def _on_selection(self, select_button):
         pass
@@ -490,8 +490,8 @@ class PlaylistDialog():
     def _on_cancel_button_clicked(self, cancel_button):
         self.dialog_box.destroy()
 
-    def _on_item_activated(self, widget, item_id, path):
-        pass
+    def _on_item_activated(self, view, path, column):
+        self.view.set_cursor(path, column, True)
 
 
 class AllArtistsAlbums(ArtistAlbums):


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