32 from functools
import partial
37 from classes
import info, ui_util
38 from classes.logger
import log
39 from classes.app
import get_app
41 from windows.views.credits_treeview
import CreditsTreeView
42 from windows.views.changelog_treeview
import ChangelogTreeView
47 import simplejson
as json
55 ui_path = os.path.join(info.PATH,
'windows',
'ui',
'about.ui')
59 QDialog.__init__(self)
72 self.btnchangelog.setVisible(
False)
73 for project
in [
'openshot-qt',
'libopenshot',
'libopenshot-audio']:
74 changelog_path = os.path.join(info.PATH,
'settings',
'%s.log' % project)
75 if os.path.exists(changelog_path):
77 for encoding_name
in (
'utf-8',
'utf_16_le'):
79 with codecs.open(changelog_path,
'r', encoding=encoding_name) as changelog_file:
80 if changelog_file.read():
81 self.btnchangelog.setVisible(
True)
87 create_text = _(
'Create & Edit Amazing Videos and Movies')
88 description_text = _(
'OpenShot Video Editor 2.x is the next generation of the award-winning <br/>OpenShot video editing platform.')
89 learnmore_text = _(
'Learn more')
90 copyright_text = _(
'Copyright © %(begin_year)s-%(current_year)s') % {
'begin_year':
'2008',
'current_year': str(datetime.datetime.today().year) }
91 about_html =
'<html><head/><body><hr/><p align="center"><span style=" font-size:10pt; font-weight:600;">%s</span></p><p align="center"><span style=" font-size:10pt;">%s </span><a href="https://www.openshot.org/%s?r=about-us"><span style=" font-size:10pt; text-decoration: none; color:#55aaff;">%s</span></a><span style=" font-size:10pt;">.</span></p></body></html>' % (create_text, description_text,
info.website_language(), learnmore_text)
92 company_html =
'<html><head/><body style="font-size:11pt; font-weight:400; font-style:normal;">\n<hr />\n<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">%s </span><a href="http://www.openshotstudios.com?r=about-us"><span style=" font-size:10pt; font-weight:600; text-decoration: none; color:#55aaff;">OpenShot Studios, LLC<br /></span></a></p></body></html>' % (copyright_text)
95 self.lblAboutDescription.setText(about_html)
96 self.lblAboutCompany.setText(company_html)
104 self.txtversion.setText(_(
"Version: %s") % info.VERSION)
105 self.txtversion.setAlignment(Qt.AlignCenter)
113 log.info(
'Credit screen has been opened')
120 log.info(
'License screen has been opened')
127 log.info(
'Changelog screen has been opened')
136 ui_path = os.path.join(info.PATH,
'windows',
'ui',
'license.ui')
140 QDialog.__init__(self)
153 with open(os.path.join(info.PATH,
'settings',
'license.txt'),
'r') as my_license:
154 text = my_license.read()
155 self.textBrowser.append(text)
158 cursor = self.textBrowser.textCursor()
159 cursor.setPosition(0)
160 self.textBrowser.setTextCursor(cursor)
167 ui_path = os.path.join(info.PATH,
'windows',
'ui',
'credits.ui')
173 treeview.refresh_view(filter=textbox.text())
178 QDialog.__init__(self)
191 supporter_text = _(
"Become a Supporter")
192 supporter_html =
'<html><head/><body><p align="center"><a href="https://www.openshot.org/%sdonate/?app-about-us"><span style=" text-decoration: underline; color:#55aaff;">%s</span></a></p></body></html>' % (
info.website_language(), supporter_text)
193 self.lblBecomeSupporter.setText(supporter_html)
197 with codecs.open(os.path.join(info.PATH,
'settings',
'contributors.json'),
'r', 'utf-8') as contributors_file:
198 developer_string = contributors_file.read()
199 developer_list = json.loads(developer_string)
206 translator_credits = []
207 translator_credits_string = _(
"translator-credits").replace(
"Launchpad Contributions:\n",
"").replace(
"translator-credits",
"")
208 if translator_credits_string:
210 translator_rows = translator_credits_string.split(
"\n")
211 for row
in translator_rows:
213 translator_parts = row.split(
"https://launchpad.net/")
214 name = translator_parts[0].strip()
215 username = translator_parts[1].strip()
216 translator_credits.append({
"name":name,
"website":
"https://launchpad.net/%s" % username})
224 self.tabCredits.removeTab(1)
228 with codecs.open(os.path.join(info.PATH,
'settings',
'supporters.json'),
'r', 'utf-8') as supporter_file:
229 supporter_string = supporter_file.read()
230 supporter_list = json.loads(supporter_string)
242 ui_path = os.path.join(info.PATH,
'windows',
'ui',
'changelog.ui')
248 treeview.refresh_view(filter=textbox.text())
253 QDialog.__init__(self)
266 github_text = _(
"OpenShot on GitHub")
267 github_html =
'<html><head/><body><p align="center"><a href="https://github.com/OpenShot/"><span style=" text-decoration: underline; color:#55aaff;">%s</span></a></p></body></html>' % (github_text)
268 self.lblGitHubLink.setText(github_html)
272 changelog_path = os.path.join(info.PATH,
'settings',
'openshot-qt.log')
273 if os.path.exists(changelog_path):
275 for encoding_name
in (
'utf-8',
'utf_16_le'):
277 with codecs.open(changelog_path,
'r', encoding=encoding_name) as changelog_file:
278 for line
in changelog_file:
279 changelog_list.append({
'hash': line[:9].strip(),
280 'date': line[9:20].strip(),
281 'author': line[20:45].strip(),
282 'subject': line[45:].strip() })
286 self.
openshot_qt_ListView = ChangelogTreeView(commits=changelog_list, commit_url=
"https://github.com/OpenShot/openshot-qt/commit/%s/")
292 changelog_path = os.path.join(info.PATH,
'settings',
'libopenshot.log')
293 if os.path.exists(changelog_path):
295 for encoding_name
in (
'utf-8',
'utf_16_le'):
297 with codecs.open(changelog_path,
'r', encoding=encoding_name) as changelog_file:
298 for line
in changelog_file:
299 changelog_list.append({
'hash': line[:9].strip(),
300 'date': line[9:20].strip(),
301 'author': line[20:45].strip(),
302 'subject': line[45:].strip() })
306 self.
libopenshot_ListView = ChangelogTreeView(commits=changelog_list, commit_url=
"https://github.com/OpenShot/libopenshot/commit/%s/")
312 changelog_path = os.path.join(info.PATH,
'settings',
'libopenshot-audio.log')
313 if os.path.exists(changelog_path):
315 for encoding_name
in (
'utf-8',
'utf_16_le'):
317 with codecs.open(changelog_path,
'r', encoding=encoding_name) as changelog_file:
318 for line
in changelog_file:
319 changelog_list.append({
'hash': line[:9].strip(),
320 'date': line[9:20].strip(),
321 'author': line[20:45].strip(),
322 'subject': line[45:].strip() })
326 self.
libopenshot_audio_ListView = ChangelogTreeView(commits=changelog_list, commit_url=
"https://github.com/OpenShot/libopenshot-audio/commit/%s/")
def track_metric_screen
Track a GUI screen being shown.
libopenshot_audio_ListView
def load_license
Load License of the project.
def get_app
Returns the current QApplication instance of OpenShot.
def Filter_Triggered
Callback for filter being changed.
def Filter_Triggered
Callback for filter being changed.
def load_ui
Load a Qt *.ui file, and also load an XML parsed version.
def load_changelog
Load the changelog window.
def website_language
Get the current website language code for URLs.
def init_ui
Initialize all child widgets and action of a window or dialog.
def load_credit
Load Credits for everybody who has contributed in several domain for Openshot.