示例#1
0
 def reject(self):
     idx = self.stack.currentIndex()
     if idx > 0:
         if confirm_delete(_('Are you sure? Any unsaved changes will be lost.'), 'confirm-cancel-edit-custom-recipe'):
             self.stack.setCurrentIndex(0)
         return
     Dialog.reject(self)
示例#2
0
 def remove_cover(self):
     if not confirm_delete(
         _('Are you sure you want to delete the cover permanently?'),
             'book-details-confirm-cover-remove', parent=self):
         return
     id_ = self.data.get('id', None)
     self.pixmap = self.default_pixmap
     self.do_layout()
     self.update()
     if id_ is not None:
         self.cover_removed.emit(id_)
示例#3
0
 def remove(self):
     idx = self.view.currentIndex()
     if idx.isValid():
         if confirm_delete(_(
                 'Are you sure you want to permanently remove this recipe?'
         ),
                           'remove-custom-recipe',
                           parent=self):
             self.model.remove((idx.row(), ))
             self.select_row()
             if self.model.rowCount() == 0:
                 self.stacks.setCurrentIndex(0)