From c33654c68c169a5e7cf918bd25b1c0932a3ec392 Mon Sep 17 00:00:00 2001 From: M2j Date: Wed, 8 Dec 2010 23:55:28 +0100 Subject: [PATCH] Bug #659019 --- openlp/plugins/songs/forms/songimportform.py | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 67ef4d8c1..a2a915efd 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -118,9 +118,6 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) - QtCore.QObject.connect(self.cancelButton, - QtCore.SIGNAL(u'clicked(bool)'), - self.onCancelButtonClicked) QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged) @@ -132,6 +129,17 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): self.setDefaults() return QtGui.QWizard.exec_(self) + def reject(self): + """ + Stop the import on pressing the cancel or close button. + """ + log.debug('Import canceled by user.') + if self.currentId() == 2: + Receiver.send_message(u'songs_stop_import') + else: + self.hide() + self.setResult(-1) + def validateCurrentPage(self): """ Validate the current page before moving on to the next page. @@ -394,14 +402,6 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): def onSongBeamerRemoveButtonClicked(self): self.removeSelectedItems(self.songBeamerFileListWidget) - def onCancelButtonClicked(self, checked): - """ - Stop the import on pressing the cancel button. - """ - log.debug('Cancel button pressed!') - if self.currentId() == 2: - Receiver.send_message(u'songs_stop_import') - def onCurrentIdChanged(self, id): if id == 2: self.preImport()