Skip to content

Commit 5166926

Browse files
committed
Fixed file that was changed after merging with webengine branch
1 parent be6422b commit 5166926

File tree

1 file changed

+39
-5
lines changed

1 file changed

+39
-5
lines changed

src/windows/views/timeline_webview.py

+39-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from PyQt5.QtGui import QCursor, QKeySequence, QColor
4141
from PyQt5.QtWebEngineWidgets import QWebEngineView
4242
from PyQt5.QtWebChannel import QWebChannel
43-
from PyQt5.QtWidgets import QMenu
43+
from PyQt5.QtWidgets import QMenu, QDialog
4444

4545
from classes import info, updates
4646
from classes import settings
@@ -2990,11 +2990,45 @@ def callback(self, effect_names, callback_data):
29902990
log.info("Applying effect {} to clip ID {}".format(name, clip.id))
29912991
log.debug(clip)
29922992

2993-
# Create Effect
2994-
effect = openshot.EffectInfo().CreateEffect(name)
2993+
# Handle custom effect dialogs
2994+
if name in effect_options:
29952995

2996-
# Get Effect JSON
2997-
effect.Id(get_app().project.generate_id())
2996+
# Get effect options
2997+
effect_params = effect_options.get(name)
2998+
2999+
# Show effect pre-processing window
3000+
from windows.process_effect import ProcessEffect
3001+
3002+
try:
3003+
win = ProcessEffect(clip.id, name, effect_params)
3004+
3005+
except ModuleNotFoundError as e:
3006+
print("[ERROR]: " + str(e))
3007+
return
3008+
3009+
print("Effect %s" % name)
3010+
print("Effect options: %s" % effect_options)
3011+
3012+
# Run the dialog event loop - blocking interaction on this window during this time
3013+
result = win.exec_()
3014+
3015+
if result == QDialog.Accepted:
3016+
log.info('Start processing')
3017+
else:
3018+
log.info('Cancel processing')
3019+
return
3020+
3021+
# Create Effect
3022+
effect = win.effect # effect.Id already set
3023+
3024+
if effect is None:
3025+
break
3026+
else:
3027+
# Create Effect
3028+
effect = openshot.EffectInfo().CreateEffect(name)
3029+
3030+
# Get Effect JSON
3031+
effect.Id(get_app().project.generate_id())
29983032
effect_json = json.loads(effect.Json())
29993033

30003034
# Append effect JSON to clip

0 commit comments

Comments
 (0)