Fix last commit

This commit is contained in:
Jon Tibble 2011-02-08 19:31:55 +00:00
parent b4d709f5e2
commit 261328d952
3 changed files with 16 additions and 12 deletions

View File

@ -220,11 +220,14 @@ def add_widget_completer(cache, widget):
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
widget.setCompleter(completer)
def create_valign_combo(parent, layout):
def create_valign_combo(form, parent, layout):
"""
Creates a standard label and combo box for asking users to select a
vertical alignment.
``form``
The UI screen that the label and combo will appear on.
``parent``
The parent object. This should be a ``QWidget`` descendant.
@ -234,10 +237,10 @@ def create_valign_combo(parent, layout):
verticalLabel = QtGui.QLabel(parent)
verticalLabel.setObjectName(u'VerticalLabel')
verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
verticalComboBox = QtGui.QComboBox(parent)
verticalComboBox.setObjectName(u'VerticalComboBox')
verticalComboBox.addItem(translate('OpenLP.Ui', 'Top'))
verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle'))
verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom'))
verticalLabel.setBuddy(verticalComboBox)
layout.addRow(verticalLabel, verticalComboBox)
form.verticalComboBox = QtGui.QComboBox(parent)
form.verticalComboBox.setObjectName(u'VerticalComboBox')
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom'))
verticalLabel.setBuddy(form.verticalComboBox)
layout.addRow(verticalLabel, form.verticalComboBox)

View File

@ -242,7 +242,8 @@ class Ui_ThemeWizard(object):
self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
self.alignmentLayout.addRow(self.horizontalLabel,
self.horizontalComboBox)
create_valign_combo(self.alignmentPage, self.alignmentLayout)
create_valign_combo(themeWizard, self.alignmentPage,
self.alignmentLayout)
self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
self.transitionsLabel.setObjectName(u'TransitionsLabel')
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)

View File

@ -76,7 +76,7 @@ class AlertsTab(SettingsTab):
self.TimeoutSpinBox.setMaximum(180)
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox)
create_valign_combo(self.fontGroupBox, self.fontLayout)
create_valign_combo(self, self.fontGroupBox, self.fontLayout)
self.leftLayout.addWidget(self.fontGroupBox)
self.leftLayout.addStretch()
self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn)
@ -171,7 +171,7 @@ class AlertsTab(SettingsTab):
u'background-color: %s' % self.font_color)
self.BackgroundColorButton.setStyleSheet(
u'background-color: %s' % self.bg_color)
self.LocationComboBox.setCurrentIndex(self.location)
self.verticalComboBox.setCurrentIndex(self.location)
font = QtGui.QFont()
font.setFamily(self.font_face)
self.FontComboBox.setCurrentFont(font)
@ -186,7 +186,7 @@ class AlertsTab(SettingsTab):
self.font_face = self.FontComboBox.currentFont().family()
settings.setValue(u'font face', QtCore.QVariant(self.font_face))
settings.setValue(u'timeout', QtCore.QVariant(self.timeout))
self.location = self.LocationComboBox.currentIndex()
self.location = self.verticalComboBox.currentIndex()
settings.setValue(u'location', QtCore.QVariant(self.location))
settings.endGroup()