Ignore:
Timestamp:
2009-01-12T11:40:15+13:00 (15 years ago)
Author:
kjdon
Message:

updated the rtl-gli branch with files from trunk. Result of a merge 14807:18318, and fixed some conflicts. I think this is the last commit following merging the files. Haven't tried to compile yet... here goes...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java

    r18297 r18364  
    269269        confirmation.setSelected(false);
    270270        if(!list.isSelectionEmpty()) {
    271         confirmation.setEnabled(true);
    272271        collection = (BasicCollectionConfiguration) list.getSelectedValue();
    273         args = new String[3];
    274         args[0] = collection.getCreator();
    275         args[1] = collection.getMaintainer();
    276         args[2] = collection.getDescription();
    277         details.setText(Dictionary.get("DeleteCollectionPrompt.Details", args));
    278         details.setCaretPosition(0);
     272
     273        String currentColName = (Gatherer.c_man.getCollection() == null) ? "" : Gatherer.c_man.getCollection().getName();
     274        if(!collection.getShortName().equals(currentColName)) {
     275            // the selected collection can only be deleted if it is NOT the collection that is currently open
     276            confirmation.setEnabled(true);
     277            confirmation.setToolTipText(null); // no tooltip
     278            ok_button.setToolTipText(null);
     279
     280            args = new String[3];
     281            args[0] = collection.getCreator();
     282            args[1] = collection.getMaintainer();
     283            args[2] = collection.getDescription();
     284            details.setText(Dictionary.get("DeleteCollectionPrompt.Details", args));
     285            details.setCaretPosition(0);
     286        } else { // trying to delete the collection that is open at present
     287            // add a tooltip saying to the confirmation checkbox saying that the current collection can't be deleted
     288            String tooltip = Dictionary.get("DeleteCollectionPrompt.Cannot_Delete_Open_Collection_Tooltip",
     289                            collection.getName());
     290            confirmation.setToolTipText(tooltip);
     291            ok_button.setToolTipText(tooltip);
     292            // delete/ok button and confirmation checkbox should be disabled
     293            ok_button.setEnabled(false);
     294            confirmation.setEnabled(false);
     295            confirmation.setSelected(false);
     296        }
    279297        }
    280298        else {
Note: See TracChangeset for help on using the changeset viewer.