~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/ui/projectsettings.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-02-04 14:42:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060204144230-9ihvyas6lhgn81k1
Tags: upstream-0.9.9.2
ImportĀ upstreamĀ versionĀ 0.9.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# PiTiVi , Non-linear video editor
 
2
#
 
3
#       ui/projectsettings.py
 
4
#
 
5
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
 
6
#
 
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.
 
11
#
 
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.
 
16
#
 
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.
 
21
 
 
22
import gobject
 
23
import gtk
 
24
from glade import GladeWindow
 
25
 
 
26
class ProjectSettingsDialog(GladeWindow):
 
27
    glade_file = "projectsettings.glade"
 
28
 
 
29
    def __init__(self, parent, project):
 
30
        GladeWindow.__init__(self, parent)
 
31
        self.project = project
 
32
        self.widgets["exportwidget"].set_settings(self.project.settings)
 
33
        self._fill_settings()
 
34
 
 
35
    def _fill_settings(self):
 
36
        w = self.widgets
 
37
        w["nameentry"].set_text(self.project.name)
 
38
        w["descriptiontextview"].get_buffer().set_text(self.project.description)
 
39
        
 
40
 
 
41
    def _update_settings(self):
 
42
        # apply selected settings to project
 
43
        w = self.widgets
 
44
        
 
45
        # Name/Description
 
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()
 
51
 
 
52
    def response_cb(self, widget, response):
 
53
        # if the response is gtk.RESPONSE_OK update the settings
 
54
        # else destroy yourself !
 
55
        self.hide()
 
56
        if response == gtk.RESPONSE_OK:
 
57
            print "settings updated"
 
58
            self._update_settings()
 
59
        else:
 
60
            print "settings NOT updated!"
 
61
        self.destroy()