From b0c9b3f07777eadbd4fb7ae38a9f462f74cec495 Mon Sep 17 00:00:00 2001 From: M2j Date: Mon, 3 Jan 2011 12:25:30 +0100 Subject: [PATCH] integrated 'split layout' in the SettingsTab class remove the documentMode from the TabWidget in the SettingsDialog replace comment for HideMode class --- openlp/core/lib/settingstab.py | 29 ++++++++++++- openlp/core/ui/__init__.py | 12 ++++-- openlp/core/ui/advancedtab.py | 35 ++-------------- openlp/core/ui/generaltab.py | 39 +++--------------- openlp/core/ui/settingsdialog.py | 9 +--- openlp/core/ui/shortcutlistdialog.py | 1 - openlp/core/ui/themestab.py | 29 ++++--------- openlp/plugins/alerts/lib/alertstab.py | 41 ++++--------------- openlp/plugins/bibles/lib/biblestab.py | 37 +++-------------- openlp/plugins/custom/lib/customtab.py | 31 +------------- openlp/plugins/media/lib/mediatab.py | 31 +------------- .../presentations/lib/presentationtab.py | 41 ++++--------------- openlp/plugins/remotes/lib/remotetab.py | 37 +++-------------- openlp/plugins/songs/lib/songstab.py | 37 +++-------------- 14 files changed, 89 insertions(+), 320 deletions(-) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 6586a50f2..5081d9769 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -55,7 +55,34 @@ class SettingsTab(QtGui.QWidget): """ Setup the tab's interface. """ - pass + 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) + + def resizeEvent(self, event=None): + """ + Resize the sides in two equal halves if the layout allows this. + """ + 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) def preLoad(self): """ diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index adb0d5679..206b9a37d 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -29,10 +29,14 @@ The :mod:`ui` module provides the core user interface for OpenLP class HideMode(object): """ - This is basically an enumeration class which specifies differnt hiding modes - for the display. The option ``Blank`` to cover the display black. The option - ``Theme`` removes the content from the theme. ``Screen`` finally hides the - output, so that the users desktop is usually shown. + This is an enumeration class which specifies the different modes of hiding + the display. + The ``Blank`` option is used to hide all output, specifically by covering + the display with a black screen. + The ``Theme`` option is used to hide all output, but covers the display with + the current theme background, as opposed to black. + Lastly, the ``Desktop`` mode hides all output by minimising the display, + leaving the user's desktop showing. """ Blank = 1 Theme = 2 diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 3ca7024e4..6de985ae7 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -46,14 +46,8 @@ class AdvancedTab(SettingsTab): Configure the UI elements for the tab. """ self.setObjectName(u'AdvancedTab') - self.advancedTabLayout = QtGui.QHBoxLayout(self) - self.advancedTabLayout.setObjectName(u'advancedTabLayout') - self.leftWidget = QtGui.QWidget(self) - self.leftWidget.setObjectName(u'leftWidget') - self.leftLayout = QtGui.QVBoxLayout(self.leftWidget) - self.leftLayout.setMargin(0) - self.leftLayout.setObjectName(u'leftLayout') - self.uiGroupBox = QtGui.QGroupBox(self.leftWidget) + SettingsTab.setupUi(self) + self.uiGroupBox = QtGui.QGroupBox(self.leftColumn) self.uiGroupBox.setObjectName(u'uiGroupBox') self.uiLayout = QtGui.QFormLayout(self.uiGroupBox) self.uiLayout.setObjectName(u'uiLayout') @@ -74,7 +68,7 @@ class AdvancedTab(SettingsTab): u'expandServiceItemCheckBox') self.uiLayout.addRow(self.expandServiceItemCheckBox) self.leftLayout.addWidget(self.uiGroupBox) -# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget) +# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') # self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox) # self.sharedCheckBox = QtGui.QCheckBox(self.sharedDirGroupBox) @@ -93,19 +87,12 @@ class AdvancedTab(SettingsTab): # self.sharedDirLayout.addRow(self.sharedLabel, self.sharedSubLayout) # self.leftLayout.addWidget(self.sharedDirGroupBox) self.leftLayout.addStretch() - self.advancedTabLayout.addWidget(self.leftWidget) - self.rightWidget = QtGui.QWidget(self) - self.rightWidget.setObjectName(u'rightWidget') - self.rightLayout = QtGui.QVBoxLayout(self.rightWidget) - self.rightLayout.setMargin(0) - self.rightLayout.setObjectName(u'rightLayout') -# self.databaseGroupBox = QtGui.QGroupBox(self.rightWidget) +# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn) # self.databaseGroupBox.setObjectName(u'databaseGroupBox') # self.databaseGroupBox.setEnabled(False) # self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox) # self.rightLayout.addWidget(self.databaseGroupBox) self.rightLayout.addStretch() - self.advancedTabLayout.addWidget(self.rightWidget) # QtCore.QObject.connect(self.sharedCheckBox, # QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged) @@ -132,20 +119,6 @@ class AdvancedTab(SettingsTab): # self.sharedPushButton.setText(translate('AdvancedTab', 'Browse...')) # self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.advancedTabLayout.spacing() - \ - self.advancedTabLayout.contentsMargins().left() - \ - self.advancedTabLayout.contentsMargins().right() - left_width = min(width - self.rightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.leftWidget.minimumSizeHint().width()) - self.leftWidget.setMinimumWidth(left_width) - def load(self): """ Load settings from disk. diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index be3463e06..15789b0d6 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -85,14 +85,8 @@ class GeneralTab(SettingsTab): Create the user interface for the general settings tab """ self.setObjectName(u'GeneralTab') - self.generalLayout = QtGui.QHBoxLayout(self) - self.generalLayout.setObjectName(u'generalLayout') - self.leftWidget = QtGui.QWidget(self) - self.leftWidget.setObjectName(u'leftWidget') - self.leftLayout = QtGui.QVBoxLayout(self.leftWidget) - self.leftLayout.setMargin(0) - self.leftLayout.setObjectName(u'leftLayout') - self.monitorGroupBox = QtGui.QGroupBox(self.leftWidget) + SettingsTab.setupUi(self) + self.monitorGroupBox = QtGui.QGroupBox(self.leftColumn) self.monitorGroupBox.setObjectName(u'monitorGroupBox') self.monitorLayout = QtGui.QFormLayout(self.monitorGroupBox) self.monitorLayout.setObjectName(u'monitorLayout') @@ -106,7 +100,7 @@ class GeneralTab(SettingsTab): self.displayOnMonitorCheck.setObjectName(u'monitorComboBox') self.monitorLayout.addRow(self.displayOnMonitorCheck) self.leftLayout.addWidget(self.monitorGroupBox) - self.startupGroupBox = QtGui.QGroupBox(self.leftWidget) + self.startupGroupBox = QtGui.QGroupBox(self.leftColumn) self.startupGroupBox.setObjectName(u'startupGroupBox') self.startupLayout = QtGui.QVBoxLayout(self.startupGroupBox) self.startupLayout.setObjectName(u'startupLayout') @@ -120,7 +114,7 @@ class GeneralTab(SettingsTab): self.showSplashCheckBox.setObjectName(u'showSplashCheckBox') self.startupLayout.addWidget(self.showSplashCheckBox) self.leftLayout.addWidget(self.startupGroupBox) - self.settingsGroupBox = QtGui.QGroupBox(self.leftWidget) + self.settingsGroupBox = QtGui.QGroupBox(self.leftColumn) self.settingsGroupBox.setObjectName(u'settingsGroupBox') self.settingsLayout = QtGui.QFormLayout(self.settingsGroupBox) self.settingsLayout.setObjectName(u'settingsLayout') @@ -138,13 +132,7 @@ class GeneralTab(SettingsTab): self.settingsLayout.addRow(self.timeoutLabel, self.timeoutSpinBox) self.leftLayout.addWidget(self.settingsGroupBox) self.leftLayout.addStretch() - self.generalLayout.addWidget(self.leftWidget) - self.rightWidget = QtGui.QWidget(self) - self.rightWidget.setObjectName(u'rightWidget') - self.rightLayout = QtGui.QVBoxLayout(self.rightWidget) - self.rightLayout.setMargin(0) - self.rightLayout.setObjectName(u'rightLayout') - self.ccliGroupBox = QtGui.QGroupBox(self.rightWidget) + self.ccliGroupBox = QtGui.QGroupBox(self.rightColumn) self.ccliGroupBox.setObjectName(u'ccliGroupBox') self.ccliLayout = QtGui.QFormLayout(self.ccliGroupBox) self.ccliLayout.setObjectName(u'ccliLayout') @@ -166,7 +154,7 @@ class GeneralTab(SettingsTab): self.ccliLayout.addRow(self.passwordLabel, self.passwordEdit) self.rightLayout.addWidget(self.ccliGroupBox) # Moved here from display tab - self.displayGroupBox = QtGui.QGroupBox(self.rightWidget) + self.displayGroupBox = QtGui.QGroupBox(self.rightColumn) self.displayGroupBox.setObjectName(u'displayGroupBox') self.displayLayout = QtGui.QGridLayout(self.displayGroupBox) self.displayLayout.setObjectName(u'displayLayout') @@ -225,7 +213,6 @@ class GeneralTab(SettingsTab): self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3) self.rightLayout.addWidget(self.displayGroupBox) self.rightLayout.addStretch() - self.generalLayout.addWidget(self.rightWidget) # Signals and slots QtCore.QObject.connect(self.overrideCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled) @@ -300,20 +287,6 @@ class GeneralTab(SettingsTab): translate('OpenLP.GeneralTab', 'Height')) self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.generalLayout.spacing() - \ - self.generalLayout.contentsMargins().left() - \ - self.generalLayout.contentsMargins().right() - left_width = min(width - self.rightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.leftWidget.minimumSizeHint().width()) - self.leftWidget.setMinimumWidth(left_width) - def load(self): """ Load the settings to populate the form diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 29518f078..537e99cc2 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -36,22 +36,15 @@ class Ui_SettingsDialog(object): build_icon(u':/system/system_settings.png')) self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) margins = self.settingsLayout.contentsMargins() - self.settingsLayout.setContentsMargins(0, margins.top(), 0, 0) self.settingsLayout.setObjectName(u'settingsLayout') self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) - self.settingsTabWidget.setDocumentMode(True) self.settingsTabWidget.setObjectName(u'settingsTabWidget') self.settingsLayout.addWidget(self.settingsTabWidget) - self.buttonBoxLayout = QtGui.QGridLayout() - self.buttonBoxLayout.setContentsMargins(margins.left(), 0, - margins.right(), margins.bottom()) - self.buttonBoxLayout.setObjectName(u'buttonBoxLayout') self.buttonBox = QtGui.QDialogButtonBox(settingsDialog) self.buttonBox.setStandardButtons( QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(u'buttonBox') - self.buttonBoxLayout.addWidget(self.buttonBox) - self.settingsLayout.addLayout(self.buttonBoxLayout) + self.settingsLayout.addWidget(self.buttonBox) self.retranslateUi(settingsDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), settingsDialog.accept) diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index 32c50fe88..3f41d377a 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -31,7 +31,6 @@ from openlp.core.lib import translate, build_icon class Ui_ShortcutListDialog(object): def setupUi(self, shortcutListDialog): shortcutListDialog.setObjectName(u'shortcutListDialog') -# shortcutListDialog.resize(500, 438) self.dialogLayout = QtGui.QVBoxLayout(shortcutListDialog) self.dialogLayout.setObjectName(u'dialogLayout') self.treeWidget = QtGui.QTreeWidget(shortcutListDialog) diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 3c3a51f43..adeb03794 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -38,10 +38,8 @@ class ThemesTab(SettingsTab): def setupUi(self): self.setObjectName(u'ThemesTab') - self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes') - self.ThemesTabLayout = QtGui.QHBoxLayout(self) - self.ThemesTabLayout.setObjectName(u'ThemesTabLayout') - self.GlobalGroupBox = QtGui.QGroupBox(self) + 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') @@ -51,8 +49,9 @@ class ThemesTab(SettingsTab): self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox) self.DefaultListView.setObjectName(u'DefaultListView') self.GlobalGroupBoxLayout.addWidget(self.DefaultListView) - self.ThemesTabLayout.addWidget(self.GlobalGroupBox) - self.LevelGroupBox = QtGui.QGroupBox(self) + 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( @@ -81,7 +80,8 @@ class ThemesTab(SettingsTab): self.GlobalLevelLabel.setObjectName(u'GlobalLevelLabel') self.LevelLayout.addRow(self.GlobalLevelRadioButton, self.GlobalLevelLabel) - self.ThemesTabLayout.addWidget(self.LevelGroupBox) + self.rightLayout.addWidget(self.LevelGroupBox) + self.rightLayout.addStretch() QtCore.QObject.connect(self.SongLevelRadioButton, QtCore.SIGNAL(u'pressed()'), self.onSongLevelButtonPressed) QtCore.QObject.connect(self.ServiceLevelRadioButton, @@ -94,6 +94,7 @@ class ThemesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): + self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes') self.GlobalGroupBox.setTitle( translate('OpenLP.ThemesTab', 'Global Theme')) self.LevelGroupBox.setTitle( @@ -117,20 +118,6 @@ class ThemesTab(SettingsTab): translate('OpenLP.ThemesTab', 'Use the global theme, overriding ' 'any themes associated with either the service or the songs.')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.ThemesTabLayout.spacing() - \ - self.ThemesTabLayout.contentsMargins().left() - \ - self.ThemesTabLayout.contentsMargins().right() - left_width = min(width - self.LevelGroupBox.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.GlobalGroupBox.minimumSizeHint().width()) - self.GlobalGroupBox.setMinimumWidth(left_width) - def load(self): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 80a824e3c..96870d94c 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -39,14 +39,8 @@ class AlertsTab(SettingsTab): def setupUi(self): self.setObjectName(u'AlertsTab') - self.AlertsLayout = QtGui.QHBoxLayout(self) - self.AlertsLayout.setObjectName(u'AlertsLayout') - 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.FontGroupBox = QtGui.QGroupBox(self.LeftColumn) + 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') @@ -87,24 +81,17 @@ class AlertsTab(SettingsTab): self.LocationComboBox.addItems([u'', u'', u'']) self.LocationComboBox.setObjectName(u'LocationComboBox') self.FontLayout.addRow(self.LocationLabel, self.LocationComboBox) - self.LeftLayout.addWidget(self.FontGroupBox) - self.LeftLayout.addStretch() - self.AlertsLayout.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.PreviewGroupBox = QtGui.QGroupBox(self.RightColumn) + 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.AlertsLayout.addWidget(self.RightColumn) + self.rightLayout.addWidget(self.PreviewGroupBox) + self.rightLayout.addStretch() # Signals and slots QtCore.QObject.connect(self.BackgroundColorButton, QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked) @@ -149,20 +136,6 @@ class AlertsTab(SettingsTab): self.LocationComboBox.setItemText(2, translate('AlertsPlugin.AlertsTab', 'Bottom')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.AlertsLayout.spacing() - \ - self.AlertsLayout.contentsMargins().left() - \ - self.AlertsLayout.contentsMargins().right() - left_width = min(width - self.RightColumn.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.LeftColumn.minimumSizeHint().width()) - self.LeftColumn.setMinimumWidth(left_width) - def onBackgroundColorButtonClicked(self): new_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.bg_color), self) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index adc451862..4010b89a1 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -46,14 +46,8 @@ class BiblesTab(SettingsTab): def setupUi(self): self.setObjectName(u'BiblesTab') - self.BibleLayout = QtGui.QHBoxLayout(self) - self.BibleLayout.setObjectName(u'BibleLayout') - self.LeftWidget = QtGui.QWidget(self) - self.LeftWidget.setObjectName(u'LeftWidget') - self.LeftLayout = QtGui.QVBoxLayout(self.LeftWidget) - self.LeftLayout.setMargin(0) - self.LeftLayout.setObjectName(u'LeftLayout') - self.VerseDisplayGroupBox = QtGui.QGroupBox(self.LeftWidget) + 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') @@ -88,16 +82,9 @@ class BiblesTab(SettingsTab): self.ChangeNoteLabel.setWordWrap(True) self.ChangeNoteLabel.setObjectName(u'ChangeNoteLabel') self.VerseDisplayLayout.addRow(self.ChangeNoteLabel) - self.LeftLayout.addWidget(self.VerseDisplayGroupBox) - self.LeftLayout.addStretch() - self.BibleLayout.addWidget(self.LeftWidget) - self.RightWidget = QtGui.QWidget(self) - self.RightWidget.setObjectName(u'RightWidget') - self.RightLayout = QtGui.QVBoxLayout(self.RightWidget) - self.RightLayout.setMargin(0) - self.RightLayout.setObjectName(u'RightLayout') - self.RightLayout.addStretch() - self.BibleLayout.addWidget(self.RightWidget) + self.leftLayout.addWidget(self.VerseDisplayGroupBox) + self.leftLayout.addStretch() + self.rightLayout.addStretch() # Signals and slots QtCore.QObject.connect( self.NewChaptersCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), @@ -148,20 +135,6 @@ class BiblesTab(SettingsTab): self.BibleSecondCheckBox.setText( translate('BiblesPlugin.BiblesTab', 'Display second Bible verses')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.BibleLayout.spacing() - \ - self.BibleLayout.contentsMargins().left() - \ - self.BibleLayout.contentsMargins().right() - left_width = min(width - self.RightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.LeftWidget.minimumSizeHint().width()) - self.LeftWidget.setMinimumWidth(left_width) - def onBibleThemeComboBoxChanged(self): self.bible_theme = self.BibleThemeComboBox.currentText() diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 9fce7a007..3c1b848aa 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -37,14 +37,8 @@ class CustomTab(SettingsTab): def setupUi(self): self.setObjectName(u'CustomTab') - self.customLayout = QtGui.QHBoxLayout(self) - self.customLayout.setObjectName(u'customLayout') - self.leftWidget = QtGui.QWidget(self) - self.leftWidget.setObjectName(u'leftWidget') - self.leftLayout = QtGui.QVBoxLayout(self.leftWidget) - self.leftLayout.setMargin(0) - self.leftLayout.setObjectName(u'leftLayout') - self.customModeGroupBox = QtGui.QGroupBox(self.leftWidget) + SettingsTab.setupUi(self) + self.customModeGroupBox = QtGui.QGroupBox(self.leftColumn) self.customModeGroupBox.setObjectName(u'customModeGroupBox') self.customModeLayout = QtGui.QFormLayout(self.customModeGroupBox) self.customModeLayout.setObjectName(u'customModeLayout') @@ -53,14 +47,7 @@ class CustomTab(SettingsTab): self.customModeLayout.addRow(self.displayFooterCheckBox) self.leftLayout.addWidget(self.customModeGroupBox) self.leftLayout.addStretch() - self.customLayout.addWidget(self.leftWidget) - self.rightWidget = QtGui.QWidget(self) - self.rightWidget.setObjectName(u'rightWidget') - self.rightLayout = QtGui.QVBoxLayout(self.rightWidget) - self.rightLayout.setMargin(0) - self.rightLayout.setObjectName(u'rightLayout') self.rightLayout.addStretch() - self.customLayout.addWidget(self.rightWidget) QtCore.QObject.connect(self.displayFooterCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onDisplayFooterCheckBoxChanged) @@ -71,20 +58,6 @@ class CustomTab(SettingsTab): self.displayFooterCheckBox.setText( translate('CustomPlugin.CustomTab', 'Display footer')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.customLayout.spacing() - \ - self.customLayout.contentsMargins().left() - \ - self.customLayout.contentsMargins().right() - left_width = min(width - self.rightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.leftWidget.minimumSizeHint().width()) - self.leftWidget.setMinimumWidth(left_width) - def onDisplayFooterCheckBoxChanged(self, check_state): self.displayFooter = False # we have a set value convert to True/False diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 8b54afb89..461fbf4ae 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -37,14 +37,8 @@ class MediaTab(SettingsTab): def setupUi(self): self.setObjectName(u'MediaTab') - self.mediaLayout = QtGui.QHBoxLayout(self) - self.mediaLayout.setObjectName(u'mediaLayout') - self.leftWidget = QtGui.QWidget(self) - self.leftWidget.setObjectName(u'leftWidget') - self.leftLayout = QtGui.QVBoxLayout(self.leftWidget) - self.leftLayout.setMargin(0) - self.leftLayout.setObjectName(u'leftLayout') - self.mediaModeGroupBox = QtGui.QGroupBox(self.leftWidget) + SettingsTab.setupUi(self) + self.mediaModeGroupBox = QtGui.QGroupBox(self.leftColumn) self.mediaModeGroupBox.setObjectName(u'mediaModeGroupBox') self.mediaModeLayout = QtGui.QFormLayout(self.mediaModeGroupBox) self.mediaModeLayout.setObjectName(u'mediaModeLayout') @@ -53,14 +47,7 @@ class MediaTab(SettingsTab): self.mediaModeLayout.addRow(self.usePhononCheckBox) self.leftLayout.addWidget(self.mediaModeGroupBox) self.leftLayout.addStretch() - self.mediaLayout.addWidget(self.leftWidget) - self.rightWidget = QtGui.QWidget(self) - self.rightWidget.setObjectName(u'rightWidget') - self.rightLayout = QtGui.QVBoxLayout(self.rightWidget) - self.rightLayout.setMargin(0) - self.rightLayout.setObjectName(u'rightLayout') self.rightLayout.addStretch() - self.mediaLayout.addWidget(self.rightWidget) QtCore.QObject.connect(self.usePhononCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onUsePhononCheckBoxChanged) @@ -72,20 +59,6 @@ class MediaTab(SettingsTab): self.usePhononCheckBox.setText( translate('MediaPlugin.MediaTab', 'Use Phonon for video playback')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.mediaLayout.spacing() - \ - self.mediaLayout.contentsMargins().left() - \ - self.mediaLayout.contentsMargins().right() - left_width = min(width - self.rightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.leftWidget.minimumSizeHint().width()) - self.leftWidget.setMinimumWidth(left_width) - def onUsePhononCheckBoxChanged(self, check_state): self.usePhonon = (check_state == QtCore.Qt.Checked) self.usePhononChanged = True diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 066577006..fef3bcba1 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -44,14 +44,8 @@ class PresentationTab(SettingsTab): Create the controls for the settings tab """ self.setObjectName(u'PresentationTab') - self.PresentationLayout = QtGui.QHBoxLayout(self) - self.PresentationLayout.setObjectName(u'PresentationLayout') - self.LeftWidget = QtGui.QWidget(self) - self.LeftWidget.setObjectName(u'LeftWidget') - self.LeftLayout = QtGui.QVBoxLayout(self.LeftWidget) - self.LeftLayout.setMargin(0) - self.LeftLayout.setObjectName(u'LeftLayout') - self.ControllersGroupBox = QtGui.QGroupBox(self.LeftWidget) + SettingsTab.setupUi(self) + self.ControllersGroupBox = QtGui.QGroupBox(self.leftColumn) self.ControllersGroupBox.setObjectName(u'ControllersGroupBox') self.ControllersLayout = QtGui.QVBoxLayout(self.ControllersGroupBox) self.ControllersLayout.setObjectName(u'ControllersLayout') @@ -63,24 +57,17 @@ class PresentationTab(SettingsTab): checkbox.setObjectName(controller.name + u'CheckBox') self.PresenterCheckboxes[controller.name] = checkbox self.ControllersLayout.addWidget(checkbox) - self.LeftLayout.addWidget(self.ControllersGroupBox) - self.AdvancedGroupBox = QtGui.QGroupBox(self.LeftWidget) + self.leftLayout.addWidget(self.ControllersGroupBox) + self.AdvancedGroupBox = QtGui.QGroupBox(self.leftColumn) self.AdvancedGroupBox.setObjectName(u'AdvancedGroupBox') self.AdvancedLayout = QtGui.QVBoxLayout(self.AdvancedGroupBox) self.AdvancedLayout.setObjectName(u'AdvancedLayout') self.OverrideAppCheckBox = QtGui.QCheckBox(self.AdvancedGroupBox) self.OverrideAppCheckBox.setObjectName(u'OverrideAppCheckBox') self.AdvancedLayout.addWidget(self.OverrideAppCheckBox) - self.LeftLayout.addWidget(self.AdvancedGroupBox) - self.LeftLayout.addStretch() - self.PresentationLayout.addWidget(self.LeftWidget) - self.RightWidget = QtGui.QWidget(self) - self.RightWidget.setObjectName(u'RightWidget') - self.RightLayout = QtGui.QVBoxLayout(self.RightWidget) - self.RightLayout.setMargin(0) - self.RightLayout.setObjectName(u'RightLayout') - self.RightLayout.addStretch() - self.PresentationLayout.addWidget(self.RightWidget) + self.leftLayout.addWidget(self.AdvancedGroupBox) + self.leftLayout.addStretch() + self.rightLayout.addStretch() def retranslateUi(self): """ @@ -100,20 +87,6 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overriden')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.PresentationLayout.spacing() - \ - self.PresentationLayout.contentsMargins().left() - \ - self.PresentationLayout.contentsMargins().right() - left_width = min(width - self.RightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.LeftWidget.minimumSizeHint().width()) - self.LeftWidget.setMinimumWidth(left_width) - def load(self): """ Load the settings. diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index 4fc66e30e..e97d33762 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -37,16 +37,8 @@ class RemoteTab(SettingsTab): def setupUi(self): self.setObjectName(u'RemoteTab') - self.remoteLayout = QtGui.QHBoxLayout(self) - self.remoteLayout.setObjectName(u'remoteLayout') - self.leftWidget = QtGui.QWidget(self) - self.leftWidget.setSizePolicy(QtGui.QSizePolicy.Fixed, - QtGui.QSizePolicy.Preferred) - self.leftWidget.setObjectName(u'leftWidget') - self.leftLayout = QtGui.QVBoxLayout(self.leftWidget) - self.leftLayout.setMargin(0) - self.leftLayout.setObjectName(u'leftLayout') - self.serverSettingsGroupBox = QtGui.QGroupBox(self.leftWidget) + SettingsTab.setupUi(self) + self.serverSettingsGroupBox = QtGui.QGroupBox(self.leftColumn) self.serverSettingsGroupBox.setObjectName(u'serverSettingsGroupBox') self.serverSettingsLayout = QtGui.QFormLayout( self.serverSettingsGroupBox) @@ -54,6 +46,10 @@ class RemoteTab(SettingsTab): self.addressLabel = QtGui.QLabel(self.serverSettingsGroupBox) self.addressLabel.setObjectName(u'addressLabel') self.addressEdit = QtGui.QLineEdit(self.serverSettingsGroupBox) + self.addressEdit.setSizePolicy(QtGui.QSizePolicy.Preferred, + QtGui.QSizePolicy.Fixed) + self.addressEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp( + u'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'), self)) self.addressEdit.setObjectName(u'addressEdit') self.serverSettingsLayout.addRow(self.addressLabel, self.addressEdit) self.portLabel = QtGui.QLabel(self.serverSettingsGroupBox) @@ -64,14 +60,7 @@ class RemoteTab(SettingsTab): self.serverSettingsLayout.addRow(self.portLabel, self.portSpinBox) self.leftLayout.addWidget(self.serverSettingsGroupBox) self.leftLayout.addStretch() - self.remoteLayout.addWidget(self.leftWidget) - self.rightWidget = QtGui.QWidget(self) - self.rightWidget.setObjectName(u'rightWidget') - self.rightLayout = QtGui.QVBoxLayout(self.rightWidget) - self.rightLayout.setMargin(0) - self.rightLayout.setObjectName(u'rightLayout') self.rightLayout.addStretch() - self.remoteLayout.addWidget(self.rightWidget) def retranslateUi(self): self.serverSettingsGroupBox.setTitle( @@ -81,20 +70,6 @@ class RemoteTab(SettingsTab): self.portLabel.setText(translate('RemotePlugin.RemoteTab', 'Port number:')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.remoteLayout.spacing() - \ - self.remoteLayout.contentsMargins().left() - \ - self.remoteLayout.contentsMargins().right() - left_width = min(width - self.rightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.leftWidget.minimumSizeHint().width()) - self.leftWidget.setMinimumWidth(left_width) - def load(self): self.portSpinBox.setValue( QtCore.QSettings().value(self.settingsSection + u'/port', diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index b1647bf64..9ed8ace94 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -37,14 +37,8 @@ class SongsTab(SettingsTab): def setupUi(self): self.setObjectName(u'SongsTab') - self.SongsLayout = QtGui.QHBoxLayout(self) - self.SongsLayout.setObjectName(u'SongsLayout') - self.LeftWidget = QtGui.QWidget(self) - self.LeftWidget.setObjectName(u'LeftWidget') - self.LeftLayout = QtGui.QVBoxLayout(self.LeftWidget) - self.LeftLayout.setMargin(0) - self.LeftLayout.setObjectName(u'LeftLayout') - self.SongsModeGroupBox = QtGui.QGroupBox(self.LeftWidget) + SettingsTab.setupUi(self) + self.SongsModeGroupBox = QtGui.QGroupBox(self.leftColumn) self.SongsModeGroupBox.setObjectName(u'SongsModeGroupBox') self.SongsModeLayout = QtGui.QVBoxLayout(self.SongsModeGroupBox) self.SongsModeLayout.setObjectName(u'SongsModeLayout') @@ -62,16 +56,9 @@ class SongsTab(SettingsTab): self.SongAddFromServiceCheckBox.setObjectName( u'SongAddFromServiceCheckBox') self.SongsModeLayout.addWidget(self.SongAddFromServiceCheckBox) - self.LeftLayout.addWidget(self.SongsModeGroupBox) - self.LeftLayout.addStretch() - self.SongsLayout.addWidget(self.LeftWidget) - self.RightWidget = QtGui.QWidget(self) - self.RightWidget.setObjectName(u'RightWidget') - self.RightLayout = QtGui.QVBoxLayout(self.RightWidget) - self.RightLayout.setMargin(0) - self.RightLayout.setObjectName(u'RightLayout') - self.RightLayout.addStretch() - self.SongsLayout.addWidget(self.RightWidget) + self.leftLayout.addWidget(self.SongsModeGroupBox) + self.leftLayout.addStretch() + self.rightLayout.addStretch() QtCore.QObject.connect(self.SearchAsTypeCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onSearchAsTypeCheckBoxChanged) @@ -98,20 +85,6 @@ class SongsTab(SettingsTab): translate('SongsPlugin.SongsTab', 'Add missing songs when opening service')) - def resizeEvent(self, event=None): - """ - Resize the sides in two equal halves if the layout allows this. - """ - if event: - SettingsTab.resizeEvent(self, event) - width = self.width() - self.SongsLayout.spacing() - \ - self.SongsLayout.contentsMargins().left() - \ - self.SongsLayout.contentsMargins().right() - left_width = min(width - self.RightWidget.minimumSizeHint().width(), - width / 2) - left_width = max(left_width, self.LeftWidget.minimumSizeHint().width()) - self.LeftWidget.setMinimumWidth(left_width) - def onSearchAsTypeCheckBoxChanged(self, check_state): self.song_search = False # we have a set value convert to True/False