=== modified file 'openshot/classes/project.py' --- openshot/classes/project.py 2010-09-18 09:05:00 +0000 +++ openshot/classes/project.py 2010-11-12 08:50:41 +0000 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # OpenShot Video Editor is a program that creates, modifies, and edits video files. # Copyright (C) 2009 Jonathan Thomas, TJ # @@ -235,6 +236,19 @@ # Add the root element westley_root = dom.createElement("mlt") dom.appendChild(westley_root) + if self.mlt_profile: + profile = dom.createElement("profile") + profile.setAttribute("description", self.mlt_profile.description()) + profile.setAttribute("width", str(self.mlt_profile.width())) + profile.setAttribute("height", str(self.mlt_profile.height())) + profile.setAttribute("sample_aspect_num", str(self.mlt_profile.sample_aspect_num())) + profile.setAttribute("sample_aspect_den", str(self.mlt_profile.sample_aspect_den())) + profile.setAttribute("display_aspect_num", str(self.mlt_profile.display_aspect_num())) + profile.setAttribute("display_aspect_den", str(self.mlt_profile.display_aspect_den())) + profile.setAttribute("progressive", self.mlt_profile.progressive() and "1" or "0") + profile.setAttribute("frame_rate_num", str(self.mlt_profile.frame_rate_num())) + profile.setAttribute("frame_rate_den", str(self.mlt_profile.frame_rate_den())) + westley_root.appendChild(profile) tractor1 = dom.createElement("tractor") tractor1.setAttribute("id", "tractor0") westley_root.appendChild(tractor1) === added file 'openshot/windows/ExportXML.py' --- openshot/windows/ExportXML.py 1970-01-01 00:00:00 +0000 +++ openshot/windows/ExportXML.py 2010-11-13 17:07:08 +0000 @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +# OpenShot Video Editor is a program that creates, modifies, and edits video files. +# Copyright (C) 2009 Jonathan Thomas +# +# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/). +# +# OpenShot Video Editor is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenShot Video Editor is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenShot Video Editor. If not, see . + +import os, gtk +import gtk +from classes import messagebox, project +from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp + +# init the foriegn language +import language.Language_Init as Language_Init + + +class frmExportXML(SimpleGtkBuilderApp): + + def __init__(self, path="ExportXML.ui", root="frmExportXML", domain="OpenShot", project=None, **kwargs): + SimpleGtkBuilderApp.__init__(self, os.path.join(project.UI_DIR, path), root, domain, **kwargs) + + self.project = project + self.form = self.project.form + + # Add language support + _ = Language_Init.Translator(project).lang.gettext + + # set a file type filter (to limit the files to only valid files) + OSPfilter = gtk.FileFilter() + OSPfilter.add_pattern("*.mlt") + OSPfilter.set_name(_("MLT XML (*.mlt)")) + self.frmExportXML.add_filter(OSPfilter) + self.frmExportXML.set_current_folder_uri("file://%s" % self.project.DESKTOP) + + + def new(self): + print "A new %s has been created" % self.__class__.__name__ + + def on_frmExportXML_response(self, widget, *args): + #print "on_frmOpenProject_response called with self.%s" % widget.get_name() + pass + + def on_btnCancel_clicked(self, widget, *args): + #print "on_btnCancel_clicked called with self.%s" % widget.get_name() + self.frmExportXML.destroy() + + + def on_btnExportXML_clicked(self, widget, *args): + #print "on_btnExportXML_clicked called with self.%s" % widget.get_name() + + # Get selected file name + file_to_save = self.frmExportXML.get_filename() + + try: + # Call the GenerateXML method on the project + self.project.GenerateXML(file_to_save) + + # close window + self.frmExportXML.destroy() + + except: + # show the error message + messagebox.show(_("Error!"), _("There was an error saving this project as XML.")) + + + def on_frmExportXML_file_activated(self, widget, *args): + #call the ExportXML method when a file is double clicked + self.on_btnExportXML_clicked(widget, *args) + + +def main(): + frm_export_xml = frmExportXML() + frm_export_xml.run() + +if __name__ == "__main__": + main() === modified file 'openshot/windows/MainGTK.py' --- openshot/windows/MainGTK.py 2010-09-22 05:01:04 +0000 +++ openshot/windows/MainGTK.py 2010-11-14 20:54:56 +0000 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # OpenShot Video Editor is a program that creates, modifies, and edits video files. # Copyright (C) 2009 Jonathan Thomas # @@ -31,7 +32,7 @@ from classes import files, lock, messagebox, open_project, project, timeline, tree, video, inputbox, av_formats, clip from windows import About, FileProperties, NewProject, OpenProject, preferences, Profiles from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp -from windows import AddFiles, ClipProperties, ExportVideo, ImportImageSeq, Titles, TransitionProperties, TreeFiles, TreeTransitions, TreeEffects, TreeHistory, BlenderGenerator, AddToTimeline, ImportTransitions +from windows import AddFiles, ClipProperties, ExportVideo, ImportImageSeq, Titles, TransitionProperties, TreeFiles, TreeTransitions, TreeEffects, TreeHistory, BlenderGenerator, AddToTimeline, ImportTransitions, ExportXML # init the foreign language from language import Language_Init @@ -1297,6 +1298,10 @@ # call toolbar button self.on_tlbMakeMovie_clicked(widget) + def on_mnuExportXML_activate(self, widget, *args): + print "on_mnuExportXML_activate called with self.%s" % widget.get_name() + ExportXML.frmExportXML(project=self.project) + def on_mnuQuit1_activate(self, widget, *args): print "on_mnuQuit1_activate called with self.%s" % widget.get_name() === added file 'openshot/windows/ui/ExportXML.ui' --- openshot/windows/ui/ExportXML.ui 1970-01-01 00:00:00 +0000 +++ openshot/windows/ui/ExportXML.ui 2010-11-13 17:02:38 +0000 @@ -0,0 +1,67 @@ + + + + + + True + 5 + Export XML + center + icons/openshot.png + normal + False + save + + + True + 2 + + + + + + True + end + + + Cancel + True + True + True + + + + False + False + 0 + + + + + Export XML + True + True + True + + + + False + False + 1 + + + + + False + end + 0 + + + + + + btnCancel + btnExportXML + + + === modified file 'openshot/windows/ui/Main.ui' --- openshot/windows/ui/Main.ui 2010-09-06 17:16:52 +0000 +++ openshot/windows/ui/Main.ui 2010-11-12 08:27:42 +0000 @@ -15,7 +15,6 @@ True - vertical True @@ -133,6 +132,15 @@ + + Export XML... + True + image1 + False + + + + True @@ -352,7 +360,6 @@ True - vertical True @@ -500,7 +507,6 @@ True True - vertical @@ -578,7 +584,6 @@ True - vertical True @@ -759,7 +764,6 @@ True - vertical True @@ -936,7 +940,6 @@ 85 True - vertical True @@ -1359,4 +1362,8 @@ True gtk-directory + + True + text-x-generic +