From 1fe2e31c1d31c5a1f293de55cf65ffbb8f04a9c7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 1 Mar 2013 12:01:14 +0100 Subject: [PATCH] aboutform/dialog: code standards --- openlp/core/ui/aboutdialog.py | 106 +++++++++++++++++----------------- openlp/core/ui/aboutform.py | 6 +- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index 0115d8af2..a5c64bd65 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -38,60 +38,60 @@ class Ui_AboutDialog(object): The actual GUI widgets for the About form. """ - def setupUi(self, aboutDialog): + def setupUi(self, about_dialog): """ Set up the UI for the dialog. """ - aboutDialog.setObjectName(u'aboutDialog') - aboutDialog.setWindowIcon(build_icon(u':/icon/openlp-logo-16x16.png')) - self.aboutDialogLayout = QtGui.QVBoxLayout(aboutDialog) - self.aboutDialogLayout.setObjectName(u'aboutDialogLayout') - self.logoLabel = QtGui.QLabel(aboutDialog) - self.logoLabel.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png')) - self.logoLabel.setObjectName(u'logoLabel') - self.aboutDialogLayout.addWidget(self.logoLabel) - self.aboutNotebook = QtGui.QTabWidget(aboutDialog) - self.aboutNotebook.setObjectName(u'aboutNotebook') - self.aboutTab = QtGui.QWidget() - self.aboutTab.setObjectName(u'aboutTab') - self.aboutTabLayout = QtGui.QVBoxLayout(self.aboutTab) - self.aboutTabLayout.setObjectName(u'aboutTabLayout') - self.aboutTextEdit = QtGui.QPlainTextEdit(self.aboutTab) - self.aboutTextEdit.setReadOnly(True) - self.aboutTextEdit.setObjectName(u'aboutTextEdit') - self.aboutTabLayout.addWidget(self.aboutTextEdit) - self.aboutNotebook.addTab(self.aboutTab, u'') - self.creditsTab = QtGui.QWidget() - self.creditsTab.setObjectName(u'creditsTab') - self.creditsTabLayout = QtGui.QVBoxLayout(self.creditsTab) - self.creditsTabLayout.setObjectName(u'creditsTabLayout') - self.creditsTextEdit = QtGui.QPlainTextEdit(self.creditsTab) - self.creditsTextEdit.setReadOnly(True) - self.creditsTextEdit.setObjectName(u'creditsTextEdit') - self.creditsTabLayout.addWidget(self.creditsTextEdit) - self.aboutNotebook.addTab(self.creditsTab, u'') - self.licenseTab = QtGui.QWidget() - self.licenseTab.setObjectName(u'licenseTab') - self.licenseTabLayout = QtGui.QVBoxLayout(self.licenseTab) - self.licenseTabLayout.setObjectName(u'licenseTabLayout') - self.licenseTextEdit = QtGui.QPlainTextEdit(self.licenseTab) - self.licenseTextEdit.setReadOnly(True) - self.licenseTextEdit.setObjectName(u'licenseTextEdit') - self.licenseTabLayout.addWidget(self.licenseTextEdit) - self.aboutNotebook.addTab(self.licenseTab, u'') - self.aboutDialogLayout.addWidget(self.aboutNotebook) - self.volunteerButton = create_button(None, u'volunteerButton', icon=u':/system/system_volunteer.png') - self.button_box = create_button_box(aboutDialog, u'button_box', [u'close'], [self.volunteerButton]) - self.aboutDialogLayout.addWidget(self.button_box) - self.retranslateUi(aboutDialog) - self.aboutNotebook.setCurrentIndex(0) + about_dialog.setObjectName(u'aboutDialog') + about_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo-16x16.png')) + self.about_dialog_layout = QtGui.QVBoxLayout(about_dialog) + self.about_dialog_layout.setObjectName(u'aboutDialogLayout') + self.logo_label = QtGui.QLabel(about_dialog) + self.logo_label.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png')) + self.logo_label.setObjectName(u'logoLabel') + self.about_dialog_layout.addWidget(self.logo_label) + self.about_notebook = QtGui.QTabWidget(about_dialog) + self.about_notebook.setObjectName(u'aboutNotebook') + self.about_tab = QtGui.QWidget() + self.about_tab.setObjectName(u'aboutTab') + self.about_tab_layout = QtGui.QVBoxLayout(self.about_tab) + self.about_tab_layout.setObjectName(u'aboutTabLayout') + self.about_text_edit = QtGui.QPlainTextEdit(self.about_tab) + self.about_text_edit.setReadOnly(True) + self.about_text_edit.setObjectName(u'aboutTextEdit') + self.about_tab_layout.addWidget(self.about_text_edit) + self.about_notebook.addTab(self.about_tab, u'') + self.credits_tab = QtGui.QWidget() + self.credits_tab.setObjectName(u'creditsTab') + self.credits_tab_layout = QtGui.QVBoxLayout(self.credits_tab) + self.credits_tab_layout.setObjectName(u'creditsTabLayout') + self.credits_text_edit = QtGui.QPlainTextEdit(self.credits_tab) + self.credits_text_edit.setReadOnly(True) + self.credits_text_edit.setObjectName(u'creditsTextEdit') + self.credits_tab_layout.addWidget(self.credits_text_edit) + self.about_notebook.addTab(self.credits_tab, u'') + self.license_tab = QtGui.QWidget() + self.license_tab.setObjectName(u'licenseTab') + self.license_tab_layout = QtGui.QVBoxLayout(self.license_tab) + self.license_tab_layout.setObjectName(u'licenseTabLayout') + self.license_text_edit = QtGui.QPlainTextEdit(self.license_tab) + self.license_text_edit.setReadOnly(True) + self.license_text_edit.setObjectName(u'licenseTextEdit') + self.license_tab_layout.addWidget(self.license_text_edit) + self.about_notebook.addTab(self.license_tab, u'') + self.about_dialog_layout.addWidget(self.about_notebook) + self.volunteer_button = create_button(None, u'volunteerButton', icon=u':/system/system_volunteer.png') + self.button_box = create_button_box(about_dialog, u'button_box', [u'close'], [self.volunteer_button]) + self.about_dialog_layout.addWidget(self.button_box) + self.retranslateUi(about_dialog) + self.about_notebook.setCurrentIndex(0) - def retranslateUi(self, aboutDialog): + def retranslateUi(self, about_dialog): """ Dynamically translate the UI. """ - aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings().About) - self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm', + about_dialog.setWindowTitle(u'%s OpenLP' % UiStrings().About) + self.about_text_edit.setPlainText(translate('OpenLP.AboutForm', 'OpenLP - Open Source Lyrics ' 'Projection\n' '\n' @@ -107,7 +107,7 @@ class Ui_AboutDialog(object): 'like to see more free Christian software being written, please ' 'consider volunteering by using the button below.' )) - self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.aboutTab), UiStrings().About) + self.about_notebook.setTabText(self.about_notebook.indexOf(self.about_tab), UiStrings().About) lead = u'Raoul "superfly" Snyman' developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin', u'Michael "cocooncrash" Gorven', @@ -165,7 +165,7 @@ class Ui_AboutDialog(object): } documentors = [u'Wesley "wrst" Stout', u'John "jseagull1" Cegalis (lead)'] - self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm', + self.credits_text_edit.setPlainText(translate('OpenLP.AboutForm', 'Project Lead\n' ' %s\n' '\n' @@ -268,7 +268,7 @@ class Ui_AboutDialog(object): u'\n '.join(translators[u'ta_LK']), u'\n '.join(translators[u'zh_CN']), u'\n '.join(documentors))) - self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.creditsTab), + self.about_notebook.setTabText(self.about_notebook.indexOf(self.credits_tab), translate('OpenLP.AboutForm', 'Credits')) copyright_note = translate('OpenLP.AboutForm', 'Copyright \xa9 2004-2013 %s\n' @@ -662,7 +662,7 @@ class Ui_AboutDialog(object): 'linking proprietary applications with the library. If this is ' 'what you want to do, use the GNU Lesser General Public License ' 'instead of this License.') - self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (copyright_note, licence, disclaimer, gpltext)) - self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.licenseTab), + self.license_text_edit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (copyright_note, licence, disclaimer, gpltext)) + self.about_notebook.setTabText(self.about_notebook.indexOf(self.license_tab), translate('OpenLP.AboutForm', 'License')) - self.volunteerButton.setText(translate('OpenLP.AboutForm', 'Volunteer')) + self.volunteer_button.setText(translate('OpenLP.AboutForm', 'Volunteer')) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index f814cf8b6..ed38d280b 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -49,15 +49,15 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): QtGui.QDialog.__init__(self, parent) applicationVersion = get_application_version() self.setupUi(self) - about_text = self.aboutTextEdit.toPlainText() + about_text = self.about_text_edit.toPlainText() about_text = about_text.replace(u'', applicationVersion[u'version']) if applicationVersion[u'build']: build_text = translate('OpenLP.AboutForm', ' build %s') % applicationVersion[u'build'] else: build_text = u'' about_text = about_text.replace(u'', build_text) - self.aboutTextEdit.setPlainText(about_text) - QtCore.QObject.connect(self.volunteerButton, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked) + self.about_text_edit.setPlainText(about_text) + QtCore.QObject.connect(self.volunteer_button, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked) def onVolunteerButtonClicked(self): """