From f56c6232e9138ff68ca2bae1c70397a106f093e4 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Wed, 26 Nov 2008 22:38:00 +0100 Subject: [PATCH] Show donation info in the about dialog --- picard/ui/mainwindow.py | 7 ++++ picard/ui/options/about.py | 10 +++-- picard/ui/ui_options_about.py | 36 ++++++++++++------ ui/options_about.ui | 71 ++++++++++++++++++++++++----------- 4 files changed, 87 insertions(+), 37 deletions(-) diff --git a/picard/ui/mainwindow.py b/picard/ui/mainwindow.py index 42f1d5c7a..3848f3821 100644 --- a/picard/ui/mainwindow.py +++ b/picard/ui/mainwindow.py @@ -207,6 +207,9 @@ class MainWindow(QtGui.QMainWindow): self.about_action = QtGui.QAction(_("&About..."), self) self.connect(self.about_action, QtCore.SIGNAL("triggered()"), self.show_about) + self.donate_action = QtGui.QAction(_("&Donate..."), self) + self.connect(self.donate_action, QtCore.SIGNAL("triggered()"), self.open_donation_page) + self.report_bug_action = QtGui.QAction(_("&Report a Bug..."), self) self.connect(self.report_bug_action, QtCore.SIGNAL("triggered()"), self.open_bug_report) @@ -385,6 +388,7 @@ class MainWindow(QtGui.QMainWindow): menu.addAction(self.report_bug_action) menu.addAction(self.view_log_action) menu.addSeparator() + menu.addAction(self.donate_action) menu.addAction(self.about_action) def update_toolbar_style(self): @@ -554,6 +558,9 @@ class MainWindow(QtGui.QMainWindow): def open_support_forum(self): webbrowser2.open("http://forums.musicbrainz.org/viewforum.php?id=2") + def open_donation_page(self): + webbrowser2.open('http://metabrainz.org/donate/index.html') + def save(self): """Tell the tagger to save the selected objects.""" self.tagger.save(self.panel.selected_objects()) diff --git a/picard/ui/options/about.py b/picard/ui/options/about.py index 2f21110c3..7c1c34401 100644 --- a/picard/ui/options/about.py +++ b/picard/ui/options/about.py @@ -48,14 +48,18 @@ class AboutOptionsPage(OptionsPage): args["translator-credits"] = _("translator-credits") if args["translator-credits"] != "translator-credits": # TR: Replace LANG with language you are translatig to. - args["translator-credits"] = _("
Translated to LANG by %s") % args["translator-credits"] + args["translator-credits"] = _("
Translated to LANG by %s") % args["translator-credits"].replace("\n", "
") else: args["translator-credits"] = "" text = _(u"""

MusicBrainz Picard
Version %(version)s

-

Supported formats: %(formats)s

-

Copyright © 2004-2007 Robert Kaye, Lukáš Lalinský and others%(translator-credits)s

+

Supported formats
%(formats)s

+

Please donate
+Thank you for using Picard. Picard relies on the MusicBrainz database, which is operated by the MetaBrainz Foundation with the help of thousands of volunteers. If you like this application please consider donating to the MetaBrainz Foundation to keep the service running.

+

Donate now!

+

Credits
+Copyright © 2004-2008 Robert Kaye, Lukáš Lalinský and others%(translator-credits)s

http://musicbrainz.org/doc/PicardTagger

""") % args self.ui.label.setOpenExternalLinks(True) diff --git a/picard/ui/ui_options_about.py b/picard/ui/ui_options_about.py index 529c2109a..cae91dafa 100644 --- a/picard/ui/ui_options_about.py +++ b/picard/ui/ui_options_about.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'ui/options_about.ui' # -# Created: Sun Jan 13 17:42:14 2008 -# by: PyQt4 UI code generator 4.3 +# Created: Wed Nov 26 21:41:46 2008 +# by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,21 +12,33 @@ from PyQt4 import QtCore, QtGui class Ui_AboutOptionsPage(object): def setupUi(self, AboutOptionsPage): AboutOptionsPage.setObjectName("AboutOptionsPage") - AboutOptionsPage.resize(QtCore.QSize(QtCore.QRect(0,0,171,137).size()).expandedTo(AboutOptionsPage.minimumSizeHint())) - + AboutOptionsPage.resize(171, 137) self.vboxlayout = QtGui.QVBoxLayout(AboutOptionsPage) - self.vboxlayout.setMargin(9) self.vboxlayout.setSpacing(6) + self.vboxlayout.setMargin(0) self.vboxlayout.setObjectName("vboxlayout") - - self.label = QtGui.QLabel(AboutOptionsPage) - self.label.setAlignment(QtCore.Qt.AlignCenter) + self.scrollArea = QtGui.QScrollArea(AboutOptionsPage) + self.scrollArea.setFrameShape(QtGui.QFrame.NoFrame) + self.scrollArea.setFrameShadow(QtGui.QFrame.Plain) + self.scrollArea.setLineWidth(0) + self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.scrollArea.setWidgetResizable(True) + self.scrollArea.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.scrollArea.setObjectName("scrollArea") + self.scrollAreaWidgetContents = QtGui.QWidget(self.scrollArea) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 171, 137)) + self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") + self.verticalLayout = QtGui.QVBoxLayout(self.scrollAreaWidgetContents) + self.verticalLayout.setSpacing(6) + self.verticalLayout.setMargin(9) + self.verticalLayout.setObjectName("verticalLayout") + self.label = QtGui.QLabel(self.scrollAreaWidgetContents) + self.label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) self.label.setWordWrap(True) self.label.setObjectName("label") - self.vboxlayout.addWidget(self.label) - - spacerItem = QtGui.QSpacerItem(20,51,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) - self.vboxlayout.addItem(spacerItem) + self.verticalLayout.addWidget(self.label) + self.scrollArea.setWidget(self.scrollAreaWidgetContents) + self.vboxlayout.addWidget(self.scrollArea) self.retranslateUi(AboutOptionsPage) QtCore.QMetaObject.connectSlotsByName(AboutOptionsPage) diff --git a/ui/options_about.ui b/ui/options_about.ui index 2fb282609..2904ae049 100644 --- a/ui/options_about.ui +++ b/ui/options_about.ui @@ -10,38 +10,65 @@ - - 9 - 6 + + 0 + - - - + + + QFrame::NoFrame - - Qt::AlignCenter + + QFrame::Plain - + + 0 + + + Qt::ScrollBarAlwaysOff + + true + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + 0 + 0 + 171 + 137 + + + + + 6 + + + 9 + + + + + + + + Qt::AlignHCenter|Qt::AlignTop + + + true + + + + + - - - - Qt::Vertical - - - - 20 - 51 - - - -