1
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30
from olive.frontend.gtk.handler import OliveHandler
32
# Olive GTK UI version
36
""" The main Olive GTK frontend class. This is called when launching the
41
self.gladefile = "/usr/share/olive/olive.glade"
42
self.toplevel = gtk.glade.XML(self.gladefile, "window_main")
44
handler = OliveHandler(self.gladefile)
46
# Dictionary for signal_autoconnect
47
dic = { "on_window_main_destroy": gtk.main_quit,
48
"on_about_activate": handler.about }
50
# Connect the signals to the handlers
51
self.toplevel.signal_autoconnect(dic)
53
# Load default data into the panels
54
self.treeview_left = self.toplevel.get_widget('treeview_left')
55
self.treeview_right = self.toplevel.get_widget('treeview_right')
60
""" Load data into the left panel. (Bookmarks) """
64
""" Load data into the right panel. (Filelist) """
69
liststore = gtk.ListStore(str, str)
74
# Fill the appropriate lists
75
for item in os.listdir('.'):
76
if os.path.isdir(item):
85
# Add'em to the ListStore
87
liststore.append(['D', item])
89
liststore.append(['', item])
91
# Create the columns and add them to the TreeView
92
self.treeview_right.set_model(liststore)
93
tvcolumn_filename = gtk.TreeViewColumn('Filename')
94
tvcolumn_filetype = gtk.TreeViewColumn('Type')
95
self.treeview_right.append_column(tvcolumn_filetype)
96
self.treeview_right.append_column(tvcolumn_filename)
99
cell = gtk.CellRendererText()
100
tvcolumn_filetype.pack_start(cell, True)
101
tvcolumn_filetype.add_attribute(cell, 'text', 0)
102
tvcolumn_filename.pack_start(cell, True)
103
tvcolumn_filename.add_attribute(cell, 'text', 1)