Changeset 29509 for main/trunk/gli


Ignore:
Timestamp:
2014-12-01T19:11:34+13:00 (9 years ago)
Author:
ak19
Message:

Kathy suggested a confirmation dialog to the reset format statement button might prevent unintentional resets.

Location:
main/trunk/gli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/classes/dictionary.properties

    r29034 r29509  
    113113CDM.FormatManager.AllFeatures:All Features
    114114CDM.FormatManager.AllParts:All Components
     115CDM.FormatManager.Default_Warning:Are you sure you want to reset the format statement to its default?
    115116CDM.FormatManager.Default:Reset to Default
    116117CDM.FormatManager.Default_Tooltip:Reset the selected format command to its default value
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r25733 r29509  
    4040import org.greenstone.gatherer.gui.DesignPaneHeader;
    4141import org.greenstone.gatherer.gui.GLIButton;
     42import org.greenstone.gatherer.gui.WarningDialog;
    4243import org.greenstone.gatherer.metadata.MetadataElement;
    4344import org.greenstone.gatherer.metadata.MetadataSetManager;
     
    991992     
    992993      public void actionPerformed(ActionEvent event) {
     994     
     995      // ensure that the user didn't accidentally press the Reset to Default button
     996      int user_choice = JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("CDM.FormatManager.Default_Warning"), Dictionary.get("General.Warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
     997      if(user_choice == JOptionPane.CANCEL_OPTION) {
     998          return;
     999      }
     1000     
    9931001        newtext = false;
    9941002        if(!ignore_event) {
     
    10351043          }
    10361044         
    1037         }
     1045    }
    10381046      }
    10391047     
Note: See TracChangeset for help on using the changeset viewer.