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

  • Committer: Jelmer Vernooij
  • Date: 2006-09-27 19:52:46 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927195246-9354d7ccf56127f5
Don't pass around gladefile all the time. 
Fix bug in status information when files have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
# Olive GTK UI version
38
38
__version__ = '0.11.0'
39
39
 
 
40
# Load the glade file
 
41
if sys.platform == 'win32':
 
42
        gladefile = os.path.dirname(sys.executable) + "/share/olive/olive.glade"
 
43
else:
 
44
        gladefile = "/usr/share/olive/olive.glade"
 
45
 
 
46
if not os.path.exists(gladefile):
 
47
        # Load from current directory if not installed
 
48
        gladefile = "olive.glade"
 
49
        # Check again
 
50
        if not os.path.exists(gladefile):
 
51
                # Fail
 
52
                print _('Glade file cannot be found.')
 
53
                sys.exit(1)
 
54
 
40
55
class OliveGtk:
41
56
    """ The main Olive GTK frontend class. This is called when launching the
42
57
    program. """
43
58
    
44
59
    def __init__(self):
45
 
        # Load the glade file
46
 
        if sys.platform == 'win32':
47
 
            self.gladefile = os.path.dirname(sys.executable) + "/share/olive/olive.glade"
48
 
        else:
49
 
            self.gladefile = "/usr/share/olive/olive.glade"
50
 
 
51
 
        if not os.path.exists(self.gladefile):
52
 
            # Load from current directory if not installed
53
 
            self.gladefile = "olive.glade"
54
 
            # Check again
55
 
            if not os.path.exists(self.gladefile):
56
 
                # Fail
57
 
                print _('Glade file cannot be found.')
58
 
                sys.exit(1)
59
 
 
60
 
        self.toplevel = gtk.glade.XML(self.gladefile, 'window_main', 'olive-gtk')
 
60
        self.toplevel = gtk.glade.XML(gladefile, 'window_main', 'olive-gtk')
61
61
        
62
62
        self.window = self.toplevel.get_widget('window_main')
63
63
        
64
64
        self.pref = OlivePreferences()
65
65
        self.comm = OliveCommunicator(self.toplevel, self.pref)
66
 
        handler = OliveHandler(self.gladefile, self.comm)
 
66
        handler = OliveHandler(self.comm)
67
67
        
68
68
        # Dictionary for signal_autoconnect
69
69
        dic = { "on_window_main_destroy": gtk.main_quit,
226
226
                for rpath, id, kind in delta.added:
227
227
                    if rpath == filename:
228
228
                        status = 'added'
229
 
                for rpath, id, kind, text_modified, meta_modified in delta.removed:
 
229
                for rpath, id, kind in delta.removed:
230
230
                    if rpath == filename:
231
231
                        status = 'removed'
232
232
                for rpath, id, kind, text_modified, meta_modified in delta.modified: