Changeset 9340


Ignore:
Timestamp:
2005-03-09T14:14:50+13:00 (19 years ago)
Author:
mdewsnip
Message:

Changed to use Gatherer.g_man.wait() instead of setModal() to implement its modality. This makes it a lot easier to use and prevents nasty race conditions.

File:
1 edited

Legend:

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

    r9096 r9340  
    4141
    4242    private String message = null;
    43     private JProgressBar progress_bar = null;
    4443
    4544
    46     /** Constructor */
    4745    public ModalProgressPopup(String title, String message)
    4846    {
    4947    super(Gatherer.g_man, title);
    50 
    5148    this.message = message;
    5249    }
    5350
    5451
    55     /** Method to display the popup on screen.
    56      */
     52    /** Method to close the popup. */
     53    public void close()
     54    {
     55    setVisible(false);
     56    Gatherer.g_man.wait(false);
     57    }
     58
     59
     60    /** Method to display the popup on screen. */
    5761    public void display()
    5862    {
    5963    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    60     setModal(true);
    6164    setSize(SIZE);
    6265
    6366    // Create
    64     progress_bar = new JProgressBar();
     67    JProgressBar progress_bar = new JProgressBar();
    6568    progress_bar.setIndeterminate(true);
    6669
     
    7578    setLocation((screen_size.width - SIZE.width) / 2, (screen_size.height - SIZE.height) / 2);
    7679    setVisible(true);
     80
     81    // Lock the rest of the GLI interface until close() is called
     82    Gatherer.g_man.wait(true);
    7783    }
    7884}
Note: See TracChangeset for help on using the changeset viewer.