/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-07-17 14:00:33 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-20060717140033-99c11b1dc94f07e2
2006-07-17  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/dialog.py: some basic dialog stuff added
    * olive/frontend/gtk/handler.py: moved dialog stuff into dialog.py
    * olive/frontend/gtk/__init__.py: added Status column to filelist
    * olive/backend/fileops.py: implemented status()
    * TODO: added a TODO list

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
except:
28
28
        sys.exit(1)
29
29
 
30
 
from olive.frontend.gtk.handler import OliveHandler
 
30
from handler import OliveHandler
31
31
 
32
32
# Olive GTK UI version
33
33
__version__ = '0.1'
37
37
    program."""
38
38
    
39
39
    def __init__(self):
 
40
        import os.path
 
41
        
40
42
        # Load the glade file
41
43
        self.gladefile = "/usr/share/olive/olive.glade"
 
44
        if not os.path.exists(self.gladefile):
 
45
            # Load from current directory if not installed
 
46
            self.gladefile = "olive.glade"
 
47
 
42
48
        self.toplevel = gtk.glade.XML(self.gladefile, "window_main")
43
49
        
44
50
        handler = OliveHandler(self.gladefile)
45
51
        
46
52
        # Dictionary for signal_autoconnect
47
53
        dic = { "on_window_main_destroy": gtk.main_quit,
48
 
                "on_about_activate": handler.about }
 
54
                "on_quit_activate": gtk.main_quit,
 
55
                "on_about_activate": handler.on_about_activate,
 
56
                "on_menuitem_file_make_directory_activate": handler.not_implemented,
 
57
                "on_menuitem_branch_commit_activate": handler.not_implemented }
49
58
        
50
59
        # Connect the signals to the handlers
51
60
        self.toplevel.signal_autoconnect(dic)
53
62
        # Load default data into the panels
54
63
        self.treeview_left = self.toplevel.get_widget('treeview_left')
55
64
        self.treeview_right = self.toplevel.get_widget('treeview_right')
56
 
        self.load_left()
57
 
        self.load_right()
 
65
        self._load_left()
 
66
        self._load_right()
58
67
    
59
 
    def load_left(self):
 
68
    def _load_left(self):
60
69
        """ Load data into the left panel. (Bookmarks) """
61
70
        pass
62
71
        
63
 
    def load_right(self):
 
72
    def _load_right(self):
64
73
        """ Load data into the right panel. (Filelist) """
65
74
        import os
66
75
        import os.path
67
76
        
 
77
        import olive.backend.fileops as fileops
 
78
        
68
79
        # Create ListStore
69
 
        liststore = gtk.ListStore(str, str)
 
80
        liststore = gtk.ListStore(str, str, str)
70
81
        
71
82
        dirs = []
72
83
        files = []
84
95
        
85
96
        # Add'em to the ListStore
86
97
        for item in dirs:    
87
 
            liststore.append(['D', item])
 
98
            liststore.append(['D', item, ''])
88
99
        for item in files:
89
 
            liststore.append(['', item])
 
100
            liststore.append(['', item, fileops.status(item)])
90
101
        
91
102
        # Create the columns and add them to the TreeView
92
103
        self.treeview_right.set_model(liststore)
 
104
        tvcolumn_filetype = gtk.TreeViewColumn('Type')
93
105
        tvcolumn_filename = gtk.TreeViewColumn('Filename')
94
 
        tvcolumn_filetype = gtk.TreeViewColumn('Type')
 
106
        tvcolumn_status = gtk.TreeViewColumn('Status')
95
107
        self.treeview_right.append_column(tvcolumn_filetype)
96
108
        self.treeview_right.append_column(tvcolumn_filename)
 
109
        self.treeview_right.append_column(tvcolumn_status)
97
110
        
98
111
        # Set up the cells
99
112
        cell = gtk.CellRendererText()
101
114
        tvcolumn_filetype.add_attribute(cell, 'text', 0)
102
115
        tvcolumn_filename.pack_start(cell, True)
103
116
        tvcolumn_filename.add_attribute(cell, 'text', 1)
 
117
        tvcolumn_status.pack_start(cell, True)
 
118
        tvcolumn_status.add_attribute(cell, 'text', 2)