← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/testing into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/testing into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)


Consistency fixes
* settings_section naming for plugins
* *_settings_section in one location for the main application
* plugintab.py goes in plugin/lib
* all settings_section/last directory keys contain directories not files
-- 
https://code.launchpad.net/~meths/openlp/testing/+merge/24466
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2010-04-28 14:17:42 +0000
+++ openlp/core/lib/mediamanageritem.py	2010-04-30 02:04:19 +0000
@@ -70,11 +70,6 @@
         The user visible name for a plugin which should use a suitable
         translation function.
 
-     ``self.SettingsSection``
-        The section in the configuration where the items in the media
-        manager are stored. This could potentially be
-        ``self.PluginNameShort.lower()``.
-
      ``self.OnNewPrompt``
         Defaults to *'Select Image(s)'*.
 
@@ -103,6 +98,7 @@
         """
         QtGui.QWidget.__init__(self)
         self.parent = parent
+        self.settings_section = title.lower()
         if type(icon) is QtGui.QIcon:
             self.icon = icon
         elif type(icon) is types.StringType:
@@ -335,20 +331,20 @@
     def onFileClick(self):
         files = QtGui.QFileDialog.getOpenFileNames(
             self, self.OnNewPrompt,
-            SettingsManager.get_last_dir(self.SettingsSection),
+            SettingsManager.get_last_dir(self.settings_section),
             self.OnNewFileMasks)
         log.info(u'New files(s) %s', unicode(files))
         if files:
             self.loadList(files)
-            dir, filename = os.path.split(unicode(files[0]))
-            SettingsManager.set_last_dir(self.SettingsSection, dir)
-            SettingsManager.set_list(
-                self.SettingsSection, self.SettingsSection, self.getFileList())
+            dir = os.path.split(unicode(files[0]))[0]
+            SettingsManager.set_last_dir(self.settings_section, dir)
+            SettingsManager.set_list(self.settings_section,
+                self.settings_section, self.getFileList())
 
     def getFileList(self):
         count = 0
         filelist = []
-        while  count < self.ListView.count():
+        while count < self.ListView.count():
             bitem = self.ListView.item(count)
             filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
             filelist.append(filename)

=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py	2010-04-28 14:17:42 +0000
+++ openlp/core/lib/settingstab.py	2010-04-30 02:04:19 +0000
@@ -40,7 +40,7 @@
         QtGui.QWidget.__init__(self)
         self.tabTitle = title
         self.tabTitleVisible = None
-        self.settingsSection = self.tabTitle.lower()
+        self.settings_section = self.tabTitle.lower()
         self.setupUi()
         self.retranslateUi()
         self.initialise()

=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/generaltab.py	2010-04-30 02:04:19 +0000
@@ -42,7 +42,7 @@
         If not set before default to last screen.
         """
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.MonitorNumber = settings.value(u'monitor',
             QtCore.QVariant(self.screens.monitor_number)).toInt()[0]
         self.screens.set_current_display(self.MonitorNumber)
@@ -229,7 +229,7 @@
 
     def load(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         for screen in self.screens.screen_list:
             screen_name = u'%s %d' % (self.trUtf8('Screen'),
                 screen[u'number'] + 1)
@@ -268,7 +268,7 @@
 
     def save(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         settings.setValue(u'monitor', QtCore.QVariant(self.MonitorNumber))
         settings.setValue(u'display on monitor',
             QtCore.QVariant(self.DisplayOnMonitor))

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2010-04-29 12:35:40 +0000
+++ openlp/core/ui/mainwindow.py	2010-04-30 02:04:19 +0000
@@ -424,8 +424,12 @@
         QtGui.QMainWindow.__init__(self)
         self.screens = screens
         self.applicationVersion = applicationVersion
-        self.generalSettingsSection = u'general'
-        self.uiSettingsSection = u'user interface'
+        # Set up settings sections for the main application
+        # (not for use by plugins)
+        self.ui_settings_section = u'user interface'
+        self.general_settings_section = u'general'
+        self.service_settings_section = u'servicemanager'
+        self.songs_settings_section = u'songs'
         self.serviceNotSaved = False
         self.settingsmanager = SettingsManager(screens)
         self.displayManager = DisplayManager(screens)
@@ -570,7 +574,8 @@
         if self.displayManager.mainDisplay.isVisible():
             self.displayManager.mainDisplay.setFocus()
         self.activateWindow()
-        if QtCore.QSettings().value(self.generalSettingsSection + u'/auto open',
+        if QtCore.QSettings().value(
+            self.general_settings_section + u'/auto open',
             QtCore.QVariant(False)).toBool():
             self.ServiceManagerContents.onLoadService(True)
 
@@ -580,7 +585,7 @@
         Triggered by delay thread.
         """
         settings = QtCore.QSettings()
-        settings.beginGroup(self.generalSettingsSection)
+        settings.beginGroup(self.general_settings_section)
         if settings.value(u'screen blank', QtCore.QVariant(False)).toBool() \
         and settings.value(u'blank warning', QtCore.QVariant(False)).toBool():
             self.LiveController.onBlankDisplay(True)
@@ -725,9 +730,10 @@
     def loadSettings(self):
         log.debug(u'Loading QSettings')
         settings = QtCore.QSettings()
-        self.recentFiles = settings.value(
-            self.generalSettingsSection + u'/recent files').toStringList()
-        settings.beginGroup(self.uiSettingsSection)
+        settings.beginGroup(self.general_settings_section)
+        self.recentFiles = settings.value(u'recent files').toStringList()
+        settings.endGroup()
+        settings.beginGroup(self.ui_settings_section)
         self.move(settings.value(u'main window position',
             QtCore.QVariant(QtCore.QPoint(0, 0))).toPoint())
         self.restoreGeometry(
@@ -738,11 +744,12 @@
     def saveSettings(self):
         log.debug(u'Saving QSettings')
         settings = QtCore.QSettings()
+        settings.beginGroup(self.general_settings_section)
         recentFiles = QtCore.QVariant(self.recentFiles) \
             if self.recentFiles else QtCore.QVariant()
-        settings.setValue(
-            self.generalSettingsSection + u'/recent files', recentFiles)
-        settings.beginGroup(self.uiSettingsSection)
+        settings.setValue(u'recent files', recentFiles)
+        settings.endGroup()
+        settings.beginGroup(self.ui_settings_section)
         settings.setValue(u'main window position',
             QtCore.QVariant(self.pos()))
         settings.setValue(u'main window state',
@@ -772,7 +779,7 @@
 
     def addRecentFile(self, filename):
         recentFileCount = QtCore.QSettings().value(
-            self.generalSettingsSection + u'/max recent files',
+            self.general_settings_section + u'/max recent files',
             QtCore.QVariant(4)).toInt()[0]
         if filename and not self.recentFiles.contains(filename):
             self.recentFiles.prepend(QtCore.QString(filename))

=== modified file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/mediadockmanager.py	2010-04-30 02:04:19 +0000
@@ -45,18 +45,17 @@
         log.debug(u'Inserting %s dock' % media_item.title)
         match = False
         for dock_index in range(0, self.media_dock.count()):
-            if self.media_dock.widget(dock_index).SettingsSection == \
+            if self.media_dock.widget(dock_index).settings_section == \
                 media_item.title.lower():
                 match = True
                 break
         if not match:
             self.media_dock.addItem(media_item, icon, media_item.title)
 
-
     def remove_dock(self, name):
         log.debug(u'remove %s dock' % name)
         for dock_index in range(0, self.media_dock.count()):
             if self.media_dock.widget(dock_index):
-                if self.media_dock.widget(dock_index).SettingsSection == name:
+                if self.media_dock.widget(dock_index).settings_section == name:
                     self.media_dock.widget(dock_index).hide()
                     self.media_dock.removeItem(dock_index)

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/servicemanager.py	2010-04-30 02:04:19 +0000
@@ -1,3 +1,4 @@
+import os.path
 # -*- coding: utf-8 -*-
 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
 
@@ -99,8 +100,6 @@
         """
         QtGui.QWidget.__init__(self)
         self.parent = parent
-        self.settingsSection = u'servicemanager'
-        self.generalSettingsSection = self.parent.generalSettingsSection
         self.serviceItems = []
         self.serviceName = u''
         self.droppos = 0
@@ -193,7 +192,7 @@
             QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
         # Last little bits of setting up
         self.service_theme = unicode(QtCore.QSettings().value(
-            self.settingsSection + u'/service theme',
+            self.parent.service_settings_section + u'/service theme',
             QtCore.QVariant(u'')).toString())
         self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
         #build the context menu
@@ -406,7 +405,7 @@
         Clear the list to create a new service
         """
         if self.parent.serviceNotSaved and QtCore.QSettings().value(
-            self.generalSettingsSection + u'/save prompt',
+            self.parent.general_settings_section + u'/save prompt',
             QtCore.QVariant(False)).toBool():
             ret = QtGui.QMessageBox.question(self,
                 self.trUtf8('Save Changes to Service?'),
@@ -491,17 +490,20 @@
         if not quick or self.isNew:
             filename = QtGui.QFileDialog.getSaveFileName(self,
             self.trUtf8(u'Save Service'),
-            SettingsManager.get_last_dir(self.settingsSection),
+            SettingsManager.get_last_dir(self.parent.service_settings_section),
             self.trUtf8(u'OpenLP Service Files (*.osz)'))
         else:
-            filename = SettingsManager.get_last_dir(self.settingsSection)
+            filename = SettingsManager.get_last_dir(
+                self.parent.service_settings_section)
         if filename:
             splittedFile = filename.split(u'.')
             if splittedFile[-1] != u'osz':
                 filename = filename + u'.osz'
             filename = unicode(filename)
             self.isNew = False
-            SettingsManager.set_last_dir(self.settingsSection, filename)
+            SettingsManager.set_last_dir(
+                self.parent.service_settings_section,
+                os.path.split(filename)[0])
             service = []
             servicefile = filename + u'.osd'
             zip = None
@@ -542,12 +544,13 @@
 
     def onLoadService(self, lastService=False):
         if lastService:
-            filename = SettingsManager.get_last_dir(self.settingsSection)
+            filename = SettingsManager.get_last_dir(
+                self.parent.service_settings_section)
         else:
             filename = QtGui.QFileDialog.getOpenFileName(
                 self, self.trUtf8('Open Service'),
-                SettingsManager.get_last_dir(self.settingsSection),
-                u'Services (*.osz)')
+                SettingsManager.get_last_dir(
+                self.parent.service_settings_section), u'Services (*.osz)')
         self.loadService(filename)
 
     def loadService(self, filename=None):
@@ -576,7 +579,9 @@
         filename = unicode(filename)
         name = filename.split(os.path.sep)
         if filename:
-            SettingsManager.set_last_dir(self.settingsSection, filename)
+            SettingsManager.set_last_dir(
+                self.parent.service_settings_section,
+                os.path.split(filename)[0])
             zip = None
             f = None
             try:
@@ -645,7 +650,8 @@
         """
         self.service_theme = unicode(self.ThemeComboBox.currentText())
         self.parent.RenderManager.set_service_theme(self.service_theme)
-        QtCore.QSettings().setValue(self.settingsSection + u'/service theme',
+        QtCore.QSettings().setValue(
+            self.parent.service_settings_section + u'/service theme',
             QtCore.QVariant(self.service_theme))
         self.regenerateServiceItems()
 
@@ -729,7 +735,7 @@
         self.parent.LiveController.addServiceManagerItem(
             self.serviceItems[item][u'service_item'], count)
         if QtCore.QSettings().value(
-            self.generalSettingsSection + u'/auto preview',
+            self.parent.general_settings_section + u'/auto preview',
             QtCore.QVariant(False)).toBool():
             item += 1
             if self.serviceItems and item < len(self.serviceItems) and \

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/slidecontroller.py	2010-04-30 02:04:19 +0000
@@ -93,8 +93,6 @@
         """
         QtGui.QWidget.__init__(self, parent)
         self.settingsmanager = settingsmanager
-        self.generalSettingsSection = u'general'
-        self.songsSettingsSection = u'songs'
         self.isLive = isLive
         self.parent = parent
         self.mainDisplay = self.parent.displayManager.mainDisplay
@@ -399,7 +397,7 @@
         if item.is_text():
             self.Toolbar.makeWidgetsInvisible(self.loop_list)
             if QtCore.QSettings().value(
-                self.songsSettingsSection + u'/show songbar',
+                self.parent.songs_settings_section + u'/show songbar',
                 QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
                 self.Toolbar.makeWidgetsVisible([u'Song Menu'])
         if item.is_capable(ItemCapabilities.AllowsLoop) and \
@@ -589,7 +587,7 @@
             self.blankButton.setChecked(True)
         self.blankScreen(HideMode.Blank, self.blankButton.isChecked())
         QtCore.QSettings().setValue(
-            self.generalSettingsSection + u'/screen blank',
+            self.parent.general_settings_section + u'/screen blank',
             QtCore.QVariant(self.blankButton.isChecked()))
 
     def onThemeDisplay(self, force=False):

=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/thememanager.py	2010-04-30 02:04:19 +0000
@@ -47,7 +47,7 @@
     def __init__(self, parent):
         QtGui.QWidget.__init__(self, parent)
         self.parent = parent
-        self.settingsSection = u'themes'
+        self.settings_section = u'themes'
         self.Layout = QtGui.QVBoxLayout(self)
         self.Layout.setSpacing(0)
         self.Layout.setMargin(0)
@@ -106,14 +106,14 @@
             QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
         #Variables
         self.themelist = []
-        self.path = AppLocation.get_section_data_path(self.settingsSection)
+        self.path = AppLocation.get_section_data_path(self.settings_section)
         self.checkThemesExists(self.path)
         self.thumbPath = os.path.join(self.path, u'.thumbnails')
         self.checkThemesExists(self.thumbPath)
         self.amendThemeForm.path = self.path
         # Last little bits of setting up
         self.global_theme = unicode(QtCore.QSettings().value(
-            self.settingsSection + u'/global theme',
+            self.settings_section + u'/global theme',
             QtCore.QVariant(u'')).toString())
 
     def changeGlobalFromTab(self, themeName):
@@ -147,7 +147,7 @@
                 name = u'%s (%s)' % (self.global_theme, self.trUtf8('default'))
                 self.ThemeListWidget.item(count).setText(name)
                 QtCore.QSettings().setValue(
-                    self.settingsSection + u'/global theme',
+                    self.settings_section + u'/global theme',
                     QtCore.QVariant(self.global_theme))
                 Receiver.send_message(u'theme_update_global', self.global_theme)
                 self.pushThemes()
@@ -170,7 +170,7 @@
 
     def onDeleteTheme(self):
         self.global_theme = unicode(QtCore.QSettings().value(
-            self.settingsSection + u'/global theme',
+            self.settings_section + u'/global theme',
             QtCore.QVariant(u'')).toString())
         item = self.ThemeListWidget.currentItem()
         if item:
@@ -224,10 +224,10 @@
         theme = unicode(item.data(QtCore.Qt.UserRole).toString())
         path = QtGui.QFileDialog.getExistingDirectory(self,
             unicode(self.trUtf8('Save Theme - (%s)')) %  theme,
-            SettingsManager.get_last_dir(self.settingsSection, 1))
+            SettingsManager.get_last_dir(self.settings_section, 1))
         path = unicode(path)
         if path:
-            SettingsManager.set_last_dir(self.settingsSection, path, 1)
+            SettingsManager.set_last_dir(self.settings_section, path, 1)
             themePath = os.path.join(path, theme + u'.theme')
             zip = None
             try:
@@ -247,12 +247,12 @@
     def onImportTheme(self):
         files = QtGui.QFileDialog.getOpenFileNames(
             self, self.trUtf8('Select Theme Import File'),
-            SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)')
+            SettingsManager.get_last_dir(self.settings_section), u'Theme (*.*)')
         log.info(u'New Themes %s', unicode(files))
         if files:
             for file in files:
                 SettingsManager.set_last_dir(
-                    self.settingsSection, unicode(file))
+                    self.settings_section, unicode(file))
                 self.unzipTheme(file, self.path)
         self.loadThemes()
 

=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py	2010-04-28 14:17:42 +0000
+++ openlp/core/ui/themestab.py	2010-04-30 02:04:19 +0000
@@ -124,7 +124,7 @@
 
     def load(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.theme_level = settings.value(
             u'theme level', QtCore.QVariant(ThemeLevel.Global)).toInt()[0]
         self.global_theme = unicode(settings.value(
@@ -139,7 +139,7 @@
 
     def save(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         settings.setValue(u'theme level',
             QtCore.QVariant(self.theme_level))
         settings.setValue(u'global theme',
@@ -179,7 +179,7 @@
         """
         #reload as may have been triggered by the ThemeManager
         self.global_theme = unicode(QtCore.QSettings().value(
-            self.settingsSection + u'/global theme',
+            self.settings_section + u'/global theme',
             QtCore.QVariant(u'')).toString())
         self.DefaultComboBox.clear()
         for theme in theme_list:

=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/alerts/alertsplugin.py	2010-04-30 02:04:19 +0000
@@ -28,8 +28,8 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import Plugin, build_icon, PluginStatus
-from openlp.plugins.alerts.lib import AlertsManager, DBManager
-from openlp.plugins.alerts.forms import AlertsTab, AlertForm
+from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager
+from openlp.plugins.alerts.forms import AlertForm
 
 log = logging.getLogger(__name__)
 

=== modified file 'openlp/plugins/alerts/forms/__init__.py'
--- openlp/plugins/alerts/forms/__init__.py	2010-03-22 18:33:54 +0000
+++ openlp/plugins/alerts/forms/__init__.py	2010-04-30 02:04:19 +0000
@@ -23,5 +23,4 @@
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
 ###############################################################################
 
-from alertstab import AlertsTab
 from alertform import AlertForm

=== modified file 'openlp/plugins/alerts/lib/__init__.py'
--- openlp/plugins/alerts/lib/__init__.py	2010-03-21 23:58:01 +0000
+++ openlp/plugins/alerts/lib/__init__.py	2010-04-30 02:04:19 +0000
@@ -24,4 +24,5 @@
 ###############################################################################
 
 from alertsmanager import AlertsManager
+from alertstab import AlertsTab
 from manager import DBManager

=== renamed file 'openlp/plugins/alerts/forms/alertstab.py' => 'openlp/plugins/alerts/lib/alertstab.py'
--- openlp/plugins/alerts/forms/alertstab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/alerts/lib/alertstab.py	2010-04-30 02:04:19 +0000
@@ -229,7 +229,7 @@
 
     def load(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.timeout = settings.value(u'timeout', QtCore.QVariant(5)).toInt()[0]
         self.font_color = unicode(settings.value(
             u'font color', QtCore.QVariant(u'#ffffff')).toString())
@@ -260,7 +260,7 @@
 
     def save(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.font_face = self.FontComboBox.currentFont().family()
         settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
         settings.setValue(u'font color', QtCore.QVariant(self.font_color))

=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/bibles/lib/biblestab.py	2010-04-30 02:04:19 +0000
@@ -189,7 +189,7 @@
 
     def load(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.show_new_chapters = settings.value(
             u'display new chapter', QtCore.QVariant(False)).toBool()
         self.display_style = settings.value(
@@ -208,7 +208,7 @@
 
     def save(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         settings.setValue(u'display new chapter',
             QtCore.QVariant(self.show_new_chapters))
         settings.setValue(u'display brackets',

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -54,7 +54,6 @@
 
     def __init__(self, parent, icon, title):
         self.PluginNameShort = u'Bible'
-        self.SettingsSection = title.lower()
         self.IconPath = u'songs/song'
         self.ListViewWithDnD_class = BibleListView
         self.lastReference = []
@@ -276,7 +275,7 @@
         self.SearchProgress.setObjectName(u'SearchProgress')
 
     def configUpdated(self):
-        if QtCore.QSettings().value(self.SettingsSection + u'/dual bibles',
+        if QtCore.QSettings().value(self.settings_section + u'/dual bibles',
             QtCore.QVariant(False)).toBool():
             self.AdvancedSecondBibleLabel.setVisible(True)
             self.AdvancedSecondBibleComboBox.setVisible(True)

=== modified file 'openlp/plugins/custom/lib/customtab.py'
--- openlp/plugins/custom/lib/customtab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/custom/lib/customtab.py	2010-04-30 02:04:19 +0000
@@ -67,10 +67,10 @@
 
     def load(self):
         self.displayFooter = QtCore.QSettings().value(
-            self.settingsSection + u'/display footer',
+            self.settings_section + u'/display footer',
             QtCore.QVariant(True)).toBool()
         self.DisplayFooterCheckBox.setChecked(self.displayFooter)
 
     def save(self):
-        QtCore.QSettings().setValue(self.settingsSection + u'/display footer',
+        QtCore.QSettings().setValue(self.settings_section + u'/display footer',
             QtCore.QVariant(self.displayFooter))

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -45,7 +45,6 @@
 
     def __init__(self, parent, icon, title):
         self.PluginNameShort = u'Custom'
-        self.SettingsSection = title.lower()
         self.IconPath = u'custom/custom'
         # this next is a class, not an instance of a class - it will
         # be instanced by the base MediaManagerItem
@@ -164,7 +163,7 @@
         service_item.title = title
         for slide in raw_slides:
             service_item.add_from_text(slide[:30], slide)
-        if QtCore.QSettings().value(self.SettingsSection + u'/display footer',
+        if QtCore.QSettings().value(self.settings_section + u'/display footer',
             QtCore.QVariant(True)).toBool() or credit:
             raw_footer.append(title + u' ' + credit)
         else:

=== modified file 'openlp/plugins/images/lib/imagetab.py'
--- openlp/plugins/images/lib/imagetab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/images/lib/imagetab.py	2010-04-30 02:04:19 +0000
@@ -72,12 +72,12 @@
 
     def load(self):
         self.loop_delay = QtCore.QSettings().value(
-            self.settingsSection + u'/loop delay',
+            self.settings_section + u'/loop delay',
             QtCore.QVariant(5)).toInt()[0]
         self.TimeoutSpinBox.setValue(self.loop_delay)
 
     def save(self):
-        QtCore.QSettings().setValue(self.settingsSection + u'/loop delay',
+        QtCore.QSettings().setValue(self.settings_section + u'/loop delay',
             QtCore.QVariant(self.loop_delay))
         Receiver.send_message(u'slidecontroller_live_spin_delay', 
             self.loop_delay)

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -49,7 +49,6 @@
 
     def __init__(self, parent, icon, title):
         self.PluginNameShort = u'Image'
-        self.SettingsSection = title.lower()
         self.IconPath = u'images/image'
         # this next is a class, not an instance of a class - it will
         # be instanced by the base MediaManagerItem
@@ -78,12 +77,12 @@
             QtGui.QAbstractItemView.ExtendedSelection)
         self.ListView.setIconSize(QtCore.QSize(88,50))
         self.servicePath = os.path.join(
-            AppLocation.get_section_data_path(self.SettingsSection),
+            AppLocation.get_section_data_path(self.settings_section),
             u'.thumbnails')
         if not os.path.exists(self.servicePath):
             os.mkdir(self.servicePath)
         self.loadList(SettingsManager.load_list(
-            self.SettingsSection, self.SettingsSection))
+            self.settings_section, self.settings_section))
 
     def addListViewToToolBar(self):
         MediaManagerItem.addListViewToToolBar(self)
@@ -122,8 +121,8 @@
                     #if not present do not worry
                     pass
                 self.ListView.takeItem(item.row())
-                SettingsManager.set_list(
-                    self.SettingsSection, self.getFileList())
+                SettingsManager.set_list(self.settings_section,
+                    self.settings_section, self.getFileList())
 
     def loadList(self, list):
         for file in list:

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -47,7 +47,6 @@
     def __init__(self, parent, icon, title):
         self.PluginNameShort = u'Media'
         self.IconPath = u'images/image'
-        self.SettingsSection = title.lower()
         # this next is a class, not an instance of a class - it will
         # be instanced by the base MediaManagerItem
         self.ListViewWithDnD_class = MediaListView
@@ -90,14 +89,15 @@
             QtGui.QAbstractItemView.ExtendedSelection)
         self.ListView.setIconSize(QtCore.QSize(88,50))
         self.loadList(SettingsManager.load_list(
-            self.SettingsSection, self.SettingsSection))
+            self.settings_section, self.settings_section))
 
     def onDeleteClick(self):
         item = self.ListView.currentItem()
         if item:
             row = self.ListView.row(item)
             self.ListView.takeItem(row)
-            SettingsManager.set_list(self.SettingsSection, self.getFileList())
+            SettingsManager.set_list(self.settings_section,
+                self.settings_section, self.getFileList())
 
     def loadList(self, list):
         for file in list:

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -52,7 +52,6 @@
     def __init__(self, parent, icon, title, controllers):
         self.controllers = controllers
         self.PluginNameShort = u'Presentation'
-        self.SettingsSection = title.lower()
         self.IconPath = u'presentations/presentation'
         self.Automatic = u''
         # this next is a class, not an instance of a class - it will
@@ -107,11 +106,12 @@
 
     def initialise(self):
         self.servicePath = os.path.join(
-            AppLocation.get_section_data_path(self.SettingsSection),
+            AppLocation.get_section_data_path(self.settings_section),
             u'thumbnails')
         if not os.path.exists(self.servicePath):
             os.mkdir(self.servicePath)
-        list = SettingsManager.load_list(self.SettingsSection, u'presentations')
+        list = SettingsManager.load_list(
+            self.settings_section, u'presentations')
         self.loadList(list)
         for item in self.controllers:
             #load the drop down selection
@@ -139,11 +139,13 @@
                 icon = None
                 for controller in self.controllers:
                     thumbPath = os.path.join(
-                        AppLocation.get_section_data_path(self.SettingsSection),
+                        AppLocation.get_section_data_path(
+                            self.settings_section),
                         u'thumbnails', controller, filename)
                     thumb = os.path.join(thumbPath, u'slide1.png')
                     preview = os.path.join(
-                        AppLocation.get_section_data_path(self.SettingsSection),
+                        AppLocation.get_section_data_path(
+                            self.settings_section),
                         controller, u'thumbnails', filename, u'slide1.png')
                     if os.path.exists(preview):
                         if os.path.exists(thumb):
@@ -167,7 +169,8 @@
         if item:
             row = self.ListView.row(item)
             self.ListView.takeItem(row)
-            SettingsManager.set_list(self.SettingsSection, self.getFileList())
+            SettingsManager.set_list(self.settings_section,
+                self.settings_section, self.getFileList())
             filepath = unicode((item.data(QtCore.Qt.UserRole)).toString())
             #not sure of this has errors
             #John please can you look at .

=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py	2010-04-30 02:04:19 +0000
@@ -101,7 +101,7 @@
             if controller.available:
                 checkbox = self.PresenterCheckboxes[controller.name]
                 checkbox.setChecked(QtCore.QSettings().value(
-                    self.settingsSection + u'/' + controller.name,
+                    self.settings_section + u'/' + controller.name,
                     QtCore.QVariant(0)).toInt()[0])
 
     def save(self):
@@ -109,5 +109,5 @@
             controller = self.controllers[key]
             checkbox = self.PresenterCheckboxes[controller.name]
             QtCore.QSettings().setValue(
-                self.settingsSection + u'/' + controller.name,
+                self.settings_section + u'/' + controller.name,
                 QtCore.QVariant(checkbox.checkState()))

=== modified file 'openlp/plugins/remotes/lib/remotetab.py'
--- openlp/plugins/remotes/lib/remotetab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/remotes/lib/remotetab.py	2010-04-30 02:04:19 +0000
@@ -57,9 +57,9 @@
 
     def load(self):
         self.RemotePortSpinBox.setValue(
-            QtCore.QSettings().value(self.settingsSection + u'/remote port',
+            QtCore.QSettings().value(self.settings_section + u'/remote port',
                 QtCore.QVariant(4316)).toInt()[0])
 
     def save(self):
-        QtCore.QSettings().setValue(self.settingsSection + u'/remote port',
+        QtCore.QSettings().setValue(self.settings_section + u'/remote port',
             QtCore.QVariant(self.RemotePortSpinBox.value()))

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2010-04-30 02:04:19 +0000
@@ -46,7 +46,6 @@
 
     def __init__(self, parent, icon, title):
         self.PluginNameShort = u'Song'
-        self.SettingsSection = title.lower()
         self.IconPath = u'songs/song'
         self.ListViewWithDnD_class = SongListView
         MediaManagerItem.__init__(self, parent, icon, title)
@@ -134,7 +133,7 @@
 
     def configUpdated(self):
         self.searchAsYouType = QtCore.QSettings().value(
-            self.SettingsSection + u'/search as type',
+            self.settings_section + u'/search as type',
             QtCore.QVariant(u'False')).toBool()
 
     def retranslateUi(self):

=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/songs/lib/songstab.py	2010-04-30 02:04:19 +0000
@@ -81,7 +81,7 @@
 
     def load(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         self.song_search = settings.value(
             u'search as type', QtCore.QVariant(False)).toBool()
         self.song_bar = settings.value(
@@ -92,7 +92,7 @@
 
     def save(self):
         settings = QtCore.QSettings()
-        settings.beginGroup(self.settingsSection)
+        settings.beginGroup(self.settings_section)
         settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
         settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
         settings.endGroup()

=== modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
--- openlp/plugins/songusage/forms/songusagedetailform.py	2010-04-28 14:17:42 +0000
+++ openlp/plugins/songusage/forms/songusagedetailform.py	2010-04-30 02:04:19 +0000
@@ -45,7 +45,6 @@
         """
         QtGui.QDialog.__init__(self, None)
         self.parent = parent
-        self.settingsSection = u'songusage'
         self.setupUi(self)
 
     def initialise(self):
@@ -57,15 +56,15 @@
         self.FromDate.setSelectedDate(fromDate)
         self.ToDate.setSelectedDate(toDate)
         self.FileLineEdit.setText(
-            SettingsManager.get_last_dir(self.settingsSection, 1))
+            SettingsManager.get_last_dir(self.parent.settings_section, 1))
 
     def defineOutputLocation(self):
         path = QtGui.QFileDialog.getExistingDirectory(self,
             self.trUtf8('Output File Location'),
-            SettingsManager.get_last_dir(self.settingsSection, 1))
+            SettingsManager.get_last_dir(self.parent.settings_section, 1))
         path = unicode(path)
         if path != u'':
-            SettingsManager.set_last_dir(self.settingsSection, path, 1)
+            SettingsManager.set_last_dir(self.parent.settings_section, path, 1)
             self.FileLineEdit.setText(path)
 
     def accept(self):


Follow ups