- disable/enable the next button if a bible/song importer is not available (http://support.openlp.org/issues/113)

- fixed song importers being available even though they should not.

bzr-revno: 1454
This commit is contained in:
Andreas Preikschat 2011-04-11 20:15:02 +02:00
commit b669eded5d
3 changed files with 25 additions and 9 deletions

View File

@ -85,8 +85,18 @@ class BibleImportForm(OpenLPWizard):
"""
OpenLPWizard.setupUi(self, image)
QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.selectStack,
QtCore.SLOT(u'setCurrentIndex(int)'))
QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onCurrentIndexChanged)
def onCurrentIndexChanged(self, index):
"""
Called when the format combo box's index changed. We have to check if
the import is available and accordingly to disable or enable the next
button.
"""
self.selectStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(BibleFormat.get_availability(index))
def customInit(self):
"""

View File

@ -66,7 +66,17 @@ class SongImportForm(OpenLPWizard):
self.formatStack.setCurrentIndex(0)
QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.formatStack.setCurrentIndex)
self.onCurrentIndexChanged)
def onCurrentIndexChanged(self, index):
"""
Called when the format combo box's index changed. We have to check if
the import is available and accordingly to disable or enable the next
button.
"""
self.formatStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(SongFormat.get_availability(index))
def customInit(self):
"""

View File

@ -39,12 +39,8 @@ if os.name == u'nt':
PAGE_AFTER = 5
PAGE_BOTH = 6
else:
try:
import uno
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
PAGE_BOTH
except ImportError:
pass
import uno
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
class OooImport(SongImport):
"""