Changeset 10396
- Timestamp:
- 2005-08-02T15:35:54+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r10387 r10396 470 470 public void exit() 471 471 { 472 System.err.println("In Gatherer.exit()..."); 472 473 exit = true; 473 474 // If we have an open collection remember it for next time, then save it and close it475 if (c_man.ready()) {476 Configuration.setString("general.open_collection", true, c_man.getCollectionFilePath());477 g_man.saveThenCloseCurrentCollection();478 }479 else {480 Configuration.setString("general.open_collection", true, null);481 }482 474 483 475 // Save the file associations … … 487 479 } 488 480 489 // Store the current position and size (if reasonable) of the Gatherer for next time490 Rectangle bounds = g_man.getBounds();491 Configuration.setBounds("general.bounds", true, bounds);492 493 // Save configuration.494 Configuration.save();495 496 481 // Get the gui to deallocate 497 g_man.setVisible(false);498 482 g_man.destroy(); 499 483 g_man_built = false; … … 509 493 // Make sure we haven't started up any processes that are still running 510 494 if (apps.size() == 0) { 511 if (Gatherer.isApplet) { 512 // If we're running as an applet we don't actually quit, just delete the main GLI window 513 g_man = null; 514 } 515 else { 495 // If we're running as an applet we don't actually quit (just hide the main GLI window) 496 if (!Gatherer.isApplet) { 516 497 // This is the end... 517 498 System.exit(0); -
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r10372 r10396 185 185 186 186 // If there was an open collection last session, reopen it 187 if (Gatherer.open_collection_file_path != null) { 187 Gatherer.open_collection_file_path = Configuration.getString("general.open_collection", true); 188 if (Gatherer.open_collection_file_path != null && !Gatherer.open_collection_file_path.equals("")) { 188 189 Gatherer.c_man.loadCollection(Gatherer.open_collection_file_path); 189 190 } -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r10387 r10396 174 174 } 175 175 else if (esrc == menu_bar.file_exit) { 176 returnToInitialPane();177 176 exit(); 178 177 } … … 291 290 292 291 293 public void destroy() { 292 /** This is called when we're absolutely finished with the GLI. It is *not* called when the applet is suspended. 293 */ 294 public void destroy() 295 { 294 296 // Destroying create pane ensures the latest log has been closed 295 297 if (create_pane != null) { 296 298 create_pane.destroy(); 299 } 300 301 // Deal to help 302 if (help != null) { 303 help.destroy(); 304 help = null; 297 305 } 298 306 } … … 409 417 /** This method ensures that all the things needing saving are saved before Gatherer.exit() is called. 410 418 */ 411 public void exit() {412 // Tell everyone who cares that they are losing focus 413 DebugStream.println("**** GUIManager exit called!");414 415 if (!Gatherer.c_man.ready() || design_pane.canSave()) {416 // If we're running as an applet we don't actually quit, just hide the main GLI window417 if (Gatherer.isApplet) {418 // consider saving???419 setVisible(false);420 421 else { 422 if (Gatherer.c_man.ready() && !Gatherer.c_man.saved()) {423 Gatherer.c_man.saveCollection();424 } 425 426 // Deal to help427 if (help != null) { 428 help.destroy();429 help = null;430 } 431 DebugStream.println("**** Calling Gatherer.self.exit");432 Gatherer.self.exit();433 }419 public void exit() 420 { 421 // If we have a collection open remember it for next time, then save it and close it 422 if (Gatherer.c_man.ready()) { 423 Configuration.setString("general.open_collection", true, Gatherer.c_man.getCollectionFilePath()); 424 saveThenCloseCurrentCollection(); 425 } 426 else { 427 Configuration.setString("general.open_collection", true, null); 428 } 429 430 // Store the current position and size of the GLI for next time 431 Configuration.setBounds("general.bounds", true, getBounds()); 432 433 // Save configuration 434 Configuration.save(); 435 436 // Hide the main window 437 setVisible(false); 438 439 // If we're running as an applet we don't quit here (we quit when the browser calls GathererApplet.destroy()) 440 if (!Gatherer.isApplet) { 441 Gatherer.self.exit(); 434 442 } 435 443 }
Note:
See TracChangeset
for help on using the changeset viewer.