integrated 'split layout' in the SettingsTab class

remove the documentMode from the TabWidget in the SettingsDialog
replace comment for HideMode class
This commit is contained in:
M2j 2011-01-03 12:25:30 +01:00
parent ebd44c7a94
commit b0c9b3f077
14 changed files with 89 additions and 320 deletions

View File

@ -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):
"""

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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',

View File

@ -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