Changeset 9677


Ignore:
Timestamp:
2005-04-14T13:53:14+12:00 (19 years ago)
Author:
mdewsnip
Message:

Now output from exploding metadata databases is displayed correctly.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

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

    r9160 r9677  
    156156    public synchronized void message(GShellEvent event) {
    157157    String message = event.getMessage();
    158     if (message.startsWith("other>")) {
     158    if (message.startsWith("explode_metadata_database.pl>")) {
    159159        message = message.substring(6);
    160160        error_message.append(message);
     
    253253
    254254    this.error_message = new StringBuffer();
    255     GShell process = new GShell(args, GShell.OTHER, 3, this, null, GShell.GSHELL_OTHER);
     255    GShell process = new GShell(args, GShell.EXPLODE, 3, this, null, GShell.GSHELL_EXPLODE);
    256256    //process.start();
    257257    process.run();
     
    263263    }
    264264
    265     private void resultPrompt(boolean success, String message) {
    266    
    267     String title;
    268     String label;
     265    private void resultPrompt(boolean success, String message)
     266    {
    269267    if (success) {
    270         title = Dictionary.get("ExplodeMetadataPrompt.Successful_Title");
    271         label = Dictionary.get("ExplodeMetadataPrompt.Successful_Explode", metadata_file.getName());
    272     } else {
    273         title = Dictionary.get("ExplodeMetadataPrompt.Failed_Title");
    274         label = Dictionary.get("ExplodeMetadataPrompt.Failed_Explode", metadata_file.getName());
    275     }
    276     SimpleResultDialog result_dialog = new SimpleResultDialog(title, label, message);
    277     result_dialog.setVisible(true); // Blocks
    278     result_dialog.dispose();
    279     result_dialog = null;
    280 
    281     }
     268        // !!! TO DO: Get explode_metadata_database.pl strings translated and use SimpleResultDialog below
     269        JOptionPane.showMessageDialog(null, Dictionary.get("ExplodeMetadataPrompt.Successful_Explode", metadata_file.getName()), Dictionary.get("ExplodeMetadataPrompt.Successful_Title"), JOptionPane.INFORMATION_MESSAGE);
     270    }
     271    else {
     272        String title = Dictionary.get("ExplodeMetadataPrompt.Failed_Title");
     273        String label = Dictionary.get("ExplodeMetadataPrompt.Failed_Explode", metadata_file.getName());
     274        SimpleResultDialog result_dialog = new SimpleResultDialog(title, label, message);
     275        result_dialog.setVisible(true); // Blocks
     276        result_dialog.dispose();
     277        result_dialog = null;
     278    }
     279    }
     280
    282281    private class CancelListener
    283282    implements ActionListener {
  • trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r9348 r9677  
    7777    /** Arguments to be given to the process (including the executable you are calling. */
    7878    private String args[] = null;
    79     /** Element in process type enumeration. */
     79    /** Elements in process type enumeration. */
    8080    static final public int BUILD = 0;
    81     /** Element in process type enumeration. */
    8281    static final public int IMPORT = 1;
    83     /** Element in process type enumeration. */
    8482    static final public int NEW = 2;
    85     /** Element in process type enumeration. */
    8683    static final public int EXPORTAS = 3;
    87     /** Element in process type enumeration. */
    8884    static final public int CDIMAGE = 4;
    89     /** Element in process type enumeration. */
    9085    static final public int CONVERT = 5;
    91     /** Element in process type enumeration. */
    92     static final public int OTHER = 6;
    93     /** Element in status type enumeration. */
     86    static final public int EXPLODE = 6;
     87
     88    /** Elements in status type enumeration. */
    9489    static final public int ERROR = 0;
    95     /** Element in status type enumeration. */
    9690    static final public int OK = 1;
    9791    static final public int CANCELLED = 2;
    98     /** Element in process type name enumeration. */
     92
     93    /** Elements in process type name enumeration. */
    9994    static public String GSHELL_BUILD = "gshell_build";
    100     /** Element in process type name enumeration. */
    10195    static public String GSHELL_IMPORT = "gshell_import";
    102     /** Element in process type name enumeration. */
    10396    static public String GSHELL_NEW = "gshell_new";
    104     /** Element in process type name enumeration */
    10597    static public String GSHELL_EXPORTAS = "gshell_exportas";
    106     /** Element in process type name enumeration */
    10798    static public String GSHELL_CDIMAGE = "gshell_cdimage";
    108     /** Element in process type name enumeration */
    10999    static public String GSHELL_CONVERT = "gshell_convert";
    110     /** Element in process type name enumeration */
    111     static public String GSHELL_OTHER = "gshell_other";
     100    static public String GSHELL_EXPLODE = "gshell_explode";
    112101
    113102    /** Determine if the given process is still executing. It does this by attempting to throw an exception - not the most efficient way, but the only one as far as I know
     
    767756        name = "convert_coll_from_gs2.pl";
    768757        break;
     758    case EXPLODE:
     759        name = "explode_metadata_database.pl";
     760        break;
    769761    default:
    770762        name = "";
Note: See TracChangeset for help on using the changeset viewer.