add a dialog at startup which inform the user that the bible format has changed and provide a possibility to upgrade

small cleanup
This commit is contained in:
Armin Köhler 2011-05-03 09:41:03 +02:00
parent b9204fa62b
commit 4bee8ca5f6
2 changed files with 14 additions and 2 deletions

View File

@ -37,7 +37,8 @@ from traceback import format_exception
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, check_directory_exists
from openlp.core.lib import Receiver, check_directory_exists, SettingsManager, \
translate
from openlp.core.lib.ui import UiStrings
from openlp.core.resources import qInitResources
from openlp.core.ui.mainwindow import MainWindow
@ -130,6 +131,18 @@ class OpenLP(QtGui.QApplication):
u'general/update check', QtCore.QVariant(True)).toBool()
if update_check:
VersionThread(self.mainWindow).start()
for plugin in self.mainWindow.pluginManager.plugins:
if plugin.name == u'Bibles' and plugin.isActive() and len(
SettingsManager.get_files(u'bibles/bibles', u'.sqlite')) == 0 \
and len(SettingsManager.get_files(u'bibles', u'.sqlite')) > 0:
if QtGui.QMessageBox.information(self.mainWindow,
translate('OpenLP', 'Information'), translate('OpenLP',
'Bible format has changed.\nYou have to upgrade your '
'existing bibles.\nShould OpenLP upgrade now?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No)) == QtGui.QMessageBox.Yes:
plugin.onToolsUpgradeItemTriggered()
break
DelayStartThread(self.mainWindow).start()
return self.exec_()

View File

@ -27,7 +27,6 @@
The bible import functions for OpenLP
"""
import logging
#import os
import os.path
import re