/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/frontend/gtk/__init__.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-20 16:41:46 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060820164146-f19c4563bf76581f
Bookmarks have titles; you can also edit them.

2006-08-20  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * po/olive-gtk.pot: generated new .pot file
    * olive/frontend/gtk/bookmark.py: implemented Edit bookmark dialog
    * cmenu.ui: added Edit item to left context menu
    * olive.glade: added Edit bookmark dialog
    * olive/frontend/gtk/__init__.py: added support for bookmark titles

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        self.comm.set_busy(self.treeview_left)
136
136
        
137
137
        # Create TreeStore
138
 
        treestore = gtk.TreeStore(str)
 
138
        treestore = gtk.TreeStore(str, str)
139
139
        
140
140
        # Get bookmarks
141
141
        bookmarks = self.comm.pref.get_bookmarks()
142
142
        
143
143
        # Add them to the TreeStore
144
 
        titer = treestore.append(None, [_('Bookmarks')])
 
144
        titer = treestore.append(None, [_('Bookmarks'), None])
145
145
        for item in bookmarks:
146
 
            treestore.append(titer, [item])
 
146
            title = self.comm.pref.get_bookmark_title(item)
 
147
            treestore.append(titer, [title, item])
147
148
        
148
149
        # Create the column and add it to the TreeView
149
150
        self.treeview_left.set_model(treestore)
333
334
        if iter is None:
334
335
            return None
335
336
        else:
336
 
            return model.get_value(iter, 0)
 
337
            return model.get_value(iter, 1)
337
338
 
338
339
    def set_statusbar(self, message):
339
340
        """ Set the statusbar message. """
356
357
        bookmarks = self.pref.get_bookmarks()
357
358
        
358
359
        # Add them to the TreeStore
359
 
        titer = treestore.append(None, [_('Bookmarks')])
 
360
        titer = treestore.append(None, [_('Bookmarks'), None])
360
361
        for item in bookmarks:
361
 
            treestore.append(titer, [item])
 
362
            title = self.pref.get_bookmark_title(item)
 
363
            treestore.append(titer, [title, item])
362
364
        
363
365
        # Add the TreeStore to the TreeView
364
366
        self.treeview_left.set_model(treestore)
573
575
        else:
574
576
            return True
575
577
 
 
578
    def get_bookmark_title(self, path):
 
579
        """ Get bookmark title. """
 
580
        try:
 
581
            ret = self.config.get(path, 'title')
 
582
        except ConfigParser.NoOptionError:
 
583
            ret = path
 
584
        
 
585
        return ret
 
586
    
 
587
    def set_bookmark_title(self, path, title):
 
588
        """ Set bookmark title. """
 
589
        self.config.set(path, 'title', title)
 
590
    
576
591
    def remove_bookmark(self, path):
577
592
        """ Remove bookmark. """
578
593
        return self.config.remove_section(path)