This commit is contained in:
M2j 2010-12-08 23:55:28 +01:00
parent 3ad231940c
commit c33654c68c

View File

@ -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()