forked from openlp/openlp
aboutform/dialog: code standards
This commit is contained in:
parent
ec56f5ff01
commit
1fe2e31c1d
@ -38,60 +38,60 @@ class Ui_AboutDialog(object):
|
|||||||
The actual GUI widgets for the About form.
|
The actual GUI widgets for the About form.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setupUi(self, aboutDialog):
|
def setupUi(self, about_dialog):
|
||||||
"""
|
"""
|
||||||
Set up the UI for the dialog.
|
Set up the UI for the dialog.
|
||||||
"""
|
"""
|
||||||
aboutDialog.setObjectName(u'aboutDialog')
|
about_dialog.setObjectName(u'aboutDialog')
|
||||||
aboutDialog.setWindowIcon(build_icon(u':/icon/openlp-logo-16x16.png'))
|
about_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo-16x16.png'))
|
||||||
self.aboutDialogLayout = QtGui.QVBoxLayout(aboutDialog)
|
self.about_dialog_layout = QtGui.QVBoxLayout(about_dialog)
|
||||||
self.aboutDialogLayout.setObjectName(u'aboutDialogLayout')
|
self.about_dialog_layout.setObjectName(u'aboutDialogLayout')
|
||||||
self.logoLabel = QtGui.QLabel(aboutDialog)
|
self.logo_label = QtGui.QLabel(about_dialog)
|
||||||
self.logoLabel.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png'))
|
self.logo_label.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png'))
|
||||||
self.logoLabel.setObjectName(u'logoLabel')
|
self.logo_label.setObjectName(u'logoLabel')
|
||||||
self.aboutDialogLayout.addWidget(self.logoLabel)
|
self.about_dialog_layout.addWidget(self.logo_label)
|
||||||
self.aboutNotebook = QtGui.QTabWidget(aboutDialog)
|
self.about_notebook = QtGui.QTabWidget(about_dialog)
|
||||||
self.aboutNotebook.setObjectName(u'aboutNotebook')
|
self.about_notebook.setObjectName(u'aboutNotebook')
|
||||||
self.aboutTab = QtGui.QWidget()
|
self.about_tab = QtGui.QWidget()
|
||||||
self.aboutTab.setObjectName(u'aboutTab')
|
self.about_tab.setObjectName(u'aboutTab')
|
||||||
self.aboutTabLayout = QtGui.QVBoxLayout(self.aboutTab)
|
self.about_tab_layout = QtGui.QVBoxLayout(self.about_tab)
|
||||||
self.aboutTabLayout.setObjectName(u'aboutTabLayout')
|
self.about_tab_layout.setObjectName(u'aboutTabLayout')
|
||||||
self.aboutTextEdit = QtGui.QPlainTextEdit(self.aboutTab)
|
self.about_text_edit = QtGui.QPlainTextEdit(self.about_tab)
|
||||||
self.aboutTextEdit.setReadOnly(True)
|
self.about_text_edit.setReadOnly(True)
|
||||||
self.aboutTextEdit.setObjectName(u'aboutTextEdit')
|
self.about_text_edit.setObjectName(u'aboutTextEdit')
|
||||||
self.aboutTabLayout.addWidget(self.aboutTextEdit)
|
self.about_tab_layout.addWidget(self.about_text_edit)
|
||||||
self.aboutNotebook.addTab(self.aboutTab, u'')
|
self.about_notebook.addTab(self.about_tab, u'')
|
||||||
self.creditsTab = QtGui.QWidget()
|
self.credits_tab = QtGui.QWidget()
|
||||||
self.creditsTab.setObjectName(u'creditsTab')
|
self.credits_tab.setObjectName(u'creditsTab')
|
||||||
self.creditsTabLayout = QtGui.QVBoxLayout(self.creditsTab)
|
self.credits_tab_layout = QtGui.QVBoxLayout(self.credits_tab)
|
||||||
self.creditsTabLayout.setObjectName(u'creditsTabLayout')
|
self.credits_tab_layout.setObjectName(u'creditsTabLayout')
|
||||||
self.creditsTextEdit = QtGui.QPlainTextEdit(self.creditsTab)
|
self.credits_text_edit = QtGui.QPlainTextEdit(self.credits_tab)
|
||||||
self.creditsTextEdit.setReadOnly(True)
|
self.credits_text_edit.setReadOnly(True)
|
||||||
self.creditsTextEdit.setObjectName(u'creditsTextEdit')
|
self.credits_text_edit.setObjectName(u'creditsTextEdit')
|
||||||
self.creditsTabLayout.addWidget(self.creditsTextEdit)
|
self.credits_tab_layout.addWidget(self.credits_text_edit)
|
||||||
self.aboutNotebook.addTab(self.creditsTab, u'')
|
self.about_notebook.addTab(self.credits_tab, u'')
|
||||||
self.licenseTab = QtGui.QWidget()
|
self.license_tab = QtGui.QWidget()
|
||||||
self.licenseTab.setObjectName(u'licenseTab')
|
self.license_tab.setObjectName(u'licenseTab')
|
||||||
self.licenseTabLayout = QtGui.QVBoxLayout(self.licenseTab)
|
self.license_tab_layout = QtGui.QVBoxLayout(self.license_tab)
|
||||||
self.licenseTabLayout.setObjectName(u'licenseTabLayout')
|
self.license_tab_layout.setObjectName(u'licenseTabLayout')
|
||||||
self.licenseTextEdit = QtGui.QPlainTextEdit(self.licenseTab)
|
self.license_text_edit = QtGui.QPlainTextEdit(self.license_tab)
|
||||||
self.licenseTextEdit.setReadOnly(True)
|
self.license_text_edit.setReadOnly(True)
|
||||||
self.licenseTextEdit.setObjectName(u'licenseTextEdit')
|
self.license_text_edit.setObjectName(u'licenseTextEdit')
|
||||||
self.licenseTabLayout.addWidget(self.licenseTextEdit)
|
self.license_tab_layout.addWidget(self.license_text_edit)
|
||||||
self.aboutNotebook.addTab(self.licenseTab, u'')
|
self.about_notebook.addTab(self.license_tab, u'')
|
||||||
self.aboutDialogLayout.addWidget(self.aboutNotebook)
|
self.about_dialog_layout.addWidget(self.about_notebook)
|
||||||
self.volunteerButton = create_button(None, u'volunteerButton', icon=u':/system/system_volunteer.png')
|
self.volunteer_button = 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.button_box = create_button_box(about_dialog, u'button_box', [u'close'], [self.volunteer_button])
|
||||||
self.aboutDialogLayout.addWidget(self.button_box)
|
self.about_dialog_layout.addWidget(self.button_box)
|
||||||
self.retranslateUi(aboutDialog)
|
self.retranslateUi(about_dialog)
|
||||||
self.aboutNotebook.setCurrentIndex(0)
|
self.about_notebook.setCurrentIndex(0)
|
||||||
|
|
||||||
def retranslateUi(self, aboutDialog):
|
def retranslateUi(self, about_dialog):
|
||||||
"""
|
"""
|
||||||
Dynamically translate the UI.
|
Dynamically translate the UI.
|
||||||
"""
|
"""
|
||||||
aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings().About)
|
about_dialog.setWindowTitle(u'%s OpenLP' % UiStrings().About)
|
||||||
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.about_text_edit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'OpenLP <version><revision> - Open Source Lyrics '
|
'OpenLP <version><revision> - Open Source Lyrics '
|
||||||
'Projection\n'
|
'Projection\n'
|
||||||
'\n'
|
'\n'
|
||||||
@ -107,7 +107,7 @@ class Ui_AboutDialog(object):
|
|||||||
'like to see more free Christian software being written, please '
|
'like to see more free Christian software being written, please '
|
||||||
'consider volunteering by using the button below.'
|
'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'
|
lead = u'Raoul "superfly" Snyman'
|
||||||
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
|
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
|
||||||
u'Michael "cocooncrash" Gorven',
|
u'Michael "cocooncrash" Gorven',
|
||||||
@ -165,7 +165,7 @@ class Ui_AboutDialog(object):
|
|||||||
}
|
}
|
||||||
documentors = [u'Wesley "wrst" Stout',
|
documentors = [u'Wesley "wrst" Stout',
|
||||||
u'John "jseagull1" Cegalis (lead)']
|
u'John "jseagull1" Cegalis (lead)']
|
||||||
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.credits_text_edit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'Project Lead\n'
|
'Project Lead\n'
|
||||||
' %s\n'
|
' %s\n'
|
||||||
'\n'
|
'\n'
|
||||||
@ -268,7 +268,7 @@ class Ui_AboutDialog(object):
|
|||||||
u'\n '.join(translators[u'ta_LK']),
|
u'\n '.join(translators[u'ta_LK']),
|
||||||
u'\n '.join(translators[u'zh_CN']),
|
u'\n '.join(translators[u'zh_CN']),
|
||||||
u'\n '.join(documentors)))
|
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'))
|
translate('OpenLP.AboutForm', 'Credits'))
|
||||||
copyright_note = translate('OpenLP.AboutForm',
|
copyright_note = translate('OpenLP.AboutForm',
|
||||||
'Copyright \xa9 2004-2013 %s\n'
|
'Copyright \xa9 2004-2013 %s\n'
|
||||||
@ -662,7 +662,7 @@ class Ui_AboutDialog(object):
|
|||||||
'linking proprietary applications with the library. If this is '
|
'linking proprietary applications with the library. If this is '
|
||||||
'what you want to do, use the GNU Lesser General Public License '
|
'what you want to do, use the GNU Lesser General Public License '
|
||||||
'instead of this 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.license_text_edit.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.about_notebook.setTabText(self.about_notebook.indexOf(self.license_tab),
|
||||||
translate('OpenLP.AboutForm', 'License'))
|
translate('OpenLP.AboutForm', 'License'))
|
||||||
self.volunteerButton.setText(translate('OpenLP.AboutForm', 'Volunteer'))
|
self.volunteer_button.setText(translate('OpenLP.AboutForm', 'Volunteer'))
|
||||||
|
@ -49,15 +49,15 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
|||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
applicationVersion = get_application_version()
|
applicationVersion = get_application_version()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
about_text = self.aboutTextEdit.toPlainText()
|
about_text = self.about_text_edit.toPlainText()
|
||||||
about_text = about_text.replace(u'<version>', applicationVersion[u'version'])
|
about_text = about_text.replace(u'<version>', applicationVersion[u'version'])
|
||||||
if applicationVersion[u'build']:
|
if applicationVersion[u'build']:
|
||||||
build_text = translate('OpenLP.AboutForm', ' build %s') % applicationVersion[u'build']
|
build_text = translate('OpenLP.AboutForm', ' build %s') % applicationVersion[u'build']
|
||||||
else:
|
else:
|
||||||
build_text = u''
|
build_text = u''
|
||||||
about_text = about_text.replace(u'<revision>', build_text)
|
about_text = about_text.replace(u'<revision>', build_text)
|
||||||
self.aboutTextEdit.setPlainText(about_text)
|
self.about_text_edit.setPlainText(about_text)
|
||||||
QtCore.QObject.connect(self.volunteerButton, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked)
|
QtCore.QObject.connect(self.volunteer_button, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked)
|
||||||
|
|
||||||
def onVolunteerButtonClicked(self):
|
def onVolunteerButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user