Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libopenshot
Submodule libopenshot added at fd21a9
11 changes: 11 additions & 0 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2979,10 +2979,15 @@ def setup_toolbars(self):
self.filesActionGroup = QActionGroup(self)
self.filesActionGroup.setExclusive(True)
self.filesActionGroup.addAction(self.actionFilesShowAll)
self.actionFilesShowAll.setToolTip("Show all imported files")
self.filesActionGroup.addAction(self.actionFilesShowVideo)
self.actionFilesShowVideo.setToolTip("Show only video files")
self.filesActionGroup.addAction(self.actionFilesShowAudio)
self.actionFilesShowAudio.setToolTip("Show only audio files")
self.filesActionGroup.addAction(self.actionFilesShowImage)
self.actionFilesShowImage.setToolTip("Show only image files")
self.actionFilesShowAll.setChecked(True)

self.filesToolbar.addAction(self.actionFilesShowAll)
self.filesToolbar.addAction(self.actionFilesShowVideo)
self.filesToolbar.addAction(self.actionFilesShowAudio)
Expand All @@ -2999,7 +3004,9 @@ def setup_toolbars(self):
self.transitionsActionGroup = QActionGroup(self)
self.transitionsActionGroup.setExclusive(True)
self.transitionsActionGroup.addAction(self.actionTransitionsShowAll)
self.actionTransitionsShowAll.setToolTip("Show all transitions")
self.transitionsActionGroup.addAction(self.actionTransitionsShowCommon)
self.actionTransitionsShowCommon.setToolTip("Show common transitions only")
self.actionTransitionsShowAll.setChecked(True)
self.transitionsToolbar.addAction(self.actionTransitionsShowAll)
self.transitionsToolbar.addAction(self.actionTransitionsShowCommon)
Expand All @@ -3016,8 +3023,11 @@ def setup_toolbars(self):
self.effectsActionGroup = QActionGroup(self)
self.effectsActionGroup.setExclusive(True)
self.effectsActionGroup.addAction(self.actionEffectsShowAll)
self.actionEffectsShowAll.setToolTip("Show all effects")
self.effectsActionGroup.addAction(self.actionEffectsShowVideo)
self.actionEffectsShowVideo.setToolTip("Show only video effects")
self.effectsActionGroup.addAction(self.actionEffectsShowAudio)
self.actionEffectsShowAudio.setToolTip("Show only audio effects")
self.actionEffectsShowAll.setChecked(True)
self.effectsToolbar.addAction(self.actionEffectsShowAll)
self.effectsToolbar.addAction(self.actionEffectsShowVideo)
Expand Down Expand Up @@ -3076,6 +3086,7 @@ def setup_toolbars(self):
self.sliderZoomWidget = ZoomSlider(self)
self.sliderZoomWidget.setMinimumSize(200, 20)
self.sliderZoomWidget.setZoomFactor(initial_scale)
self.sliderZoomWidget.setToolTip("Zoom in/out of the timeline")

# add zoom widgets
self.timelineToolbar.addWidget(self.sliderZoomWidget)
Expand Down
16 changes: 15 additions & 1 deletion src/windows/views/files_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def contextMenuEvent(self, event):

menu.addAction(self.win.actionFile_Properties)
menu.addSeparator()
menu.addAction(self.win.actionRemove_from_Project)
confirm_action = menu.addAction(_("Remove from Project"))
confirm_action.triggered.connect(self.confirm_remove_file)
menu.addSeparator()

# Show menu
Expand Down Expand Up @@ -261,6 +262,19 @@ def value_updated(self, item):
# Update file thumbnail
self.win.FileUpdated.emit(file_id)

def confirm_remove_file(self):
from PyQt5.QtWidgets import QMessageBox
_ = get_app()._tr

reply = QMessageBox.question(
self,
_("Confirm Delete"),
_("Are you sure you want to delete this file from the project?"),
QMessageBox.Yes | QMessageBox.Cancel
)

if reply == QMessageBox.Yes:
self.win.actionRemove_from_Project.trigger()
def __init__(self, model, *args):
# Invoke parent init
super().__init__(*args)
Expand Down
21 changes: 16 additions & 5 deletions src/windows/views/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3389,14 +3389,25 @@ def dragMoveEvent(self, event):
# Drop an item on the timeline
def dropEvent(self, event):
log.info("Dropping item on timeline - item_ids: %s, item_type: %s" % (self.item_ids, self.item_type))

print("Dropped mimeData content:", event.mimeData().text())
# Accept the event
event.accept()
def dragEnterEvent(self, event):
if event.mimeData().hasText() and self._is_valid_file(event.mimeData().text()):
event.acceptProposedAction()

if self.item_type == "effect":
pos = event.posF()
data = json.loads(event.mimeData().text())
self.addEffect(data, pos)
def dropEvent(self, event):
file_path = event.mimeData().text()
position = self._pixels_to_frames(event.pos().x())

# Create new clip
clip = Clip(file_path)
clip.position = position
self.current_track.addClip(clip)
if self.item_type == "effect":
pos = event.posF()
data = json.loads(event.mimeData().text())
self.addEffect(data, pos)

elif self.item_type in ["clip", "transition"] and self.item_ids:
# Update most recent clip or transition
Expand Down