Changeset 29011 for main/trunk/gli


Ignore:
Timestamp:
2014-04-30T18:43:09+12:00 (10 years ago)
Author:
ak19
Message:
  1. The top right dialog button that closes the dialog should behave as a cancel press, not an accept all press. 2. RemoteGS3 should not try to convert GS2 format statements, but does allow opening a collection containing the html-entity encoded GS2 format statements. 3. Added more tooltips
Location:
main/trunk/gli
Files:
2 edited

Legend:

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

    r29009 r29011  
    941941#
    942942#***** FormatConversionDialog *****
    943 FormatConversionDialog.Title:Convert Greenstone 2 format statements to Greenstone 3
     943FormatConversionDialog.Title:Convert Greenstone2 format statements to Greenstone3
    944944FormatConversionDialog.Reconvert:Reconvert
     945FormatConversionDialog.Reconvert_Tooltip:Converts the text that is currently in the Greenstone2 format text area into a Greenstone3 format statement.
    945946FormatConversionDialog.XHTML_Tidy:XHTML Tidy
    946947FormatConversionDialog.XHTML_Tidy_Tooltip:Will run HTML Tidy over the Greenstone3 format statement to try to fix up obvious XHTML errors.
    947948FormatConversionDialog.Next:Next
     949FormatConversionDialog.Next_Tooltip:Inspect the next Greenstone3 format statement that has been automatically converted from a Greenstone2 format statement.
    948950FormatConversionDialog.Accept_All:Accept All
    949 FormatConversionDialog.GS2_Text_Tooltip:Greenstone2 format statement
     951FormatConversionDialog.Accept_All_Tooltip:Closes this dialog, accepting the default Greenstone3 format statements that have been automatically produced for the current and any subsequent Greenstone2 format statements.
     952FormatConversionDialog.Cancel_Tooltip:Cancels out of opening the collection and closes this dialog, discarding any changes made in the dialog.
     953FormatConversionDialog.GS2_Text_Tooltip:Greenstone2 format statement.
    950954FormatConversionDialog.GS3_Text_Tooltip:Greenstone3 format statement, must be XML to be active in Greenstone.
    951955FormatConversionDialog.Tidy_Failed:Tidy failed.
    952956FormatConversionDialog.Tidy_Done:Tidy done.
    953957FormatConversionDialog.XML_Still_Invalid:XML is still invalid.
    954 FormatConversionDialog.Error_GS3_Format:Error in GS3 format statement.
     958FormatConversionDialog.Error_GS3_Format:Error in Greenstone3 format statement.
    955959FormatConversionDialog.Invalid_XML:Invalid XML.
    956960FormatConversionDialog.Invalid_XML_Warning_Title:Cancel or Continue?
    957961FormatConversionDialog.Cancel_Or_Continue_Next:Either press Cancel to go back and re-edit the XML.\nOr press OK to store the current XML as-is, albeit inactive, and continue on to the next statement.\nYou can later use the Format tab to revisit this format statement if you want to update its syntax.
    958 FormatConversionDialog.Cancel_Or_Accept_All:One or more GS3 format statements contains invalid XML.\nEither press Cancel to correct the XML.\nOr press OK to store the GS3 format statements as-is, albeit inactive.\nYou can later use the Format tab to revisit the format statements if you want to update their syntax.
     962FormatConversionDialog.Cancel_Or_Accept_All:One or more Greenstone3 format statements contains invalid XML.\nEither press Cancel to correct the XML.\nOr press OK to store the Greenstone3 format statements as-is, albeit inactive.\nYou can later use the Format tab to revisit the format statements if you want to update their syntax.
    959963
    960964#**********************
  • main/trunk/gli/src/org/greenstone/gatherer/gui/FormatConversionDialog.java

    r29009 r29011  
    4242// Help tooltips on buttons
    4343// + Undo, Redo buttons
    44 // Split class into dialog/widgets and data processing
     44// X Split class into dialog/widgets and data processing?
     45// http://www.java2s.com/Tutorial/Java/0240__Swing/SettingJOptionPanebuttonlabelstoFrench.htm
    4546
    4647public class FormatConversionDialog extends ModalDialog
     
    9798    setSize(SIZE);
    9899    setTitle(Dictionary.get(Dictionary.get("FormatConversionDialog.Title")));
     100    this.addWindowListener(new WindowClosingListener()); // the dialog's top right close button should behave as a Cancel press
    99101    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    100102   
     
    103105    midbutton_panel.setComponentOrientation(Dictionary.getOrientation());
    104106    JButton reconvert_button = new JButton(Dictionary.get("FormatConversionDialog.Reconvert"));
     107    reconvert_button.setToolTipText(Dictionary.get("FormatConversionDialog.Reconvert_Tooltip"));
    105108    midbutton_panel.add(reconvert_button);
    106109    reconvert_button.addActionListener(new ReconvertListener());
     
    135138    next_button = new JButton(Dictionary.get("FormatConversionDialog.Next"));
    136139    accept_all_button = new JButton(Dictionary.get("FormatConversionDialog.Accept_All"));
     140    accept_all_button.setToolTipText(Dictionary.get("FormatConversionDialog.Accept_All_Tooltip"));
    137141    cancel_button.addActionListener(new CancelButtonListener());
     142    cancel_button.setToolTipText(Dictionary.get("FormatConversionDialog.Cancel_Tooltip"));
    138143    next_button.addActionListener(new NextButtonListener());
     144    next_button.setToolTipText(Dictionary.get("FormatConversionDialog.Next_Tooltip"));
    139145    accept_all_button.addActionListener(new AcceptAllButtonListener());
    140146    button_panel.add(cancel_button);
     
    158164    initTextArea(gs3_textarea);
    159165    gs2_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip"));
    160     gs3_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip"));
     166    gs3_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS3_Text_Tooltip"));
    161167
    162168
     
    230236
    231237    if(Gatherer.GS3 && collect_cfg_file.getAbsolutePath().endsWith(".xml")) {
     238
    232239        //System.err.println("*** Opening an xml config file");
    233240       
     
    259266        }
    260267        System.err.println("*** Found GS2 format statements in config file to be converted to GS3.");
     268
     269       
     270        // if remote GS3, do we open the collection with the html-encoded GS2 format statements
     271        // or do we not allow the remote user to open such a collection at all?
     272        // For now we allow them to open it, but print a warning that conversions are not possible.
     273       
     274        if(Gatherer.isGsdlRemote) { // remote GS3
     275            System.err.println("*** Cannot convert GS2 collections from a remote GS3 server.");
     276            return OpenCollectionDialog.OK_OPTION;
     277        }
    261278
    262279        // If we get here, it means there were no CDataSections in the first (any) <gsf:gs2-format/>
     
    788805    }
    789806
     807    // windowClosing() is called when the user presses the top-right close button the dialog
     808    // this means the user wanted to cancel out of the entire Format Conversion Wizard.
     809    private class WindowClosingListener extends WindowAdapter {
     810    public void windowClosing(WindowEvent e) {     
     811        dlgResult = OpenCollectionDialog.CANCEL_OPTION;
     812    }
     813    }
     814
    790815    private class ReconvertListener implements ActionListener {
    791816    public void actionPerformed(ActionEvent e) {
Note: See TracChangeset for help on using the changeset viewer.