← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bug-versions into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bug-versions into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-versions/+merge/84365

Fix the plugin Disabled route as it has never been tested

Stop plugins being available if the database is more advanced than the code.
-- 
https://code.launchpad.net/~trb143/openlp/bug-versions/+merge/84365
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug-versions into lp:openlp.
=== modified file 'openlp/core/lib/db.py'
--- openlp/core/lib/db.py	2011-11-08 06:22:35 +0000
+++ openlp/core/lib/db.py	2011-12-03 13:36:26 +0000
@@ -182,6 +182,7 @@
         settings.beginGroup(plugin_name)
         self.db_url = u''
         self.is_dirty = False
+        self.session = None
         db_type = unicode(
             settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString())
         if db_type == u'sqlite':

=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py	2011-10-26 20:11:15 +0000
+++ openlp/core/lib/pluginmanager.py	2011-12-03 13:36:26 +0000
@@ -158,6 +158,8 @@
         for plugin in self.plugins:
             if plugin.status is not PluginStatus.Disabled:
                 plugin.settings_tab = plugin.getSettingsTab(settings_form)
+            else:
+                plugin.settings_tab = None
         settings_form.plugins = self.plugins
 
     def hook_import_menu(self, import_menu):

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2011-06-12 16:02:52 +0000
+++ openlp/core/ui/pluginform.py	2011-12-03 13:36:26 +0000
@@ -117,16 +117,17 @@
             self.pluginListWidget.currentItem().text().split(u'(')[0][:-1]
         self.activePlugin = None
         for plugin in self.parent().pluginManager.plugins:
-            if plugin.nameStrings[u'singular'] == plugin_name_singular:
-                self.activePlugin = plugin
-                break
+            if plugin.status != PluginStatus.Disabled:
+                if plugin.nameStrings[u'singular'] == plugin_name_singular:
+                    self.activePlugin = plugin
+                    break
         if self.activePlugin:
             self._setDetails()
         else:
             self._clearDetails()
 
     def onStatusComboBoxChanged(self, status):
-        if self.programaticChange:
+        if self.programaticChange or status == PluginStatus.Disabled:
             return
         if status == 0:
             Receiver.send_message(u'cursor_busy')

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2011-09-12 16:35:32 +0000
+++ openlp/plugins/songs/songsplugin.py	2011-12-03 13:36:26 +0000
@@ -64,6 +64,9 @@
         self.icon_path = u':/plugins/plugin_songs.png'
         self.icon = build_icon(self.icon_path)
 
+    def checkPreConditions(self):
+        return self.manager.session is not None
+
     def initialise(self):
         log.info(u'Songs Initialising')
         Plugin.initialise(self)

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2011-08-26 19:31:02 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2011-12-03 13:36:26 +0000
@@ -54,6 +54,9 @@
         self.inactiveIcon = build_icon(u':/songusage/song_usage_inactive.png')
         self.songUsageActive = False
 
+    def checkPreConditions(self):
+        return self.manager.session is not None
+
     def addToolsMenuItem(self, tools_menu):
         """
         Give the SongUsage plugin the opportunity to add items to the


Follow ups