openshot.code team mailing list archive
-
openshot.code team
-
Mailing list archive
-
Message #00055
[Branch ~openshot.code/openshot/main] Rev 546: Fixed a regression in revision 509, which causes the color pickers to not initialize correctly, a...
------------------------------------------------------------
revno: 546
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Sat 2011-09-03 00:56:45 -0500
message:
Fixed a regression in revision 509, which causes the color pickers to not initialize correctly, and thus the screen freezes. This only happened on non-title SVG files, which had a less predictable XML structure.
modified:
openshot/windows/MainGTK.py
openshot/windows/Titles.py
--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main
Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/MainGTK.py'
--- openshot/windows/MainGTK.py 2011-09-02 05:36:05 +0000
+++ openshot/windows/MainGTK.py 2011-09-03 05:56:45 +0000
@@ -1670,7 +1670,7 @@
def on_mnuNewTitle_activate(self, widget, *args):
print "on_mnuNewTitle_activate called with self.%s" % widget.get_name()
- Titles.frmNewTitle(form=self, project=self.project)
+ Titles.frmTitles(form=self, project=self.project)
def on_mnu3dTitle_activate(self, widget, *args):
@@ -3665,7 +3665,7 @@
#print "on_mnuClipEditTitle_activate"
#edit a title using the title editor
- Titles.frmNewTitle(form=self.form, project=self.project, file=os.path.join(self.project.folder, self.selected_clip.file_object.name))
+ Titles.frmTitles(form=self.form, project=self.project, file=os.path.join(self.project.folder, self.selected_clip.file_object.name))
def on_mnuClipProperties_activate(self, event, *args):
@@ -4502,7 +4502,7 @@
if file_item and mode == "simple":
# SIMPLE EDIT MODE
#edit a title using the title editor
- Titles.frmNewTitle(form=self.form, project=self.project, file=os.path.join(self.project.folder, file_item.name))
+ Titles.frmTitles(form=self.form, project=self.project, file=os.path.join(self.project.folder, file_item.name))
# Update thumbnail
self.project.thumbnailer.get_thumb_at_frame(file_item.name)
=== modified file 'openshot/windows/Titles.py'
--- openshot/windows/Titles.py 2011-09-02 04:51:00 +0000
+++ openshot/windows/Titles.py 2011-09-03 05:56:45 +0000
@@ -30,6 +30,7 @@
import subprocess
import fnmatch
import gtk
+
from xml.dom import minidom
from classes import files, messagebox, project, profiles
from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp
@@ -41,7 +42,7 @@
import language.Language_Init as Language_Init
-class frmNewTitle(SimpleGtkBuilderApp):
+class frmTitles(SimpleGtkBuilderApp):
def __init__(self, path="titles.ui", root="frmTitles", domain="OpenShot", form=None, project=None, file=None, **kwargs):
SimpleGtkBuilderApp.__init__(self, os.path.join(project.UI_DIR, path), root, domain, **kwargs)
@@ -107,8 +108,11 @@
self.filename = self.file
self.load_svg_template(self.file)
- self.update_font_color_button()
- self.update_background_color_button()
+ try:
+ self.update_font_color_button()
+ self.update_background_color_button()
+ except:
+ print "Warning: Failed to initialize the color pickers from the SVG."
#set edit button states
self.btnEditText.set_sensitive(True)
@@ -339,6 +343,7 @@
# refresh the main form
self.form.refresh_files()
+
def find_in_list(self, l, value):
'''when passed a partial value, function will return the list index'''
@@ -521,28 +526,34 @@
def on_btnBackgroundColor_color_set(self, widget):
- self.bg_color_code = self.btnBackgroundColor.get_color()
- color_name = self.html_color(self.bg_color_code)
-
- # get background alpha
- raw_alpha = float(self.btnBackgroundColor.get_alpha())
- self.bg_color_alpha = raw_alpha / 65535.0
-
- #set the style element
- self.set_bg_style(color_name)
+ try:
+ self.bg_color_code = self.btnBackgroundColor.get_color()
+ color_name = self.html_color(self.bg_color_code)
+
+ # get background alpha
+ raw_alpha = float(self.btnBackgroundColor.get_alpha())
+ self.bg_color_alpha = raw_alpha / 65535.0
+
+ #set the style element
+ self.set_bg_style(color_name)
+ except:
+ print "Warning: Failed to set background color."
def on_btnFontColor_color_set(self, widget):
- # get font color
- self.font_color_code = self.btnFontColor.get_color()
- self.font_color_code = self.html_color(self.font_color_code)
-
- # get font alpha
- raw_alpha = float(self.btnFontColor.get_alpha())
- self.font_color_alpha = raw_alpha / 65535.0
-
- #set the style element
- self.set_font_color()
+ try:
+ # get font color
+ self.font_color_code = self.btnFontColor.get_color()
+ self.font_color_code = self.html_color(self.font_color_code)
+
+ # get font alpha
+ raw_alpha = float(self.btnFontColor.get_alpha())
+ self.font_color_alpha = raw_alpha / 65535.0
+
+ #set the style element
+ self.set_font_color()
+ except:
+ print "Warning: Failed to set font color."
def update_font_color_button(self):
"""Updates the color shown on the font color button"""
@@ -695,9 +706,9 @@
-def main():
- frm_titles = frmNewTitle()
- frm_titles.run()
-
-if __name__ == "__main__":
- main()
+#def main():
+# frm_titles = frmTitles()
+# frm_titles.run()
+#
+#if __name__ == "__main__":
+# main()