Merge lp:~fincha/openshot/andy-1.2 into lp:openshot/1.4
- andy-1.2
- Merge into main
Proposed by
Andy Finch
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merge reported by: | Jonathan Thomas | ||||||||||||||||
Merged at revision: | not available | ||||||||||||||||
Proposed branch: | lp:~fincha/openshot/andy-1.2 | ||||||||||||||||
Merge into: | lp:openshot/1.4 | ||||||||||||||||
Diff against target: |
939 lines (+627/-19) (has conflicts) 14 files modified
openshot/classes/clip.py (+76/-1) openshot/classes/project.py (+21/-0) openshot/classes/thumbnail.py (+19/-7) openshot/effects/bass.xml (+23/-0) openshot/effects/treble.xml (+22/-0) openshot/windows/AddFiles.py (+53/-5) openshot/windows/FileProperties.py (+13/-0) openshot/windows/ImportTransitions.py (+138/-0) openshot/windows/MainGTK.py (+75/-4) openshot/windows/TreeTransitions.py (+28/-1) openshot/windows/preferences.py (+3/-1) openshot/windows/ui/ImportTransitions.ui (+134/-0) openshot/windows/ui/Main.ui (+9/-0) openshot/windows/ui/Main_clip_properties.ui (+13/-0) Text conflict in openshot/classes/clip.py Text conflict in openshot/classes/project.py Text conflict in openshot/windows/FileProperties.py |
||||||||||||||||
To merge this branch: | bzr merge lp:~fincha/openshot/andy-1.2 | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Thomas | Pending | ||
Review via email: mp+29753@code.launchpad.net |
Commit message
Description of the change
Includes the following fixes/changes:
#510755 - 'Replace Clip' option on the right click menu - replaces clip, but preserves current properties.
#510708 - Allow user to import new transitions (done via a gui)
#502861 - Dragging a clip on the Timeline shouldn't change the mute/visible properties (Couldn't actually prevent the change when dragging, but now you can't accidentally change them when right clicking or in razor mode).
#517068 - Add Frame snapshot. Keyboard shortcut 'f' extracts the current frame and adds to the project as an image.
Also added Bass & Treble audio effects - might replace these later with a proper equaliser, if I can get the ladspa audio effects working.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openshot/classes/clip.py' | |||
2 | --- openshot/classes/clip.py 2010-07-06 03:23:04 +0000 | |||
3 | +++ openshot/classes/clip.py 2010-07-12 22:08:40 +0000 | |||
4 | @@ -1308,7 +1308,7 @@ | |||
5 | 1308 | 1308 | ||
6 | 1309 | def on_motion_notify_x (self, item, target, event): | 1309 | def on_motion_notify_x (self, item, target, event): |
7 | 1310 | """this method allows the clip to be dragged and dropped on a track""" | 1310 | """this method allows the clip to be dragged and dropped on a track""" |
9 | 1311 | 1311 | ||
10 | 1312 | # get the new x,y coordinates from the mouse | 1312 | # get the new x,y coordinates from the mouse |
11 | 1313 | new_x = float(event.x) | 1313 | new_x = float(event.x) |
12 | 1314 | new_y = float(event.y) | 1314 | new_y = float(event.y) |
13 | @@ -1804,6 +1804,7 @@ | |||
14 | 1804 | else: | 1804 | else: |
15 | 1805 | # The clip has moved | 1805 | # The clip has moved |
16 | 1806 | type_of_event = _("Moved clip") | 1806 | type_of_event = _("Moved clip") |
17 | 1807 | <<<<<<< TREE | ||
18 | 1807 | 1808 | ||
19 | 1808 | # Animate the clip to it's new position | 1809 | # Animate the clip to it's new position |
20 | 1809 | item.animate(distance_from_clip, drop_track.y_top - item.get_bounds().y1 + 2, 1.0, 0.0, False, 200, 4, goocanvas.ANIMATE_FREEZE) | 1810 | item.animate(distance_from_clip, drop_track.y_top - item.get_bounds().y1 + 2, 1.0, 0.0, False, 200, 4, goocanvas.ANIMATE_FREEZE) |
21 | @@ -1818,6 +1819,12 @@ | |||
22 | 1818 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = type_of_event) | 1819 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = type_of_event) |
23 | 1819 | 1820 | ||
24 | 1820 | 1821 | ||
25 | 1822 | ======= | ||
26 | 1823 | |||
27 | 1824 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = type_of_event) | ||
28 | 1825 | |||
29 | 1826 | |||
30 | 1827 | >>>>>>> MERGE-SOURCE | ||
31 | 1821 | elif isResize: | 1828 | elif isResize: |
32 | 1822 | 1829 | ||
33 | 1823 | # remove clip from goocanvas | 1830 | # remove clip from goocanvas |
34 | @@ -1885,6 +1892,7 @@ | |||
35 | 1885 | 1892 | ||
36 | 1886 | 1893 | ||
37 | 1887 | def on_visible_click (self, item, target, event): | 1894 | def on_visible_click (self, item, target, event): |
38 | 1895 | <<<<<<< TREE | ||
39 | 1888 | 1896 | ||
40 | 1889 | # get a reference to the language translate method | 1897 | # get a reference to the language translate method |
41 | 1890 | _ = self.parent.parent.project.translate | 1898 | _ = self.parent.parent.project.translate |
42 | @@ -1917,9 +1925,43 @@ | |||
43 | 1917 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed visibility of clip")) | 1925 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed visibility of clip")) |
44 | 1918 | 1926 | ||
45 | 1919 | return False | 1927 | return False |
46 | 1928 | ======= | ||
47 | 1929 | #don't do this if in razor mode | ||
48 | 1930 | (isArrow, isRazor, isSnap, isResize) = self.parent.parent.project.form.get_toolbar_options() | ||
49 | 1931 | if isArrow: | ||
50 | 1932 | # get a reference to the 2 main canvas objects & theme | ||
51 | 1933 | theme = self.parent.parent.project.theme | ||
52 | 1934 | |||
53 | 1935 | # get the parent left group | ||
54 | 1936 | parent_group = item.get_parent() | ||
55 | 1937 | canvas = parent_group.get_canvas() | ||
56 | 1938 | canvas.pointer_ungrab (item, event.time) | ||
57 | 1939 | |||
58 | 1940 | if self.play_video == True: | ||
59 | 1941 | # Load Hover Over | ||
60 | 1942 | imgTrack_Visible = gtk.image_new_from_file("%s/openshot/themes/%s/not_visible_transparent.png" % (self.parent.parent.project.form.openshot_path, theme)) | ||
61 | 1943 | item.set_properties(pixbuf = imgTrack_Visible.get_pixbuf()) | ||
62 | 1944 | |||
63 | 1945 | # update play video variable | ||
64 | 1946 | self.play_video = False | ||
65 | 1947 | |||
66 | 1948 | else: | ||
67 | 1949 | # Load normal image | ||
68 | 1950 | imgTrack_Visible = gtk.image_new_from_file("%s/openshot/themes/%s/visible_transparent.png" % (self.parent.parent.project.form.openshot_path, theme)) | ||
69 | 1951 | item.set_properties(pixbuf = imgTrack_Visible.get_pixbuf()) | ||
70 | 1952 | |||
71 | 1953 | # update play video variable | ||
72 | 1954 | self.play_video = True | ||
73 | 1955 | |||
74 | 1956 | # mark project as modified | ||
75 | 1957 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed visibility of clip")) | ||
76 | 1958 | |||
77 | 1959 | return False | ||
78 | 1960 | >>>>>>> MERGE-SOURCE | ||
79 | 1920 | 1961 | ||
80 | 1921 | 1962 | ||
81 | 1922 | def on_audio_click (self, item, target, event): | 1963 | def on_audio_click (self, item, target, event): |
82 | 1964 | <<<<<<< TREE | ||
83 | 1923 | 1965 | ||
84 | 1924 | # get a reference to the language translate method | 1966 | # get a reference to the language translate method |
85 | 1925 | _ = self.parent.parent.project.translate | 1967 | _ = self.parent.parent.project.translate |
86 | @@ -1952,6 +1994,39 @@ | |||
87 | 1952 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed audio of clip")) | 1994 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed audio of clip")) |
88 | 1953 | 1995 | ||
89 | 1954 | return False | 1996 | return False |
90 | 1997 | ======= | ||
91 | 1998 | #don't do this if in razor mode. | ||
92 | 1999 | (isArrow, isRazor, isSnap, isResize) = self.parent.parent.project.form.get_toolbar_options() | ||
93 | 2000 | if isArrow: | ||
94 | 2001 | # get a reference to the 2 main canvas objects & theme | ||
95 | 2002 | theme = self.parent.parent.project.theme | ||
96 | 2003 | |||
97 | 2004 | # get the parent left group | ||
98 | 2005 | parent_group = item.get_parent() | ||
99 | 2006 | canvas = parent_group.get_canvas() | ||
100 | 2007 | canvas.pointer_ungrab (item, event.time) | ||
101 | 2008 | |||
102 | 2009 | if self.play_audio == True: | ||
103 | 2010 | # Load Hover Over | ||
104 | 2011 | imgTrack_Visible = gtk.image_new_from_file("%s/openshot/themes/%s/speaker_mute_transparent.png" % (self.parent.parent.project.form.openshot_path, theme)) | ||
105 | 2012 | item.set_properties(pixbuf = imgTrack_Visible.get_pixbuf()) | ||
106 | 2013 | |||
107 | 2014 | # update play video variable | ||
108 | 2015 | self.play_audio = False | ||
109 | 2016 | |||
110 | 2017 | else: | ||
111 | 2018 | # Load normal image | ||
112 | 2019 | imgTrack_Visible = gtk.image_new_from_file("%s/openshot/themes/%s/speaker_transparent.png" % (self.parent.parent.project.form.openshot_path, theme)) | ||
113 | 2020 | item.set_properties(pixbuf = imgTrack_Visible.get_pixbuf()) | ||
114 | 2021 | |||
115 | 2022 | # update play video variable | ||
116 | 2023 | self.play_audio = True | ||
117 | 2024 | |||
118 | 2025 | # mark project as modified | ||
119 | 2026 | self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Changed audio of clip")) | ||
120 | 2027 | |||
121 | 2028 | return False | ||
122 | 2029 | >>>>>>> MERGE-SOURCE | ||
123 | 1955 | 2030 | ||
124 | 1956 | def on_effect_click (self, item, target, event): | 2031 | def on_effect_click (self, item, target, event): |
125 | 1957 | pass | 2032 | pass |
126 | 1958 | 2033 | ||
127 | === modified file 'openshot/classes/project.py' | |||
128 | --- openshot/classes/project.py 2010-07-07 00:04:26 +0000 | |||
129 | +++ openshot/classes/project.py 2010-07-12 22:08:40 +0000 | |||
130 | @@ -55,6 +55,8 @@ | |||
131 | 55 | self.USER_DIR = os.path.join(os.path.expanduser("~"), ".openshot") | 55 | self.USER_DIR = os.path.join(os.path.expanduser("~"), ".openshot") |
132 | 56 | self.THEMES_DIR = os.path.join(self.BASE_DIR, "openshot", "themes") | 56 | self.THEMES_DIR = os.path.join(self.BASE_DIR, "openshot", "themes") |
133 | 57 | self.USER_PROFILES_DIR = os.path.join(self.USER_DIR, "user_profiles") | 57 | self.USER_PROFILES_DIR = os.path.join(self.USER_DIR, "user_profiles") |
134 | 58 | self.USER_TRANSITIONS_DIR = os.path.join(self.USER_DIR, "user_transitions") | ||
135 | 59 | |||
136 | 58 | 60 | ||
137 | 59 | # only run the following code if we are really using | 61 | # only run the following code if we are really using |
138 | 60 | # this project file... | 62 | # this project file... |
139 | @@ -123,6 +125,7 @@ | |||
140 | 123 | pidPath = os.path.join(path, "pid.lock") | 125 | pidPath = os.path.join(path, "pid.lock") |
141 | 124 | pid=int(open(pidPath, 'r').read().strip()) | 126 | pid=int(open(pidPath, 'r').read().strip()) |
142 | 125 | 127 | ||
143 | 128 | <<<<<<< TREE | ||
144 | 126 | # list of folders that should not be deleted | 129 | # list of folders that should not be deleted |
145 | 127 | safe_folders = ["blender", "queue", "user_profiles"] | 130 | safe_folders = ["blender", "queue", "user_profiles"] |
146 | 128 | 131 | ||
147 | @@ -138,6 +141,23 @@ | |||
148 | 138 | # remove folder | 141 | # remove folder |
149 | 139 | os.removedirs(os.path.join(path, child_path)) | 142 | os.removedirs(os.path.join(path, child_path)) |
150 | 140 | 143 | ||
151 | 144 | ======= | ||
152 | 145 | # list of folders that should not be deleted | ||
153 | 146 | safe_folders = ["blender", "queue", "user_profiles", "user_transitions"] | ||
154 | 147 | |||
155 | 148 | # loop through all folders in the USER_DIR | ||
156 | 149 | for child_path in os.listdir(path): | ||
157 | 150 | if os.path.isdir(os.path.join(path, child_path)): | ||
158 | 151 | if child_path not in safe_folders: | ||
159 | 152 | # clear all files / folders recursively in the thumbnail folder | ||
160 | 153 | if os.getpid() == pid: | ||
161 | 154 | # only clear this folder for the primary instance of OpenShot | ||
162 | 155 | self.remove_files(os.path.join(path, child_path)) | ||
163 | 156 | |||
164 | 157 | # remove folder | ||
165 | 158 | os.removedirs(os.path.join(path, child_path)) | ||
166 | 159 | |||
167 | 160 | >>>>>>> MERGE-SOURCE | ||
168 | 141 | # thumbnail path | 161 | # thumbnail path |
169 | 142 | thumbnail_path = os.path.join(path, "thumbnail") | 162 | thumbnail_path = os.path.join(path, "thumbnail") |
170 | 143 | 163 | ||
171 | @@ -193,6 +213,7 @@ | |||
172 | 193 | state['DESKTOP'] = empty_project.DESKTOP | 213 | state['DESKTOP'] = empty_project.DESKTOP |
173 | 194 | state['THEMES_DIR'] = empty_project.THEMES_DIR | 214 | state['THEMES_DIR'] = empty_project.THEMES_DIR |
174 | 195 | state['USER_PROFILES_DIR'] = empty_project.USER_PROFILES_DIR | 215 | state['USER_PROFILES_DIR'] = empty_project.USER_PROFILES_DIR |
175 | 216 | state['USER_TRANSITIONS_DIR'] = empty_project.USER_TRANSITIONS_DIR | ||
176 | 196 | state['refresh_xml'] = True | 217 | state['refresh_xml'] = True |
177 | 197 | state['mlt_profile'] = None | 218 | state['mlt_profile'] = None |
178 | 198 | 219 | ||
179 | 199 | 220 | ||
180 | === modified file 'openshot/classes/thumbnail.py' | |||
181 | --- openshot/classes/thumbnail.py 2010-02-27 19:51:35 +0000 | |||
182 | +++ openshot/classes/thumbnail.py 2010-07-12 22:08:40 +0000 | |||
183 | @@ -180,8 +180,10 @@ | |||
184 | 180 | self.profile = None | 180 | self.profile = None |
185 | 181 | self.f = None | 181 | self.f = None |
186 | 182 | 182 | ||
189 | 183 | def get_thumb_at_frame(self, filename, frame=1): | 183 | def get_thumb_at_frame(self, filename, frame=1, new_name=""): |
190 | 184 | 184 | '''by passing a value in new_name, this will extract a | |
191 | 185 | full size frame (based on the project profile).''' | ||
192 | 186 | |||
193 | 185 | self.file_name = filename | 187 | self.file_name = filename |
194 | 186 | 188 | ||
195 | 187 | project_path = self.project.folder | 189 | project_path = self.project.folder |
196 | @@ -189,14 +191,15 @@ | |||
197 | 189 | (dirName, fileName) = os.path.split(myPath) | 191 | (dirName, fileName) = os.path.split(myPath) |
198 | 190 | (fileBaseName, fileExtension)=os.path.splitext(fileName) | 192 | (fileBaseName, fileExtension)=os.path.splitext(fileName) |
199 | 191 | fileExtension = fileExtension.replace(".", "") | 193 | fileExtension = fileExtension.replace(".", "") |
201 | 192 | 194 | ||
202 | 193 | mlt.Factory.init() | 195 | mlt.Factory.init() |
203 | 194 | 196 | ||
207 | 195 | # just get 1 thumbnail frame | 197 | |
205 | 196 | self.thumbnail_path = project_path + "/thumbnail/" + fileBaseName + "_" + fileExtension + "_%d.png" | ||
206 | 197 | |||
208 | 198 | # set the profile | 198 | # set the profile |
210 | 199 | self.profile = mlt.Profile("quarter_ntsc") | 199 | if new_name == "": |
211 | 200 | self.profile = mlt.Profile("quarter_ntsc") | ||
212 | 201 | else: | ||
213 | 202 | self.profile = profiles.mlt_profiles(self.project).get_profile(self.project.project_type) | ||
214 | 200 | 203 | ||
215 | 201 | # Create the producer | 204 | # Create the producer |
216 | 202 | self.p = mlt.Producer( self.profile, '%s' % self.file_name ) | 205 | self.p = mlt.Producer( self.profile, '%s' % self.file_name ) |
217 | @@ -205,6 +208,15 @@ | |||
218 | 205 | if self.p.is_valid() == False: | 208 | if self.p.is_valid() == False: |
219 | 206 | return None | 209 | return None |
220 | 207 | 210 | ||
221 | 211 | |||
222 | 212 | if new_name == "": | ||
223 | 213 | # just get 1 thumbnail frame | ||
224 | 214 | self.thumbnail_path = project_path + "/thumbnail/" + fileBaseName + "_" + fileExtension + "_%d.png" | ||
225 | 215 | else: | ||
226 | 216 | #for snapshots, use the new file name | ||
227 | 217 | #don't use the thumbnail path for the new file | ||
228 | 218 | self.thumbnail_path = project_path + "/" + new_name | ||
229 | 219 | |||
230 | 208 | # create the consumer | 220 | # create the consumer |
231 | 209 | self.c = mlt.Consumer(self.profile, "avformat", self.thumbnail_path) | 221 | self.c = mlt.Consumer(self.profile, "avformat", self.thumbnail_path) |
232 | 210 | 222 | ||
233 | 211 | 223 | ||
234 | === added file 'openshot/effects/bass.xml' | |||
235 | --- openshot/effects/bass.xml 1970-01-01 00:00:00 +0000 | |||
236 | +++ openshot/effects/bass.xml 2010-07-12 22:08:40 +0000 | |||
237 | @@ -0,0 +1,23 @@ | |||
238 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
239 | 2 | <!DOCTYPE openshot-effect> | ||
240 | 3 | <effect> | ||
241 | 4 | <title translatable="True">Bass</title> | ||
242 | 5 | <description translatable="True">Sox Bass control</description> | ||
243 | 6 | <icon>audio.png</icon> | ||
244 | 7 | <category>Audio</category> | ||
245 | 8 | <service>sox:bass</service> | ||
246 | 9 | |||
247 | 10 | <param name="frequency" type="spinner" title="Frequency" description=""> | ||
248 | 11 | <min>1</min> | ||
249 | 12 | <max>5000</max> | ||
250 | 13 | <default>100</default> | ||
251 | 14 | </param> | ||
252 | 15 | |||
253 | 16 | <param name="gain" type="spinner" title="Gain" description=""> | ||
254 | 17 | <min>-20</min> | ||
255 | 18 | <max>20</max> | ||
256 | 19 | <default>10</default> | ||
257 | 20 | </param> | ||
258 | 21 | |||
259 | 22 | |||
260 | 23 | </effect> | ||
261 | 0 | 24 | ||
262 | === added file 'openshot/effects/treble.xml' | |||
263 | --- openshot/effects/treble.xml 1970-01-01 00:00:00 +0000 | |||
264 | +++ openshot/effects/treble.xml 2010-07-12 22:08:40 +0000 | |||
265 | @@ -0,0 +1,22 @@ | |||
266 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
267 | 2 | <!DOCTYPE openshot-effect> | ||
268 | 3 | <effect> | ||
269 | 4 | <title translatable="True">Treble</title> | ||
270 | 5 | <description translatable="True">Sox Treble control</description> | ||
271 | 6 | <icon>audio.png</icon> | ||
272 | 7 | <category>Audio</category> | ||
273 | 8 | <service>sox:treble</service> | ||
274 | 9 | |||
275 | 10 | <param name="frequency" type="spinner" title="Frequency" description=""> | ||
276 | 11 | <min>3000</min> | ||
277 | 12 | <max>22000</max> | ||
278 | 13 | <default>5000</default> | ||
279 | 14 | </param> | ||
280 | 15 | |||
281 | 16 | <param name="gain" type="spinner" title="Gain" description=""> | ||
282 | 17 | <min>-20</min> | ||
283 | 18 | <max>20</max> | ||
284 | 19 | <default>8</default> | ||
285 | 20 | </param> | ||
286 | 21 | |||
287 | 22 | </effect> | ||
288 | 0 | 23 | ||
289 | === modified file 'openshot/windows/AddFiles.py' | |||
290 | --- openshot/windows/AddFiles.py 2010-04-03 18:52:42 +0000 | |||
291 | +++ openshot/windows/AddFiles.py 2010-07-12 22:08:40 +0000 | |||
292 | @@ -34,13 +34,10 @@ | |||
293 | 34 | # Add language support | 34 | # Add language support |
294 | 35 | _ = Language_Init.Translator(project).lang.gettext | 35 | _ = Language_Init.Translator(project).lang.gettext |
295 | 36 | 36 | ||
296 | 37 | self.frmAddFiles.set_title("OpenShot") | ||
297 | 37 | self.frmAddFiles.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) | 38 | self.frmAddFiles.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) |
298 | 38 | self.frmAddFiles.set_select_multiple(True) | 39 | self.frmAddFiles.set_select_multiple(True) |
304 | 39 | #if the video folder exists, default to this | 40 | |
300 | 40 | #video_dir = os.path.join(os.path.expanduser("~"), "Video") | ||
301 | 41 | #if video_dir: | ||
302 | 42 | # self.frmAddFiles.set_current_folder(video_dir) | ||
303 | 43 | |||
305 | 44 | self.form = form | 41 | self.form = form |
306 | 45 | self.project = project | 42 | self.project = project |
307 | 46 | 43 | ||
308 | @@ -81,6 +78,57 @@ | |||
309 | 81 | #call the open project method when a file is double clicked | 78 | #call the open project method when a file is double clicked |
310 | 82 | self.on_btnAdd_clicked(widget, *args) | 79 | self.on_btnAdd_clicked(widget, *args) |
311 | 83 | 80 | ||
312 | 81 | class frmReplaceFiles(SimpleGtkBuilderApp): | ||
313 | 82 | |||
314 | 83 | def __init__(self, path="AddFiles.ui", root="frmAddFiles", domain="OpenShot", form=None, project=None,clip=None, **kwargs): | ||
315 | 84 | SimpleGtkBuilderApp.__init__(self, os.path.join(project.UI_DIR, path), root, domain, **kwargs) | ||
316 | 85 | |||
317 | 86 | # Add language support | ||
318 | 87 | _ = Language_Init.Translator(project).lang.gettext | ||
319 | 88 | |||
320 | 89 | self.frmAddFiles.set_title("OpenShot") | ||
321 | 90 | self.frmAddFiles.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) | ||
322 | 91 | self.frmAddFiles.set_select_multiple(False) | ||
323 | 92 | |||
324 | 93 | self.form = form | ||
325 | 94 | self.project = project | ||
326 | 95 | self.clip = clip | ||
327 | 96 | |||
328 | 97 | self.frmAddFiles.show_all() | ||
329 | 98 | |||
330 | 99 | def on_btnCancel_clicked(self, widget, *args): | ||
331 | 100 | self.frmAddFiles.destroy() | ||
332 | 101 | |||
333 | 102 | def on_btnAdd_clicked(self, widget, *args): | ||
334 | 103 | replace_clip_with = self.frmAddFiles.get_filename() | ||
335 | 104 | try: | ||
336 | 105 | #does the new file already exist in the project? | ||
337 | 106 | file_object = self.project.project_folder.FindFile(replace_clip_with) | ||
338 | 107 | if not file_object: | ||
339 | 108 | #add the file to the project | ||
340 | 109 | self.project.project_folder.AddFile(replace_clip_with) | ||
341 | 110 | |||
342 | 111 | #this method does the actual replacement and modifies the project | ||
343 | 112 | self.form.replace_clip(self.clip,replace_clip_with) | ||
344 | 113 | |||
345 | 114 | except: | ||
346 | 115 | messagebox.show(_("Error"), _("There was an error importing the selected files")) | ||
347 | 116 | |||
348 | 117 | #set the last used folder | ||
349 | 118 | preferences.Settings.app_state["import_folder"] = self.frmAddFiles.get_current_folder() | ||
350 | 119 | |||
351 | 120 | |||
352 | 121 | self.frmAddFiles.destroy() | ||
353 | 122 | |||
354 | 123 | |||
355 | 124 | |||
356 | 125 | def on_frmAddFiles_file_activated(self, widget, *args): | ||
357 | 126 | #call the open project method when a file is double clicked | ||
358 | 127 | self.on_btnAdd_clicked(widget, *args) | ||
359 | 128 | |||
360 | 129 | def get_replace_clip_with(self): | ||
361 | 130 | return self.replace_clip_with | ||
362 | 131 | |||
363 | 84 | 132 | ||
364 | 85 | 133 | ||
365 | 86 | def main(): | 134 | def main(): |
366 | 87 | 135 | ||
367 | === modified file 'openshot/windows/FileProperties.py' | |||
368 | --- openshot/windows/FileProperties.py 2010-07-04 19:40:34 +0000 | |||
369 | +++ openshot/windows/FileProperties.py 2010-07-12 22:08:40 +0000 | |||
370 | @@ -39,8 +39,21 @@ | |||
371 | 39 | 39 | ||
372 | 40 | #set the thumbnail - use the preview thumbnail | 40 | #set the thumbnail - use the preview thumbnail |
373 | 41 | #for video & image files | 41 | #for video & image files |
374 | 42 | <<<<<<< TREE | ||
375 | 42 | pixbuf = file.get_thumbnail(112, 83) | 43 | pixbuf = file.get_thumbnail(112, 83) |
376 | 43 | self.imgPreview.set_from_pixbuf(pixbuf) | 44 | self.imgPreview.set_from_pixbuf(pixbuf) |
377 | 45 | ======= | ||
378 | 46 | if file.file_type != "audio": | ||
379 | 47 | if file.thumb_location != "": | ||
380 | 48 | pixbuf = gtk.gdk.pixbuf_new_from_file(file.thumb_location) | ||
381 | 49 | pixbuf = pixbuf.scale_simple(112,83,gtk.gdk.INTERP_BILINEAR) | ||
382 | 50 | self.imgPreview.set_from_pixbuf(pixbuf) | ||
383 | 51 | else: | ||
384 | 52 | #use the generic OpenShot audio thumbnail | ||
385 | 53 | pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(self.project.IMAGE_DIR, "AudioThumbnail.png")) | ||
386 | 54 | pixbuf = pixbuf.scale_simple(112,83,gtk.gdk.INTERP_BILINEAR) | ||
387 | 55 | self.imgPreview.set_from_pixbuf(pixbuf) | ||
388 | 56 | >>>>>>> MERGE-SOURCE | ||
389 | 44 | 57 | ||
390 | 45 | #set the file type | 58 | #set the file type |
391 | 46 | self.lblMimeType.set_label(file.file_type) | 59 | self.lblMimeType.set_label(file.file_type) |
392 | 47 | 60 | ||
393 | === added file 'openshot/windows/ImportTransitions.py' | |||
394 | --- openshot/windows/ImportTransitions.py 1970-01-01 00:00:00 +0000 | |||
395 | +++ openshot/windows/ImportTransitions.py 2010-07-12 22:08:40 +0000 | |||
396 | @@ -0,0 +1,138 @@ | |||
397 | 1 | # OpenShot Video Editor is a program that creates, modifies, and edits video files. | ||
398 | 2 | # Copyright (C) 2009 Jonathan Thomas | ||
399 | 3 | # | ||
400 | 4 | # This file is part of OpenShot Video Editor (http://launchpad.net/openshot/). | ||
401 | 5 | # | ||
402 | 6 | # OpenShot Video Editor is free software: you can redistribute it and/or modify | ||
403 | 7 | # it under the terms of the GNU General Public License as published by | ||
404 | 8 | # the Free Software Foundation, either version 3 of the License, or | ||
405 | 9 | # (at your option) any later version. | ||
406 | 10 | # | ||
407 | 11 | # OpenShot Video Editor is distributed in the hope that it will be useful, | ||
408 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
409 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
410 | 14 | # GNU General Public License for more details. | ||
411 | 15 | # | ||
412 | 16 | # You should have received a copy of the GNU General Public License | ||
413 | 17 | # along with OpenShot Video Editor. If not, see <http://www.gnu.org/licenses/>. | ||
414 | 18 | |||
415 | 19 | import os | ||
416 | 20 | import gtk | ||
417 | 21 | import shutil | ||
418 | 22 | from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp | ||
419 | 23 | from classes import project, messagebox | ||
420 | 24 | from PIL import Image | ||
421 | 25 | |||
422 | 26 | # init the foreign language | ||
423 | 27 | from language import Language_Init | ||
424 | 28 | |||
425 | 29 | |||
426 | 30 | class frmImportTransitions(SimpleGtkBuilderApp): | ||
427 | 31 | |||
428 | 32 | def __init__(self, path="ImportTransitions.ui", root="frmImportTransitions", domain="OpenShot", form=None, project=None, **kwargs): | ||
429 | 33 | SimpleGtkBuilderApp.__init__(self, os.path.join(project.UI_DIR, path), root, domain, **kwargs) | ||
430 | 34 | |||
431 | 35 | # Add language support | ||
432 | 36 | _ = Language_Init.Translator(project).lang.gettext | ||
433 | 37 | |||
434 | 38 | self.project = project | ||
435 | 39 | |||
436 | 40 | filter = gtk.FileFilter() | ||
437 | 41 | filter.set_name("PNG or PGM files") | ||
438 | 42 | filter.add_pattern("*.png") | ||
439 | 43 | filter.add_pattern("*.pgm") | ||
440 | 44 | |||
441 | 45 | self.fileTransition.add_filter(filter) | ||
442 | 46 | self.fileIcon.add_filter(filter) | ||
443 | 47 | |||
444 | 48 | self.transition_file = "" | ||
445 | 49 | self.icon_file = "" | ||
446 | 50 | |||
447 | 51 | self.frmImportTransitions.show_all() | ||
448 | 52 | |||
449 | 53 | def on_btnCancel_clicked(self, widget, *args): | ||
450 | 54 | |||
451 | 55 | self.frmImportTransitions.destroy() | ||
452 | 56 | |||
453 | 57 | |||
454 | 58 | |||
455 | 59 | def on_fileTransition_file_set(self, widget, *args): | ||
456 | 60 | |||
457 | 61 | self.transition_file = self.fileTransition.get_filename() | ||
458 | 62 | |||
459 | 63 | if self.icon_file: | ||
460 | 64 | if self.check_filename_ok(): | ||
461 | 65 | self.btnOK.set_sensitive(True) | ||
462 | 66 | else: | ||
463 | 67 | messagebox.show("Openshot", _("The Transition and Icon file names must be the same.")) | ||
464 | 68 | |||
465 | 69 | |||
466 | 70 | |||
467 | 71 | def on_fileIcon_file_set(self, widget, *args): | ||
468 | 72 | |||
469 | 73 | self.icon_file = self.fileIcon.get_filename() | ||
470 | 74 | |||
471 | 75 | if self.transition_file: | ||
472 | 76 | if self.check_filename_ok(): | ||
473 | 77 | self.btnOK.set_sensitive(True) | ||
474 | 78 | else: | ||
475 | 79 | messagebox.show("Openshot", _("The Transition and Icon file names must be the same.")) | ||
476 | 80 | |||
477 | 81 | |||
478 | 82 | def on_btnOK_clicked(self, widget, *args): | ||
479 | 83 | #check if a transition with this name exists | ||
480 | 84 | if self.check_icon_size(): | ||
481 | 85 | (dirName, filename) = os.path.split(self.transition_file) | ||
482 | 86 | if os.path.exists(os.path.join(self.project.USER_TRANSITIONS_DIR,filename)): | ||
483 | 87 | messagebox.show("Openshot", _("A Transition with the filename %s already exists. Do you want to replace it?" % filename), gtk.BUTTONS_YES_NO, self.import_transition()) | ||
484 | 88 | else: | ||
485 | 89 | #just import the transition | ||
486 | 90 | self.import_transition() | ||
487 | 91 | else: | ||
488 | 92 | messagebox.show("Openshot", _("The icon file must have a size of 80x62. The Transition will not be imported.")) | ||
489 | 93 | |||
490 | 94 | def check_icon_size(self): | ||
491 | 95 | #check the icon is 80x62 | ||
492 | 96 | try: | ||
493 | 97 | im = Image.open(self.icon_file) | ||
494 | 98 | except IOError: | ||
495 | 99 | print "failed to identify", self.icon_file | ||
496 | 100 | else: | ||
497 | 101 | w, h = im.size | ||
498 | 102 | if w != 80 or h != 62: | ||
499 | 103 | return False | ||
500 | 104 | else: | ||
501 | 105 | return True | ||
502 | 106 | |||
503 | 107 | def check_filename_ok(self): | ||
504 | 108 | #check both filenames match | ||
505 | 109 | (dirName, self.iconfilename) = os.path.split(self.icon_file) | ||
506 | 110 | (iconBaseName, fileExtension)=os.path.splitext(self.iconfilename) | ||
507 | 111 | |||
508 | 112 | (dirName, self.transfilename) = os.path.split(self.transition_file) | ||
509 | 113 | (transBaseName, fileExtension)=os.path.splitext(self.transfilename) | ||
510 | 114 | if iconBaseName == transBaseName: | ||
511 | 115 | return True | ||
512 | 116 | else: | ||
513 | 117 | return False | ||
514 | 118 | |||
515 | 119 | |||
516 | 120 | def import_transition(self): | ||
517 | 121 | if not os.path.exists(self.project.USER_TRANSITIONS_DIR): | ||
518 | 122 | os.makedirs(self.project.USER_TRANSITIONS_DIR) | ||
519 | 123 | os.makedirs(os.path.join(self.project.USER_TRANSITIONS_DIR, "icons")) | ||
520 | 124 | try: | ||
521 | 125 | shutil.copyfile(self.transition_file, os.path.join(self.project.USER_TRANSITIONS_DIR, self.transfilename)) | ||
522 | 126 | shutil.copyfile(self.icon_file, os.path.join(self.project.USER_TRANSITIONS_DIR, "icons", self.iconfilename)) | ||
523 | 127 | messagebox.show("Openshot", _("Transition Imported successfully! Restart Openshot for the changes to take effect.")) | ||
524 | 128 | self.frmImportTransitions.destroy() | ||
525 | 129 | except: | ||
526 | 130 | messagebox.show("Openshot Error!", _("There was an error importing the Transition!")) | ||
527 | 131 | |||
528 | 132 | |||
529 | 133 | def main(): | ||
530 | 134 | import_transitions = frmImportTransitions() | ||
531 | 135 | import_transitions.run() | ||
532 | 136 | |||
533 | 137 | if __name__ == "__main__": | ||
534 | 138 | main() | ||
535 | 0 | \ No newline at end of file | 139 | \ No newline at end of file |
536 | 1 | 140 | ||
537 | === modified file 'openshot/windows/MainGTK.py' | |||
538 | --- openshot/windows/MainGTK.py 2010-07-07 06:25:46 +0000 | |||
539 | +++ openshot/windows/MainGTK.py 2010-07-12 22:08:40 +0000 | |||
540 | @@ -31,7 +31,7 @@ | |||
541 | 31 | from classes import files, lock, messagebox, open_project, project, timeline, tree, video, inputbox, av_formats, clip | 31 | from classes import files, lock, messagebox, open_project, project, timeline, tree, video, inputbox, av_formats, clip |
542 | 32 | from windows import About, FileProperties, NewProject, OpenProject, preferences, Profiles | 32 | from windows import About, FileProperties, NewProject, OpenProject, preferences, Profiles |
543 | 33 | from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp | 33 | from windows.SimpleGtkBuilderApp import SimpleGtkBuilderApp |
545 | 34 | from windows import AddFiles, ClipProperties, ExportVideo, ImportImageSeq, Titles, TransitionProperties, TreeFiles, TreeTransitions, TreeEffects, TreeHistory, BlenderGenerator, AddToTimeline | 34 | from windows import AddFiles, ClipProperties, ExportVideo, ImportImageSeq, Titles, TransitionProperties, TreeFiles, TreeTransitions, TreeEffects, TreeHistory, BlenderGenerator, AddToTimeline, ImportTransitions |
546 | 35 | 35 | ||
547 | 36 | # init the foreign language | 36 | # init the foreign language |
548 | 37 | from language import Language_Init | 37 | from language import Language_Init |
549 | @@ -519,8 +519,10 @@ | |||
550 | 519 | # Strip 'file://' from the beginning | 519 | # Strip 'file://' from the beginning |
551 | 520 | file_to_open = uri[7:] | 520 | file_to_open = uri[7:] |
552 | 521 | 521 | ||
553 | 522 | |||
554 | 522 | # Open the project file | 523 | # Open the project file |
555 | 523 | self.open_project(file_to_open) | 524 | self.open_project(file_to_open) |
556 | 525 | |||
557 | 524 | 526 | ||
558 | 525 | 527 | ||
559 | 526 | def open_project(self, file_to_open): | 528 | def open_project(self, file_to_open): |
560 | @@ -541,6 +543,7 @@ | |||
561 | 541 | # Update the main form | 543 | # Update the main form |
562 | 542 | self.refresh() | 544 | self.refresh() |
563 | 543 | 545 | ||
564 | 546 | |||
565 | 544 | 547 | ||
566 | 545 | def new(self): | 548 | def new(self): |
567 | 546 | print "A new %s has been created" % self.__class__.__name__ | 549 | print "A new %s has been created" % self.__class__.__name__ |
568 | @@ -1156,6 +1159,9 @@ | |||
569 | 1156 | 1159 | ||
570 | 1157 | # show import file dialog | 1160 | # show import file dialog |
571 | 1158 | ImportImageSeq.frmImportImageSequence(form=self, project=self.project) | 1161 | ImportImageSeq.frmImportImageSequence(form=self, project=self.project) |
572 | 1162 | |||
573 | 1163 | def on_mnuImportTransitions_activate(self, widget, *args): | ||
574 | 1164 | ImportTransitions.frmImportTransitions(form=self, project=self.project) | ||
575 | 1159 | 1165 | ||
576 | 1160 | 1166 | ||
577 | 1161 | def on_mnuSaveProject_activate(self, widget, *args): | 1167 | def on_mnuSaveProject_activate(self, widget, *args): |
578 | @@ -1705,22 +1711,28 @@ | |||
579 | 1705 | self.on_tlbNext_clicked(widget, event) | 1711 | self.on_tlbNext_clicked(widget, event) |
580 | 1706 | 1712 | ||
581 | 1707 | elif keyname == "s": | 1713 | elif keyname == "s": |
583 | 1708 | #go to the end of the clip | 1714 | #save the project |
584 | 1709 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): | 1715 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): |
585 | 1710 | # call the save button | 1716 | # call the save button |
586 | 1711 | self.on_tlbSave_clicked(widget) | 1717 | self.on_tlbSave_clicked(widget) |
587 | 1712 | 1718 | ||
588 | 1713 | elif keyname == "y": | 1719 | elif keyname == "y": |
590 | 1714 | #go to the end of the clip | 1720 | #redo |
591 | 1715 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): | 1721 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): |
592 | 1716 | # Undo last action | 1722 | # Undo last action |
593 | 1717 | self.redo_last() | 1723 | self.redo_last() |
594 | 1718 | 1724 | ||
595 | 1719 | elif keyname == "z": | 1725 | elif keyname == "z": |
597 | 1720 | #go to the end of the clip | 1726 | #undo |
598 | 1721 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): | 1727 | if (event.state == gtk.gdk.CONTROL_MASK) or (event.state == gtk.gdk.CONTROL_MASK | gtk.gdk.MOD2_MASK): |
599 | 1722 | # Undo last action | 1728 | # Undo last action |
600 | 1723 | self.undo_last() | 1729 | self.undo_last() |
601 | 1730 | |||
602 | 1731 | elif keyname == "f": | ||
603 | 1732 | #snapshot | ||
604 | 1733 | self.get_frame_snapshot() | ||
605 | 1734 | |||
606 | 1735 | |||
607 | 1724 | 1736 | ||
608 | 1725 | 1737 | ||
609 | 1726 | def toggle_mode(self): | 1738 | def toggle_mode(self): |
610 | @@ -1757,6 +1769,48 @@ | |||
611 | 1757 | canvas_item = clip.get_canvas_child(root_right, clip.unique_id) | 1769 | canvas_item = clip.get_canvas_child(root_right, clip.unique_id) |
612 | 1758 | # divide clip | 1770 | # divide clip |
613 | 1759 | clip.divide_clip(x, canvas_item) | 1771 | clip.divide_clip(x, canvas_item) |
614 | 1772 | |||
615 | 1773 | |||
616 | 1774 | def get_frame_snapshot(self): | ||
617 | 1775 | '''Extracts a frame from each (non-audio) clip at the current | ||
618 | 1776 | playhead position''' | ||
619 | 1777 | # Get playhead position | ||
620 | 1778 | current_position = self.project.sequences[0].play_head_position | ||
621 | 1779 | # get frames per second | ||
622 | 1780 | fps = self.project.fps() | ||
623 | 1781 | # Loop through all tracks | ||
624 | 1782 | for track in self.project.sequences[0].tracks: | ||
625 | 1783 | # Loop through all clips on this track | ||
626 | 1784 | for clip in track.clips: | ||
627 | 1785 | # is playhead overlapping this clip | ||
628 | 1786 | if current_position > clip.position_on_track and current_position < (clip.position_on_track + clip.length()): | ||
629 | 1787 | #only extract frames from non-audio files | ||
630 | 1788 | if clip.file_object.file_type != "audio": | ||
631 | 1789 | clip_position = (current_position + clip.start_time) - clip.position_on_track | ||
632 | 1790 | frame_position = round(clip_position * fps) | ||
633 | 1791 | #when extracting a frame, it gets added to the | ||
634 | 1792 | #project as a new file. | ||
635 | 1793 | #Here we get the name of the existing clip, and | ||
636 | 1794 | #modify it to make it unique. | ||
637 | 1795 | filepath = clip.file_object.project.folder | ||
638 | 1796 | (fileBaseName, fileExtension)=os.path.splitext(clip.name) | ||
639 | 1797 | #add a number to the end of the filename. | ||
640 | 1798 | #get the next available number for the file | ||
641 | 1799 | blnFind = True | ||
642 | 1800 | intNum = 0 | ||
643 | 1801 | while blnFind == True: | ||
644 | 1802 | intNum += 1 | ||
645 | 1803 | blnFind = os.path.exists(os.path.join(filepath, fileBaseName + str(intNum) + ".png")) | ||
646 | 1804 | |||
647 | 1805 | #this will be the new name of the snapshot image file | ||
648 | 1806 | new_name = fileBaseName + str(intNum) + ".png" | ||
649 | 1807 | #extract the frame | ||
650 | 1808 | self.project.thumbnailer.get_thumb_at_frame(clip.file_object.name, int(frame_position), new_name) | ||
651 | 1809 | #add the file to the project in the project folder | ||
652 | 1810 | self.project.project_folder.AddFile(self.project.folder + "/" + new_name) | ||
653 | 1811 | #refresh the tree | ||
654 | 1812 | self.refresh() | ||
655 | 1813 | |||
656 | 1760 | 1814 | ||
657 | 1761 | 1815 | ||
658 | 1762 | def get_toolbar_options(self): | 1816 | def get_toolbar_options(self): |
659 | @@ -3085,6 +3139,23 @@ | |||
660 | 3085 | if is_title: | 3139 | if is_title: |
661 | 3086 | self.form.refresh() | 3140 | self.form.refresh() |
662 | 3087 | 3141 | ||
663 | 3142 | |||
664 | 3143 | def on_mnuReplaceClip_activate (self, event, *args): | ||
665 | 3144 | # show import file dialog to select replacement file | ||
666 | 3145 | AddFiles.frmReplaceFiles(form=self, project=self.project, clip=self.selected_clip) | ||
667 | 3146 | |||
668 | 3147 | |||
669 | 3148 | def replace_clip(self, selected_clip, new_clip): | ||
670 | 3149 | #this replaces the selected clip with a new clip | ||
671 | 3150 | (filepath, filename) = os.path.split(new_clip) | ||
672 | 3151 | file = self.project.project_folder.FindFile(filename) | ||
673 | 3152 | if file: | ||
674 | 3153 | selected_clip.file_object = file | ||
675 | 3154 | selected_clip.name = filename | ||
676 | 3155 | #force a refresh of the xml | ||
677 | 3156 | self.project.set_project_modified(is_modified=True, refresh_xml=True, type=_("Replaced Clip")) | ||
678 | 3157 | self.project.Render() | ||
679 | 3158 | self.form.refresh() | ||
680 | 3088 | 3159 | ||
681 | 3089 | def on_mnuSliceandShuffle_activate(self, event, *args): | 3160 | def on_mnuSliceandShuffle_activate(self, event, *args): |
682 | 3090 | """ Cut a clip into many small pieces and shuffle them """ | 3161 | """ Cut a clip into many small pieces and shuffle them """ |
683 | 3091 | 3162 | ||
684 | === modified file 'openshot/windows/TreeTransitions.py' | |||
685 | --- openshot/windows/TreeTransitions.py 2010-05-31 21:31:32 +0000 | |||
686 | +++ openshot/windows/TreeTransitions.py 2010-07-12 22:08:40 +0000 | |||
687 | @@ -18,7 +18,7 @@ | |||
688 | 18 | 18 | ||
689 | 19 | import os | 19 | import os |
690 | 20 | import gtk, gobject, pango | 20 | import gtk, gobject, pango |
692 | 21 | from classes import project | 21 | from classes import project, messagebox |
693 | 22 | 22 | ||
694 | 23 | # init the foreign language | 23 | # init the foreign language |
695 | 24 | from language import Language_Init | 24 | from language import Language_Init |
696 | @@ -90,6 +90,33 @@ | |||
697 | 90 | self.store.set_value(item, 1, _(trans_name)) | 90 | self.store.set_value(item, 1, _(trans_name)) |
698 | 91 | self.store.set_value(item, 2, os.path.join(self.project.TRANSITIONS_DIR, file_name)) | 91 | self.store.set_value(item, 2, os.path.join(self.project.TRANSITIONS_DIR, file_name)) |
699 | 92 | 92 | ||
700 | 93 | #get any user created transitions | ||
701 | 94 | if os.path.exists(self.project.USER_TRANSITIONS_DIR): | ||
702 | 95 | user_list = os.listdir(self.project.USER_TRANSITIONS_DIR) | ||
703 | 96 | try: | ||
704 | 97 | for fname in sorted(user_list): | ||
705 | 98 | (dirName, file_name) = os.path.split(fname) | ||
706 | 99 | (fileBaseName, fileExtension)=os.path.splitext(file_name) | ||
707 | 100 | file_path = os.path.join(self.project.USER_TRANSITIONS_DIR, "icons", fileBaseName + ".png") | ||
708 | 101 | |||
709 | 102 | if fileBaseName == "icons": | ||
710 | 103 | # ignore the 'icons' folder | ||
711 | 104 | continue | ||
712 | 105 | |||
713 | 106 | # get the pixbuf | ||
714 | 107 | pbThumb = gtk.gdk.pixbuf_new_from_file(file_path) | ||
715 | 108 | |||
716 | 109 | # get name of transition | ||
717 | 110 | trans_name = fileBaseName.replace("_", " ").capitalize() | ||
718 | 111 | |||
719 | 112 | # add transition to tree | ||
720 | 113 | item = self.store.append(None) | ||
721 | 114 | self.store.set_value(item, 0, pbThumb) | ||
722 | 115 | self.store.set_value(item, 1, _(trans_name)) | ||
723 | 116 | self.store.set_value(item, 2, os.path.join(self.project.USER_TRANSITIONS_DIR, file_name)) | ||
724 | 117 | except: | ||
725 | 118 | messagebox.show("Openshot Error!", _("There was an error loading user created transitions.")) | ||
726 | 119 | |||
727 | 93 | 120 | ||
728 | 94 | # connect signals | 121 | # connect signals |
729 | 95 | self.treeview.connect_after('drag_begin', self.on_treeTransition_drag_begin) | 122 | self.treeview.connect_after('drag_begin', self.on_treeTransition_drag_begin) |
730 | 96 | 123 | ||
731 | === modified file 'openshot/windows/preferences.py' | |||
732 | --- openshot/windows/preferences.py 2010-07-06 03:23:04 +0000 | |||
733 | +++ openshot/windows/preferences.py 2010-07-12 22:08:40 +0000 | |||
734 | @@ -80,6 +80,7 @@ | |||
735 | 80 | #populate the themes | 80 | #populate the themes |
736 | 81 | for dir in os.listdir(self.project.THEMES_DIR): | 81 | for dir in os.listdir(self.project.THEMES_DIR): |
737 | 82 | self.cmbThemes.append_text(dir) | 82 | self.cmbThemes.append_text(dir) |
738 | 83 | |||
739 | 83 | 84 | ||
740 | 84 | # populate project file type combo | 85 | # populate project file type combo |
741 | 85 | for file_type in ["binary", "ascii"]: | 86 | for file_type in ["binary", "ascii"]: |
742 | @@ -190,7 +191,8 @@ | |||
743 | 190 | def load_theme_image(self, theme_name): | 191 | def load_theme_image(self, theme_name): |
744 | 191 | #loads the preview image for the selected theme. | 192 | #loads the preview image for the selected theme. |
745 | 192 | themes_folder = os.path.join(self.project.THEMES_DIR, theme_name) | 193 | themes_folder = os.path.join(self.project.THEMES_DIR, theme_name) |
747 | 193 | self.imgTheme.set_from_file(os.path.join(themes_folder, "play.png")) | 194 | if os.path.exists(os.path.join(themes_folder, "play.png")): |
748 | 195 | self.imgTheme.set_from_file(os.path.join(themes_folder, "play.png")) | ||
749 | 194 | 196 | ||
750 | 195 | 197 | ||
751 | 196 | def on_icvCategories_selection_changed(self, icon_view, model=None): | 198 | def on_icvCategories_selection_changed(self, icon_view, model=None): |
752 | 197 | 199 | ||
753 | === added file 'openshot/windows/ui/ImportTransitions.ui' | |||
754 | --- openshot/windows/ui/ImportTransitions.ui 1970-01-01 00:00:00 +0000 | |||
755 | +++ openshot/windows/ui/ImportTransitions.ui 2010-07-12 22:08:40 +0000 | |||
756 | @@ -0,0 +1,134 @@ | |||
757 | 1 | <?xml version="1.0"?> | ||
758 | 2 | <interface> | ||
759 | 3 | <requires lib="gtk+" version="2.16"/> | ||
760 | 4 | <!-- interface-naming-policy project-wide --> | ||
761 | 5 | <object class="GtkWindow" id="frmImportTransitions"> | ||
762 | 6 | <property name="width_request">400</property> | ||
763 | 7 | <property name="height_request">180</property> | ||
764 | 8 | <property name="title" translatable="yes">Import Transitions</property> | ||
765 | 9 | <property name="window_position">center</property> | ||
766 | 10 | <property name="icon">icons/openshot.png</property> | ||
767 | 11 | <child> | ||
768 | 12 | <object class="GtkVBox" id="vbox1"> | ||
769 | 13 | <property name="visible">True</property> | ||
770 | 14 | <property name="orientation">vertical</property> | ||
771 | 15 | <child> | ||
772 | 16 | <object class="GtkLabel" id="label3"> | ||
773 | 17 | <property name="visible">True</property> | ||
774 | 18 | <property name="label" translatable="yes">The Transition file and Icon file must have the same file name, | ||
775 | 19 | and the Icon should be 80x62.</property> | ||
776 | 20 | </object> | ||
777 | 21 | <packing> | ||
778 | 22 | <property name="padding">6</property> | ||
779 | 23 | <property name="position">0</property> | ||
780 | 24 | </packing> | ||
781 | 25 | </child> | ||
782 | 26 | <child> | ||
783 | 27 | <object class="GtkTable" id="table1"> | ||
784 | 28 | <property name="visible">True</property> | ||
785 | 29 | <property name="n_rows">2</property> | ||
786 | 30 | <property name="n_columns">2</property> | ||
787 | 31 | <child> | ||
788 | 32 | <object class="GtkLabel" id="label1"> | ||
789 | 33 | <property name="visible">True</property> | ||
790 | 34 | <property name="xalign">0</property> | ||
791 | 35 | <property name="xpad">10</property> | ||
792 | 36 | <property name="label" translatable="yes">Select Transition:</property> | ||
793 | 37 | </object> | ||
794 | 38 | <packing> | ||
795 | 39 | <property name="x_options">GTK_FILL</property> | ||
796 | 40 | </packing> | ||
797 | 41 | </child> | ||
798 | 42 | <child> | ||
799 | 43 | <object class="GtkLabel" id="label2"> | ||
800 | 44 | <property name="visible">True</property> | ||
801 | 45 | <property name="xalign">0</property> | ||
802 | 46 | <property name="xpad">12</property> | ||
803 | 47 | <property name="label" translatable="yes">Select Icon:</property> | ||
804 | 48 | </object> | ||
805 | 49 | <packing> | ||
806 | 50 | <property name="top_attach">1</property> | ||
807 | 51 | <property name="bottom_attach">2</property> | ||
808 | 52 | <property name="x_options">GTK_FILL</property> | ||
809 | 53 | </packing> | ||
810 | 54 | </child> | ||
811 | 55 | <child> | ||
812 | 56 | <object class="GtkFileChooserButton" id="fileTransition"> | ||
813 | 57 | <property name="visible">True</property> | ||
814 | 58 | <property name="create_folders">False</property> | ||
815 | 59 | <signal name="file_set" handler="on_fileTransition_file_set"/> | ||
816 | 60 | </object> | ||
817 | 61 | <packing> | ||
818 | 62 | <property name="left_attach">1</property> | ||
819 | 63 | <property name="right_attach">2</property> | ||
820 | 64 | <property name="x_padding">12</property> | ||
821 | 65 | <property name="y_padding">12</property> | ||
822 | 66 | </packing> | ||
823 | 67 | </child> | ||
824 | 68 | <child> | ||
825 | 69 | <object class="GtkFileChooserButton" id="fileIcon"> | ||
826 | 70 | <property name="visible">True</property> | ||
827 | 71 | <property name="create_folders">False</property> | ||
828 | 72 | <signal name="file_set" handler="on_fileIcon_file_set"/> | ||
829 | 73 | </object> | ||
830 | 74 | <packing> | ||
831 | 75 | <property name="left_attach">1</property> | ||
832 | 76 | <property name="right_attach">2</property> | ||
833 | 77 | <property name="top_attach">1</property> | ||
834 | 78 | <property name="bottom_attach">2</property> | ||
835 | 79 | <property name="x_padding">12</property> | ||
836 | 80 | <property name="y_padding">12</property> | ||
837 | 81 | </packing> | ||
838 | 82 | </child> | ||
839 | 83 | </object> | ||
840 | 84 | <packing> | ||
841 | 85 | <property name="position">2</property> | ||
842 | 86 | </packing> | ||
843 | 87 | </child> | ||
844 | 88 | <child> | ||
845 | 89 | <object class="GtkHButtonBox" id="hbuttonbox1"> | ||
846 | 90 | <property name="visible">True</property> | ||
847 | 91 | <property name="layout_style">end</property> | ||
848 | 92 | <child> | ||
849 | 93 | <object class="GtkButton" id="btnCancel"> | ||
850 | 94 | <property name="label">gtk-cancel</property> | ||
851 | 95 | <property name="visible">True</property> | ||
852 | 96 | <property name="can_focus">True</property> | ||
853 | 97 | <property name="receives_default">True</property> | ||
854 | 98 | <property name="use_stock">True</property> | ||
855 | 99 | <signal name="clicked" handler="on_btnCancel_clicked"/> | ||
856 | 100 | </object> | ||
857 | 101 | <packing> | ||
858 | 102 | <property name="expand">False</property> | ||
859 | 103 | <property name="fill">False</property> | ||
860 | 104 | <property name="position">0</property> | ||
861 | 105 | </packing> | ||
862 | 106 | </child> | ||
863 | 107 | <child> | ||
864 | 108 | <object class="GtkButton" id="btnOK"> | ||
865 | 109 | <property name="label">gtk-ok</property> | ||
866 | 110 | <property name="visible">True</property> | ||
867 | 111 | <property name="sensitive">False</property> | ||
868 | 112 | <property name="can_focus">True</property> | ||
869 | 113 | <property name="receives_default">True</property> | ||
870 | 114 | <property name="use_stock">True</property> | ||
871 | 115 | <signal name="clicked" handler="on_btnOK_clicked"/> | ||
872 | 116 | </object> | ||
873 | 117 | <packing> | ||
874 | 118 | <property name="expand">False</property> | ||
875 | 119 | <property name="fill">False</property> | ||
876 | 120 | <property name="position">1</property> | ||
877 | 121 | </packing> | ||
878 | 122 | </child> | ||
879 | 123 | </object> | ||
880 | 124 | <packing> | ||
881 | 125 | <property name="fill">False</property> | ||
882 | 126 | <property name="padding">1</property> | ||
883 | 127 | <property name="pack_type">end</property> | ||
884 | 128 | <property name="position">1</property> | ||
885 | 129 | </packing> | ||
886 | 130 | </child> | ||
887 | 131 | </object> | ||
888 | 132 | </child> | ||
889 | 133 | </object> | ||
890 | 134 | </interface> | ||
891 | 0 | 135 | ||
892 | === modified file 'openshot/windows/ui/Main.ui' | |||
893 | --- openshot/windows/ui/Main.ui 2010-07-04 20:03:37 +0000 | |||
894 | +++ openshot/windows/ui/Main.ui 2010-07-12 22:08:40 +0000 | |||
895 | @@ -77,6 +77,15 @@ | |||
896 | 77 | </object> | 77 | </object> |
897 | 78 | </child> | 78 | </child> |
898 | 79 | <child> | 79 | <child> |
899 | 80 | <object class="GtkImageMenuItem" id="mnuImportTransitions"> | ||
900 | 81 | <property name="label" translatable="yes">Import New Transition...</property> | ||
901 | 82 | <property name="visible">True</property> | ||
902 | 83 | <property name="use_stock">False</property> | ||
903 | 84 | <property name="accel_group">accelgroup1</property> | ||
904 | 85 | <signal name="activate" handler="on_mnuImportTransitions_activate"/> | ||
905 | 86 | </object> | ||
906 | 87 | </child> | ||
907 | 88 | <child> | ||
908 | 80 | <object class="GtkSeparatorMenuItem" id="separatormenuitem3"> | 89 | <object class="GtkSeparatorMenuItem" id="separatormenuitem3"> |
909 | 81 | <property name="visible">True</property> | 90 | <property name="visible">True</property> |
910 | 82 | </object> | 91 | </object> |
911 | 83 | 92 | ||
912 | === modified file 'openshot/windows/ui/Main_clip_properties.ui' | |||
913 | --- openshot/windows/ui/Main_clip_properties.ui 2010-05-03 05:51:49 +0000 | |||
914 | +++ openshot/windows/ui/Main_clip_properties.ui 2010-07-12 22:08:40 +0000 | |||
915 | @@ -69,6 +69,15 @@ | |||
916 | 69 | </object> | 69 | </object> |
917 | 70 | </child> | 70 | </child> |
918 | 71 | <child> | 71 | <child> |
919 | 72 | <object class="GtkImageMenuItem" id="mnuReplaceClip"> | ||
920 | 73 | <property name="label" translatable="yes">Replace Clip</property> | ||
921 | 74 | <property name="visible">True</property> | ||
922 | 75 | <property name="image">image1</property> | ||
923 | 76 | <property name="use_stock">False</property> | ||
924 | 77 | <signal name="activate" handler="on_mnuReplaceClip_activate"/> | ||
925 | 78 | </object> | ||
926 | 79 | </child> | ||
927 | 80 | <child> | ||
928 | 72 | <object class="GtkImageMenuItem" id="mnuRemoveClip"> | 81 | <object class="GtkImageMenuItem" id="mnuRemoveClip"> |
929 | 73 | <property name="label" translatable="yes">Remove Clip</property> | 82 | <property name="label" translatable="yes">Remove Clip</property> |
930 | 74 | <property name="visible">True</property> | 83 | <property name="visible">True</property> |
931 | @@ -94,4 +103,8 @@ | |||
932 | 94 | </child> | 103 | </child> |
933 | 95 | </object> | 104 | </object> |
934 | 96 | <object class="GtkAccelGroup" id="accelgroup1"/> | 105 | <object class="GtkAccelGroup" id="accelgroup1"/> |
935 | 106 | <object class="GtkImage" id="image1"> | ||
936 | 107 | <property name="visible">True</property> | ||
937 | 108 | <property name="stock">gtk-missing-image</property> | ||
938 | 109 | </object> | ||
939 | 97 | </interface> | 110 | </interface> |