Skip to content

Commit

Permalink
Merge branch 'develop' into pending
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Jan 23, 2020
2 parents c7d0692 + d039709 commit 1e0ecf3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/classes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def __init__(self, *args, mode=None):
# Auto load project passed as argument
self.window.OpenProjectSignal.emit(path)
else:
# Auto import media file
# Apply the default settings and Auto import media file
self.project.load("")
self.window.filesTreeView.add_file(path)
else:
# Recover backup file (this can't happen until after the Main Window has completely loaded)
Expand Down
6 changes: 6 additions & 0 deletions src/classes/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ def reset(self):
self.pending_action = None
self.last_action = None

# Notify watchers of new history state
self.update_watchers()

def add_listener(self, listener, index=-1):
""" Add a new listener (which will invoke the changed(action) method
each time an UpdateAction is available). """
Expand Down Expand Up @@ -371,3 +374,6 @@ def apply_last_action_to_history(self, previous_value):
self.actionHistory.append(self.pending_action)
self.last_action = self.pending_action
self.pending_action = None

# Notify watchers of new history state
self.update_watchers()
12 changes: 12 additions & 0 deletions src/windows/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon

from classes import info
from classes import ui_util
from classes.app import get_app
from classes.metrics import *
Expand Down Expand Up @@ -979,6 +980,17 @@ def accept(self):
super(Export, self).accept()

def reject(self):
if self.exporting and not self.close_button.isVisible():
# Show confirmation dialog
_ = get_app()._tr
result = QMessageBox.question(self,
_("Export Video"),
_("Are you sure you want to cancel the export?"),
QMessageBox.No | QMessageBox.Yes)
if result == QMessageBox.No:
# Resume export
return

# Re-set OMP thread enabled flag
if self.s.get("omp_threads_enabled"):
openshot.Settings.Instance().WAIT_FOR_VIDEO_PROCESSING_TASK = False
Expand Down
6 changes: 4 additions & 2 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import platform
import shutil
import webbrowser
from time import sleep
from operator import itemgetter
from uuid import uuid4
from copy import deepcopy
from time import sleep, time

from PyQt5.QtCore import *
from PyQt5.QtGui import QIcon, QCursor, QKeySequence
Expand Down Expand Up @@ -617,6 +617,8 @@ def actionSave_trigger(self, event):

def auto_save_project(self):
"""Auto save the project"""
import time

app = get_app()
s = settings.get_settings()

Expand All @@ -634,7 +636,7 @@ def auto_save_project(self):
file_name, file_ext = os.path.splitext(file_name)

# Make copy of unsaved project file in 'recovery' folder
recover_path_with_timestamp = os.path.join(info.RECOVERY_PATH, "%d-%s.osp" % (int(time()), file_name))
recover_path_with_timestamp = os.path.join(info.RECOVERY_PATH, "%d-%s.osp" % (int(time.time()), file_name))
shutil.copy(file_path, recover_path_with_timestamp)

# Find any recovery file older than X auto-saves
Expand Down

0 comments on commit 1e0ecf3

Please sign in to comment.