~nagos/openshot/nagos

« back to all changes in this revision

Viewing changes to openshot/windows/preferences.py

  • Committer: Jonathan Thomas
  • Date: 2010-02-03 07:06:00 UTC
  • mfrom: (189.1.1 openshot)
  • Revision ID: jonathan@jonathan64-20100203070600-6e7b7dgbxjiuhzfl
Merged Andy's codec checking branch into the trunk.  This
requires the "melt" command line program to be installed
from the mlt framework.  (sudo apt-get install melt)

Also, tweaked some of the export screen code, to reset
the invalid_codecs list each time you change the quality
dropdown.  Also, replaced all codec/format dropdowns in 
the advanced window to no longer be editable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import gtk, gtk.glade
22
22
import xml.dom.minidom as xml
23
23
 
24
 
from classes import profiles, project, messagebox
 
24
from classes import profiles, project, messagebox, tree
25
25
from windows.SimpleGladeApp import SimpleGladeApp
26
26
from xdg.IconTheme import *
27
27
 
49
49
                self.model = gtk.ListStore(str, gtk.gdk.Pixbuf)
50
50
                
51
51
                #Populate the form with the preference category icons
52
 
                #There is only one category at the moment
 
52
                #General section
53
53
                pixbuf = view.render_icon(gtk.STOCK_PREFERENCES, size=gtk.ICON_SIZE_BUTTON, detail = None)
54
54
                self.model.append([_('General'), pixbuf])
55
55
                
56
 
                #This would add another category called 'Audio'
57
 
                #pixbuf = view.render_icon(gtk.STOCK_EDIT, size=gtk.ICON_SIZE_BUTTON, detail = None)
58
 
                #self.model.append(['Audio', pixbuf])
 
56
                #Formats section
 
57
                pixbuf = view.render_icon(gtk.STOCK_INFO, size=gtk.ICON_SIZE_BUTTON, detail = None)
 
58
                self.model.append(['AV Formats', pixbuf])
59
59
                
60
60
                                
61
61
                # Connect the iconview with the model
81
81
                for file_type in ["binary", "ascii"]:
82
82
                        self.cmbFileType.append_text(file_type)
83
83
                        
 
84
                        
 
85
                #populate the codecs & formats
 
86
                
 
87
                self.VCodecList = gtk.ListStore(str)
 
88
                self.tvVCodecs.set_model(self.VCodecList)
 
89
                tree.treeviewAddGeneralTextColumn(self.tvVCodecs,"Video Codecs",0)
 
90
                
 
91
                self.ACodecList = gtk.ListStore(str)
 
92
                self.tvACodecs.set_model(self.ACodecList)
 
93
                tree.treeviewAddGeneralTextColumn(self.tvACodecs,"Audio Codecs",0)
 
94
                
 
95
                self.FormatsList = gtk.ListStore(str)
 
96
                self.tvFormats.set_model(self.FormatsList)
 
97
                tree.treeviewAddGeneralTextColumn(self.tvFormats,"Formats",0)   
 
98
                
 
99
                self.populate_codecs()
 
100
                
 
101
                        
84
102
                #populate form objects
85
103
                self.txtImageLength.set_text(self.settings.general["imported_image_length"])
86
104
                theme_name = self.settings.general["default_theme"]
94
112
                #show the form
95
113
                self.frmPreferences.show_all()
96
114
                
 
115
        def populate_codecs(self):
 
116
                
 
117
                #populate the codecs
 
118
                
 
119
                #video codecs           
 
120
                for codec in self.form.vcodecs:
 
121
                        self.VCodecList.append([codec])
 
122
                
 
123
                #audio codecs
 
124
                for acodec in self.form.acodecs:
 
125
                        self.ACodecList.append([acodec])
 
126
                
 
127
                #formats
 
128
                for format in self.form.vformats:
 
129
                        self.FormatsList.append([format])
 
130
                        
 
131
        
 
132
        def on_btnReload_clicked(self, widget, *args):
 
133
                
 
134
                #clear the codecs from the form object
 
135
                #and repopulate the listviews
 
136
                
 
137
                self.VCodecList.clear()
 
138
                self.ACodecList.clear()
 
139
                self.FormatsList.clear()
 
140
                
 
141
                self.form.vcodecs[:] = []
 
142
                self.form.acodecs[:] = []
 
143
                self.form.vformats[:] = []
 
144
                
 
145
                self.form.get_avformats()
 
146
                
 
147
                self.populate_codecs()
 
148
                
97
149
                
98
150
        def on_btnCancel_clicked(self, widget, *args):
99
151
                self.frmPreferences.destroy()
140
192
                if category == "General":
141
193
                        self.nbPrefPages.set_current_page(0)
142
194
                #When adding extra categories,
143
 
                #include them in this 'If' statement e.g.
144
 
                #elif category == "Audio":
145
 
                #       self.nbPrefPages.set_current_page(1)
 
195
                #include them in this 'If' statement
 
196
                elif category == "AV Formats":
 
197
                        self.nbPrefPages.set_current_page(1)
146
198
                        
147
199
        
148
200
        def set_dropdown_values(self, value_to_set, combobox):