Changeset 7314


Ignore:
Timestamp:
2004-05-13T15:40:26+12:00 (20 years ago)
Author:
kjdon
Message:

added veronikas changes for the feedback stuff

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

Legend:

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

    r6885 r7314  
    5050import org.greenstone.gatherer.cdm.CommandTokenizer;
    5151import org.greenstone.gatherer.collection.CollectionManager;
     52import org.greenstone.gatherer.feedback.ActionRecorderDialog;
    5253import org.greenstone.gatherer.file.FileManager;
    5354import org.greenstone.gatherer.file.FileAssociationManager;
     
    124125    /** The name of the necessary environment variable to check for in the programs environment. */
    125126    static public String KEY = "GSDLPATH";
     127
     128    // feedback stuff
     129    /** is the feedback feature enabled? */
     130    static public boolean feedback_enabled = true;
     131    /** the action recorder dialog */
     132    static public ActionRecorderDialog feedback_dialog = null;
    126133    /** Extra environment information which must be set before shell processes will run properly. Should always be null if the startup script/program has done its job properly. */
    127134    static public String extra_env[] = null;
     
    205212        loadConfig(gsdl_path, exec_path, perl_path, mirroring_enabled, wget_version_str, wget_path);
    206213
    207         // MDSTesting
    208         //new MDSTest("dublin.mds"); // Old style
    209         //new MDSTest("dublin2.mds"); // Multilingually Optimizated
    210         //System.exit(0);
    211 
     214        // the feedback dialog has been loaded with a default locale,
     215        // now set the user specified one
     216        if (feedback_enabled && feedback_dialog != null) {
     217        feedback_dialog.setLocale(config.getLocale("general.locale", true));
     218        }
     219       
    212220        // Read Dictionary
    213221        dictionary = new Dictionary(config.getLocale("general.locale", true), config.getFont("general.font", true));
     222
    214223
    215224        if (gsdl_path == null) {
     
    305314
    306315        // After the window has been made visible, check that it is in the correct place
     316        // sometimes java places a window not in the correct place,
     317        // but with an offset. If so, we work out what the offset is ]
     318        // and change the desired location to take that into account
    307319        Point location = g_man.getLocation();
    308320        int x_offset = bounds.x - location.x;
     
    310322        // If not, offset the window to move it into the correct location
    311323        if (x_offset > 0 || y_offset > 0) {
     324        ///ystem.err.println("changing the location to "+(bounds.x + x_offset)+" "+ (bounds.y + y_offset));
    312325        g_man.setLocation(bounds.x + x_offset, bounds.y + y_offset);
    313326        }
     
    492505    System.setProperty("java.util.prefs.syncInterval","2000000"); // One message every 600 hours!
    493506
     507
    494508    // Override the exception handler with a new one which we can easily quiet the exceptions from.
    495509    // System.setProperty("sun.awt.exception.handler", "GLIExceptionHandler");
     
    502516        exception.printStackTrace();
    503517    }
    504 
     518   
    505519    Gatherer gatherer = new Gatherer();
    506 
    507520    boolean debug = false;
     521    boolean feedback_enabled = false;
    508522    boolean mirroring_enabled = false;
    509523    boolean no_load = false;
     
    569583            debug = true;
    570584            }
     585            // Run GLI with feedback enabled.
     586            else if(argument_name.equals(StaticStrings.FEEDBACK_ARGUMENT)) {
     587            feedback_enabled = true;
     588            }
    571589            // Forces no loading on previous collection.
    572590            else if(argument_name.equals(StaticStrings.NO_LOAD_ARGUMENT)) {
     
    661679    // Arguments all parsed.
    662680
     681    if (feedback_enabled) {
     682        // if feedback is enabled, set up the recorder dialog
     683        Locale currLocale = Locale.getDefault(); // use teh default locale for now - this will be changed by the Gatherer run method
     684        ActionRecorderDialog dlg = new ActionRecorderDialog (currLocale);
     685        gatherer.feedback_enabled = true;
     686        gatherer.feedback_dialog = dlg;
     687    }
     688   
    663689    // Splash screen.
    664690    Splash splash = new Splash();
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r7224 r7314  
    446446        // Create the menu-bar and stick it up the top.
    447447        menu_bar = new MenuBar(new MenuListenerImpl());
    448         content_pane.add(menu_bar, BorderLayout.NORTH);
     448
     449        //feedback changes
     450        //content_pane.add(menu_bar, BorderLayout.NORTH);
     451        this.setJMenuBar(menu_bar);
     452        // end feedback changes
     453
    449454        // Create the tabbed pane and plop it in the center where it will
    450455        // expand to consume all available space like any good gas would.
     
    452457        tab_pane.addChangeListener(this);
    453458        tab_pane.setFont(Gatherer.config.getFont("general.font", false));
    454 
    455 //          // May have to play with the order in which tabs are added.
    456 //          if(Gatherer.config.get("workflow.browse", true)) {
    457 //          browser_pane = new BrowsingPane();
    458 //          tab_pane.addTab("GUI.Hunt", Utility.getImage("browsing.gif"), browser_pane);
    459 //          tab_pane.setEnabledAt(tab_pane.indexOfComponent(browser_pane), Gatherer.config.get("workflow.browse", false));
    460 //          }
    461459
    462460        if(Gatherer.config.get(StaticStrings.WORKFLOW_MIRROR, true)) {
  • trunk/gli/src/org/greenstone/gatherer/gui/ModalDialog.java

    r6770 r7314  
    3838/** An extension of the JDialog that overrides the JVM's typical modal behaviour. This typical behaviour is that when a modal dialog is opened, all other windows cease to respond to user events until the modal dialog is disposed. However this prevents us opening the help documents property whenever a modal dialog is open. Thus we override the modal behaviour so that only the owner frame or dialog is blocked.
    3939 * Note that because we always call the super constructor with modal set to false, this should be made visible with setVisible(true) rather than show() which will return straight away. */
     40// feedback note: veronika had changed all the super constructor calls to
     41// use modal instead of false - not sure if this is needed so I have not
     42// put that in. --kjdon
    4043public class ModalDialog
    4144    extends JDialog {
  • trunk/gli/src/org/greenstone/gatherer/gui/Splash.java

    r5589 r7314  
    6464    public void destroy() {
    6565    dispose();
    66     rootPane = null;
     66    // feedback change - don't set the rootPane to null
     67    //rootPane = null;
    6768    }
    6869}
  • trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r7288 r7314  
    106106    static final public String EXTRACTED_NAMESPACE                        = "ex.";
    107107    static final public String FALSE_STR                                  = "false";
     108    static final public String FEEDBACK_ARGUMENT                          = "-feedback";
    108109    static final public String FILE_ATTRIBUTE                             = "file";
    109110    static final public String FILENAME_STR                               = "Filename";
Note: See TracChangeset for help on using the changeset viewer.