Now that all glade bits are removed. Time for changes! In this case GUI changes: I find it silly looking to have 1 expander (bookmark) in the left panel. Therefor I replaced the TreeView with a ListView and added folder icons to the bookmarks. This makes it more in line with nautilus anyway. Take2: changed some treeview_left -> window.treeview_left
Jasper
# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: [EMAIL PROTECTED] # target_branch: https://code.launchpad.net/~bzr-gtk/bzr-gtk/trunk # testament_sha1: 98f1e6e699571e7c14f0ffb9a6d0894e883288b6 # timestamp: 2008-07-20 19:45:35 +0200 # source_branch: https://code.launchpad.net/~bzr-gtk/bzr-gtk/trunk # base_revision_id: [EMAIL PROTECTED] # # Begin patch === modified file 'olive/__init__.py' --- olive/__init__.py 2008-07-20 16:29:18 +0000 +++ olive/__init__.py 2008-07-20 17:42:17 +0000 @@ -96,8 +96,6 @@ # Initialize the statusbar self.context_id = self.window.statusbar.get_context_id('olive') - # Get the TreeViews - self.treeview_left = self.window.treeview_left self.treeview_right = self.window.treeview_right # Get the drive selector @@ -142,7 +140,7 @@ # Acceptable errors when loading files/folders in the treeviews self.acceptable_errors = (errno.ENOENT, errno.ELOOP) - self._load_left() + self.refresh_left() # Apply menu state self.window.mb_view_showhidden.set_active(self.pref.get_preference('dotted_files', 'bool')) @@ -852,37 +850,7 @@ self.pref.write() self.window.destroy() - - def _load_left(self): - """ Load data into the left panel. (Bookmarks) """ - # Create TreeStore - treestore = gtk.TreeStore(str, str) - - # Get bookmarks - bookmarks = self.pref.get_bookmarks() - - # Add them to the TreeStore - titer = treestore.append(None, [_i18n('Bookmarks'), None]) - - # Get titles and sort by title - bookmarks = [[self.pref.get_bookmark_title(item), item] for item in bookmarks] - bookmarks.sort() - for title_item in bookmarks: - treestore.append(titer, title_item) - - # Create the column and add it to the TreeView - self.treeview_left.set_model(treestore) - tvcolumn_bookmark = gtk.TreeViewColumn(_i18n('Bookmark')) - self.treeview_left.append_column(tvcolumn_bookmark) - - # Set up the cells - cell = gtk.CellRendererText() - tvcolumn_bookmark.pack_start(cell, True) - tvcolumn_bookmark.add_attribute(cell, 'text', 0) - - # Expand the tree - self.treeview_left.expand_all() - + def _load_right(self): """ Load data into the right panel. (Filelist) """ # Create ListStore @@ -1070,7 +1038,7 @@ def get_selected_left(self): """ Get the selected bookmark. """ - treeselection = self.treeview_left.get_selection() + treeselection = self.window.treeview_left.get_selection() (model, iter) = treeselection.get_selected() if iter is None: @@ -1096,9 +1064,9 @@ def refresh_left(self): """ Refresh the bookmark list. """ - # Get TreeStore and clear it - treestore = self.treeview_left.get_model() - treestore.clear() + # Get ListStore and clear it + liststore = self.window.bookmarklist + liststore.clear() # Re-read preferences self.pref.read() @@ -1106,20 +1074,14 @@ # Get bookmarks bookmarks = self.pref.get_bookmarks() - # Add them to the TreeStore - titer = treestore.append(None, [_i18n('Bookmarks'), None]) - # Get titles and sort by title - bookmarks = [[self.pref.get_bookmark_title(item), item] for item in bookmarks] + bookmarks = [[self.pref.get_bookmark_title(item), item, gtk.STOCK_DIRECTORY] for item in bookmarks] bookmarks.sort() for title_item in bookmarks: - treestore.append(titer, title_item) + liststore.append(title_item) - # Add the TreeStore to the TreeView - self.treeview_left.set_model(treestore) - - # Expand the tree - self.treeview_left.expand_all() + # Add the ListStore to the TreeView + self.window.treeview_left.set_model(liststore) def refresh_right(self, path=None): """ Refresh the file list. """ === modified file 'olive/window.py' --- olive/window.py 2008-07-20 16:02:18 +0000 +++ olive/window.py 2008-07-20 16:59:34 +0000 @@ -373,14 +373,26 @@ self.scrolledwindow_left.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.treeview_left = gtk.TreeView() - self.treeview_left.set_headers_visible(False) self.treeview_left.connect("button-press-event", self.signal.on_treeview_left_button_press_event) self.treeview_left.connect("button-release-event", self.signal.on_treeview_left_button_release_event) self.treeview_left.connect("row-activated", self.signal.on_treeview_left_row_activated) self.scrolledwindow_left.add(self.treeview_left) - # Move olive/__init__.py _load_left List creation here - + self.bookmarklist = gtk.ListStore(gobject.TYPE_STRING, + gobject.TYPE_STRING, + gobject.TYPE_STRING) + self.treeview_left.set_model(self.bookmarklist) + + icon = gtk.CellRendererPixbuf() + cell = gtk.CellRendererText() + + col_bookmark = gtk.TreeViewColumn(_i18n('Bookmarks')) + col_bookmark.pack_start(icon, False) + col_bookmark.pack_start(cell, False) + col_bookmark.set_attributes(icon, stock_id=2) + col_bookmark.add_attribute(cell, 'text', 0) + self.treeview_left.append_column(col_bookmark) + def _create_filelist(self): """ Creates the file list (a ListStore in a TreeView in a ScrolledWindow)""" # Model: [ icon, dir, name, status text, status, size (int), size (human), mtime (int), mtime (local), fileid ] # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWbZuc5YABGhfgERQWe///3+9 3Sq////wYAf98lKSlABbD66AAAADSTKaDRo0AA0NAAaAABoPUGTQ4yZNGIYmmAgYE0wRgmJppoAM IcZMmjEMTTAQMCaYIwTE000AGEEpokI0eoyap+qem0k9qg9QxHqABo0A0AANKjQyAaaaNDTTIGgN GmQ0GTJo0AGEkgICYmkzQnpAmACKeCnqfqmRpibTTU9qki30DsMa8OLBYlp501cCXTmw+Imeup0R xxGlAvwWQgfdxeWCchhYjFU77KZyPtQiTHMwUMhOVE+aogPiSdc6BzFqSOAwkiaBML+B9GBuR+ao ZMCSQyop6RiyeSkyihPxRhZqpZrax3d6EUvkoVKcQ5QQoVaLs/1ns+UsXtH/JTLrLvIql84ghw6u avafgpVrWV/zIsgS+v1pkMNFhfUYKibhVXuCq67xPe2NsjYbjC1nbtS3KKh+TNEt+W4ZpSmOQA3I bzh1xzVjwi82yNsWQ7vVTGQwym6T6FkVkuVW8+/wVzkThc6NL5fg3BsDoVqzFUkjMFo5jsMFQZij 2KD57A1sjO/DaQomwNQRR9xkPFA8CSa5iWy/VWO7+YDKinSZGAsQFl9ychMr5kmQAVEcZcHQEUkQ KekJlxAcUlaX8nSRoWhApj8mmgTDrSJIHj0QVBIgeNhH2QwEUtBgnXVKA+cKQ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xWg oHuLw+5/a1yrRu7l1G5cg5hEC7p6BeC1IUf2D28fYHP0rQ209/EY0oVYepULejz5kEQme4DyS00V Cr5iBMoyGTJL3FCAhpR6pgdpE1dbrKjvJh+9id71ia+DkMOoQwPHpzlYA5ZgHeOFRcdI4ckhkCrS yFcDygXtYQvYtDCbQVFqBkHBT3amZs9f4dYv17akyBMcxY86zAmSDxsANiNq8AVKPmdBsDkKy4uL dVJ2ojAomMwd7UjIChFClIBkyUBw47RheCBcFcpcqmgkyQwpi7OQxMzLxCHLgZKm0AgklV5r4vC0 TDJLyHdaR/gZVIKLEkyLnCrtL0npxs1jLMzONLwFJFR2FYGXC4jmPtsLAY83oOTNYhWFNjDjI3pw a0CiAxwTktv6mXxGS5zVpw0CVhcYntN6mMJ5GoqoANCH/IhYB0kiYTYGFxQT/eC9ECguAKJErBhz sw6iFnf4/8ctI3RsUxyJo4IBlWlpIhBAxAokBIIhY/z+ChA3VOqe7FzewfwUEdi71qH0hJVCqNiZ VigHiLr7IEw0kP41CtIuM9IODTcNr3YooJF4j9kyxF1qG/q40YkkXMlQFRcQCrm75P6N5xH6SlI1 1hYLvDMUGQHoqAc9JkupDGn29rONh0B4HaCwML/VAqxGwx2mSB5qVMB5W8f1G6sNgqy1eh/8XckU 4UJC2bnOWA==
signature.asc
Description: OpenPGP digital signature
-- bzr-gtk mailing list [email protected] Modify settings or unsubscribe at: https://lists.canonical.com/mailman/listinfo/bzr-gtk
