From 261328d952a1d7cad22bab43cbc63fb6ce48b301 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 19:31:55 +0000 Subject: [PATCH] Fix last commit --- openlp/core/lib/ui.py | 19 +++++++++++-------- openlp/core/ui/themewizard.py | 3 ++- openlp/plugins/alerts/lib/alertstab.py | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 30f442012..843f4ef92 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -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) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index e50ab0d45..38dd9f1dc 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -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) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 01dbc2f7e..a350c13cc 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -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()