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

« back to all changes in this revision

Viewing changes to pitivi/application.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-07-07 13:43:47 UTC
  • mto: (6.1.9 sid) (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20110707134347-cari9kxjiakzej9z
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
# You should have received a copy of the GNU Lesser General Public
20
20
# License along with this program; if not, write to the
21
 
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
 
# Boston, MA 02111-1307, USA.
 
21
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 
22
# Boston, MA 02110-1301, USA.
23
23
 
24
24
"""
25
25
Main application
44
44
from pitivi.configure import APPNAME
45
45
from pitivi.settings import GlobalSettings
46
46
from pitivi.threads import ThreadMaster
47
 
from pitivi.pluginmanager import PluginManager
48
47
from pitivi.signalinterface import Signallable
49
48
from pitivi.log.loggable import Loggable
50
49
from pitivi.log import log
64
63
# AND THEN load up the required parts.
65
64
# This will result in a much better end-user experience
66
65
 
 
66
 
67
67
class Pitivi(Loggable, Signallable):
68
68
    """
69
69
    Pitivi's main application class.
85
85
 
86
86
    @ivar settings: Application-wide settings.
87
87
    @type settings: L{GlobalSettings}.
88
 
    @ivar projects: List of used projects
89
 
    @type projects: List of L{Project}.
90
88
    @ivar current: Currently used project.
91
89
    @type current: L{Project}.
92
90
    """
121
119
                % APPNAME)
122
120
        instance.PiTiVi = self
123
121
 
124
 
        self.projects = []
125
122
        self.current = None
126
123
 
127
124
        # get settings
129
126
        self.threads = ThreadMaster()
130
127
        #self.screencast = False
131
128
 
132
 
        self.plugin_manager = PluginManager(
133
 
            self.settings.get_local_plugin_path(),
134
 
            self.settings.get_plugin_settings_path())
135
129
        self.effects = EffectsHandler()
136
 
        self.deviceprobe = None
137
130
 
138
131
        self.projectManager = ProjectManager(self.effects)
139
132
        self._connectToProjectManager(self.projectManager)
160
153
            return False
161
154
        self.threads.stopAllThreads()
162
155
        self.settings.storeSettings()
163
 
        if self.deviceprobe:
164
 
            self.deviceprobe.release()
165
 
        self.deviceprobe = None
166
156
        self.current = None
167
157
        instance.PiTiVi = None
168
158
        self.emit("shutdown")
279
269
        dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
280
270
                                   buttons=gtk.BUTTONS_OK)
281
271
        dialog.set_icon_name("pitivi")
282
 
        dialog.set_markup("<b>"+message+"</b>")
 
272
        dialog.set_markup("<b>" + message + "</b>")
283
273
        dialog.format_secondary_text(detail)
284
274
        dialog.run()
285
275
 
386
376
        self.projectManager.connect("new-project-loading", self._hideWizardCb)
387
377
        self.projectManager.connect("new-project-failed", self._showWizardCb)
388
378
        self.wizard = StartUpWizard(self)
389
 
        self.wizard.hide()
390
379
        return FullGuiPitivi._createGui(self)
391
380
 
392
381
    def _showGui(self):
427
416
 
428
417
    def _newProjectLoaded(self, project):
429
418
        # create previewer and set ui
430
 
        previewer = Previewer(self.current, pipeline=None, ui=self.viewer)
 
419
        previewer = Previewer(project, ui=self.viewer)
431
420
        self._setActioner(previewer)
432
421
        # hack to make the gtk.HScale seek slider UI behave properly
433
422
        self.viewer._durationChangedCb(None, project.timeline.duration)
449
438
 
450
439
    def _newProjectLoaded(self, project):
451
440
        # create renderer and set output file
452
 
        renderer = Renderer(self.current, outfile=self.outfile)
 
441
        renderer = Renderer(project, outfile=self.outfile)
453
442
        self._setActioner(renderer)
454
443
 
455
444
    def shutdown(self):