Ignore:
Timestamp:
2005-03-10T11:54:56+13:00 (19 years ago)
Author:
mdewsnip
Message:

Changed WarningDialog to take the dialog title and message as arguments. This means that these strings are marked as used when running showkeyusage.pl.

Location:
trunk/gli/src/org/greenstone/gatherer/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r9334 r9350  
    194194        // If we're adding metadata to folders display the warning
    195195        if (esrc == add && !file_nodes[0].isLeaf()) {
    196         WarningDialog dialog = new WarningDialog("warning.DirectoryLevelMetadata", null, true);
     196        WarningDialog dialog = new WarningDialog("warning.DirectoryLevelMetadata", "DirectoryLevelMetadata.Title", "DirectoryLevelMetadata.Message", null, true);
    197197        int dialog_result = dialog.display();
    198198        dialog.dispose();
  • trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionMetadataPrompt.java

    r9201 r9350  
    211211        cancelled = false;
    212212        if (metadata_sets_list.isNothingTicked()) {
    213         WarningDialog dialog = new WarningDialog("warning.NoMetadataSetsSelected", null, true);
     213        WarningDialog dialog = new WarningDialog("warning.NoMetadataSetsSelected", "NoMetadataSetsSelected.Title", "NoMetadataSetsSelected.Message", null, true);
    214214        if (dialog.display() == JOptionPane.OK_OPTION) {
    215215            // Otherwise we are free to go
  • trunk/gli/src/org/greenstone/gatherer/gui/WarningDialog.java

    r8607 r9350  
    3939public class WarningDialog
    4040    extends ModalDialog
    41     implements ActionListener, KeyListener {
    42 
     41    implements ActionListener, KeyListener
     42{
    4343    static final private Dimension NORMAL_SIZE = new Dimension(450, 160);
    4444    static final private Dimension SETTING_SIZE = new Dimension(450, 200);
     
    5252    private String affected_property;
    5353    private String full_property;
    54     private String warning_name;
    55 
    56 
    57     public WarningDialog(String full_property, String affected_property, boolean can_cancel)
    58     {
    59     this(full_property, null, affected_property, can_cancel);
    60     }
    61 
    62 
    63     public WarningDialog(String full_property, String[] args, String affected_property, boolean can_cancel)
     54
     55
     56    public WarningDialog(String warning_name, String warning_title, String warning_message, String affected_property, boolean can_cancel)
    6457    {
    6558    super(Gatherer.g_man, "Warning", true);
     
    6760    // Determine the name of this prompt.
    6861    this.affected_property = affected_property;
    69     this.full_property = full_property;
    70     warning_name = full_property.substring(full_property.indexOf(".") + 1);
     62    this.full_property = warning_name;
    7163
    7264    // Now build dialog.
     
    7769        setSize(NORMAL_SIZE);
    7870    }
    79     Dictionary.setText(this, warning_name + ".Title");
     71    Dictionary.setText(this, warning_title);
    8072
    8173    // Creation
     
    8981    text_area.setLineWrap(true);
    9082    text_area.setWrapStyleWord(true);
    91     Dictionary.setText(text_area, warning_name + ".Message", args);
     83    Dictionary.setText(text_area, warning_message);
    9284
    9385    value_panel = new JPanel();
Note: See TracChangeset for help on using the changeset viewer.