Skip to content

Commit

Permalink
Merge branch 'develop' into simplify-unity
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Oct 18, 2019
2 parents 152bfc3 + 9deedcf commit 054f800
Show file tree
Hide file tree
Showing 17 changed files with 48,868 additions and 47,716 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true
[*]
insert_final_newline = true
end_of_line = 'lf'
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
2. Then enable 'Debug Mode (Verbose)' in the Preferences
3. Quit OpenShot and delete both log files:
* **Windows**: OpenShot stores its logs in your user profile directory (`%USERPROFILE%`, e.g. `C:\Users\username\`)
* **`%USERPROFILE%/.openshot_qt/openshot_qt.log`**
* **`%USERPROFILE%/.openshot_qt/openshot-qt.log`**
* **`%USERPROFILE%/.openshot_qt/libopenshot.log`**
* **Linux/MacOS**: OpenShot stores its logs in your home directory (`$HOME`, e.g. `/home/username/`)
* **`$HOME/.openshot_qt/openshot_qt.log`**
* **`$HOME/.openshot_qt/openshot-qt.log`**
* **`$HOME/.openshot_qt/libopenshot.log`**
4. Re-launch OpenShot and trigger the crash as quickly as possible (to keep the log files small)
5. Attach **both** log files
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ cd doc
make html
```

The documentation for the most recent release can be viewed online at [openshot.org/user-guide](https://www.openshot.org/user-guide/).

## Report a bug

Please report bugs using the official [Report a Bug](https://www.openshot.org/issues/new/)
Expand Down
53 changes: 31 additions & 22 deletions src/classes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import sys
import platform
import traceback
import atexit
from uuid import uuid4
from PyQt5.QtWidgets import QApplication, QStyleFactory, QMessageBox
from PyQt5.QtGui import QPalette, QColor, QFontDatabase, QFont
Expand Down Expand Up @@ -102,9 +103,6 @@ def __init__(self, *args, mode=None):
except Exception:
pass

# Connect QCoreApplication::aboutToQuit() signal to log end of the session
self.aboutToQuit.connect(self.onLogTheEnd)

# Setup application
self.setApplicationName('openshot')
self.setApplicationVersion(info.SETUP['version'])
Expand Down Expand Up @@ -189,19 +187,32 @@ def __init__(self, *args, mode=None):
self.setStyle(QStyleFactory.create("Fusion"))

darkPalette = self.palette()

darkPalette.setColor(QPalette.Window, QColor(53, 53, 53))
darkPalette.setColor(QPalette.WindowText, Qt.white)
darkPalette.setColor(QPalette.Base, QColor(25, 25, 25))
darkPalette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))
darkPalette.setColor(QPalette.ToolTipBase, Qt.white)
darkPalette.setColor(QPalette.ToolTipText, Qt.white)
darkPalette.setColor(QPalette.Light, QColor(68, 68, 68))
darkPalette.setColor(QPalette.Text, Qt.white)
darkPalette.setColor(QPalette.Button, QColor(53, 53, 53))
darkPalette.setColor(QPalette.ButtonText, Qt.white)
darkPalette.setColor(QPalette.BrightText, Qt.red)
darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218))
darkPalette.setColor(QPalette.Highlight, QColor(42, 130, 218, 192))
darkPalette.setColor(QPalette.HighlightedText, Qt.black)
darkPalette.setColor(QPalette.Disabled, QPalette.Text, QColor(104, 104, 104))
#
# Disabled palette
#
darkPalette.setColor(QPalette.Disabled, QPalette.WindowText, QColor(255, 255, 255, 128))
darkPalette.setColor(QPalette.Disabled, QPalette.Base, QColor(68, 68, 68))
darkPalette.setColor(QPalette.Disabled, QPalette.Text, QColor(255, 255, 255, 128))
darkPalette.setColor(QPalette.Disabled, QPalette.Button, QColor(53, 53, 53, 128))
darkPalette.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(255, 255, 255, 128))
darkPalette.setColor(QPalette.Disabled, QPalette.Highlight, QColor(151, 151, 151, 192))
darkPalette.setColor(QPalette.Disabled, QPalette.HighlightedText, Qt.black)

# Tooltips
darkPalette.setColor(QPalette.ToolTipBase, QColor(42, 130, 218))
darkPalette.setColor(QPalette.ToolTipText, Qt.white)

self.setPalette(darkPalette)
self.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 0px solid white; }")

Expand Down Expand Up @@ -244,19 +255,17 @@ def run(self):
# return exit result
return res

# Log the session's end
@pyqtSlot()
def onLogTheEnd(self):
""" Log when the primary Qt event loop ends """
# Log the session's end
@atexit.register
def onLogTheEnd():
""" Log when the primary Qt event loop ends """

try:
from classes.logger import log
import time
log.info('OpenShot\'s session ended'.center(48))
log.info(time.asctime().center(48))
log.info("================================================")
except Exception:
pass
try:
from classes.logger import log
import time
log.info('OpenShot\'s session ended'.center(48))
log.info(time.asctime().center(48))
log.info("================================================")
except Exception:
pass

# return 0 on success
return 0
3 changes: 3 additions & 0 deletions src/classes/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
# Desktop launcher ID, for Linux
DESKTOP_ID = "org.openshot.OpenShot.desktop"

# Blender minimum version required (a string value)
BLENDER_MIN_VERSION = "2.80"

# Languages
CMDLINE_LANGUAGE = None
CURRENT_LANGUAGE = 'en_US'
Expand Down
32 changes: 16 additions & 16 deletions src/classes/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def json(self, is_array=False, only_value=False):
"partial": self.partial_update,
"old_values": copy.deepcopy(self.old_values)}

# Always remove 'history' key (if found). This prevents nested "history"
# attributes when a project dict is loaded.
try:
if data_dict.get("value") and "history" in data_dict.get("value"):
data_dict.get("value").pop("history", None)
if data_dict.get("old_values") and "history" in data_dict.get("old_values"):
data_dict.get("old_values").pop("history", None)
except Exception:
log.info('Warning: failed to clear history attribute from undo/redo data.')
# Always remove 'history' key (if found). This prevents nested "history"
# attributes when a project dict is loaded.
try:
if isinstance(data_dict.get("value"), dict) and "history" in data_dict.get("value"):
data_dict.get("value").pop("history", None)
if isinstance(data_dict.get("old_values"), dict) and "history" in data_dict.get("old_values"):
data_dict.get("old_values").pop("history", None)
except Exception as ex:
log.warning('Failed to clear history attribute from undo/redo data. {}'.format(ex))

if not is_array:
# Use a JSON Object as the root object
Expand Down Expand Up @@ -112,12 +112,12 @@ def load_json(self, value):
# Always remove 'history' key (if found). This prevents nested "history"
# attributes when a project dict is loaded.
try:
if self.values and "history" in self.values:
if isinstance(self.values, dict) and "history" in self.values:
self.values.pop("history", None)
if self.old_values and "history" in self.old_values:
if isinstance(self.old_values, dict) and "history" in self.old_values:
self.old_values.pop("history", None)
except Exception:
log.info('Warning: failed to clear history attribute from undo/redo data.')
except Exception as ex:
log.warning('Failed to clear history attribute from undo/redo data. {}'.format(ex))


class UpdateManager:
Expand Down Expand Up @@ -180,7 +180,7 @@ def save_history(self, project, history_length):
actionDict = json.loads(action.json(), strict=False)
undo_list.append(actionDict)
else:
log.info("Saving undo, skipped key: %s" % str(action.key))
log.info("Saving undo history, skipped key: %s" % str(action.key))

# Set history data in project
self.ignore_history = True
Expand All @@ -203,15 +203,15 @@ def add_listener(self, listener, index=-1):
# Insert listener at index
self.updateListeners.insert(index, listener)
else:
log.warning("Listener already added.")
log.warning("Cannot add existing listener: {}".format(str(listener)))

def add_watcher(self, watcher):
""" Add a new watcher (which will invoke the updateStatusChanged() method each time a 'redo' or 'undo' action is available). """

if not watcher in self.statusWatchers:
self.statusWatchers.append(watcher)
else:
log.warning("Watcher already added.")
log.warning("Cannot add existing watcher: {}".format(str(watcher)))

def update_watchers(self):
""" Notify all watchers if any 'undo' or 'redo' actions are available. """
Expand Down
Loading

0 comments on commit 054f800

Please sign in to comment.