adapt editbibleform - some fixes

This commit is contained in:
Armin Köhler 2012-04-05 20:31:15 +02:00
parent 33dcda419a
commit 06033df8ad
3 changed files with 53 additions and 35 deletions

View File

@ -49,34 +49,52 @@ class Ui_EditBibleDialog(object):
# Meta tab # Meta tab
self.metaTab = QtGui.QWidget() self.metaTab = QtGui.QWidget()
self.metaTab.setObjectName(u'metaTab') self.metaTab.setObjectName(u'metaTab')
self.metaTabLayout = QtGui.QFormLayout(self.metaTab) self.metaTabLayout = QtGui.QVBoxLayout(self.metaTab)
self.metaTabLayout.setObjectName(u'metaTabLayout') self.metaTabLayout.setObjectName(u'metaTabLayout')
self.versionNameLabel = QtGui.QLabel(self.metaTab) self.licenseDetailsGroupBox = QtGui.QGroupBox(self.metaTab)
self.licenseDetailsGroupBox.setObjectName(u'licenseDetailsGroupBox')
self.licenseDetailsLayout = QtGui.QFormLayout(
self.licenseDetailsGroupBox)
self.licenseDetailsLayout.setObjectName(u'licenseDetailsLayout')
self.versionNameLabel = QtGui.QLabel(self.licenseDetailsGroupBox)
self.versionNameLabel.setObjectName(u'versionNameLabel') self.versionNameLabel.setObjectName(u'versionNameLabel')
self.versionNameEdit = QtGui.QLineEdit(self.metaTab) self.versionNameEdit = QtGui.QLineEdit(self.licenseDetailsGroupBox)
self.versionNameEdit.setObjectName(u'versionNameEdit') self.versionNameEdit.setObjectName(u'versionNameEdit')
self.versionNameLabel.setBuddy(self.versionNameEdit) self.versionNameLabel.setBuddy(self.versionNameEdit)
self.metaTabLayout.addRow(self.versionNameLabel, self.versionNameEdit) self.licenseDetailsLayout.addRow(self.versionNameLabel,
self.copyrightLabel = QtGui.QLabel(self.metaTab) self.versionNameEdit)
self.copyrightLabel = QtGui.QLabel(self.licenseDetailsGroupBox)
self.copyrightLabel.setObjectName(u'copyrightLabel') self.copyrightLabel.setObjectName(u'copyrightLabel')
self.copyrightEdit = QtGui.QLineEdit(self.metaTab) self.copyrightEdit = QtGui.QLineEdit(self.licenseDetailsGroupBox)
self.copyrightEdit.setObjectName(u'copyrightEdit') self.copyrightEdit.setObjectName(u'copyrightEdit')
self.copyrightLabel.setBuddy(self.copyrightEdit) self.copyrightLabel.setBuddy(self.copyrightEdit)
self.metaTabLayout.addRow(self.copyrightLabel, self.copyrightEdit) self.licenseDetailsLayout.addRow(self.copyrightLabel,
self.permissionsLabel = QtGui.QLabel(self.metaTab) self.copyrightEdit)
self.permissionsLabel = QtGui.QLabel(self.licenseDetailsGroupBox)
self.permissionsLabel.setObjectName(u'permissionsLabel') self.permissionsLabel.setObjectName(u'permissionsLabel')
self.permissionsEdit = QtGui.QLineEdit(self.metaTab) self.permissionsEdit = QtGui.QLineEdit(self.licenseDetailsGroupBox)
self.permissionsEdit.setObjectName(u'permissionsEdit') self.permissionsEdit.setObjectName(u'permissionsEdit')
self.permissionsLabel.setBuddy(self.permissionsEdit) self.permissionsLabel.setBuddy(self.permissionsEdit)
self.metaTabLayout.addRow(self.permissionsLabel, self.permissionsEdit) self.licenseDetailsLayout.addRow(self.permissionsLabel,
self.languageSelectionLabel = QtGui.QLabel(self.metaTab) self.permissionsEdit)
self.metaTabLayout.addWidget(self.licenseDetailsGroupBox)
self.languageSelectionGroupBox = QtGui.QGroupBox(self.metaTab)
self.languageSelectionGroupBox.setObjectName(
u'languageSelectionGroupBox')
self.languageSelectionLayout = QtGui.QVBoxLayout(
self.languageSelectionGroupBox)
self.languageSelectionLabel = QtGui.QLabel(
self.languageSelectionGroupBox)
self.languageSelectionLabel.setObjectName(u'languageSelectionLabel') self.languageSelectionLabel.setObjectName(u'languageSelectionLabel')
self.languageSelectionComboBox = QtGui.QComboBox(self.metaTab) self.languageSelectionComboBox = QtGui.QComboBox(
self.languageSelectionGroupBox)
self.languageSelectionComboBox.setObjectName( self.languageSelectionComboBox.setObjectName(
u'languageSelectionComboBox') u'languageSelectionComboBox')
self.languageSelectionComboBox.addItems([u'', u'', u'', u'']) self.languageSelectionComboBox.addItems([u'', u'', u'', u''])
self.metaTabLayout.addRow(self.languageSelectionLabel, self.languageSelectionLayout.addWidget(self.languageSelectionLabel)
self.languageSelectionComboBox) self.languageSelectionLayout.addWidget(self.languageSelectionComboBox)
self.metaTabLayout.addWidget(self.languageSelectionGroupBox)
self.metaTabLayout.addStretch()
self.bibleTabWidget.addTab(self.metaTab, u'') self.bibleTabWidget.addTab(self.metaTab, u'')
# Book name tab # Book name tab
self.bookNameTab = QtGui.QWidget() self.bookNameTab = QtGui.QWidget()
@ -97,7 +115,6 @@ class Ui_EditBibleDialog(object):
self.bookNameWidgetLayout.setObjectName(u'bookNameWidgetLayout') self.bookNameWidgetLayout.setObjectName(u'bookNameWidgetLayout')
self.bookNameLabel = {} self.bookNameLabel = {}
self.bookNameEdit= {} self.bookNameEdit= {}
x = 0
for book in BiblesResourcesDB.get_books(): for book in BiblesResourcesDB.get_books():
self.bookNameLabel[book[u'abbreviation']] = QtGui.QLabel( self.bookNameLabel[book[u'abbreviation']] = QtGui.QLabel(
self.bookNameWidget) self.bookNameWidget)
@ -110,7 +127,6 @@ class Ui_EditBibleDialog(object):
self.bookNameWidgetLayout.addRow( self.bookNameWidgetLayout.addRow(
self.bookNameLabel[book[u'abbreviation']], self.bookNameLabel[book[u'abbreviation']],
self.bookNameEdit[book[u'abbreviation']]) self.bookNameEdit[book[u'abbreviation']])
x = x + 1
self.scrollArea.setWidget(self.bookNameWidget) self.scrollArea.setWidget(self.bookNameWidget)
self.bookNameTabLayout.addWidget(self.scrollArea) self.bookNameTabLayout.addWidget(self.scrollArea)
self.bookNameTabLayout.addStretch() self.bookNameTabLayout.addStretch()
@ -126,23 +142,27 @@ class Ui_EditBibleDialog(object):
def retranslateUi(self, editBibleDialog): def retranslateUi(self, editBibleDialog):
self.booknames = BibleStrings().Booknames self.booknames = BibleStrings().Booknames
editBibleDialog.setWindowTitle( editBibleDialog.setWindowTitle(
translate('BiblesPlugin.EditBibleForm', 'Song Editor')) translate('BiblesPlugin.EditBibleForm', 'Bible Editor'))
# Meta tab
self.bibleTabWidget.setTabText( self.bibleTabWidget.setTabText(
self.bibleTabWidget.indexOf(self.metaTab), self.bibleTabWidget.indexOf(self.metaTab),
translate('SongsPlugin.EditBibleForm', 'License Details')) translate('SongsPlugin.EditBibleForm', 'Meta Data'))
self.licenseDetailsGroupBox.setTitle(
translate('BiblesPlugin.EditBibleForm', 'License Details'))
self.versionNameLabel.setText( self.versionNameLabel.setText(
translate('BiblesPlugin.EditBibleForm', 'Version name:')) translate('BiblesPlugin.EditBibleForm', 'Version name:'))
self.copyrightLabel.setText( self.copyrightLabel.setText(
translate('BiblesPlugin.EditBibleForm', 'Copyright:')) translate('BiblesPlugin.EditBibleForm', 'Copyright:'))
self.permissionsLabel.setText( self.permissionsLabel.setText(
translate('BiblesPlugin.EditBibleForm', 'Permissions:')) translate('BiblesPlugin.EditBibleForm', 'Permissions:'))
self.bibleTabWidget.setTabText( self.languageSelectionGroupBox.setTitle(translate(
self.bibleTabWidget.indexOf(self.bookNameTab), 'BiblesPlugin.EditBibleForm', 'Default Bible Language'))
translate('SongsPlugin.EditBibleForm', 'Custom Book Names'))
self.languageSelectionLabel.setText( self.languageSelectionLabel.setText(
translate('BiblesPlugin.EditBibleForm', 'Book name language:')) translate('BiblesPlugin.EditBibleForm',
'Book name language in search field, search results and on '
'display:'))
self.languageSelectionComboBox.setItemText(0, self.languageSelectionComboBox.setItemText(0,
translate('BiblesPlugin.EditBibleForm', 'General Settings')) translate('BiblesPlugin.EditBibleForm', 'Global Settings'))
self.languageSelectionComboBox.setItemText(LanguageSelection.Bible + 1, self.languageSelectionComboBox.setItemText(LanguageSelection.Bible + 1,
translate('BiblesPlugin.EditBibleForm', 'Bible Language')) translate('BiblesPlugin.EditBibleForm', 'Bible Language'))
self.languageSelectionComboBox.setItemText( self.languageSelectionComboBox.setItemText(
@ -151,12 +171,10 @@ class Ui_EditBibleDialog(object):
self.languageSelectionComboBox.setItemText( self.languageSelectionComboBox.setItemText(
LanguageSelection.English + 1, LanguageSelection.English + 1,
translate('BiblesPlugin.EditBibleForm', 'English')) translate('BiblesPlugin.EditBibleForm', 'English'))
self.languageSelectionComboBox.setToolTip( # Book name tab
translate('BiblesPlugin.EditBibleForm', 'Multiple options:\n' self.bibleTabWidget.setTabText(
'General Settings - the option choosen in settings section\n' self.bibleTabWidget.indexOf(self.bookNameTab),
'Bible language - the language in which the Bible book names ' translate('SongsPlugin.EditBibleForm', 'Custom Book Names'))
'were imported\nApplication language - the language you have '
'chosen for OpenLP\nEnglish - always use English book names'))
for book in BiblesResourcesDB.get_books(): for book in BiblesResourcesDB.get_books():
self.bookNameLabel[book[u'abbreviation']].setText( self.bookNameLabel[book[u'abbreviation']].setText(
u'%s:' % unicode(self.booknames[book[u'abbreviation']])) u'%s:' % unicode(self.booknames[book[u'abbreviation']]))

View File

@ -82,12 +82,11 @@ class EditBibleForm(QtGui.QDialog, Ui_EditBibleDialog):
self.bookNameNotice.setText(translate('BiblesPlugin.EditBibleForm', self.bookNameNotice.setText(translate('BiblesPlugin.EditBibleForm',
'This is a webbible.\nIt is not possible to customize the Book ' 'This is a webbible.\nIt is not possible to customize the Book '
'Names.')) 'Names.'))
self.bookNameTabLayout.removeWidget(self.scrollArea) self.scrollArea.hide()
self.scrollArea.setParent(None)
else: else:
self.bookNameNotice.setText(translate('BiblesPlugin.EditBibleForm', self.bookNameNotice.setText(translate('BiblesPlugin.EditBibleForm',
'To use the customized Book Names, choose the option "Bible ' 'To use the customized Book Names, choose the option "Bible '
'language"\nin general settings or explicit for this Bible.')) 'language"\nin global settings or explicit for this Bible.'))
for book in BiblesResourcesDB.get_books(): for book in BiblesResourcesDB.get_books():
self.books[book[u'abbreviation']] = self.manager.get_book_by_id( self.books[book[u'abbreviation']] = self.manager.get_book_by_id(
self.bible, book[u'id']) self.bible, book[u'id'])

View File

@ -276,10 +276,11 @@ class BiblesTab(SettingsTab):
'end marks may be defined.\nThey have to be separated by a ' 'end marks may be defined.\nThey have to be separated by a '
'vertical bar "|".\nPlease clear this edit line to use the ' 'vertical bar "|".\nPlease clear this edit line to use the '
'default value.')) 'default value.'))
self.languageSelectionGroupBox.setTitle(translate('BiblesPlugin.BiblesTab', self.languageSelectionGroupBox.setTitle(translate(
'Default Search Field Language')) 'BiblesPlugin.BiblesTab', 'Default Bible Language'))
self.languageSelectionLabel.setText(translate('BiblesPlugin.BiblesTab', self.languageSelectionLabel.setText(translate('BiblesPlugin.BiblesTab',
'Book name language in search field:')) 'Book name language in search field,\nsearch results and on '
'display:'))
self.languageSelectionComboBox.setItemText(LanguageSelection.Bible, self.languageSelectionComboBox.setItemText(LanguageSelection.Bible,
translate('BiblesPlugin.BiblesTab', 'Bible language')) translate('BiblesPlugin.BiblesTab', 'Bible language'))
self.languageSelectionComboBox.setItemText( self.languageSelectionComboBox.setItemText(