1
# PiTiVi , Non-linear video editor
3
# ui/projectsettings.py
5
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
7
# This program is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU Lesser General Public
9
# License as published by the Free Software Foundation; either
10
# version 2.1 of the License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
# Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public
18
# License along with this program; if not, write to the
19
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
# Boston, MA 02111-1307, USA.
24
from glade import GladeWindow
26
class ProjectSettingsDialog(GladeWindow):
27
glade_file = "projectsettings.glade"
29
def __init__(self, parent, project):
30
GladeWindow.__init__(self, parent)
31
self.project = project
32
self.widgets["exportwidget"].set_settings(self.project.settings)
35
def _fill_settings(self):
37
w["nameentry"].set_text(self.project.name)
38
w["descriptiontextview"].get_buffer().set_text(self.project.description)
41
def _update_settings(self):
42
# apply selected settings to project
46
self.project.name = w["nameentry"].get_text()
47
txtbuffer = w["descriptiontextview"].get_buffer()
48
self.project.description = txtbuffer.get_text(txtbuffer.get_start_iter(),
49
txtbuffer.get_end_iter())
50
w["exportwidget"]._update_settings()
52
def response_cb(self, widget, response):
53
# if the response is gtk.RESPONSE_OK update the settings
54
# else destroy yourself !
56
if response == gtk.RESPONSE_OK:
57
print "settings updated"
58
self._update_settings()
60
print "settings NOT updated!"