Changeset 10559
- Timestamp:
- 2005-08-25T09:19:03+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r10548 r10559 181 181 } 182 182 else if (esrc == menu_bar.file_open) { 183 String collection_file_path = showOpenCollectionDialog(); 184 185 // User has selected a collection to open 186 if (collection_file_path != null) { 187 // If there is already a collection open, save and close it 188 if (Gatherer.c_man.ready()) { 189 saveThenCloseCurrentCollection(); 190 } 191 192 // Open the selected collection 193 Gatherer.c_man.loadCollection(collection_file_path); 194 } 183 new OpenCollectionTask().start(); 195 184 } 196 185 else if (esrc == menu_bar.file_options) { … … 404 393 Dictionary.register(tab_pane); 405 394 content_pane.add(tab_pane, BorderLayout.CENTER); 395 406 396 // Call refresh to update all controls to reflect current collection status. 407 397 refresh(-1, Gatherer.c_man.ready()); … … 645 635 646 636 647 /** When the load collection option is choosen this method is called to produce the modal file load prompt. 637 private class OpenCollectionTask 638 extends Thread 639 { 640 public void run() 641 { 642 // If using a remote Greenstone check if the collection configurations have been downloaded; do so if not 643 if (Gatherer.isGsdlRemote) { 644 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 645 if (!collect_directory.exists() || collect_directory.listFiles().length == 0) { 646 if (!RemoteGreenstoneServer.downloadCollectionConfigurations()) { 647 // Something went wrong downloading the collection configurations 648 return; 649 } 650 } 651 } 652 653 String collection_file_path = showOpenCollectionDialog(); 654 655 // User has selected a collection to open 656 if (collection_file_path != null) { 657 // If there is already a collection open, save and close it 658 if (Gatherer.c_man.ready()) { 659 saveThenCloseCurrentCollection(); 660 } 661 662 // Open the selected collection 663 Gatherer.c_man.loadCollection(collection_file_path); 664 } 665 } 666 } 667 668 669 /** When the load collection option is chosen this method is called to produce the modal file load prompt. 648 670 */ 649 671 private String showOpenCollectionDialog() 650 672 { 651 // If using a remote Greenstone check if the collection configurations have been downloaded; do so if not652 File collect_directory = new File(Gatherer.getCollectDirectoryPath());653 if (Gatherer.isGsdlRemote && (!collect_directory.exists() || collect_directory.listFiles().length == 0)) {654 if (!RemoteGreenstoneServer.downloadCollectionConfigurations()) {655 // Something went wrong downloading the collection configurations656 return null;657 }658 }659 660 673 // We first try the simple open collection dialog 661 674 SimpleOpenCollectionDialog dialog = new SimpleOpenCollectionDialog(); … … 668 681 669 682 // Chosen to use the advanced 'browse' dialog 683 File collect_directory = null; 670 684 if (user_choice == SimpleOpenCollectionDialog.BROWSE_OPTION) { 671 685 if (Gatherer.GS3) {
Note:
See TracChangeset
for help on using the changeset viewer.