Changeset 10718


Ignore:
Timestamp:
May 1, 2011, 12:54:17 PM (13 years ago)
Author:
mlg
Message:

Adds confirmation messages for images and categories deletion.

Location:
extensions/jiwigo/trunk/src/main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java

    r10715 r10718  
    273273            setUpUi();
    274274        } else if (arg0.getSource().equals(menuDelete)) {
    275             try {
    276                 if (SpringUtils.getCategoryService().delete(selectedCategory)) {
    277                     setUpUi();
    278                 } else {
     275            int response = JOptionPane.showConfirmDialog(null, Messages.getMessage("categories_confirmationDelete"),
     276                    Messages.getMessage("confirmation"), JOptionPane.YES_NO_OPTION);
     277            if (response == 0) {
     278                try {
     279                    if (SpringUtils.getCategoryService().delete(selectedCategory)) {
     280                        setUpUi();
     281                    } else {
     282                        JOptionPane.showMessageDialog(null, Messages.getMessage("deletingCategoryError"),
     283                                Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
     284                    }
     285                } catch (Exception e) {
     286                    LOG.error(Tools.getStackTrace(e));
    279287                    JOptionPane.showMessageDialog(null, Messages.getMessage("deletingCategoryError"),
    280288                            Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    281289                }
    282             } catch (Exception e) {
    283                 LOG.error(Tools.getStackTrace(e));
    284                 JOptionPane.showMessageDialog(null, Messages.getMessage("deletingCategoryError"),
    285                         Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    286290            }
    287291        }
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java

    r10717 r10718  
    247247
    248248        } else if (arg0.getSource().equals(menuDeleteImage)) {
    249             try {
    250                 if (SpringUtils.getImageService().delete(image)) {
    251                     parent.refresh();
    252                 } else {
     249            int response = JOptionPane.showConfirmDialog(null,
     250                    Messages.getMessage("thumbviewer_deleteImageConfirmation"), Messages.getMessage("confirmation"),
     251                    JOptionPane.YES_NO_OPTION);
     252            if (response == 0) {
     253                try {
     254                    if (SpringUtils.getImageService().delete(image)) {
     255                        parent.refresh();
     256                    } else {
     257                        JOptionPane.showMessageDialog(this, Messages.getMessage("deletingImageError"),
     258                                Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
     259                    }
     260                } catch (JiwigoException e) {
     261                    LOG.error(Tools.getStackTrace(e));
    253262                    JOptionPane.showMessageDialog(this, Messages.getMessage("deletingImageError"),
    254263                            Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    255264                }
    256             } catch (JiwigoException e) {
    257                 LOG.error(Tools.getStackTrace(e));
    258                 JOptionPane.showMessageDialog(this, Messages.getMessage("deletingImageError"),
    259                         Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    260265            }
    261266        }
  • extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages.properties

    r10717 r10718  
    1313info=Info
    1414file=File
     15confirmation=Confirmation
    1516
    1617#####################################################
     
    4950thumbviewer_selectTag=Select tags :
    5051thumbviewer_deleteImage=Delete image
     52thumbviewer_deleteImageConfirmation=Are you sure you want to delete this image ?
    5153
    5254#####################################################
     
    8789categories_enterName=Fill the category name
    8890categories_delete=Delete
     91categories_confirmationDelete=Are you sure you want to delete this category ?
    8992
    9093
  • extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages_en.properties

    r10717 r10718  
    1313info=Info
    1414file=File
     15confirmation=Confirmation
    1516
    1617#####################################################
     
    4950thumbviewer_selectTag=Select tags :
    5051thumbviewer_deleteImage=Delete image
     52thumbviewer_deleteImageConfirmation=Are you sure you want to delete this image ?
    5153
    5254#####################################################
     
    8789categories_enterName=Fill the category name
    8890categories_delete=Delete
     91categories_confirmationDelete=Are you sure you want to delete this category ?
    8992
    9093
  • extensions/jiwigo/trunk/src/main/resources/fr/mael/jiwigo/trad/messages_fr.properties

    r10717 r10718  
    1313info=Info
    1414file=Fichier
     15confirmation=Confirmation
    1516
    1617#####################################################
     
    4950thumbviewer_selectTag=Veuillez sélectionner un (des) tag(s) :
    5051thumbviewer_deleteImage=Supprimer l'image
     52thumbviewer_deleteImageConfirmation=Êtes-vous sûr de vouloir supprimer cette image ?
    5153
    5254#####################################################
     
    8789categories_enterName=Entrez le nom de la catégorie
    8890categories_delete=Supprimer
     91categories_confirmationDelete=Êtes-vous sûr de vouloir supprimer cette catégorie ?
    8992
    9093
Note: See TracChangeset for help on using the changeset viewer.