forked from openlp/openlp
making 'cancel bible import' work
This commit is contained in:
parent
b465d763cd
commit
20b1c33a4b
@ -99,9 +99,6 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
QtCore.QObject.connect(self.OpenSongBrowseButton,
|
QtCore.QObject.connect(self.OpenSongBrowseButton,
|
||||||
QtCore.SIGNAL(u'clicked()'),
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
self.onOpenSongBrowseButtonClicked)
|
self.onOpenSongBrowseButtonClicked)
|
||||||
QtCore.QObject.connect(self.cancelButton,
|
|
||||||
QtCore.SIGNAL(u'clicked(bool)'),
|
|
||||||
self.onCancelButtonClicked)
|
|
||||||
QtCore.QObject.connect(self,
|
QtCore.QObject.connect(self,
|
||||||
QtCore.SIGNAL(u'currentIdChanged(int)'),
|
QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||||
self.onCurrentIdChanged)
|
self.onCurrentIdChanged)
|
||||||
@ -113,6 +110,16 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
self.setDefaults()
|
self.setDefaults()
|
||||||
return QtGui.QWizard.exec_(self)
|
return QtGui.QWizard.exec_(self)
|
||||||
|
|
||||||
|
def reject(self):
|
||||||
|
"""
|
||||||
|
Stop the import on cancel button, close button or ESC key.
|
||||||
|
"""
|
||||||
|
log.debug('Import canceled by user.')
|
||||||
|
if self.currentId() == 3:
|
||||||
|
Receiver.send_message(u'bibles_stop_import')
|
||||||
|
else:
|
||||||
|
self.done(QtGui.QDialog.Rejected)
|
||||||
|
|
||||||
def validateCurrentPage(self):
|
def validateCurrentPage(self):
|
||||||
"""
|
"""
|
||||||
Validate the current page before moving on to the next page.
|
Validate the current page before moving on to the next page.
|
||||||
@ -244,14 +251,6 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'),
|
translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'),
|
||||||
self.OpenSongFileEdit)
|
self.OpenSongFileEdit)
|
||||||
|
|
||||||
def onCancelButtonClicked(self, checked):
|
|
||||||
"""
|
|
||||||
Stop the import on pressing the cancel button.
|
|
||||||
"""
|
|
||||||
log.debug('Cancel button pressed!')
|
|
||||||
if self.currentId() == 3:
|
|
||||||
Receiver.send_message(u'bibles_stop_import')
|
|
||||||
|
|
||||||
def onCurrentIdChanged(self, pageId):
|
def onCurrentIdChanged(self, pageId):
|
||||||
if pageId == 3:
|
if pageId == 3:
|
||||||
self.preImport()
|
self.preImport()
|
||||||
|
Loading…
Reference in New Issue
Block a user