/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/bookmark.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2007-02-01 14:52:43 UTC
  • mto: (157.1.2 trunk) (170.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 141.
  • Revision ID: szilveszter.farkas@gmail.com-20070201145243-5a1k1yhh0b6gabyj
Remove trash from olive.glade. Some cleanups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    pass
22
22
 
23
23
import gtk
24
 
import gtk.glade
25
24
 
26
25
from olive import OlivePreferences
27
26
from dialog import error_dialog
28
 
from guifiles import GLADEFILENAME
29
 
 
30
 
 
31
 
class OliveBookmark:
32
 
    """ Display the Edit bookmark dialog and perform the needed actions. """
33
 
    def __init__(self, selected):
34
 
        """ Initialize the Edit bookmark dialog. """
35
 
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_bookmark', 'olive-gtk')
36
 
        
37
 
        self.window = self.glade.get_widget('window_bookmark')
38
 
        
39
 
        self.pref = OlivePreferences()
40
 
        
41
 
        # Dictionary for signal_autoconnect
42
 
        dic = { "on_button_bookmark_save_clicked": self.bookmark,
43
 
                "on_button_bookmark_cancel_clicked": self.close }
44
 
        
45
 
        # Connect the signals to the handlers
46
 
        self.glade.signal_autoconnect(dic)
47
 
        
48
 
        # Get some important widgets
49
 
        self.entry_location = self.glade.get_widget('entry_bookmark_location')
50
 
        self.entry_title = self.glade.get_widget('entry_bookmark_title')
51
 
        
52
 
        self.selected = selected
53
 
 
54
 
    def display(self):
55
 
        """ Display the Edit bookmark dialog. """
56
 
        path = self.selected
57
 
        self.entry_location.set_text(path)
58
 
        self.entry_title.set_text(self.pref.get_bookmark_title(path))
59
 
        self.window.show_all()
60
 
        
61
 
    def bookmark(self, widget):
62
 
        if self.entry_title.get_text() == '':
63
 
            error_dialog(_('No title given'),
64
 
                         _('Please specify a title to continue.'))
65
 
            return
66
 
        
67
 
        self.pref.set_bookmark_title(self.entry_location.get_text(),
68
 
                                     self.entry_title.get_text())
69
 
        self.pref.write()
70
 
        
71
 
        self.close()
72
 
    
73
 
    def close(self, widget=None):
74
 
        self.window.destroy()
75
 
 
76
 
class OliveBookmarkDialog(gtk.Dialog):
 
27
 
 
28
 
 
29
class BookmarkDialog(gtk.Dialog):
77
30
    """ This class wraps the old Bookmark window into a gtk.Dialog. """
78
31
    
79
32
    def __init__(self, selected, parent=None):