Fix database versions

This commit is contained in:
Tim Bentley 2011-12-03 12:51:40 +00:00
parent 0a5d089f07
commit 1239cd707c
4 changed files with 11 additions and 4 deletions

View File

@ -182,6 +182,7 @@ class Manager(object):
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':

View File

@ -158,6 +158,8 @@ class PluginManager(object):
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):

View File

@ -117,6 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.pluginListWidget.currentItem().text().split(u'(')[0][:-1]
self.activePlugin = None
for plugin in self.parent().pluginManager.plugins:
if plugin.status != PluginStatus.Disabled:
if plugin.nameStrings[u'singular'] == plugin_name_singular:
self.activePlugin = plugin
break
@ -126,7 +127,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
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')

View File

@ -64,6 +64,9 @@ class SongsPlugin(Plugin):
self.icon_path = u':/plugins/plugin_songs.png'
self.icon = build_icon(self.icon_path)
def checkPreConditions(self):
return not self.manager.session == None
def initialise(self):
log.info(u'Songs Initialising')
Plugin.initialise(self)