Skip to content
Merged
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
Binary file modified images/AboutLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,316 changes: 5,289 additions & 27 deletions images/openshot-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63,985 changes: 44,014 additions & 19,971 deletions src/classes/openshot_rc.py

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions src/themes/cosmic/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def __init__(self, app):
color: #91C3FF;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 8px;
padding-right: 8px;
border: none;
}

Expand Down Expand Up @@ -276,7 +278,8 @@ def __init__(self, app):
}

QTabWidget#exportTabs QTabBar::tab,
QTabWidget#tabCategories QTabBar::tab {
QTabWidget#tabCategories QTabBar::tab,
QTabWidget#tabCredits QTabBar::tab{
margin-bottom: 10px;
}

Expand Down Expand Up @@ -453,13 +456,6 @@ def __init__(self, app):
color: #666666;
}

QWidget#aboutDialog QWidget#txtversion {
background-color: #141923;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 4px;
}

.property_value {
foreground-color: #0078FF;
background-color: #283241;
Expand Down
122 changes: 80 additions & 42 deletions src/windows/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from functools import partial

from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QDialog

from classes import info, ui_util
Expand All @@ -41,6 +40,7 @@
from classes.metrics import track_metric_screen
from windows.views.credits_treeview import CreditsTreeView
from windows.views.changelog_treeview import ChangelogTreeView
from windows.views.menu import StyledContextMenu

import requests
import threading
Expand Down Expand Up @@ -96,9 +96,21 @@ def __init__(self):
self.app = get_app()
_ = self.app._tr

# Load logo banner (using display DPI)
icon = QIcon(":/about/AboutLogo.png")
self.lblAboutLogo.setPixmap(icon.pixmap(icon.availableSizes()[0]))
self.setStyleSheet("""
QDialog {
background-image: url(:/about/AboutLogo.png);
background-repeat: no-repeat;
background-position: center;
background-size: stretch;
margin: 0px;
padding: 0px;
border: none;
}
QLabel#txtversion, QLabel#lblAboutCompany {
background: transparent;
margin-bottom: 10px;
}
""")

# Hide chnagelog button by default
self.btnchangelog.setVisible(False)
Expand All @@ -113,45 +125,29 @@ def __init__(self):
else:
log.warn("No changelog files found, disabling button")

create_text = _('Create & Edit Amazing Videos and Movies')
description_text = _("OpenShot Video Editor is an Award-Winning, Free, and<br> Open-Source Video Editor for Linux, Mac, Chrome OS, and Windows.")
learnmore_text = _('Learn more')
copyright_text = _('Copyright &copy; %(begin_year)s-%(current_year)s') % {
'begin_year': '2008',
'current_year': str(datetime.datetime.today().year)
}
about_html = '''
<html><head/><body style="padding:24px 0;"><hr/>
<div align="center" style="margin:12px 0;">
<p style="font-size:10pt;font-weight:600;margin-bottom:18px;">
%s
</p>
<p style="font-size:10pt;margin-bottom:12px;">%s
<a href="https://www.openshot.org/%s?r=about-us"
style="text-decoration:none;">%s</a>
</p>
<div align="center" style="">
<p style="font-size:11pt; font-weight: 300;">%s</p>
</div>
</body></html>
''' % (
create_text,
description_text,
info.website_language(),
learnmore_text)
''' % (description_text,)
company_html = '''
<html><head/>
<body style="font-size:10pt;font-weight:400;font-style:normal;padding:24px 0;">
<hr />
<div style="margin:12px 0;font-weight:600;" align="center">
%s
<div style="font-weight:400;" align="right">
%s<br>
<a href="http://www.openshotstudios.com?r=about-us"
style="text-decoration:none;">OpenShot Studios, LLC</a><br/>
style="text-decoration:none; color: #91C3FF;">OpenShot Studios, LLC</a>
</div>
</body></html>
''' % (copyright_text)

# Set description and company labels
self.lblAboutDescription.setText(about_html)
self.lblAboutCompany.setText(company_html)
self.lblAboutCompany.setAlignment(Qt.AlignRight | Qt.AlignBottom)
self.txtversion.setAlignment(Qt.AlignLeft | Qt.AlignBottom)

# set events handlers
self.btncredit.clicked.connect(self.load_credit)
Expand All @@ -167,10 +163,49 @@ def __init__(self):
# Load release details from HTTP
self.get_current_release()

def contextMenuEvent(self, event):
"""Handle right-click context menu."""
menu = StyledContextMenu(parent=self)

# get translations
self.app = get_app()
_ = self.app._tr

# Add "Copy Version Info" action
copy_action = menu.addAction(_("Copy Version Info"))
action = menu.exec_(event.globalPos())

if action == copy_action:
self.copy_version_info()

def copy_version_info(self):
"""Copy cleaned version info (without HTML <div> and unnecessary links) to clipboard."""
# Get the raw HTML text from txtversion
raw_html = self.txtversion.text()

# Step 1: Strip <div> tags
clean_text = re.sub(r'<div[^>]*>|</div>', '', raw_html).strip()

# Step 2: Replace <br/> with newline characters
clean_text = clean_text.replace("<br/>", "\n")

# Step 3: Remove the HTML link after 'Release Date: x-x-x |'
# Matches "Release Date: YYYY-MM-DD | <a href=...>Release Notes</a>" and keeps only "Release Date: YYYY-MM-DD"
clean_text = re.sub(r'(Release Date: \d{4}-\d{2}-\d{2}) \|.*', r'\1', clean_text)

# Copy the cleaned text to the clipboard
clipboard = get_app().clipboard()
clipboard.setText(clean_text)

def display_release(self, version_text):

self.txtversion.setText(version_text)
self.txtversion.setAlignment(Qt.AlignCenter)
version_html = '''
<div style="font-weight:400;" align="left">
%s
</div>
''' % (version_text)

self.txtversion.setText(version_html)

def get_current_release(self):
"""Get the current version """
Expand Down Expand Up @@ -211,26 +246,33 @@ def get_release_from_http(self):
string_release_notes = _("Release Notes")
string_official = _("Official")
version_date = version_info.get("date")

# Parse the date string into a datetime object
date_obj = datetime.datetime.strptime(version_date, "%Y-%m-%d %H:%M")
formatted_date = date_obj.strftime("%Y-%m-%d")

if frozen_git_SHA == release_git_SHA:
# Remove -release-candidate... from build name
log.warning("Official release detected with SHA (%s) for v%s" %
(release_git_SHA, info.VERSION))
log.warning("Official release detected with SHA (%s) for v%s" % (release_git_SHA, info.VERSION))
build_name = build_name.replace("-candidate", "")
frozen_version_label = f'<br/><br/><b>{build_name} ({string_official})</b><br/>{string_release_date}: {version_date}<br><a href="{release_notes}" style="text-decoration:none;">{string_release_notes}</a>'
frozen_version_label = f'{build_name} | {string_official}<br/>{string_release_date}: {formatted_date}'
if string_release_notes:
frozen_version_label += f' | <a href="{release_notes}" style="text-decoration:none;color: #91C3FF;">{string_release_notes}</a>'
else:
# Display current build name - unedited
log.warning("Build SHA (%s) does not match an official release SHA (%s) for v%s" %
(frozen_git_SHA, release_git_SHA, info.VERSION))
frozen_version_label = f"<br/><br/><b>{build_name}</b><br/>{string_release_date}: {version_date}"
frozen_version_label = f"{build_name}<br/>{string_release_date}: {formatted_date}"

# Init some variables
openshot_qt_version = _("Version: %s") % info.VERSION
libopenshot_version = "libopenshot: %s" % openshot.OPENSHOT_VERSION_FULL
libopenshot_version = "%s" % openshot.OPENSHOT_VERSION_FULL
version_text = f"{openshot_qt_version} | {libopenshot_version}"
if frozen_version_label:
version_text += f"<br/>{frozen_version_label}"

# emit release found
self.releaseFound.emit("<b>%s</b><br/>%s%s" % (openshot_qt_version,
libopenshot_version,
frozen_version_label))
self.releaseFound.emit(version_text)

except Exception as Ex:
log.error("Failed to get version from: %s" % RELEASE_URL % info.VERSION)
Expand Down Expand Up @@ -313,11 +355,9 @@ def __init__(self):
# Update supporter button
supporter_text = _("Become a Supporter")
supporter_html = '''
<html><head/><body>
<p align="center">
<a href="https://www.openshot.org/%sdonate/?app-about-us">%s</a>
</p>
</body></html>
''' % (info.website_language(), supporter_text)
self.lblBecomeSupporter.setText(supporter_html)

Expand Down Expand Up @@ -434,11 +474,9 @@ def __init__(self):
# Update github link button
github_text = _("OpenShot on GitHub")
github_html = '''
<html><head/><body>
<p align="center">
<a href="https://github.com/OpenShot/">%s</a>
</p>
</body></html>
''' % (github_text)
self.lblGitHubLink.setText(github_html)

Expand Down
Loading
Loading