openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #02446
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Added saving currently selected media plugin.
This will not work correctly when plugins are disabled and re-enabled during a session until plugins media items and tabs can be reinserted where they were taken out.
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/29706
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2010-07-09 21:32:32 +0000
+++ openlp/core/ui/advancedtab.py 2010-07-12 15:16:53 +0000
@@ -53,22 +53,32 @@
self.leftLayout = QtGui.QVBoxLayout(self.leftWidget)
self.leftLayout.setSpacing(8)
self.leftLayout.setMargin(0)
- self.recentGroupBox = QtGui.QGroupBox(self.leftWidget)
- self.recentGroupBox.setObjectName(u'recentGroupBox')
- self.recentGroupBox.setGeometry(QtCore.QRect(0, 0, 220, 57))
- self.recentGroupBox.setMaximumSize(QtCore.QSize(220, 57))
- self.recentLayout = QtGui.QHBoxLayout(self.recentGroupBox)
+ self.uiGroupBox = QtGui.QGroupBox(self.leftWidget)
+ self.uiGroupBox.setObjectName(u'uiGroupBox')
+ self.uiGroupBox.setMaximumWidth(260)
+ self.uiLayout = QtGui.QVBoxLayout(self.uiGroupBox)
+ self.uiLayout.setSpacing(8)
+ self.uiLayout.setMargin(6)
+ self.uiLayout.setObjectName(u'uiLayout')
+ self.recentLayout = QtGui.QHBoxLayout()
self.recentLayout.setSpacing(8)
- self.recentLayout.setMargin(6)
+ self.recentLayout.setMargin(0)
self.recentLayout.setObjectName(u'recentLayout')
- self.recentLabel = QtGui.QLabel(self.recentGroupBox)
+ self.recentLabel = QtGui.QLabel(self.uiGroupBox)
self.recentLabel.setObjectName(u'recentLabel')
self.recentLayout.addWidget(self.recentLabel)
- self.recentSpinBox = QtGui.QSpinBox(self.recentGroupBox)
+ self.recentSpinBox = QtGui.QSpinBox(self.uiGroupBox)
+ self.recentSpinBox.setObjectName(u'recentSpinBox')
self.recentSpinBox.setMinimum(0)
- self.recentSpinBox.setObjectName(u'recentSpinBox')
self.recentLayout.addWidget(self.recentSpinBox)
- self.leftLayout.addWidget(self.recentGroupBox)
+ self.recentSpacer = QtGui.QSpacerItem(50, 20,
+ QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ self.recentLayout.addItem(self.recentSpacer)
+ self.uiLayout.addLayout(self.recentLayout)
+ self.mediaPluginCheckBox = QtGui.QCheckBox(self.uiGroupBox)
+ self.mediaPluginCheckBox.setObjectName(u'mediaPluginCheckBox')
+ self.uiLayout.addWidget(self.mediaPluginCheckBox)
+ self.leftLayout.addWidget(self.uiGroupBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
# self.sharedDirGroupBox.setGeometry(QtCore.QRect(0, 65, 500, 85))
@@ -108,6 +118,8 @@
# self.databaseLayout.setSpacing(8)
# self.databaseLayout.setMargin(8)
# self.rightLayout.addWidget(self.databaseGroupBox)
+# self.rightSpacer = QtGui.QSpacerItem(20, 40,
+# QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
# self.advancedTabLayout.addWidget(self.rightWidget)
# QtCore.QObject.connect(self.sharedCheckBox,
# QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged)
@@ -116,9 +128,11 @@
"""
Setup the interface translation strings.
"""
- self.recentGroupBox.setTitle(translate('AdvancedTab', 'Recent Files'))
+ self.uiGroupBox.setTitle(translate('AdvancedTab', 'UI Settings'))
self.recentLabel.setText(
- translate('AdvancedTab', 'Number of recent files to list:'))
+ translate('AdvancedTab', 'Number of recent files to display:'))
+ self.mediaPluginCheckBox.setText(translate('AdvancedTab',
+ 'Save currently selected media manager plugin'))
# self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText(
@@ -140,6 +154,9 @@
u'max recent files', QtCore.QVariant(20)).toInt()[0])
self.recentSpinBox.setValue(settings.value(u'recent file count',
QtCore.QVariant(4)).toInt()[0])
+ self.mediaPluginCheckBox.setChecked(
+ settings.value(u'save current plugin',
+ QtCore.QVariant(False)).toBool())
settings.endGroup()
def save(self):
@@ -150,6 +167,8 @@
settings.beginGroup(self.settingsSection)
settings.setValue(u'recent file count',
QtCore.QVariant(self.recentSpinBox.value()))
+ settings.setValue(u'save current plugin',
+ QtCore.QVariant(self.mediaPluginCheckBox.isChecked()))
settings.endGroup()
def onSharedCheckBoxChanged(self, checked):
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2010-07-10 10:44:23 +0000
+++ openlp/core/ui/mainwindow.py 2010-07-12 15:16:53 +0000
@@ -658,6 +658,12 @@
log.info(u'Load Themes')
self.ThemeManagerContents.loadThemes()
log.info(u'Load data from Settings')
+ if QtCore.QSettings().value(u'advanced/save current plugin',
+ QtCore.QVariant(False)).toBool():
+ savedPlugin = QtCore.QSettings().value(
+ u'advanced/current media plugin', QtCore.QVariant()).toInt()[0]
+ if savedPlugin != -1:
+ self.MediaToolBox.setCurrentIndex(savedPlugin)
self.settingsForm.postSetUp()
def setAutoLanguage(self, value):
@@ -820,6 +826,10 @@
"""
# Clean temporary files used by services
self.ServiceManagerContents.cleanUp()
+ if QtCore.QSettings().value(u'advanced/save current plugin',
+ QtCore.QVariant(False)).toBool():
+ QtCore.QSettings().setValue(u'advanced/current media plugin',
+ QtCore.QVariant(self.MediaToolBox.currentIndex()))
# Call the cleanup method to shutdown plugins.
log.info(u'cleanup plugins')
self.plugin_manager.finalise_plugins()
Follow ups