Do not error out when user clicks stop selected job with no job selected. Fixes #863766 (list index out of range after attempting to stop a job)

This commit is contained in:
Kovid Goyal 2011-09-30 21:07:17 -06:00
parent a569362a4c
commit 2af4016006

View File

@ -500,6 +500,8 @@ class JobsDialog(QDialog, Ui_JobsDialog):
def kill_job(self, *args):
rows = [index.row() for index in
self.jobs_view.selectionModel().selectedRows()]
return error_dialog(self, _('No job'),
_('No job selected'), show=True)
if question_dialog(self, _('Are you sure?'),
ngettext('Do you really want to stop the selected job?',
'Do you really want to stop all the selected jobs?',