Skip to content

Commit b2ad5b3

Browse files
committed
Merge branch 'master' into merge-master-into-develop
# Conflicts: # src/classes/info.py
2 parents eb7ecbb + fa699d7 commit b2ad5b3

14 files changed

+167
-137
lines changed

.gitlab-ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ linux-builder:
1919
- cp -r "$CI_PROJECT_DIR/build/install-x64/python/." "$CI_PROJECT_DIR"
2020
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:$LD_LIBRARY_PATH
2121
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID" > "build/install-x64/share/$CI_PROJECT_NAME"
22-
- git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
22+
- git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
2323
- python3 freeze.py build
2424
- python3 installer/build-server.py "$SLACK_TOKEN" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" "$WINDOWS_KEY" "$WINDOWS_PASSWORD" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME"
2525
when: always
@@ -59,7 +59,7 @@ mac-builder:
5959
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:$LD_LIBRARY_PATH
6060
- export DYLD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:DYLD_LIBRARY_PATH
6161
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID" > "build/install-x64/share/$CI_PROJECT_NAME"
62-
- git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
62+
- git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
6363
- /Library/Frameworks/Python.Framework/Versions/3.6/bin/python3.6 freeze.py bdist_mac --iconfile=installer/openshot.icns --custom-info-plist=installer/Info.plist --bundle-name="OpenShot Video Editor"
6464
- /Library/Frameworks/Python.Framework/Versions/3.6/bin/python3.6 installer/build-server.py "$SLACK_TOKEN" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" "$WINDOWS_KEY" "$WINDOWS_PASSWORD" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME"
6565
when: always
@@ -85,8 +85,8 @@ windows-builder-x64:
8585
- $env:Path = "$CI_PROJECT_DIR\build\install-x64\lib;$CI_PROJECT_DIR\build\install-x64\lib\python3.7\site-packages\;C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\mingw64\lib\python3.7\;C:\msys64\mingw64\lib\python3.7\site-packages\;C:\msys64\mingw64\lib\python3.7\site-packages\PyQt5;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\usr;C:\msys64\usr\lib;" + $env:Path;
8686
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x64\lib\python3.7\site-packages\;C:\msys64\usr\lib;C:\msys64\usr\lib\site-packages\;C:\msys64\mingw64\lib\python3.7\;C:\msys64\mingw64\lib\python3.7\site-packages\;C:\msys64\mingw64\lib\python3.7\site-packages\PyQt5;";
8787
- New-Item -path "build/install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID" -ItemType file -force
88-
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
89-
- git log "$PREV_GIT_LABEL..HEAD" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
88+
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
89+
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
9090
- python3 freeze.py build
9191
- python3 installer/build-server.py "$SLACK_TOKEN" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" "$WINDOWS_KEY" "$WINDOWS_PASSWORD" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME"
9292
when: always
@@ -112,8 +112,8 @@ windows-builder-x86:
112112
- $env:Path = "$CI_PROJECT_DIR\build\install-x86\lib;$CI_PROJECT_DIR\build\install-x86\lib\python3.7\site-packages\;C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\mingw32\lib\python3.7\;C:\msys32\mingw32\lib\python3.7\site-packages\;C:\msys32\mingw32\lib\python3.7\site-packages\PyQt5;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\usr;C:\msys32\usr\lib;" + $env:Path;
113113
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x86\lib\python3.7\site-packages\;C:\msys32\usr\lib;C:\msys32\usr\lib\site-packages\;C:\msys32\mingw32\lib\python3.7\;C:\msys32\mingw32\lib\python3.7\site-packages\;C:\msys32\mingw32\lib\python3.7\site-packages\PyQt5;";
114114
- New-Item -path "build/install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID" -ItemType file -force
115-
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0)
116-
- git log "$PREV_GIT_LABEL..HEAD" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x86/share/$CI_PROJECT_NAME.log"
115+
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
116+
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"%C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x86/share/$CI_PROJECT_NAME.log"
117117
- python3 freeze.py build
118118
- editbin /LARGEADDRESSAWARE "$CI_PROJECT_DIR\build\exe.mingw-3.7\openshot-qt.exe"
119119
- python3 installer/build-server.py "$SLACK_TOKEN" "$S3_ACCESS_KEY" "$S3_SECRET_KEY" "$WINDOWS_KEY" "$WINDOWS_PASSWORD" "$GITHUB_USER" "$GITHUB_PASS" "True" "$CI_COMMIT_REF_NAME"

freeze.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ def find_files(directory, patterns):
292292
# for certain distros (like Fedora, openSUSE, Debian, etc...)
293293
# Also add Glib related files (required for some distros)
294294

295-
for added_lib in [ARCHLIB + "libssl.so.1.0.0",
296-
ARCHLIB + "libcrypto.so.1.0.0",
295+
for added_lib in [ARCHLIB + "libssl.so",
296+
ARCHLIB + "libcrypto.so",
297297
ARCHLIB + "libglib-2.0.so",
298298
ARCHLIB + "libgio-2.0.so",
299299
ARCHLIB + "libgmodule-2.0.so",

installer/build-mac-dmg.sh

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ mv "$OS_PATH/MacOS/images" "$OS_PATH/Resources/images"; ln -s "../Resources/imag
3434
mv "$OS_PATH/MacOS/language" "$OS_PATH/Resources/language"; ln -s "../Resources/language" "$OS_PATH/MacOS/language";
3535
mv "$OS_PATH/MacOS/presets" "$OS_PATH/Resources/presets"; ln -s "../Resources/presets" "$OS_PATH/MacOS/presets";
3636
mv "$OS_PATH/MacOS/profiles" "$OS_PATH/Resources/profiles"; ln -s "../Resources/profiles" "$OS_PATH/MacOS/profiles";
37+
mv "$OS_PATH/MacOS/resources" "$OS_PATH/Resources/resources"; ln -s "../Resources/resources" "$OS_PATH/MacOS/resources";
3738
mv "$OS_PATH/MacOS/settings" "$OS_PATH/Resources/settings"; ln -s "../Resources/settings" "$OS_PATH/MacOS/settings";
3839
mv "$OS_PATH/MacOS/tests" "$OS_PATH/Resources/tests"; ln -s "../Resources/tests" "$OS_PATH/MacOS/tests";
3940
mv "$OS_PATH/MacOS/timeline" "$OS_PATH/Resources/timeline"; ln -s "../Resources/timeline" "$OS_PATH/MacOS/timeline";

src/classes/metrics.py

+24-8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import requests
3131
import platform
3232
import threading
33+
import time
3334
import urllib.parse
3435
from copy import deepcopy
3536
from classes import info
@@ -86,6 +87,9 @@
8687
"cd5": linux_distro
8788
}
8889

90+
# Queue for metrics (incase things are disabled... just queue it up
91+
# incase the user enables metrics later
92+
metric_queue = []
8993

9094
def track_metric_screen(screen_name):
9195
"""Track a GUI screen being shown"""
@@ -148,19 +152,31 @@ def track_metric_session(is_start=True):
148152

149153
def send_metric(params):
150154
"""Send anonymous metric over HTTP for tracking"""
155+
156+
# Add to queue and *maybe* send if the user allows it
157+
metric_queue.append(params)
158+
151159
# Check if the user wants to send metrics and errors
152160
if s.get("send_metrics"):
153161

154-
url_params = urllib.parse.urlencode(params)
155-
url = "http://www.google-analytics.com/collect?%s" % url_params
162+
for metric_params in metric_queue:
163+
url_params = urllib.parse.urlencode(metric_params)
164+
url = "http://www.google-analytics.com/collect?%s" % url_params
156165

157-
# Send metric HTTP data
158-
try:
159-
r = requests.get(url, headers={"user-agent": user_agent}, verify=False)
160-
log.info("Track metric: [%s] %s | (%s bytes)" % (r.status_code, r.url, len(r.content)))
166+
# Send metric HTTP data
167+
try:
168+
r = requests.get(url, headers={"user-agent": user_agent}, verify=False)
169+
log.info("Track metric: [%s] %s | (%s bytes)" % (r.status_code, r.url, len(r.content)))
161170

162-
except Exception as Ex:
163-
log.error("Failed to Track metric: %s" % (Ex))
171+
except Exception as Ex:
172+
log.error("Failed to Track metric: %s" % (Ex))
173+
174+
# Wait a moment, so we don't spam the requests
175+
time.sleep(0.25)
176+
177+
# All metrics have been sent (or attempted to send)
178+
# Clear the queue
179+
metric_queue.clear()
164180

165181

166182
def send_exception(stacktrace, source):

src/classes/project_data.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,17 @@ def scale_keyframe_value(self, original_value, scale_factor):
399399
return round(original_value * scale_factor)
400400

401401
def rescale_keyframes(self, scale_factor):
402-
"""Adjust all keyframe coordinates from previous FPS to new FPS (using a scale factor)"""
402+
"""Adjust all keyframe coordinates from previous FPS to new FPS (using a scale factor)
403+
and return scaled project data without modifing the current project."""
403404
log.info('Scale all keyframes by a factor of %s' % scale_factor)
404405

406+
# Create copy of active project data
407+
data = copy.deepcopy(self._data)
408+
409+
# Rescale the the copied project data
405410
# Loop through all clips (and look for Keyframe objects)
406411
# Scale the X coordinate by factor (which represents the frame #)
407-
for clip in self._data.get('clips', []):
412+
for clip in data.get('clips', []):
408413
for attribute in clip:
409414
if type(clip.get(attribute)) == dict and "Points" in clip.get(attribute):
410415
for point in clip.get(attribute).get("Points"):
@@ -429,7 +434,7 @@ def rescale_keyframes(self, scale_factor):
429434

430435
# Loop through all effects/transitions (and look for Keyframe objects)
431436
# Scale the X coordinate by factor (which represents the frame #)
432-
for effect in self._data.get('effects', []):
437+
for effect in data.get('effects', []):
433438
for attribute in effect:
434439
if type(effect.get(attribute)) == dict and "Points" in effect.get(attribute):
435440
for point in effect.get(attribute).get("Points"):
@@ -441,9 +446,8 @@ def rescale_keyframes(self, scale_factor):
441446
if "co" in point:
442447
point["co"]["X"] = self.scale_keyframe_value(point["co"].get("X", 0.0), scale_factor)
443448

444-
# Get app, and distribute all project data through update manager
445-
from classes.app import get_app
446-
get_app().updates.load(self._data)
449+
# return the copied and scaled project data
450+
return data
447451

448452
def read_legacy_project_file(self, file_path):
449453
"""Attempt to read a legacy version 1.x openshot project file"""

src/settings/_default.settings

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"restart": true
334334
},
335335
{
336-
"value": true,
336+
"value": false,
337337
"title": "Send Anonymous Metrics and Errors",
338338
"type": "bool",
339339
"category": "Debug",

src/windows/about.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def __init__(self):
9595
self.btnchangelog.clicked.connect(self.load_changelog)
9696

9797
# Init some variables
98-
self.txtversion.setText(_("Version: %s") % info.VERSION)
98+
openshot_qt_version = _("Version: %s") % info.VERSION
99+
libopenshot_version = "libopenshot: %s" % openshot.OPENSHOT_VERSION_FULL
100+
self.txtversion.setText("<b>%s</b><br/>%s" % (openshot_qt_version, libopenshot_version))
99101
self.txtversion.setAlignment(Qt.AlignCenter)
100102

101103
# Track metrics
@@ -266,6 +268,7 @@ def __init__(self):
266268
'date': line[9:20].strip(),
267269
'author': line[20:45].strip(),
268270
'subject': line[45:].strip() })
271+
break
269272
except:
270273
# Ignore decoding errors
271274
pass

0 commit comments

Comments
 (0)