Switched around the order of some dialogs when deleting items in the Song Maintenance dialog.

This commit is contained in:
Raoul Snyman 2009-08-02 21:10:54 +02:00
parent 2b237bb488
commit 708a62ad47

View File

@ -79,15 +79,15 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
item_id = self._getCurrentItemId(list_widget) item_id = self._getCurrentItemId(list_widget)
if item_id != -1: if item_id != -1:
item = get_func(item_id) item = get_func(item_id)
if QtGui.QMessageBox.warning(self, dlg_title, del_text, if item is not None and len(item.songs) == 0:
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes) if QtGui.QMessageBox.warning(self, dlg_title, del_text,
) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)
if item is not None and len(item.songs) == 0: ) == QtGui.QMessageBox.Yes:
del_func(item.id) del_func(item.id)
reset_func() reset_func()
else: else:
QtGui.QMessageBox.critical(self, dlg_title, err_text, QtGui.QMessageBox.critical(self, dlg_title, err_text,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
else: else:
QtGui.QMessageBox.critical(self, dlg_title, sel_text, QtGui.QMessageBox.critical(self, dlg_title, sel_text,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))