Half plugin tabs done

This commit is contained in:
Tim Bentley 2013-03-16 16:59:10 +00:00
parent e641c0e8b3
commit 19c05a7fc0
9 changed files with 680 additions and 683 deletions

View File

@ -342,8 +342,7 @@ class Manager(object):
if try_count >= 2:
raise
def get_all_objects(self, object_class, filter_clause=None,
order_by_ref=None):
def get_all_objects(self, object_class, filter_clause=None, order_by_ref=None):
"""
Returns all the objects from the database

View File

@ -36,6 +36,7 @@ from PyQt4 import QtGui
from openlp.core.lib import Registry
class SettingsTab(QtGui.QWidget):
"""
SettingsTab is a helper widget for plugins to define Tabs for the settings
@ -52,11 +53,11 @@ class SettingsTab(QtGui.QWidget):
The title of the tab, which is usually displayed on the tab.
"""
QtGui.QWidget.__init__(self, parent)
self.tabTitle = title
self.tabTitleVisible = visible_title
self.settingsSection = self.tabTitle.lower()
self.tab_title = title
self.tab_title_visible = visible_title
self.settings_section = self.tab_title.lower()
if icon_path:
self.iconPath = icon_path
self.icon_path = icon_path
self.setupUi()
self.retranslateUi()
self.initialise()
@ -66,20 +67,20 @@ class SettingsTab(QtGui.QWidget):
"""
Setup the tab's interface.
"""
self.tabLayout = QtGui.QHBoxLayout(self)
self.tabLayout.setObjectName(u'tabLayout')
self.leftColumn = QtGui.QWidget(self)
self.leftColumn.setObjectName(u'leftColumn')
self.leftLayout = QtGui.QVBoxLayout(self.leftColumn)
self.leftLayout.setMargin(0)
self.leftLayout.setObjectName(u'leftLayout')
self.tabLayout.addWidget(self.leftColumn)
self.rightColumn = QtGui.QWidget(self)
self.rightColumn.setObjectName(u'rightColumn')
self.rightLayout = QtGui.QVBoxLayout(self.rightColumn)
self.rightLayout.setMargin(0)
self.rightLayout.setObjectName(u'rightLayout')
self.tabLayout.addWidget(self.rightColumn)
self.tab_layout = QtGui.QHBoxLayout(self)
self.tab_layout.setObjectName(u'tab_layout')
self.left_column = QtGui.QWidget(self)
self.left_column.setObjectName(u'left_column')
self.left_layout = QtGui.QVBoxLayout(self.left_column)
self.left_layout.setMargin(0)
self.left_layout.setObjectName(u'left_layout')
self.tab_layout.addWidget(self.left_column)
self.right_column = QtGui.QWidget(self)
self.right_column.setObjectName(u'right_column')
self.right_layout = QtGui.QVBoxLayout(self.right_column)
self.right_layout.setMargin(0)
self.right_layout.setObjectName(u'right_layout')
self.tab_layout.addWidget(self.right_column)
def resizeEvent(self, event=None):
"""
@ -87,11 +88,11 @@ class SettingsTab(QtGui.QWidget):
"""
if event:
QtGui.QWidget.resizeEvent(self, event)
width = self.width() - self.tabLayout.spacing() - \
self.tabLayout.contentsMargins().left() - self.tabLayout.contentsMargins().right()
left_width = min(width - self.rightColumn.minimumSizeHint().width(), width / 2)
left_width = max(left_width, self.leftColumn.minimumSizeHint().width())
self.leftColumn.setFixedWidth(left_width)
width = self.width() - self.tab_layout.spacing() - \
self.tab_layout.contentsMargins().left() - self.tab_layout.contentsMargins().right()
left_width = min(width - self.right_column.minimumSizeHint().width(), width / 2)
left_width = max(left_width, self.left_column.minimumSizeHint().width())
self.left_column.setFixedWidth(left_width)
def retranslateUi(self):
"""
@ -133,7 +134,7 @@ class SettingsTab(QtGui.QWidget):
"""
pass
def tabVisible(self):
def tab_visible(self):
"""
Tab has just been made visible to the user
"""

View File

@ -55,7 +55,7 @@ class AdvancedTab(SettingsTab):
self.default_image = u':/graphics/openlp-splash-screen.png'
self.default_color = u'#ffffff'
self.data_exists = False
self.iconPath = u':/system/system_settings.png'
self.icon_path = u':/system/system_settings.png'
advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced')
SettingsTab.__init__(self, parent, u'Advanced', advanced_translated)
@ -65,7 +65,7 @@ class AdvancedTab(SettingsTab):
"""
self.setObjectName(u'AdvancedTab')
SettingsTab.setupUi(self)
self.ui_group_box = QtGui.QGroupBox(self.leftColumn)
self.ui_group_box = QtGui.QGroupBox(self.left_column)
self.ui_group_box.setObjectName(u'ui_group_box')
self.ui_layout = QtGui.QFormLayout(self.ui_group_box)
self.ui_layout.setObjectName(u'ui_layout')
@ -90,9 +90,9 @@ class AdvancedTab(SettingsTab):
self.enable_auto_close_check_box = QtGui.QCheckBox(self.ui_group_box)
self.enable_auto_close_check_box.setObjectName(u'enable_auto_close_check_box')
self.ui_layout.addRow(self.enable_auto_close_check_box)
self.leftLayout.addWidget(self.ui_group_box)
self.left_layout.addWidget(self.ui_group_box)
# Default service name
self.service_name_group_box = QtGui.QGroupBox(self.leftColumn)
self.service_name_group_box = QtGui.QGroupBox(self.left_column)
self.service_name_group_box.setObjectName(u'service_name_group_box')
self.service_name_layout = QtGui.QFormLayout(self.service_name_group_box)
self.service_name_check_box = QtGui.QCheckBox(self.service_name_group_box)
@ -129,9 +129,9 @@ class AdvancedTab(SettingsTab):
self.service_name_example = QtGui.QLabel(self.service_name_group_box)
self.service_name_example.setObjectName(u'service_name_example')
self.service_name_layout.addRow(self.service_name_example_label, self.service_name_example)
self.leftLayout.addWidget(self.service_name_group_box)
self.left_layout.addWidget(self.service_name_group_box)
# Data Directory
self.data_directory_group_box = QtGui.QGroupBox(self.leftColumn)
self.data_directory_group_box = QtGui.QGroupBox(self.left_column)
self.data_directory_group_box.setObjectName(u'data_directory_group_box')
self.data_directory_layout = QtGui.QFormLayout(self.data_directory_group_box)
self.data_directory_layout.setObjectName(u'data_directory_layout')
@ -172,10 +172,10 @@ class AdvancedTab(SettingsTab):
self.data_directory_layout.addRow(self.data_directory_new_label, self.new_data_directory_label_layout)
self.data_directory_layout.addRow(self.data_directory_copy_check_layout)
self.data_directory_layout.addRow(self.new_data_directory_has_files_label)
self.leftLayout.addWidget(self.data_directory_group_box)
self.leftLayout.addStretch()
self.left_layout.addWidget(self.data_directory_group_box)
self.left_layout.addStretch()
# Default Image
self.default_image_group_box = QtGui.QGroupBox(self.rightColumn)
self.default_image_group_box = QtGui.QGroupBox(self.right_column)
self.default_image_group_box.setObjectName(u'default_image_group_box')
self.default_image_layout = QtGui.QFormLayout(self.default_image_group_box)
self.default_image_layout.setObjectName(u'default_image_layout')
@ -200,18 +200,18 @@ class AdvancedTab(SettingsTab):
self.default_file_layout.addWidget(self.default_browse_button)
self.default_file_layout.addWidget(self.default_revert_button)
self.default_image_layout.addRow(self.default_file_label, self.default_file_layout)
self.rightLayout.addWidget(self.default_image_group_box)
self.right_layout.addWidget(self.default_image_group_box)
# Hide mouse
self.hide_mouse_group_box = QtGui.QGroupBox(self.rightColumn)
self.hide_mouse_group_box = QtGui.QGroupBox(self.right_column)
self.hide_mouse_group_box.setObjectName(u'hide_mouse_group_box')
self.hide_mouse_layout = QtGui.QVBoxLayout(self.hide_mouse_group_box)
self.hide_mouse_layout.setObjectName(u'hide_mouse_layout')
self.hide_mouse_check_box = QtGui.QCheckBox(self.hide_mouse_group_box)
self.hide_mouse_check_box.setObjectName(u'hide_mouse_check_box')
self.hide_mouse_layout.addWidget(self.hide_mouse_check_box)
self.rightLayout.addWidget(self.hide_mouse_group_box)
self.right_layout.addWidget(self.hide_mouse_group_box)
# Service Item Slide Limits
self.slide_group_box = QtGui.QGroupBox(self.rightColumn)
self.slide_group_box = QtGui.QGroupBox(self.right_column)
self.slide_group_box.setObjectName(u'slide_group_box')
self.slide_layout = QtGui.QVBoxLayout(self.slide_group_box)
self.slide_layout.setObjectName(u'slide_layout')
@ -227,9 +227,9 @@ class AdvancedTab(SettingsTab):
self.next_item_radio_button = QtGui.QRadioButton(self.slide_group_box)
self.next_item_radio_button.setObjectName(u'next_item_radio_button')
self.slide_layout.addWidget(self.next_item_radio_button)
self.rightLayout.addWidget(self.slide_group_box)
self.right_layout.addWidget(self.slide_group_box)
# Display Workarounds
self.display_workaround_group_box = QtGui.QGroupBox(self.leftColumn)
self.display_workaround_group_box = QtGui.QGroupBox(self.left_column)
self.display_workaround_group_box.setObjectName(u'display_workaround_group_box')
self.display_workaround_layout = QtGui.QVBoxLayout(self.display_workaround_group_box)
self.display_workaround_layout.setObjectName(u'display_workaround_layout')
@ -239,8 +239,8 @@ class AdvancedTab(SettingsTab):
self.alternate_rows_check_box = QtGui.QCheckBox(self.display_workaround_group_box)
self.alternate_rows_check_box.setObjectName(u'alternate_rows_check_box')
self.display_workaround_layout.addWidget(self.alternate_rows_check_box)
self.rightLayout.addWidget(self.display_workaround_group_box)
self.rightLayout.addStretch()
self.right_layout.addWidget(self.display_workaround_group_box)
self.right_layout.addStretch()
self.should_update_service_name_example = False
self.service_name_check_box.toggled.connect(self.service_name_check_box_toggled)
self.service_name_day.currentIndexChanged.connect(self.on_service_name_day_changed)
@ -259,7 +259,6 @@ class AdvancedTab(SettingsTab):
self.wrap_slide_radio_button.clicked.connect(self.on_wrap_slide_button_clicked)
self.next_item_radio_button.clicked.connect(self.on_next_item_button_clicked)
def retranslateUi(self):
"""
Setup the interface translation strings.
@ -334,7 +333,7 @@ class AdvancedTab(SettingsTab):
Load settings from disk.
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.beginGroup(self.settings_section)
# The max recent files value does not have an interface and so never
# gets actually stored in the settings therefore the default value of
# 20 will always be used.
@ -406,7 +405,7 @@ class AdvancedTab(SettingsTab):
Save settings to disk.
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.beginGroup(self.settings_section)
settings.setValue(u'default service enabled', self.service_name_check_box.isChecked())
service_name = self.service_name_edit.text()
preset_is_valid = self.generate_service_name_example()[0]

View File

@ -48,8 +48,8 @@ class GeneralTab(SettingsTab):
"""
self.screens = ScreenList()
self.iconPath = u':/icon/openlp-logo-16x16.png'
generalTranslated = translate('OpenLP.GeneralTab', 'General')
SettingsTab.__init__(self, parent, u'General', generalTranslated)
general_translated = translate('OpenLP.GeneralTab', 'General')
SettingsTab.__init__(self, parent, u'General', general_translated)
def setupUi(self):
"""
@ -59,185 +59,185 @@ class GeneralTab(SettingsTab):
SettingsTab.setupUi(self)
self.tabLayout.setStretch(1, 1)
# Monitors
self.monitorGroupBox = QtGui.QGroupBox(self.leftColumn)
self.monitorGroupBox.setObjectName(u'monitorGroupBox')
self.monitorLayout = QtGui.QGridLayout(self.monitorGroupBox)
self.monitorLayout.setObjectName(u'monitorLayout')
self.monitorRadioButton = QtGui.QRadioButton(self.monitorGroupBox)
self.monitorRadioButton.setObjectName(u'monitorRadioButton')
self.monitorLayout.addWidget(self.monitorRadioButton, 0, 0, 1, 5)
self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox)
self.monitorComboBox.setObjectName(u'monitorComboBox')
self.monitorLayout.addWidget(self.monitorComboBox, 1, 1, 1, 4)
self.monitor_group_box = QtGui.QGroupBox(self.left_column)
self.monitor_group_box.setObjectName(u'monitor_group_box')
self.monitor_layout = QtGui.QGridLayout(self.monitor_group_box)
self.monitor_layout.setObjectName(u'monitor_layout')
self.monitor_radio_button = QtGui.QRadioButton(self.monitor_group_box)
self.monitor_radio_button.setObjectName(u'monitor_radio_button')
self.monitor_layout.addWidget(self.monitor_radio_button, 0, 0, 1, 5)
self.monitor_combo_box = QtGui.QComboBox(self.monitor_group_box)
self.monitor_combo_box.setObjectName(u'monitor_combo_box')
self.monitor_layout.addWidget(self.monitor_combo_box, 1, 1, 1, 4)
# Display Position
self.overrideRadioButton = QtGui.QRadioButton(self.monitorGroupBox)
self.overrideRadioButton.setObjectName(u'overrideRadioButton')
self.monitorLayout.addWidget(self.overrideRadioButton, 2, 0, 1, 5)
self.override_radio_button = QtGui.QRadioButton(self.monitor_group_box)
self.override_radio_button.setObjectName(u'override_radio_button')
self.monitor_layout.addWidget(self.override_radio_button, 2, 0, 1, 5)
# Custom position
self.customXLabel = QtGui.QLabel(self.monitorGroupBox)
self.customXLabel.setObjectName(u'customXLabel')
self.monitorLayout.addWidget(self.customXLabel, 3, 1)
self.customXValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
self.customXValueEdit.setObjectName(u'customXValueEdit')
self.customXValueEdit.setRange(-9999, 9999)
self.monitorLayout.addWidget(self.customXValueEdit, 4, 1)
self.customYLabel = QtGui.QLabel(self.monitorGroupBox)
self.customYLabel.setObjectName(u'customYLabel')
self.monitorLayout.addWidget(self.customYLabel, 3, 2)
self.customYValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
self.customYValueEdit.setObjectName(u'customYValueEdit')
self.customYValueEdit.setRange(-9999, 9999)
self.monitorLayout.addWidget(self.customYValueEdit, 4, 2)
self.customWidthLabel = QtGui.QLabel(self.monitorGroupBox)
self.customWidthLabel.setObjectName(u'customWidthLabel')
self.monitorLayout.addWidget(self.customWidthLabel, 3, 3)
self.customWidthValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
self.customWidthValueEdit.setMaximum(9999)
self.monitorLayout.addWidget(self.customWidthValueEdit, 4, 3)
self.customHeightLabel = QtGui.QLabel(self.monitorGroupBox)
self.customHeightLabel.setObjectName(u'customHeightLabel')
self.monitorLayout.addWidget(self.customHeightLabel, 3, 4)
self.customHeightValueEdit = QtGui.QSpinBox(self.monitorGroupBox)
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
self.customHeightValueEdit.setMaximum(9999)
self.monitorLayout.addWidget(self.customHeightValueEdit, 4, 4)
self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
self.monitorLayout.addWidget(self.displayOnMonitorCheck, 5, 0, 1, 5)
self.custom_x_label = QtGui.QLabel(self.monitor_group_box)
self.custom_x_label.setObjectName(u'custom_x_label')
self.monitor_layout.addWidget(self.custom_x_label, 3, 1)
self.custom_X_value_edit = QtGui.QSpinBox(self.monitor_group_box)
self.custom_X_value_edit.setObjectName(u'custom_X_value_edit')
self.custom_X_value_edit.setRange(-9999, 9999)
self.monitor_layout.addWidget(self.custom_X_value_edit, 4, 1)
self.custom_y_label = QtGui.QLabel(self.monitor_group_box)
self.custom_y_label.setObjectName(u'custom_y_label')
self.monitor_layout.addWidget(self.custom_y_label, 3, 2)
self.custom_Y_value_edit = QtGui.QSpinBox(self.monitor_group_box)
self.custom_Y_value_edit.setObjectName(u'custom_Y_value_edit')
self.custom_Y_value_edit.setRange(-9999, 9999)
self.monitor_layout.addWidget(self.custom_Y_value_edit, 4, 2)
self.custom_width_label = QtGui.QLabel(self.monitor_group_box)
self.custom_width_label.setObjectName(u'custom_width_label')
self.monitor_layout.addWidget(self.custom_width_label, 3, 3)
self.custom_width_value_edit = QtGui.QSpinBox(self.monitor_group_box)
self.custom_width_value_edit.setObjectName(u'custom_width_value_edit')
self.custom_width_value_edit.setMaximum(9999)
self.monitor_layout.addWidget(self.custom_width_value_edit, 4, 3)
self.custom_height_label = QtGui.QLabel(self.monitor_group_box)
self.custom_height_label.setObjectName(u'custom_height_label')
self.monitor_layout.addWidget(self.custom_height_label, 3, 4)
self.custom_height_value_edit = QtGui.QSpinBox(self.monitor_group_box)
self.custom_height_value_edit.setObjectName(u'custom_height_value_edit')
self.custom_height_value_edit.setMaximum(9999)
self.monitor_layout.addWidget(self.custom_height_value_edit, 4, 4)
self.display_on_monitor_check = QtGui.QCheckBox(self.monitor_group_box)
self.display_on_monitor_check.setObjectName(u'monitor_combo_box')
self.monitor_layout.addWidget(self.display_on_monitor_check, 5, 0, 1, 5)
# Set up the stretchiness of each column, so that the first column
# less stretchy (and therefore smaller) than the others
self.monitorLayout.setColumnStretch(0, 1)
self.monitorLayout.setColumnStretch(1, 3)
self.monitorLayout.setColumnStretch(2, 3)
self.monitorLayout.setColumnStretch(3, 3)
self.monitorLayout.setColumnStretch(4, 3)
self.leftLayout.addWidget(self.monitorGroupBox)
self.monitor_layout.setColumnStretch(0, 1)
self.monitor_layout.setColumnStretch(1, 3)
self.monitor_layout.setColumnStretch(2, 3)
self.monitor_layout.setColumnStretch(3, 3)
self.monitor_layout.setColumnStretch(4, 3)
self.left_layout.addWidget(self.monitor_group_box)
# CCLI Details
self.ccliGroupBox = QtGui.QGroupBox(self.leftColumn)
self.ccliGroupBox.setObjectName(u'ccliGroupBox')
self.ccliLayout = QtGui.QFormLayout(self.ccliGroupBox)
self.ccliLayout.setObjectName(u'ccliLayout')
self.numberLabel = QtGui.QLabel(self.ccliGroupBox)
self.numberLabel.setObjectName(u'numberLabel')
self.numberEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.numberEdit.setValidator(QtGui.QIntValidator())
self.numberEdit.setObjectName(u'numberEdit')
self.ccliLayout.addRow(self.numberLabel, self.numberEdit)
self.usernameLabel = QtGui.QLabel(self.ccliGroupBox)
self.usernameLabel.setObjectName(u'usernameLabel')
self.usernameEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.usernameEdit.setObjectName(u'usernameEdit')
self.ccliLayout.addRow(self.usernameLabel, self.usernameEdit)
self.passwordLabel = QtGui.QLabel(self.ccliGroupBox)
self.passwordLabel.setObjectName(u'passwordLabel')
self.passwordEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.passwordEdit.setEchoMode(QtGui.QLineEdit.Password)
self.passwordEdit.setObjectName(u'passwordEdit')
self.ccliLayout.addRow(self.passwordLabel, self.passwordEdit)
self.leftLayout.addWidget(self.ccliGroupBox)
self.ccli_group_box = QtGui.QGroupBox(self.left_column)
self.ccli_group_box.setObjectName(u'ccli_group_box')
self.ccli_layout = QtGui.QFormLayout(self.ccli_group_box)
self.ccli_layout.setObjectName(u'ccli_layout')
self.number_label = QtGui.QLabel(self.ccli_group_box)
self.number_label.setObjectName(u'number_label')
self.number_edit = QtGui.QLineEdit(self.ccli_group_box)
self.number_edit.setValidator(QtGui.QIntValidator())
self.number_edit.setObjectName(u'number_edit')
self.ccli_layout.addRow(self.number_label, self.number_edit)
self.username_label = QtGui.QLabel(self.ccli_group_box)
self.username_label.setObjectName(u'username_label')
self.username_edit = QtGui.QLineEdit(self.ccli_group_box)
self.username_edit.setObjectName(u'username_edit')
self.ccli_layout.addRow(self.username_label, self.username_edit)
self.password_label = QtGui.QLabel(self.ccli_group_box)
self.password_label.setObjectName(u'password_label')
self.password_edit = QtGui.QLineEdit(self.ccli_group_box)
self.password_edit.setEchoMode(QtGui.QLineEdit.Password)
self.password_edit.setObjectName(u'password_edit')
self.ccli_layout.addRow(self.password_label, self.password_edit)
self.left_layout.addWidget(self.ccli_group_box)
# Background audio
self.audioGroupBox = QtGui.QGroupBox(self.leftColumn)
self.audioGroupBox.setObjectName(u'audioGroupBox')
self.audioLayout = QtGui.QVBoxLayout(self.audioGroupBox)
self.audioLayout.setObjectName(u'audioLayout')
self.startPausedCheckBox = QtGui.QCheckBox(self.audioGroupBox)
self.startPausedCheckBox.setObjectName(u'startPausedCheckBox')
self.audioLayout.addWidget(self.startPausedCheckBox)
self.repeatListCheckBox = QtGui.QCheckBox(self.audioGroupBox)
self.repeatListCheckBox.setObjectName(u'repeatListCheckBox')
self.audioLayout.addWidget(self.repeatListCheckBox)
self.leftLayout.addWidget(self.audioGroupBox)
self.leftLayout.addStretch()
self.audio_group_box = QtGui.QGroupBox(self.left_column)
self.audio_group_box.setObjectName(u'audio_group_box')
self.audio_layout = QtGui.QVBoxLayout(self.audio_group_box)
self.audio_layout.setObjectName(u'audio_layout')
self.start_paused_check_box = QtGui.QCheckBox(self.audio_group_box)
self.start_paused_check_box.setObjectName(u'start_paused_check_box')
self.audio_layout.addWidget(self.start_paused_check_box)
self.repeat_list_check_box = QtGui.QCheckBox(self.audio_group_box)
self.repeat_list_check_box.setObjectName(u'repeat_list_check_box')
self.audio_layout.addWidget(self.repeat_list_check_box)
self.left_layout.addWidget(self.audio_group_box)
self.left_layout.addStretch()
# Application Startup
self.startupGroupBox = QtGui.QGroupBox(self.rightColumn)
self.startupGroupBox.setObjectName(u'startupGroupBox')
self.startupLayout = QtGui.QVBoxLayout(self.startupGroupBox)
self.startupLayout.setObjectName(u'startupLayout')
self.warningCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.warningCheckBox.setObjectName(u'warningCheckBox')
self.startupLayout.addWidget(self.warningCheckBox)
self.autoOpenCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.autoOpenCheckBox.setObjectName(u'autoOpenCheckBox')
self.startupLayout.addWidget(self.autoOpenCheckBox)
self.showSplashCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.showSplashCheckBox.setObjectName(u'showSplashCheckBox')
self.startupLayout.addWidget(self.showSplashCheckBox)
self.checkForUpdatesCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.checkForUpdatesCheckBox.setObjectName(u'checkForUpdatesCheckBox')
self.startupLayout.addWidget(self.checkForUpdatesCheckBox)
self.rightLayout.addWidget(self.startupGroupBox)
self.startup_group_box = QtGui.QGroupBox(self.right_column)
self.startup_group_box.setObjectName(u'startup_group_box')
self.startup_layout = QtGui.QVBoxLayout(self.startup_group_box)
self.startup_layout.setObjectName(u'startup_layout')
self.warning_check_box = QtGui.QCheckBox(self.startup_group_box)
self.warning_check_box.setObjectName(u'warning_check_box')
self.startup_layout.addWidget(self.warning_check_box)
self.auto_open_check_box = QtGui.QCheckBox(self.startup_group_box)
self.auto_open_check_box.setObjectName(u'auto_open_check_box')
self.startup_layout.addWidget(self.auto_open_check_box)
self.show_splash_check_box = QtGui.QCheckBox(self.startup_group_box)
self.show_splash_check_box.setObjectName(u'show_splash_check_box')
self.startup_layout.addWidget(self.show_splash_check_box)
self.check_for_updates_check_box = QtGui.QCheckBox(self.startup_group_box)
self.check_for_updates_check_box.setObjectName(u'check_for_updates_check_box')
self.startup_layout.addWidget(self.check_for_updates_check_box)
self.right_layout.addWidget(self.startup_group_box)
# Application Settings
self.settingsGroupBox = QtGui.QGroupBox(self.rightColumn)
self.settingsGroupBox.setObjectName(u'settingsGroupBox')
self.settingsLayout = QtGui.QFormLayout(self.settingsGroupBox)
self.settingsLayout.setObjectName(u'settingsLayout')
self.saveCheckServiceCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.saveCheckServiceCheckBox.setObjectName(u'saveCheckServiceCheckBox')
self.settingsLayout.addRow(self.saveCheckServiceCheckBox)
self.autoUnblankCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.autoUnblankCheckBox.setObjectName(u'autoUnblankCheckBox')
self.settingsLayout.addRow(self.autoUnblankCheckBox)
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
self.settingsLayout.addRow(self.autoPreviewCheckBox)
self.settings_group_box = QtGui.QGroupBox(self.right_column)
self.settings_group_box.setObjectName(u'settings_group_box')
self.settings_layout = QtGui.QFormLayout(self.settings_group_box)
self.settings_layout.setObjectName(u'settings_layout')
self.save_check_service_check_box = QtGui.QCheckBox(self.settings_group_box)
self.save_check_service_check_box.setObjectName(u'save_check_service_check_box')
self.settings_layout.addRow(self.save_check_service_check_box)
self.auto_unblank_check_box = QtGui.QCheckBox(self.settings_group_box)
self.auto_unblank_check_box.setObjectName(u'auto_unblank_check_box')
self.settings_layout.addRow(self.auto_unblank_check_box)
self.auto_preview_check_box = QtGui.QCheckBox(self.settings_group_box)
self.auto_preview_check_box.setObjectName(u'auto_preview_check_box')
self.settings_layout.addRow(self.auto_preview_check_box)
# Moved here from image tab
self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox)
self.timeoutLabel.setObjectName(u'timeoutLabel')
self.timeoutSpinBox = QtGui.QSpinBox(self.settingsGroupBox)
self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
self.timeoutSpinBox.setRange(1, 180)
self.settingsLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
self.rightLayout.addWidget(self.settingsGroupBox)
self.rightLayout.addStretch()
self.timeout_label = QtGui.QLabel(self.settings_group_box)
self.timeout_label.setObjectName(u'timeout_label')
self.timeout_spin_box = QtGui.QSpinBox(self.settings_group_box)
self.timeout_spin_box.setObjectName(u'timeout_spin_box')
self.timeout_spin_box.setRange(1, 180)
self.settings_layout.addRow(self.timeout_label, self.timeout_spin_box)
self.right_layout.addWidget(self.settings_group_box)
self.right_layout.addStretch()
# Signals and slots
self.overrideRadioButton.toggled.connect(self.onOverrideRadioButtonPressed)
self.customHeightValueEdit.valueChanged.connect(self.onDisplayChanged)
self.customWidthValueEdit.valueChanged.connect(self.onDisplayChanged)
self.customYValueEdit.valueChanged.connect(self.onDisplayChanged)
self.customXValueEdit.valueChanged.connect(self.onDisplayChanged)
self.monitorComboBox.currentIndexChanged.connect(self.onDisplayChanged)
self.override_radio_button.toggled.connect(self.on_override_radio_button_pressed)
self.custom_height_value_edit.valueChanged.connect(self.on_display_changed)
self.custom_width_value_edit.valueChanged.connect(self.on_display_changed)
self.custom_Y_value_edit.valueChanged.connect(self.on_display_changed)
self.custom_X_value_edit.valueChanged.connect(self.on_display_changed)
self.monitor_combo_box.currentIndexChanged.connect(self.on_display_changed)
# Reload the tab, as the screen resolution/count may have changed.
Registry().register_function(u'config_screen_changed', self.load)
# Remove for now
self.usernameLabel.setVisible(False)
self.usernameEdit.setVisible(False)
self.passwordLabel.setVisible(False)
self.passwordEdit.setVisible(False)
self.username_label.setVisible(False)
self.username_edit.setVisible(False)
self.password_label.setVisible(False)
self.password_edit.setVisible(False)
def retranslateUi(self):
"""
Translate the general settings tab to the currently selected language
"""
self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General')
self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
self.monitorRadioButton.setText(translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
self.displayOnMonitorCheck.setText(translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startupGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Startup'))
self.warningCheckBox.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning'))
self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service'))
self.showSplashCheckBox.setText(translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.checkForUpdatesCheckBox.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.settingsGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab',
self.tab_title_visible = translate('OpenLP.GeneralTab', 'General')
self.monitor_group_box.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
self.monitor_radio_button.setText(translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
self.display_on_monitor_check.setText(translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startup_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Startup'))
self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning'))
self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service'))
self.show_splash_check_box.setText(translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.settings_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
self.save_check_service_check_box.setText(translate('OpenLP.GeneralTab',
'Prompt to save before starting a new service'))
self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item'))
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
self.ccliGroupBox.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(UiStrings().CCLINumberLabel)
self.usernameLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect password:'))
self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item'))
self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service'))
self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:'))
self.timeout_spin_box.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
self.ccli_group_box.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details'))
self.number_label.setText(UiStrings().CCLInumber_label)
self.username_label.setText(translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.password_label.setText(translate('OpenLP.GeneralTab', 'SongSelect password:'))
# Moved from display tab
self.overrideRadioButton.setText(translate('OpenLP.GeneralTab', 'Override display position:'))
self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
self.audioGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Background Audio'))
self.startPausedCheckBox.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
self.repeatListCheckBox.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
self.override_radio_button.setText(translate('OpenLP.GeneralTab', 'Override display position:'))
self.custom_x_label.setText(translate('OpenLP.GeneralTab', 'X'))
self.custom_y_label.setText(translate('OpenLP.GeneralTab', 'Y'))
self.custom_height_label.setText(translate('OpenLP.GeneralTab', 'Height'))
self.custom_width_label.setText(translate('OpenLP.GeneralTab', 'Width'))
self.audio_group_box.setTitle(translate('OpenLP.GeneralTab', 'Background Audio'))
self.start_paused_check_box.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
self.repeat_list_check_box.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
def load(self):
"""
@ -245,36 +245,36 @@ class GeneralTab(SettingsTab):
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
self.monitorComboBox.clear()
self.monitorComboBox.addItems(self.screens.get_screen_list())
self.monitor_combo_box.clear()
self.monitor_combo_box.addItems(self.screens.get_screen_list())
monitorNumber = settings.value(u'monitor')
self.monitorComboBox.setCurrentIndex(monitorNumber)
self.numberEdit.setText(settings.value(u'ccli number'))
self.usernameEdit.setText(settings.value(u'songselect username'))
self.passwordEdit.setText(settings.value(u'songselect password'))
self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt'))
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank'))
self.displayOnMonitorCheck.setChecked(self.screens.display)
self.warningCheckBox.setChecked(settings.value(u'blank warning'))
self.autoOpenCheckBox.setChecked(settings.value(u'auto open'))
self.showSplashCheckBox.setChecked(settings.value(u'show splash'))
self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check'))
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview'))
self.timeoutSpinBox.setValue(settings.value(u'loop delay'))
self.monitorRadioButton.setChecked(not settings.value(u'override position',))
self.overrideRadioButton.setChecked(settings.value(u'override position'))
self.customXValueEdit.setValue(settings.value(u'x position'))
self.customYValueEdit.setValue(settings.value(u'y position'))
self.customHeightValueEdit.setValue(settings.value(u'height'))
self.customWidthValueEdit.setValue(settings.value(u'width'))
self.startPausedCheckBox.setChecked(settings.value(u'audio start paused'))
self.repeatListCheckBox.setChecked(settings.value(u'audio repeat list'))
self.monitor_combo_box.setCurrentIndex(monitorNumber)
self.number_edit.setText(settings.value(u'ccli number'))
self.username_edit.setText(settings.value(u'songselect username'))
self.password_edit.setText(settings.value(u'songselect password'))
self.save_check_service_check_box.setChecked(settings.value(u'save prompt'))
self.auto_unblank_check_box.setChecked(settings.value(u'auto unblank'))
self.display_on_monitor_check.setChecked(self.screens.display)
self.warning_check_box.setChecked(settings.value(u'blank warning'))
self.auto_open_check_box.setChecked(settings.value(u'auto open'))
self.show_splash_check_box.setChecked(settings.value(u'show splash'))
self.check_for_updates_check_box.setChecked(settings.value(u'update check'))
self.auto_preview_check_box.setChecked(settings.value(u'auto preview'))
self.timeout_spin_box.setValue(settings.value(u'loop delay'))
self.monitor_radio_button.setChecked(not settings.value(u'override position',))
self.override_radio_button.setChecked(settings.value(u'override position'))
self.custom_X_value_edit.setValue(settings.value(u'x position'))
self.custom_Y_value_edit.setValue(settings.value(u'y position'))
self.custom_height_value_edit.setValue(settings.value(u'height'))
self.custom_width_value_edit.setValue(settings.value(u'width'))
self.start_paused_check_box.setChecked(settings.value(u'audio start paused'))
self.repeat_list_check_box.setChecked(settings.value(u'audio repeat list'))
settings.endGroup()
self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customHeightValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customWidthValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.monitor_combo_box.setDisabled(self.override_radio_button.isChecked())
self.custom_X_value_edit.setEnabled(self.override_radio_button.isChecked())
self.custom_Y_value_edit.setEnabled(self.override_radio_button.isChecked())
self.custom_height_value_edit.setEnabled(self.override_radio_button.isChecked())
self.custom_width_value_edit.setEnabled(self.override_radio_button.isChecked())
self.display_changed = False
settings.beginGroup(self.settingsSection)
@ -284,26 +284,26 @@ class GeneralTab(SettingsTab):
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'monitor', self.monitorComboBox.currentIndex())
settings.setValue(u'display on monitor', self.displayOnMonitorCheck.isChecked())
settings.setValue(u'blank warning', self.warningCheckBox.isChecked())
settings.setValue(u'auto open', self.autoOpenCheckBox.isChecked())
settings.setValue(u'show splash', self.showSplashCheckBox.isChecked())
settings.setValue(u'update check', self.checkForUpdatesCheckBox.isChecked())
settings.setValue(u'save prompt', self.saveCheckServiceCheckBox.isChecked())
settings.setValue(u'auto unblank', self.autoUnblankCheckBox.isChecked())
settings.setValue(u'auto preview', self.autoPreviewCheckBox.isChecked())
settings.setValue(u'loop delay', self.timeoutSpinBox.value())
settings.setValue(u'ccli number', self.numberEdit.displayText())
settings.setValue(u'songselect username', self.usernameEdit.displayText())
settings.setValue(u'songselect password', self.passwordEdit.displayText())
settings.setValue(u'x position', self.customXValueEdit.value())
settings.setValue(u'y position', self.customYValueEdit.value())
settings.setValue(u'height', self.customHeightValueEdit.value())
settings.setValue(u'width', self.customWidthValueEdit.value())
settings.setValue(u'override position', self.overrideRadioButton.isChecked())
settings.setValue(u'audio start paused', self.startPausedCheckBox.isChecked())
settings.setValue(u'audio repeat list', self.repeatListCheckBox.isChecked())
settings.setValue(u'monitor', self.monitor_combo_box.currentIndex())
settings.setValue(u'display on monitor', self.display_on_monitor_check.isChecked())
settings.setValue(u'blank warning', self.warning_check_box.isChecked())
settings.setValue(u'auto open', self.auto_open_check_box.isChecked())
settings.setValue(u'show splash', self.show_splash_check_box.isChecked())
settings.setValue(u'update check', self.check_for_updates_check_box.isChecked())
settings.setValue(u'save prompt', self.save_check_service_check_box.isChecked())
settings.setValue(u'auto unblank', self.auto_unblank_check_box.isChecked())
settings.setValue(u'auto preview', self.auto_preview_check_box.isChecked())
settings.setValue(u'loop delay', self.timeout_spin_box.value())
settings.setValue(u'ccli number', self.number_edit.displayText())
settings.setValue(u'songselect username', self.username_edit.displayText())
settings.setValue(u'songselect password', self.password_edit.displayText())
settings.setValue(u'x position', self.custom_X_value_edit.value())
settings.setValue(u'y position', self.custom_Y_value_edit.value())
settings.setValue(u'height', self.custom_height_value_edit.value())
settings.setValue(u'width', self.custom_width_value_edit.value())
settings.setValue(u'override position', self.override_radio_button.isChecked())
settings.setValue(u'audio start paused', self.start_paused_check_box.isChecked())
settings.setValue(u'audio repeat list', self.repeat_list_check_box.isChecked())
settings.endGroup()
# On save update the screens as well
self.post_set_up(True)
@ -317,14 +317,14 @@ class GeneralTab(SettingsTab):
# Do not continue on start up.
if not postUpdate:
return
self.screens.set_current_display(self.monitorComboBox.currentIndex())
self.screens.display = self.displayOnMonitorCheck.isChecked()
self.screens.set_current_display(self.monitor_combo_box.currentIndex())
self.screens.display = self.display_on_monitor_check.isChecked()
self.screens.override[u'size'] = QtCore.QRect(
self.customXValueEdit.value(),
self.customYValueEdit.value(),
self.customWidthValueEdit.value(),
self.customHeightValueEdit.value())
if self.overrideRadioButton.isChecked():
self.custom_X_value_edit.value(),
self.custom_Y_value_edit.value(),
self.custom_width_value_edit.value(),
self.custom_height_value_edit.value())
if self.override_radio_button.isChecked():
self.screens.set_override_display()
else:
self.screens.reset_current_display()
@ -332,21 +332,21 @@ class GeneralTab(SettingsTab):
self.settings_form.register_post_process(u'config_screen_changed')
self.display_changed = False
def onOverrideRadioButtonPressed(self, checked):
def on_override_radio_button_pressed(self, checked):
"""
Toggle screen state depending on check box state.
``checked``
The state of the check box (boolean).
"""
self.monitorComboBox.setDisabled(checked)
self.customXValueEdit.setEnabled(checked)
self.customYValueEdit.setEnabled(checked)
self.customHeightValueEdit.setEnabled(checked)
self.customWidthValueEdit.setEnabled(checked)
self.monitor_combo_box.setDisabled(checked)
self.custom_X_value_edit.setEnabled(checked)
self.custom_Y_value_edit.setEnabled(checked)
self.custom_height_value_edit.setEnabled(checked)
self.custom_width_value_edit.setEnabled(checked)
self.display_changed = True
def onDisplayChanged(self):
def on_display_changed(self):
"""
Called when the width, height, x position or y position has changed.
"""

View File

@ -40,13 +40,13 @@ class ThemesTab(SettingsTab):
"""
ThemesTab is the theme settings tab in the settings dialog.
"""
def __init__(self, parent):
def _init_(self, parent):
"""
Constructor
"""
generalTranslated = translate('OpenLP.ThemesTab', 'Themes')
SettingsTab.__init__(self, parent, u'Themes', generalTranslated)
self.iconPath = u':/themes/theme_new.png'
theme_translated = translate('OpenLP.ThemesTab', 'Themes')
SettingsTab._init_(self, parent, u'Themes', theme_translated)
self.icon_path = u':/themes/theme_new.png'
def setupUi(self):
"""
@ -54,74 +54,74 @@ class ThemesTab(SettingsTab):
"""
self.setObjectName(u'ThemesTab')
SettingsTab.setupUi(self)
self.GlobalGroupBox = QtGui.QGroupBox(self.leftColumn)
self.GlobalGroupBox.setObjectName(u'GlobalGroupBox')
self.GlobalGroupBoxLayout = QtGui.QVBoxLayout(self.GlobalGroupBox)
self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout')
self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox)
self.DefaultComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
self.DefaultComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.DefaultComboBox.setObjectName(u'DefaultComboBox')
self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox)
self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox)
self.DefaultListView.setObjectName(u'DefaultListView')
self.GlobalGroupBoxLayout.addWidget(self.DefaultListView)
self.leftLayout.addWidget(self.GlobalGroupBox)
self.leftLayout.addStretch()
self.LevelGroupBox = QtGui.QGroupBox(self.rightColumn)
self.LevelGroupBox.setObjectName(u'LevelGroupBox')
self.LevelLayout = QtGui.QFormLayout(self.LevelGroupBox)
self.LevelLayout.setLabelAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.LevelLayout.setFormAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.LevelLayout.setObjectName(u'LevelLayout')
self.SongLevelRadioButton = QtGui.QRadioButton(self.LevelGroupBox)
self.SongLevelRadioButton.setObjectName(u'SongLevelRadioButton')
self.SongLevelLabel = QtGui.QLabel(self.LevelGroupBox)
self.SongLevelLabel.setObjectName(u'SongLevelLabel')
self.LevelLayout.addRow(self.SongLevelRadioButton, self.SongLevelLabel)
self.ServiceLevelRadioButton = QtGui.QRadioButton(self.LevelGroupBox)
self.ServiceLevelRadioButton.setObjectName(u'ServiceLevelRadioButton')
self.ServiceLevelLabel = QtGui.QLabel(self.LevelGroupBox)
self.ServiceLevelLabel.setObjectName(u'ServiceLevelLabel')
self.LevelLayout.addRow(self.ServiceLevelRadioButton, self.ServiceLevelLabel)
self.GlobalLevelRadioButton = QtGui.QRadioButton(self.LevelGroupBox)
self.GlobalLevelRadioButton.setObjectName(u'GlobalLevelRadioButton')
self.GlobalLevelLabel = QtGui.QLabel(self.LevelGroupBox)
self.GlobalLevelLabel.setObjectName(u'GlobalLevelLabel')
self.LevelLayout.addRow(self.GlobalLevelRadioButton, self.GlobalLevelLabel)
label_top_margin = (self.SongLevelRadioButton.sizeHint().height() -
self.SongLevelLabel.sizeHint().height()) / 2
for label in [self.SongLevelLabel, self.ServiceLevelLabel, self.GlobalLevelLabel]:
self.global_group_box = QtGui.QGroupBox(self.left_column)
self.global_group_box.setObjectName(u'global_group_box')
self.global_group_box_layout = QtGui.QVBoxLayout(self.global_group_box)
self.global_group_box_layout.setObjectName(u'global_group_box_layout')
self.default_combo_box = QtGui.QComboBox(self.global_group_box)
self.default_combo_box.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
self.default_combo_box.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.default_combo_box.setObjectName(u'default_combo_box')
self.global_group_box_layout.addWidget(self.default_combo_box)
self.default_list_view = QtGui.QLabel(self.global_group_box)
self.default_list_view.setObjectName(u'default_list_view')
self.global_group_box_layout.addWidget(self.default_list_view)
self.left_layout.addWidget(self.global_group_box)
self.left_layout.addStretch()
self.level_group_box = QtGui.QGroupBox(self.right_column)
self.level_group_box.setObjectName(u'level_group_box')
self.level_layout = QtGui.QFormLayout(self.level_group_box)
self.level_layout.set_labelAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.level_layout.setFormAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.level_layout.setObjectName(u'level_layout')
self.song_level_radio_button = QtGui.Q_radio_button(self.level_group_box)
self.song_level_radio_button.setObjectName(u'song_level_radio_button')
self.song_level_label = QtGui.QLabel(self.level_group_box)
self.song_level_label.setObjectName(u'song_level_label')
self.level_layout.addRow(self.song_level_radio_button, self.song_level_label)
self.service_level_radio_button = QtGui.Q_radio_button(self.level_group_box)
self.service_level_radio_button.setObjectName(u'service_level_radio_button')
self.service_level_label = QtGui.QLabel(self.level_group_box)
self.service_level_label.setObjectName(u'service_level_label')
self.level_layout.addRow(self.service_level_radio_button, self.service_level_label)
self.global_level_radio_button = QtGui.Q_radio_button(self.level_group_box)
self.global_level_radio_button.setObjectName(u'global_level_radio_button')
self.global_level_label = QtGui.QLabel(self.level_group_box)
self.global_level_label.setObjectName(u'global_level_label')
self.level_layout.addRow(self.global_level_radio_button, self.global_level_label)
label_top_margin = (self.song_level_radio_button.sizeHint().height() -
self.song_level_label.sizeHint().height()) / 2
for label in [self.song_level_label, self.service_level_label, self.global_level_label]:
rect = label.rect()
rect.setTop(rect.top() + label_top_margin)
label.setFrameRect(rect)
label.setWordWrap(True)
self.rightLayout.addWidget(self.LevelGroupBox)
self.rightLayout.addStretch()
self.SongLevelRadioButton.clicked.connect(self.onSongLevelButtonClicked)
self.ServiceLevelRadioButton.clicked.connect(self.onServiceLevelButtonClicked)
self.GlobalLevelRadioButton.clicked.connect(self.onGlobalLevelButtonClicked)
self.DefaultComboBox.activated.connect(self.onDefaultComboBoxChanged)
self.right_layout.addWidget(self.level_group_box)
self.right_layout.addStretch()
self.song_level_radio_button.clicked.connect(self.on_song_level_button_clicked)
self.service_level_radio_button.clicked.connect(self.on_service_level_button_Clicked)
self.global_level_radio_button.clicked.connect(self.on_global_level_buttonClicked)
self.default_combo_box.activated.connect(self.on_default_combo_box_changed)
Registry().register_function(u'theme_update_list', self.update_theme_list)
def retranslateUi(self):
"""
Translate the UI on the fly
"""
self.tabTitleVisible = UiStrings().Themes
self.GlobalGroupBox.setTitle(translate('OpenLP.ThemesTab', 'Global Theme'))
self.LevelGroupBox.setTitle(translate('OpenLP.ThemesTab', 'Theme Level'))
self.SongLevelRadioButton.setText(translate('OpenLP.ThemesTab', 'S&ong Level'))
self.SongLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the theme from each song '
self.tab_title_visible = UiStrings().Themes
self.global_group_box.setTitle(translate('OpenLP.ThemesTab', 'Global Theme'))
self.level_group_box.setTitle(translate('OpenLP.ThemesTab', 'Theme Level'))
self.song_level_radio_button.setText(translate('OpenLP.ThemesTab', 'S&ong Level'))
self.song_level_label.setText(translate('OpenLP.ThemesTab', 'Use the theme from each song '
'in the database. If a song doesn\'t have a theme associated with '
'it, then use the service\'s theme. If the service doesn\'t have '
'a theme, then use the global theme.'))
self.ServiceLevelRadioButton.setText(translate('OpenLP.ThemesTab', '&Service Level'))
self.ServiceLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the theme from the service, '
self.service_level_radio_button.setText(translate('OpenLP.ThemesTab', '&Service Level'))
self.service_level_label.setText(translate('OpenLP.ThemesTab', 'Use the theme from the service, '
'overriding any of the individual songs\' themes. If the '
'service doesn\'t have a theme, then use the global theme.'))
self.GlobalLevelRadioButton.setText(translate('OpenLP.ThemesTab', '&Global Level'))
self.GlobalLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
self.global_level_radio_button.setText(translate('OpenLP.ThemesTab', '&Global Level'))
self.global_level_label.setText(translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
'any themes associated with either the service or the songs.'))
def load(self):
@ -134,11 +134,11 @@ class ThemesTab(SettingsTab):
self.global_theme = settings.value(u'global theme')
settings.endGroup()
if self.theme_level == ThemeLevel.Global:
self.GlobalLevelRadioButton.setChecked(True)
self.global_level_radio_button.setChecked(True)
elif self.theme_level == ThemeLevel.Service:
self.ServiceLevelRadioButton.setChecked(True)
self.service_level_radio_button.setChecked(True)
else:
self.SongLevelRadioButton.setChecked(True)
self.song_level_radio_button.setChecked(True)
def save(self):
"""
@ -158,31 +158,31 @@ class ThemesTab(SettingsTab):
"""
Registry().execute(u'theme_update_global')
def onSongLevelButtonClicked(self):
def on_song_level_Button_clicked(self):
"""
Set the theme level
"""
self.theme_level = ThemeLevel.Song
def onServiceLevelButtonClicked(self):
def on_service_levelButton_clicked(self):
"""
Set the theme level
"""
self.theme_level = ThemeLevel.Service
def onGlobalLevelButtonClicked(self):
def on_global_levelButton_clicked(self):
"""
Set the theme level
"""
self.theme_level = ThemeLevel.Global
def onDefaultComboBoxChanged(self, value):
def on_default_combo_box_changed(self, value):
"""
Set the global default theme
"""
self.global_theme = self.DefaultComboBox.currentText()
self.global_theme = self.default_combo_box.currentText()
self.renderer.set_global_theme()
self.__previewGlobalTheme()
self._previewGlobalTheme()
def update_theme_list(self, theme_list):
"""
@ -194,16 +194,16 @@ class ThemesTab(SettingsTab):
[u'Bible Theme', u'Song Theme']
"""
# Reload as may have been triggered by the ThemeManager.
self.global_theme = Settings().value(self.settingsSection + u'/global theme')
self.DefaultComboBox.clear()
self.DefaultComboBox.addItems(theme_list)
find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme)
self.global_theme = Settings().value(self.settings_section + u'/global theme')
self.default_combo_box.clear()
self.default_combo_box.addItems(theme_list)
find_and_set_in_combo_box(self.default_combo_box, self.global_theme)
self.renderer.set_global_theme()
self.renderer.set_theme_level(self.theme_level)
if self.global_theme is not u'':
self.__previewGlobalTheme()
self._preview_global_theme()
def __previewGlobalTheme(self):
def _preview_global_theme(self):
"""
Utility method to update the global theme preview image.
"""
@ -211,4 +211,4 @@ class ThemesTab(SettingsTab):
preview = QtGui.QPixmap(unicode(image))
if not preview.isNull():
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(preview)
self.default_list_view.setPixmap(preview)

View File

@ -43,99 +43,99 @@ class AlertsTab(SettingsTab):
def setupUi(self):
self.setObjectName(u'AlertsTab')
SettingsTab.setupUi(self)
self.fontGroupBox = QtGui.QGroupBox(self.leftColumn)
self.fontGroupBox.setObjectName(u'fontGroupBox')
self.fontLayout = QtGui.QFormLayout(self.fontGroupBox)
self.fontLayout.setObjectName(u'fontLayout')
self.fontLabel = QtGui.QLabel(self.fontGroupBox)
self.fontLabel.setObjectName(u'fontLabel')
self.fontComboBox = QtGui.QFontComboBox(self.fontGroupBox)
self.fontComboBox.setObjectName(u'fontComboBox')
self.fontLayout.addRow(self.fontLabel, self.fontComboBox)
self.fontColorLabel = QtGui.QLabel(self.fontGroupBox)
self.fontColorLabel.setObjectName(u'fontColorLabel')
self.colorLayout = QtGui.QHBoxLayout()
self.colorLayout.setObjectName(u'colorLayout')
self.fontColorButton = QtGui.QPushButton(self.fontGroupBox)
self.fontColorButton.setObjectName(u'fontColorButton')
self.colorLayout.addWidget(self.fontColorButton)
self.colorLayout.addSpacing(20)
self.backgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
self.backgroundColorLabel.setObjectName(u'backgroundColorLabel')
self.colorLayout.addWidget(self.backgroundColorLabel)
self.backgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
self.backgroundColorButton.setObjectName(u'backgroundColorButton')
self.colorLayout.addWidget(self.backgroundColorButton)
self.fontLayout.addRow(self.fontColorLabel, self.colorLayout)
self.fontSizeLabel = QtGui.QLabel(self.fontGroupBox)
self.fontSizeLabel.setObjectName(u'fontSizeLabel')
self.fontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.fontSizeSpinBox.setObjectName(u'fontSizeSpinBox')
self.fontLayout.addRow(self.fontSizeLabel, self.fontSizeSpinBox)
self.timeoutLabel = QtGui.QLabel(self.fontGroupBox)
self.timeoutLabel.setObjectName(u'timeoutLabel')
self.timeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.timeoutSpinBox.setMaximum(180)
self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
self.fontLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.fontGroupBox)
self.verticalLabel.setObjectName(u'verticalLabel')
self.verticalComboBox.setObjectName(u'verticalComboBox')
self.fontLayout.addRow(self.verticalLabel, self.verticalComboBox)
self.leftLayout.addWidget(self.fontGroupBox)
self.leftLayout.addStretch()
self.previewGroupBox = QtGui.QGroupBox(self.rightColumn)
self.previewGroupBox.setObjectName(u'previewGroupBox')
self.previewLayout = QtGui.QVBoxLayout(self.previewGroupBox)
self.previewLayout.setObjectName(u'previewLayout')
self.fontPreview = QtGui.QLineEdit(self.previewGroupBox)
self.fontPreview.setObjectName(u'fontPreview')
self.previewLayout.addWidget(self.fontPreview)
self.rightLayout.addWidget(self.previewGroupBox)
self.rightLayout.addStretch()
self.font_group_box = QtGui.QGroupBox(self.leftColumn)
self.font_group_box.setObjectName(u'font_group_box')
self.font_layout = QtGui.QFormLayout(self.font_group_box)
self.font_layout.setObjectName(u'font_layout')
self.font_label = QtGui.QLabel(self.font_group_box)
self.font_label.setObjectName(u'font_label')
self.font_combo_box = QtGui.QFontComboBox(self.font_group_box)
self.font_combo_box.setObjectName(u'font_combo_box')
self.font_layout.addRow(self.font_label, self.font_combo_box)
self.font_color_label = QtGui.QLabel(self.font_group_box)
self.font_color_label.setObjectName(u'font_color_label')
self.color_layout = QtGui.QHBoxLayout()
self.color_layout.setObjectName(u'color_layout')
self.font_color_button = QtGui.QPushButton(self.font_group_box)
self.font_color_button.setObjectName(u'font_color_button')
self.color_layout.addWidget(self.font_color_button)
self.color_layout.addSpacing(20)
self.background_color_label = QtGui.QLabel(self.font_group_box)
self.background_color_label.setObjectName(u'background_color_label')
self.color_layout.addWidget(self.background_color_label)
self.background_color_button = QtGui.QPushButton(self.font_group_box)
self.background_color_button.setObjectName(u'background_color_button')
self.color_layout.addWidget(self.background_color_button)
self.font_layout.addRow(self.font_color_label, self.color_layout)
self.font_size_label = QtGui.QLabel(self.font_group_box)
self.font_size_label.setObjectName(u'font_size_label')
self.font_size_spin_box = QtGui.QSpinBox(self.font_group_box)
self.font_size_spin_box.setObjectName(u'font_size_spin_box')
self.font_layout.addRow(self.font_size_label, self.font_size_spin_box)
self.timeout_label = QtGui.QLabel(self.font_group_box)
self.timeout_label.setObjectName(u'timeout_label')
self.timeout_spin_box = QtGui.QSpinBox(self.font_group_box)
self.timeout_spin_box.setMaximum(180)
self.timeout_spin_box.setObjectName(u'timeout_spin_box')
self.font_layout.addRow(self.timeout_label, self.timeout_spin_box)
self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.font_group_box)
self.vertical_label.setObjectName(u'vertical_label')
self.vertical_combo_box.setObjectName(u'vertical_combo_box')
self.font_layout.addRow(self.vertical_label, self.vertical_combo_box)
self.left_layout.addWidget(self.font_group_box)
self.left_layout.addStretch()
self.preview_group_box = QtGui.QGroupBox(self.rightColumn)
self.preview_group_box.setObjectName(u'preview_group_box')
self.preview_layout = QtGui.QVBoxLayout(self.preview_group_box)
self.preview_layout.setObjectName(u'preview_layout')
self.font_preview = QtGui.QLineEdit(self.preview_group_box)
self.font_preview.setObjectName(u'font_preview')
self.preview_layout.addWidget(self.font_preview)
self.right_layout.addWidget(self.preview_group_box)
self.right_layout.addStretch()
# Signals and slots
self.backgroundColorButton.clicked.connect(self.onBackgroundColorButtonClicked)
self.fontColorButton.clicked.connect(self.onFontColorButtonClicked)
self.fontComboBox.activated.connect(self.onFontComboBoxClicked)
self.timeoutSpinBox.valueChanged.connect(self.onTimeoutSpinBoxChanged)
self.fontSizeSpinBox.valueChanged.connect(self.onFontSizeSpinBoxChanged)
self.background_color_button.clicked.connect(self.on_background_color_button_clicked)
self.font_color_button.clicked.connect(self.onFontColor_button_clicked)
self.font_combo_box.activated.connect(self.onFontcombo_box_clicked)
self.timeout_spin_box.valueChanged.connect(self.onTimeout_spin_box_changed)
self.font_size_spin_box.valueChanged.connect(self.onfont_size_spin_box_changed)
def retranslateUi(self):
self.fontGroupBox.setTitle(translate('AlertsPlugin.AlertsTab', 'Font'))
self.fontLabel.setText(translate('AlertsPlugin.AlertsTab', 'Font name:'))
self.fontColorLabel.setText(translate('AlertsPlugin.AlertsTab', 'Font color:'))
self.backgroundColorLabel.setText(translate('AlertsPlugin.AlertsTab', 'Background color:'))
self.fontSizeLabel.setText(translate('AlertsPlugin.AlertsTab', 'Font size:'))
self.fontSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
self.timeoutLabel.setText(translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.timeoutSpinBox.setSuffix(UiStrings().Seconds)
self.previewGroupBox.setTitle(UiStrings().Preview)
self.fontPreview.setText(UiStrings().OLPV2x)
self.font_group_box.setTitle(translate('AlertsPlugin.AlertsTab', 'Font'))
self.font_label.setText(translate('AlertsPlugin.AlertsTab', 'Font name:'))
self.font_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Font color:'))
self.background_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Background color:'))
self.font_size_label.setText(translate('AlertsPlugin.AlertsTab', 'Font size:'))
self.font_size_spin_box.setSuffix(UiStrings().font_sizePtUnit)
self.timeout_label.setText(translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.timeout_spin_box.setSuffix(UiStrings().Seconds)
self.preview_group_box.setTitle(UiStrings().Preview)
self.font_preview.setText(UiStrings().OLPV2x)
def onBackgroundColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor(QtGui.QColor(self.bg_color), self)
def on_background_color_button_clicked(self):
new_color = QtGui.QColorDialog.getColor(QtGui.QColor(self.background_color), self)
if new_color.isValid():
self.bg_color = new_color.name()
self.backgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color)
self.updateDisplay()
self.background_color = new_color.name()
self.background_color_button.setStyleSheet(u'background-color: %s' % self.background_color)
self.update_display()
def onFontComboBoxClicked(self):
self.updateDisplay()
def on_font_combo_box_clicked(self):
self.update_display()
def onFontColorButtonClicked(self):
def on_font_color_button_clicked(self):
new_color = QtGui.QColorDialog.getColor(QtGui.QColor(self.font_color), self)
if new_color.isValid():
self.font_color = new_color.name()
self.fontColorButton.setStyleSheet(u'background-color: %s' % self.font_color)
self.updateDisplay()
self.font_color_button.setStyleSheet(u'background-color: %s' % self.font_color)
self.update_display()
def onTimeoutSpinBoxChanged(self):
self.timeout = self.timeoutSpinBox.value()
def on_timeout_spin_box_changed(self):
self.timeout = self.timeout_spin_box.value()
self.changed = True
def onFontSizeSpinBoxChanged(self):
self.font_size = self.fontSizeSpinBox.value()
self.updateDisplay()
def on_font_size_spin_box_changed(self):
self.font_size = self.font_size_spin_box.value()
self.update_display()
def load(self):
settings = Settings()
@ -143,45 +143,45 @@ class AlertsTab(SettingsTab):
self.timeout = settings.value(u'timeout')
self.font_color = settings.value(u'font color')
self.font_size = settings.value(u'font size')
self.bg_color = settings.value(u'background color')
self.background_color = settings.value(u'background color')
self.font_face = settings.value(u'font face')
self.location = settings.value(u'location')
settings.endGroup()
self.fontSizeSpinBox.setValue(self.font_size)
self.timeoutSpinBox.setValue(self.timeout)
self.fontColorButton.setStyleSheet(u'background-color: %s' % self.font_color)
self.backgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color)
self.verticalComboBox.setCurrentIndex(self.location)
self.font_size_spin_box.setValue(self.font_size)
self.timeout_spin_box.setValue(self.timeout)
self.font_color_button.setStyleSheet(u'background-color: %s' % self.font_color)
self.background_color_button.setStyleSheet(u'background-color: %s' % self.background_color)
self.vertical_combo_box.setCurrentIndex(self.location)
font = QtGui.QFont()
font.setFamily(self.font_face)
self.fontComboBox.setCurrentFont(font)
self.updateDisplay()
self.font_combo_box.setCurrentFont(font)
self.update_display()
self.changed = False
def save(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
# Check value has changed as no event handles this field
if settings.value(u'location') != self.verticalComboBox.currentIndex():
if settings.value(u'location') != self.vertical_combo_box.currentIndex():
self.changed = True
settings.setValue(u'background color', self.bg_color)
settings.setValue(u'background color', self.background_color)
settings.setValue(u'font color', self.font_color)
settings.setValue(u'font size', self.font_size)
self.font_face = self.fontComboBox.currentFont().family()
self.font_face = self.font_combo_box.currentFont().family()
settings.setValue(u'font face', self.font_face)
settings.setValue(u'timeout', self.timeout)
self.location = self.verticalComboBox.currentIndex()
self.location = self.vertical_combo_box.currentIndex()
settings.setValue(u'location', self.location)
settings.endGroup()
if self.changed:
self.settings_form.register_post_process(u'update_display_css')
self.changed = False
def updateDisplay(self):
def update_display(self):
font = QtGui.QFont()
font.setFamily(self.fontComboBox.currentFont().family())
font.setFamily(self.font_combo_box.currentFont().family())
font.setBold(True)
font.setPointSize(self.font_size)
self.fontPreview.setFont(font)
self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' % (self.bg_color, self.font_color))
self.font_preview.setFont(font)
self.font_preview.setStyleSheet(u'background-color: %s; color: %s' % (self.background_color, self.font_color))
self.changed = True

View File

@ -38,13 +38,14 @@ from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, update_referenc
log = logging.getLogger(__name__)
class BiblesTab(SettingsTab):
"""
BiblesTab is the Bibles settings tab in the settings dialog.
"""
log.info(u'Bible Tab loaded')
def __init__(self, parent, title, visible_title, icon_path):
def _init_(self, parent, title, visible_title, icon_path):
self.paragraph_style = True
self.show_new_chapters = False
self.display_style = 0
@ -53,248 +54,247 @@ class BiblesTab(SettingsTab):
def setupUi(self):
self.setObjectName(u'BiblesTab')
SettingsTab.setupUi(self)
self.verseDisplayGroupBox = QtGui.QGroupBox(self.leftColumn)
self.verseDisplayGroupBox.setObjectName(u'verseDisplayGroupBox')
self.verseDisplayLayout = QtGui.QFormLayout(self.verseDisplayGroupBox)
self.verseDisplayLayout.setObjectName(u'verseDisplayLayout')
self.newChaptersCheckBox = QtGui.QCheckBox(self.verseDisplayGroupBox)
self.newChaptersCheckBox.setObjectName(u'newChaptersCheckBox')
self.verseDisplayLayout.addRow(self.newChaptersCheckBox)
self.displayStyleLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.displayStyleLabel.setObjectName(u'displayStyleLabel')
self.displayStyleComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.displayStyleComboBox.addItems([u'', u'', u'', u''])
self.displayStyleComboBox.setObjectName(u'displayStyleComboBox')
self.verseDisplayLayout.addRow(self.displayStyleLabel, self.displayStyleComboBox)
self.layoutStyleLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.layoutStyleLabel.setObjectName(u'layoutStyleLabel')
self.layoutStyleComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.layoutStyleComboBox.setObjectName(u'layoutStyleComboBox')
self.layoutStyleComboBox.addItems([u'', u'', u''])
self.verseDisplayLayout.addRow(self.layoutStyleLabel, self.layoutStyleComboBox)
self.bibleSecondCheckBox = QtGui.QCheckBox(self.verseDisplayGroupBox)
self.bibleSecondCheckBox.setObjectName(u'bibleSecondCheckBox')
self.verseDisplayLayout.addRow(self.bibleSecondCheckBox)
self.bibleThemeLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.bibleThemeLabel.setObjectName(u'BibleThemeLabel')
self.bibleThemeComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.bibleThemeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
self.bibleThemeComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.bibleThemeComboBox.addItem(u'')
self.bibleThemeComboBox.setObjectName(u'BibleThemeComboBox')
self.verseDisplayLayout.addRow(self.bibleThemeLabel, self.bibleThemeComboBox)
self.changeNoteLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.changeNoteLabel.setWordWrap(True)
self.changeNoteLabel.setObjectName(u'changeNoteLabel')
self.verseDisplayLayout.addRow(self.changeNoteLabel)
self.leftLayout.addWidget(self.verseDisplayGroupBox)
self.scriptureReferenceGroupBox = QtGui.QGroupBox(self.leftColumn)
self.scriptureReferenceGroupBox.setObjectName(u'scriptureReferenceGroupBox')
self.scriptureReferenceLayout = QtGui.QGridLayout(self.scriptureReferenceGroupBox)
self.verseSeparatorCheckBox = QtGui.QCheckBox(self.scriptureReferenceGroupBox)
self.verseSeparatorCheckBox.setObjectName(u'verseSeparatorCheckBox')
self.scriptureReferenceLayout.addWidget(self.verseSeparatorCheckBox, 0, 0)
self.verseSeparatorLineEdit = QtGui.QLineEdit(self.scriptureReferenceGroupBox)
# self.verseSeparatorLineEdit.setPalette
self.verseSeparatorLineEdit.setObjectName(u'verseSeparatorLineEdit')
self.scriptureReferenceLayout.addWidget(self.verseSeparatorLineEdit, 0, 1)
self.rangeSeparatorCheckBox = QtGui.QCheckBox(self.scriptureReferenceGroupBox)
self.rangeSeparatorCheckBox.setObjectName(u'rangeSeparatorCheckBox')
self.scriptureReferenceLayout.addWidget(self.rangeSeparatorCheckBox, 1, 0)
self.rangeSeparatorLineEdit = QtGui.QLineEdit(self.scriptureReferenceGroupBox)
self.rangeSeparatorLineEdit.setObjectName(u'rangeSeparatorLineEdit')
self.scriptureReferenceLayout.addWidget(self.rangeSeparatorLineEdit, 1, 1)
self.listSeparatorCheckBox = QtGui.QCheckBox(self.scriptureReferenceGroupBox)
self.listSeparatorCheckBox.setObjectName(u'listSeparatorCheckBox')
self.scriptureReferenceLayout.addWidget(self.listSeparatorCheckBox, 2, 0)
self.listSeparatorLineEdit = QtGui.QLineEdit(self.scriptureReferenceGroupBox)
self.listSeparatorLineEdit.setObjectName(u'listSeparatorLineEdit')
self.scriptureReferenceLayout.addWidget(self.listSeparatorLineEdit, 2, 1)
self.endSeparatorCheckBox = QtGui.QCheckBox(self.scriptureReferenceGroupBox)
self.endSeparatorCheckBox.setObjectName(u'endSeparatorCheckBox')
self.scriptureReferenceLayout.addWidget(self.endSeparatorCheckBox, 3, 0)
self.endSeparatorLineEdit = QtGui.QLineEdit(self.scriptureReferenceGroupBox)
self.endSeparatorLineEdit.setObjectName(u'endSeparatorLineEdit')
self.endSeparatorLineEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^0-9]*'),
self.endSeparatorLineEdit))
self.scriptureReferenceLayout.addWidget(self.endSeparatorLineEdit, 3, 1)
self.leftLayout.addWidget(self.scriptureReferenceGroupBox)
self.rightColumn.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
self.languageSelectionGroupBox = QtGui.QGroupBox(self.rightColumn)
self.languageSelectionGroupBox.setObjectName(u'languageSelectionGroupBox')
self.languageSelectionLayout = QtGui.QVBoxLayout(self.languageSelectionGroupBox)
self.languageSelectionLabel = QtGui.QLabel(self.languageSelectionGroupBox)
self.languageSelectionLabel.setObjectName(u'languageSelectionLabel')
self.languageSelectionComboBox = QtGui.QComboBox(self.languageSelectionGroupBox)
self.languageSelectionComboBox.setObjectName(u'languageSelectionComboBox')
self.languageSelectionComboBox.addItems([u'', u'', u''])
self.languageSelectionLayout.addWidget(self.languageSelectionLabel)
self.languageSelectionLayout.addWidget(self.languageSelectionComboBox)
self.rightLayout.addWidget(self.languageSelectionGroupBox)
self.leftLayout.addStretch()
self.rightLayout.addStretch()
self.verse_display_group_box = QtGui.QGroupBox(self.left_column)
self.verse_display_group_box.setObjectName(u'verse_display_group_box')
self.verse_display_layout = QtGui.QFormLayout(self.verse_display_group_box)
self.verse_display_layout.setObjectName(u'verse_display_layout')
self.new_chapters_check_box = QtGui.QCheckBox(self.verse_display_group_box)
self.new_chapters_check_box.setObjectName(u'new_chapters_check_box')
self.verse_display_layout.addRow(self.new_chapters_check_box)
self.display_style_label = QtGui.QLabel(self.verse_display_group_box)
self.display_style_label.setObjectName(u'display_style_label')
self.display_style_combo_box = QtGui.QComboBox(self.verse_display_group_box)
self.display_style_combo_box.addItems([u'', u'', u'', u''])
self.display_style_combo_box.setObjectName(u'display_style_combo_box')
self.verse_display_layout.addRow(self.display_style_label, self.display_style_combo_box)
self.layout_style_label = QtGui.QLabel(self.verse_display_group_box)
self.layout_style_label.setObjectName(u'layout_style_label')
self.layout_style_combo_box = QtGui.QComboBox(self.verse_display_group_box)
self.layout_style_combo_box.setObjectName(u'layout_style_combo_box')
self.layout_style_combo_box.addItems([u'', u'', u''])
self.verse_display_layout.addRow(self.layout_style_label, self.layout_style_combo_box)
self.bible_second_check_box = QtGui.QCheckBox(self.verse_display_group_box)
self.bible_second_check_box.setObjectName(u'bible_second_check_box')
self.verse_display_layout.addRow(self.bible_second_check_box)
self.bible_theme_label = QtGui.QLabel(self.verse_display_group_box)
self.bible_theme_label.setObjectName(u'BibleTheme_label')
self.bible_theme_combo_box = QtGui.QComboBox(self.verse_display_group_box)
self.bible_theme_combo_box.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
self.bible_theme_combo_box.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.bible_theme_combo_box.addItem(u'')
self.bible_theme_combo_box.setObjectName(u'BibleThemecombo_box')
self.verse_display_layout.addRow(self.bible_theme_label, self.bible_theme_combo_box)
self.change_note_label = QtGui.QLabel(self.verse_display_group_box)
self.change_note_label.setWordWrap(True)
self.change_note_label.setObjectName(u'change_note_label')
self.verse_display_layout.addRow(self.change_note_label)
self.left_layout.addWidget(self.verse_display_group_box)
self.scripture_reference_group_box = QtGui.QGroupBox(self.left_column)
self.scripture_reference_group_box.setObjectName(u'scripture_reference_group_box')
self.scripture_reference_layout = QtGui.QGridLayout(self.scripture_reference_group_box)
self.verse_separator_check_box = QtGui.QCheckBox(self.scripture_reference_group_box)
self.verse_separator_check_box.setObjectName(u'verse_separator_check_box')
self.scripture_reference_layout.addWidget(self.verse_separator_check_box, 0, 0)
self.verse_separator_line_edit = QtGui.QLineEdit(self.scripture_reference_group_box)
self.verse_separator_line_edit.setObjectName(u'verse_separator_line_edit')
self.scripture_reference_layout.addWidget(self.verse_separator_line_edit, 0, 1)
self.range_separator_check_box = QtGui.QCheckBox(self.scripture_reference_group_box)
self.range_separator_check_box.setObjectName(u'range_separator_check_box')
self.scripture_reference_layout.addWidget(self.range_separator_check_box, 1, 0)
self.range_separator_line_edit = QtGui.QLineEdit(self.scripture_reference_group_box)
self.range_separator_line_edit.setObjectName(u'range_separator_line_edit')
self.scripture_reference_layout.addWidget(self.range_separator_line_edit, 1, 1)
self.list_separator_check_box = QtGui.QCheckBox(self.scripture_reference_group_box)
self.list_separator_check_box.setObjectName(u'list_separator_check_box')
self.scripture_reference_layout.addWidget(self.list_separator_check_box, 2, 0)
self.list_separator_line_edit = QtGui.QLineEdit(self.scripture_reference_group_box)
self.list_separator_line_edit.setObjectName(u'list_separator_line_edit')
self.scripture_reference_layout.addWidget(self.list_separator_line_edit, 2, 1)
self.end_separator_check_box = QtGui.QCheckBox(self.scripture_reference_group_box)
self.end_separator_check_box.setObjectName(u'end_separator_check_box')
self.scripture_reference_layout.addWidget(self.end_separator_check_box, 3, 0)
self.end_separator_line_edit = QtGui.QLineEdit(self.scripture_reference_group_box)
self.end_separator_line_edit.setObjectName(u'end_separator_line_edit')
self.end_separator_line_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^0-9]*'),
self.end_separator_line_edit))
self.scripture_reference_layout.addWidget(self.end_separator_line_edit, 3, 1)
self.left_layout.addWidget(self.scripture_reference_group_box)
self.right_column.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
self.language_selection_group_box = QtGui.QGroupBox(self.right_column)
self.language_selection_group_box.setObjectName(u'language_selection_group_box')
self.language_selection_layout = QtGui.QVBoxLayout(self.language_selection_group_box)
self.language_selection_label = QtGui.QLabel(self.language_selectiongroup_box)
self.language_selection_label.setObjectName(u'language_selection_label')
self.language_selection_combo_box = QtGui.QComboBox(self.language_selection_group_box)
self.language_selection_combo_box.setObjectName(u'language_selection_combo_box')
self.language_selection_combo_box.addItems([u'', u'', u''])
self.language_selection_layout.addWidget(self.language_selection_label)
self.language_selection_layout.addWidget(self.language_selection_combo_box)
self.right_layout.addWidget(self.language_selectiongroup_box)
self.left_layout.addStretch()
self.right_layout.addStretch()
# Signals and slots
self.newChaptersCheckBox.stateChanged.connect(self.onNewChaptersCheckBoxChanged)
self.displayStyleComboBox.activated.connect(self.onDisplayStyleComboBoxChanged)
self.bibleThemeComboBox.activated.connect(self.onBibleThemeComboBoxChanged)
self.layoutStyleComboBox.activated.connect(self.onLayoutStyleComboBoxChanged)
self.bibleSecondCheckBox.stateChanged.connect(self.onBibleSecondCheckBox)
self.verseSeparatorCheckBox.clicked.connect(self.onVerseSeparatorCheckBoxClicked)
self.verseSeparatorLineEdit.textEdited.connect(self.onVerseSeparatorLineEditEdited)
self.verseSeparatorLineEdit.editingFinished.connect(self.onVerseSeparatorLineEditFinished)
self.rangeSeparatorCheckBox.clicked.connect(self.onRangeSeparatorCheckBoxClicked)
self.rangeSeparatorLineEdit.textEdited.connect(self.onRangeSeparatorLineEditEdited)
self.rangeSeparatorLineEdit.editingFinished.connect(self.onRangeSeparatorLineEditFinished)
self.listSeparatorCheckBox.clicked.connect(self.onListSeparatorCheckBoxClicked)
self.listSeparatorLineEdit.textEdited.connect(self.onListSeparatorLineEditEdited)
self.listSeparatorLineEdit.editingFinished.connect(self.onListSeparatorLineEditFinished)
self.endSeparatorCheckBox.clicked.connect(self.onEndSeparatorCheckBoxClicked)
self.endSeparatorLineEdit.textEdited.connect(self.onEndSeparatorLineEditEdited)
self.endSeparatorLineEdit.editingFinished.connect(self.onEndSeparatorLineEditFinished)
self.new_chapters_check_box.stateChanged.connect(self.on_new_chapters_check_box_changed)
self.display_style_combo_box.activated.connect(self.on_display_style_combo_box_changed)
self.bible_theme_combo_box.activated.connect(self.on_bible_theme_combo_box_changed)
self.layout_style_combo_box.activated.connect(self.on_layout_style_combo_boxChanged)
self.bible_second_check_box.stateChanged.connect(self.on_bible_second_check_box)
self.verse_separator_check_box.clicked.connect(self.on_verse_separator_check_box_clicked)
self.verse_separator_line_edit.textEdited.connect(self.on_verse_separator_line_edit_edited)
self.verse_separator_line_edit.editingFinished.connect(self.on_verse_separator_line_edit_finished)
self.range_separator_check_box.clicked.connect(self.on_range_separator_check_box_clicked)
self.range_separator_line_edit.textEdited.connect(self.on_range_separator_line_edit_edited)
self.range_separator_line_edit.editingFinished.connect(self.on_range_separator_line_edit_finished)
self.list_separator_check_box.clicked.connect(self.on_list_separator_check_box_clicked)
self.list_separator_line_edit.textEdited.connect(self.on_list_separator_line_edit_edited)
self.list_separator_line_edit.editingFinished.connect(self.on_list_separator_line_edit_finished)
self.end_separator_check_box.clicked.connect(self.on_end_separator_check_box_clicked)
self.end_separator_line_edit.textEdited.connect(self.on_end_separator_line_edit_edited)
self.end_separator_line_edit.editingFinished.connect(self.on_end_separator_line_edit_finished)
Registry().register_function(u'theme_update_list', self.update_theme_list)
self.languageSelectionComboBox.activated.connect(self.onLanguageSelectionComboBoxChanged)
self.language_selectioncombo_box.activated.connect(self.on_language_selection_combo_box_changed)
def retranslateUi(self):
self.verseDisplayGroupBox.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
self.newChaptersCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'Only show new chapter numbers'))
self.layoutStyleLabel.setText(UiStrings().LayoutStyle)
self.displayStyleLabel.setText(UiStrings().DisplayStyle)
self.bibleThemeLabel.setText(translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
self.layoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide, UiStrings().VersePerSlide)
self.layoutStyleComboBox.setItemText(LayoutStyle.VersePerLine, UiStrings().VersePerLine)
self.layoutStyleComboBox.setItemText(LayoutStyle.Continuous, UiStrings().Continuous)
self.displayStyleComboBox.setItemText(DisplayStyle.NoBrackets,
self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
self.new_chapters_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Only show new chapter numbers'))
self.layout_style_label.setText(UiStrings()._layout_style_)
self.display_style_label.setText(UiStrings().DisplayStyle)
self.bible_theme_label.setText(translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
self.layout_style_combo_box.setItemText(LayoutStyle.VersePerSlide, UiStrings().VersePerSlide)
self.layout_style_combo_box.setItemText(LayoutStyle.VersePerLine, UiStrings().VersePerLine)
self.layout_style_combo_box.setItemText(LayoutStyle.Continuous, UiStrings().Continuous)
self.display_style_combo_box.setItemText(DisplayStyle.NoBrackets,
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
self.displayStyleComboBox.setItemText(DisplayStyle.Round,
self.display_style_combo_box.setItemText(DisplayStyle.Round,
translate('BiblesPlugin.BiblesTab', '( And )'))
self.displayStyleComboBox.setItemText(DisplayStyle.Curly,
self.display_style_combo_box.setItemText(DisplayStyle.Curly,
translate('BiblesPlugin.BiblesTab', '{ And }'))
self.displayStyleComboBox.setItemText(DisplayStyle.Square,
self.display_style_combo_box.setItemText(DisplayStyle.Square,
translate('BiblesPlugin.BiblesTab', '[ And ]'))
self.changeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
self.change_note_label.setText(translate('BiblesPlugin.BiblesTab',
'Note:\nChanges do not affect verses already in the service.'))
self.bibleSecondCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'Display second Bible verses'))
self.scriptureReferenceGroupBox.setTitle(translate('BiblesPlugin.BiblesTab', 'Custom Scripture References'))
self.verseSeparatorCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'Verse Separator:'))
self.rangeSeparatorCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'Range Separator:'))
self.listSeparatorCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'List Separator:'))
self.endSeparatorCheckBox.setText(translate('BiblesPlugin.BiblesTab', 'End Mark:'))
self.bible_second_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Display second Bible verses'))
self.scripture_reference_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Custom Scripture References'))
self.verse_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Verse Separator:'))
self.range_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Range Separator:'))
self.list_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'List Separator:'))
self.end_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'End Mark:'))
tip_text = translate('BiblesPlugin.BiblesTab',
'Multiple alternative verse separators may be defined.\nThey have to be separated by a vertical bar "|".'
'\nPlease clear this edit line to use the default value.')
self.verseSeparatorLineEdit.setToolTip(tip_text)
self.rangeSeparatorLineEdit.setToolTip(tip_text)
self.listSeparatorLineEdit.setToolTip(tip_text)
self.endSeparatorLineEdit.setToolTip(tip_text)
self.languageSelectionGroupBox.setTitle(translate('BiblesPlugin.BiblesTab', 'Default Bible Language'))
self.languageSelectionLabel.setText(translate('BiblesPlugin.BiblesTab',
self.verse_separator_line_edit.setToolTip(tip_text)
self.range_separator_line_edit.setToolTip(tip_text)
self.list_separator_line_edit.setToolTip(tip_text)
self.end_separator_line_edit.setToolTip(tip_text)
self.language_selectiongroup_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Default Bible Language'))
self.language_selection_label.setText(translate('BiblesPlugin.BiblesTab',
'Book name language in search field,\nsearch results and on display:'))
self.languageSelectionComboBox.setItemText(LanguageSelection.Bible,
self.language_selectioncombo_box.setItemText(LanguageSelection.Bible,
translate('BiblesPlugin.BiblesTab', 'Bible Language'))
self.languageSelectionComboBox.setItemText(LanguageSelection.Application,
self.language_selectioncombo_box.setItemText(LanguageSelection.Application,
translate('BiblesPlugin.BiblesTab', 'Application Language'))
self.languageSelectionComboBox.setItemText(LanguageSelection.English,
self.language_selectioncombo_box.setItemText(LanguageSelection.English,
translate('BiblesPlugin.BiblesTab', 'English'))
def onBibleThemeComboBoxChanged(self):
self.bible_theme = self.bibleThemeComboBox.currentText()
def on_bible_theme_combo_box_changed(self):
self.bible_theme = self.bible_theme_combo_box.currentText()
def onDisplayStyleComboBoxChanged(self):
self.display_style = self.displayStyleComboBox.currentIndex()
def on_display_style_combo_box_changed(self):
self.display_style = self.display_style_combo_box.currentIndex()
def onLayoutStyleComboBoxChanged(self):
self.layout_style = self.layoutStyleComboBox.currentIndex()
def on_layout_style_combo_boxChanged(self):
self.layout_style = self.layout_style_combo_box.currentIndex()
def onLanguageSelectionComboBoxChanged(self):
self.language_selection = self.languageSelectionComboBox.currentIndex()
def on_language_selection_combo_box_changed(self):
self.language_selection = self.language_selectioncombo_box.currentIndex()
def onNewChaptersCheckBoxChanged(self, check_state):
def on_new_chapters_check_box_changed(self, check_state):
self.show_new_chapters = False
# We have a set value convert to True/False.
if check_state == QtCore.Qt.Checked:
self.show_new_chapters = True
def onBibleSecondCheckBox(self, check_state):
def on_bible_second_check_box(self, check_state):
self.second_bibles = False
# We have a set value convert to True/False.
if check_state == QtCore.Qt.Checked:
self.second_bibles = True
def onVerseSeparatorCheckBoxClicked(self, checked):
def on_verse_separator_check_box_clicked(self, checked):
if checked:
self.verseSeparatorLineEdit.setFocus()
self.verse_separator_line_edit.setFocus()
else:
self.verseSeparatorLineEdit.setText(get_reference_separator(u'sep_v_default'))
self.verseSeparatorLineEdit.setPalette(self.getGreyTextPalette(not checked))
self.verse_separator_line_edit.setText(get_reference_separator(u'sep_v_default'))
self.verse_separator_line_edit.setPalette(self.getGreyTextPalette(not checked))
def onVerseSeparatorLineEditEdited(self, text):
self.verseSeparatorCheckBox.setChecked(True)
self.verseSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
def on_verse_separator_line_edit_edited(self, text):
self.verse_separator_check_box.setChecked(True)
self.verse_separator_line_edit.setPalette(self.getGreyTextPalette(False))
def onVerseSeparatorLineEditFinished(self):
if self.verseSeparatorLineEdit.isModified():
text = self.verseSeparatorLineEdit.text()
def on_verse_separator_line_edit_finished(self):
if self.verse_separator_line_edit.isModified():
text = self.verse_separator_line_edit.text()
if text == get_reference_separator(u'sep_v_default') or not text.replace(u'|', u''):
self.verseSeparatorCheckBox.setChecked(False)
self.verseSeparatorLineEdit.setText(get_reference_separator(u'sep_v_default'))
self.verseSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.verse_separator_check_box.setChecked(False)
self.verse_separator_line_edit.setText(get_reference_separator(u'sep_v_default'))
self.verse_separator_line_edit.setPalette(self.getGreyTextPalette(True))
def onRangeSeparatorCheckBoxClicked(self, checked):
def on_range_separator_check_box_clicked(self, checked):
if checked:
self.rangeSeparatorLineEdit.setFocus()
self.range_separator_line_edit.setFocus()
else:
self.rangeSeparatorLineEdit.setText(get_reference_separator(u'sep_r_default'))
self.rangeSeparatorLineEdit.setPalette(self.getGreyTextPalette(not checked))
self.range_separator_line_edit.setText(get_reference_separator(u'sep_r_default'))
self.range_separator_line_edit.setPalette(self.getGreyTextPalette(not checked))
def onRangeSeparatorLineEditEdited(self, text):
self.rangeSeparatorCheckBox.setChecked(True)
self.rangeSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
def on_range_separator_line_edit_edited(self, text):
self.range_separator_check_box.setChecked(True)
self.range_separator_line_edit.setPalette(self.getGreyTextPalette(False))
def onRangeSeparatorLineEditFinished(self):
if self.rangeSeparatorLineEdit.isModified():
text = self.rangeSeparatorLineEdit.text()
def on_range_separator_line_edit_finished(self):
if self.range_separator_line_edit.isModified():
text = self.range_separator_line_edit.text()
if text == get_reference_separator(u'sep_r_default') or not text.replace(u'|', u''):
self.rangeSeparatorCheckBox.setChecked(False)
self.rangeSeparatorLineEdit.setText(get_reference_separator(u'sep_r_default'))
self.rangeSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.range_separator_check_box.setChecked(False)
self.range_separator_line_edit.setText(get_reference_separator(u'sep_r_default'))
self.range_separator_line_edit.setPalette(self.getGreyTextPalette(True))
def onListSeparatorCheckBoxClicked(self, checked):
def on_list_separator_check_box_clicked(self, checked):
if checked:
self.listSeparatorLineEdit.setFocus()
self.list_separator_line_edit.setFocus()
else:
self.listSeparatorLineEdit.setText(get_reference_separator(u'sep_l_default'))
self.listSeparatorLineEdit.setPalette(self.getGreyTextPalette(not checked))
self.list_separator_line_edit.setText(get_reference_separator(u'sep_l_default'))
self.list_separator_line_edit.setPalette(self.getGreyTextPalette(not checked))
def onListSeparatorLineEditEdited(self, text):
self.listSeparatorCheckBox.setChecked(True)
self.listSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
def on_list_separator_line_edit_edited(self, text):
self.list_separator_check_box.setChecked(True)
self.list_separator_line_edit.setPalette(self.getGreyTextPalette(False))
def onListSeparatorLineEditFinished(self):
if self.listSeparatorLineEdit.isModified():
text = self.listSeparatorLineEdit.text()
def on_list_separator_line_edit_finished(self):
if self.list_separator_line_edit.isModified():
text = self.list_separator_line_edit.text()
if text == get_reference_separator(u'sep_l_default') or not text.replace(u'|', u''):
self.listSeparatorCheckBox.setChecked(False)
self.listSeparatorLineEdit.setText(get_reference_separator(u'sep_l_default'))
self.listSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.list_separator_check_box.setChecked(False)
self.list_separator_line_edit.setText(get_reference_separator(u'sep_l_default'))
self.list_separator_line_edit.setPalette(self.getGreyTextPalette(True))
def onEndSeparatorCheckBoxClicked(self, checked):
def on_end_separator_check_box_clicked(self, checked):
if checked:
self.endSeparatorLineEdit.setFocus()
self.end_separator_line_edit.setFocus()
else:
self.endSeparatorLineEdit.setText(get_reference_separator(u'sep_e_default'))
self.endSeparatorLineEdit.setPalette(self.getGreyTextPalette(not checked))
self.end_separator_line_edit.setText(get_reference_separator(u'sep_e_default'))
self.end_separator_line_edit.setPalette(self.getGreyTextPalette(not checked))
def onEndSeparatorLineEditEdited(self, text):
self.endSeparatorCheckBox.setChecked(True)
self.endSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
def on_end_separator_line_edit_edited(self, text):
self.end_separator_check_box.setChecked(True)
self.end_separator_line_edit.setPalette(self.getGreyTextPalette(False))
def onEndSeparatorLineEditFinished(self):
if self.endSeparatorLineEdit.isModified():
text = self.endSeparatorLineEdit.text()
def on_end_separator_line_edit_finished(self):
if self.end_separator_line_edit.isModified():
text = self.end_separator_line_edit.text()
if text == get_reference_separator(u'sep_e_default') or not text.replace(u'|', u''):
self.endSeparatorCheckBox.setChecked(False)
self.endSeparatorLineEdit.setText(get_reference_separator(u'sep_e_default'))
self.endSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.end_separator_check_box.setChecked(False)
self.end_separator_line_edit.setText(get_reference_separator(u'sep_e_default'))
self.end_separator_line_edit.setPalette(self.getGreyTextPalette(True))
def load(self):
settings = Settings()
@ -304,48 +304,48 @@ class BiblesTab(SettingsTab):
self.layout_style = settings.value(u'verse layout style')
self.bible_theme = settings.value(u'bible theme')
self.second_bibles = settings.value(u'second bibles')
self.newChaptersCheckBox.setChecked(self.show_new_chapters)
self.displayStyleComboBox.setCurrentIndex(self.display_style)
self.layoutStyleComboBox.setCurrentIndex(self.layout_style)
self.bibleSecondCheckBox.setChecked(self.second_bibles)
self.new_chapters_check_box.setChecked(self.show_new_chapters)
self.display_style_combo_box.setCurrentIndex(self.display_style)
self.layout_style_combo_box.setCurrentIndex(self.layout_style)
self.bible_second_check_box.setChecked(self.second_bibles)
verse_separator = settings.value(u'verse separator')
if (verse_separator.strip(u'|') == u'') or (verse_separator == get_reference_separator(u'sep_v_default')):
self.verseSeparatorLineEdit.setText(get_reference_separator(u'sep_v_default'))
self.verseSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.verseSeparatorCheckBox.setChecked(False)
self.verse_separator_line_edit.setText(get_reference_separator(u'sep_v_default'))
self.verse_separator_line_edit.setPalette(self.getGreyTextPalette(True))
self.verse_separator_check_box.setChecked(False)
else:
self.verseSeparatorLineEdit.setText(verse_separator)
self.verseSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
self.verseSeparatorCheckBox.setChecked(True)
self.verse_separator_line_edit.setText(verse_separator)
self.verse_separator_line_edit.setPalette(self.getGreyTextPalette(False))
self.verse_separator_check_box.setChecked(True)
range_separator = settings.value(u'range separator')
if (range_separator.strip(u'|') == u'') or (range_separator == get_reference_separator(u'sep_r_default')):
self.rangeSeparatorLineEdit.setText(get_reference_separator(u'sep_r_default'))
self.rangeSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.rangeSeparatorCheckBox.setChecked(False)
self.range_separator_line_edit.setText(get_reference_separator(u'sep_r_default'))
self.range_separator_line_edit.setPalette(self.getGreyTextPalette(True))
self.range_separator_check_box.setChecked(False)
else:
self.rangeSeparatorLineEdit.setText(range_separator)
self.rangeSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
self.rangeSeparatorCheckBox.setChecked(True)
self.range_separator_line_edit.setText(range_separator)
self.range_separator_line_edit.setPalette(self.getGreyTextPalette(False))
self.range_separator_check_box.setChecked(True)
list_separator = settings.value(u'list separator')
if (list_separator.strip(u'|') == u'') or (list_separator == get_reference_separator(u'sep_l_default')):
self.listSeparatorLineEdit.setText(get_reference_separator(u'sep_l_default'))
self.listSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.listSeparatorCheckBox.setChecked(False)
self.list_separator_line_edit.setText(get_reference_separator(u'sep_l_default'))
self.list_separator_line_edit.setPalette(self.getGreyTextPalette(True))
self.list_separator_check_box.setChecked(False)
else:
self.listSeparatorLineEdit.setText(list_separator)
self.listSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
self.listSeparatorCheckBox.setChecked(True)
self.list_separator_line_edit.setText(list_separator)
self.list_separator_line_edit.setPalette(self.getGreyTextPalette(False))
self.list_separator_check_box.setChecked(True)
end_separator = settings.value(u'end separator')
if (end_separator.strip(u'|') == u'') or (end_separator == get_reference_separator(u'sep_e_default')):
self.endSeparatorLineEdit.setText(get_reference_separator(u'sep_e_default'))
self.endSeparatorLineEdit.setPalette(self.getGreyTextPalette(True))
self.endSeparatorCheckBox.setChecked(False)
self.end_separator_line_edit.setText(get_reference_separator(u'sep_e_default'))
self.end_separator_line_edit.setPalette(self.getGreyTextPalette(True))
self.end_separator_check_box.setChecked(False)
else:
self.endSeparatorLineEdit.setText(end_separator)
self.endSeparatorLineEdit.setPalette(self.getGreyTextPalette(False))
self.endSeparatorCheckBox.setChecked(True)
self.end_separator_line_edit.setText(end_separator)
self.end_separator_line_edit.setPalette(self.getGreyTextPalette(False))
self.end_separator_check_box.setChecked(True)
self.language_selection = settings.value(u'book name language')
self.languageSelectionComboBox.setCurrentIndex(self.language_selection)
self.language_selectioncombo_box.setCurrentIndex(self.language_selection)
settings.endGroup()
def save(self):
@ -356,20 +356,20 @@ class BiblesTab(SettingsTab):
settings.setValue(u'verse layout style', self.layout_style)
settings.setValue(u'second bibles', self.second_bibles)
settings.setValue(u'bible theme', self.bible_theme)
if self.verseSeparatorCheckBox.isChecked():
settings.setValue(u'verse separator', self.verseSeparatorLineEdit.text())
if self.verse_separator_check_box.isChecked():
settings.setValue(u'verse separator', self.verse_separator_line_edit.text())
else:
settings.remove(u'verse separator')
if self.rangeSeparatorCheckBox.isChecked():
settings.setValue(u'range separator', self.rangeSeparatorLineEdit.text())
if self.range_separator_check_box.isChecked():
settings.setValue(u'range separator', self.range_separator_line_edit.text())
else:
settings.remove(u'range separator')
if self.listSeparatorCheckBox.isChecked():
settings.setValue(u'list separator', self.listSeparatorLineEdit.text())
if self.list_separator_check_box.isChecked():
settings.setValue(u'list separator', self.list_separator_line_edit.text())
else:
settings.remove(u'list separator')
if self.endSeparatorCheckBox.isChecked():
settings.setValue(u'end separator', self.endSeparatorLineEdit.text())
if self.end_separator_check_box.isChecked():
settings.setValue(u'end separator', self.end_separator_line_edit.text())
else:
settings.remove(u'end separator')
update_reference_separators()
@ -388,10 +388,10 @@ class BiblesTab(SettingsTab):
[u'Bible Theme', u'Song Theme']
"""
self.bibleThemeComboBox.clear()
self.bibleThemeComboBox.addItem(u'')
self.bibleThemeComboBox.addItems(theme_list)
find_and_set_in_combo_box(self.bibleThemeComboBox, self.bible_theme)
self.bible_theme_combo_box.clear()
self.bible_theme_combo_box.addItem(u'')
self.bible_theme_combo_box.addItems(theme_list)
find_and_set_in_combo_box(self.bible_theme_combo_box, self.bible_theme)
def getGreyTextPalette(self, greyed):
"""
@ -403,4 +403,3 @@ class BiblesTab(SettingsTab):
color.setAlpha(128)
palette.setColor(QtGui.QPalette.Active, QtGui.QPalette.Text, color)
return palette

View File

@ -353,8 +353,7 @@ class BibleDB(QtCore.QObject, Manager):
book, book_id, language_id)
return book_id
def get_book_ref_id_by_localised_name(self, book,
language_selection):
def get_book_ref_id_by_localised_name(self, book, language_selection):
"""
Return the id of a named book.
@ -362,8 +361,7 @@ class BibleDB(QtCore.QObject, Manager):
The name of the book, according to the selected language.
``language_selection``
The language selection the user has chosen in the settings
section of the Bible.
The language selection the user has chosen in the settings section of the Bible.
"""
log.debug(u'get_book_ref_id_by_localised_name("%s", "%s")', book, language_selection)
from openlp.plugins.bibles.lib import LanguageSelection, BibleStrings
@ -423,12 +421,12 @@ class BibleDB(QtCore.QObject, Manager):
log.debug(u'Book name corrected to "%s"', db_book.name)
if end_verse == -1:
end_verse = self.get_verse_count(book_id, chapter)
verses = self.session.query(Verse)\
.filter_by(book_id=db_book.id)\
.filter_by(chapter=chapter)\
.filter(Verse.verse >= start_verse)\
.filter(Verse.verse <= end_verse)\
.order_by(Verse.verse)\
verses = self.session.query(Verse) \
.filter_by(book_id=db_book.id) \
.filter_by(chapter=chapter) \
.filter(Verse.verse >= start_verse) \
.filter(Verse.verse <= end_verse) \
.order_by(Verse.verse) \
.all()
verse_list.extend(verses)
else:
@ -491,9 +489,9 @@ class BibleDB(QtCore.QObject, Manager):
The chapter to get the verse count for.
"""
log.debug(u'BibleDB.get_verse_count("%s", "%s")', book_ref_id, chapter)
count = self.session.query(func.max(Verse.verse)).join(Book)\
.filter(Book.book_reference_id==book_ref_id)\
.filter(Verse.chapter==chapter)\
count = self.session.query(func.max(Verse.verse)).join(Book) \
.filter(Book.book_reference_id == book_ref_id) \
.filter(Verse.chapter == chapter) \
.scalar()
if not count:
return 0

View File

@ -37,6 +37,7 @@ from sqlalchemy import Table, func, select, insert
__version__ = 1
log = logging.getLogger(__name__)
def upgrade_setup(metadata):
"""
Set up the latest revision all tables, with reflection, needed for the
@ -56,7 +57,7 @@ def upgrade_1(session, metadata, tables):
"""
Version 1 upgrade.
This upgrade renames a number of keys to a single naming convention..
This upgrade renames a number of keys to a single naming convention.
"""
metadata_table = metadata.tables[u'metadata']
# Copy "Version" to "name" ("version" used by upgrade system)