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) settings.beginGroup(plugin_name)
self.db_url = u'' self.db_url = u''
self.is_dirty = False self.is_dirty = False
self.session = None
db_type = unicode( db_type = unicode(
settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString()) settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString())
if db_type == u'sqlite': if db_type == u'sqlite':

View File

@ -158,6 +158,8 @@ class PluginManager(object):
for plugin in self.plugins: for plugin in self.plugins:
if plugin.status is not PluginStatus.Disabled: if plugin.status is not PluginStatus.Disabled:
plugin.settings_tab = plugin.getSettingsTab(settings_form) plugin.settings_tab = plugin.getSettingsTab(settings_form)
else:
plugin.settings_tab = None
settings_form.plugins = self.plugins settings_form.plugins = self.plugins
def hook_import_menu(self, import_menu): def hook_import_menu(self, import_menu):

View File

@ -117,16 +117,17 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.pluginListWidget.currentItem().text().split(u'(')[0][:-1] self.pluginListWidget.currentItem().text().split(u'(')[0][:-1]
self.activePlugin = None self.activePlugin = None
for plugin in self.parent().pluginManager.plugins: for plugin in self.parent().pluginManager.plugins:
if plugin.nameStrings[u'singular'] == plugin_name_singular: if plugin.status != PluginStatus.Disabled:
self.activePlugin = plugin if plugin.nameStrings[u'singular'] == plugin_name_singular:
break self.activePlugin = plugin
break
if self.activePlugin: if self.activePlugin:
self._setDetails() self._setDetails()
else: else:
self._clearDetails() self._clearDetails()
def onStatusComboBoxChanged(self, status): def onStatusComboBoxChanged(self, status):
if self.programaticChange: if self.programaticChange or status == PluginStatus.Disabled:
return return
if status == 0: if status == 0:
Receiver.send_message(u'cursor_busy') 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_path = u':/plugins/plugin_songs.png'
self.icon = build_icon(self.icon_path) self.icon = build_icon(self.icon_path)
def checkPreConditions(self):
return not self.manager.session == None
def initialise(self): def initialise(self):
log.info(u'Songs Initialising') log.info(u'Songs Initialising')
Plugin.initialise(self) Plugin.initialise(self)