- Timestamp:
- 2009-05-13T14:45:08+12:00 (15 years ago)
- Location:
- gli/trunk/src/org/greenstone/gatherer/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/gui/GUIManager.java
r19306 r19438 477 477 } 478 478 479 // some cases we have already saved the collection, but don't want to 480 // override the general.open_collection value here 481 public void exitNoCollectionSave(int exit_status) { 482 // Store the current position and size of the GLI for next time 483 Configuration.setBounds("general.bounds", true, getBounds()); 484 485 // Save configuration 486 Configuration.save(); 487 488 // Hide the main window 489 setVisible(false); 490 491 // If we're running as an applet we don't quit here (we quit when the browser calls GathererApplet.destroy()) 492 if (!Gatherer.isApplet) { 493 Gatherer.exit(exit_status); 494 } 495 496 } 479 497 /** This method ensures that all the things needing saving are saved before Gatherer.exit() is called. 480 498 */ -
gli/trunk/src/org/greenstone/gatherer/gui/Preferences.java
r19306 r19438 723 723 // interface font, interface language, changed gliserver url or library url 724 724 boolean restart_required = false; 725 boolean keep_collection_open = false; 725 726 String restart_message = ""; 726 727 … … 743 744 restart_required = true; 744 745 restart_message = Dictionary.get("Preferences.General.Manual_Restart_Required"); 746 745 747 } 746 748 if(Gatherer.c_man.getCollection() != null) { 747 749 // if the gliserver url has changed while a collection is open, 748 750 // close the open collection of the old library URL 749 Gatherer.c_man.saveCollection(); 750 Gatherer.c_man.closeCollection(); 751 Gatherer.g_man.saveThenCloseCurrentCollection(); 751 752 Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(), true, ""); 752 753 } … … 777 778 // if the gliserver url has changed while a collection is open, 778 779 // close the open collection of the old gliserver URL 779 Gatherer.c_man.saveCollection(); 780 Gatherer.c_man.closeCollection(); 780 Gatherer.g_man.saveThenCloseCurrentCollection(); 781 781 Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(), true, ""); 782 782 } … … 824 824 restart_required = true; 825 825 restart_message = Dictionary.get("Preferences.General.Restart_Required"); 826 826 827 } 827 828 … … 829 830 String current_lang = Configuration.getLanguage(); 830 831 if (!current_lang.equals(((DictionaryEntry) language_combobox.getSelectedItem()).getLocale().getLanguage())) { 832 // need to save the collection before changing the locale otherwise it stuffs the metadata names up 833 if(Gatherer.c_man.getCollection() != null) { 834 Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(), true, Gatherer.c_man.getLoadedCollectionColFilePath()); 835 Gatherer.g_man.saveThenCloseCurrentCollection(); 836 keep_collection_open = true; 837 } 838 831 839 Configuration.setLocale("general.locale", Configuration.GENERAL_SETTING, ((DictionaryEntry) language_combobox.getSelectedItem()).getLocale()); 832 840 restart_required = true; … … 904 912 905 913 if (restart_required) { 914 if (keep_collection_open) { 915 Gatherer.g_man.exitNoCollectionSave(Gatherer.EXIT_THEN_RESTART); 916 } else { 906 917 Gatherer.g_man.exit(Gatherer.EXIT_THEN_RESTART); 918 } 907 919 } 908 920 }
Note:
See TracChangeset
for help on using the changeset viewer.