- Timestamp:
- 2009-01-12T11:40:15+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/branches/rtl-gli/src/org/greenstone/gatherer/gui/Preferences.java
r18297 r18364 731 731 public void actionPerformed(ActionEvent event) 732 732 { 733 // Several options requiring restarting the GLI to apply: 734 // interface font, interface language, changed gliserver url or library url 735 boolean restart_required = false; 736 String restart_message = ""; 737 738 733 739 // Connection preferences 734 740 String program_str = program_field.getText(); … … 738 744 Configuration.setPreviewCommand(program_str); 739 745 746 String old_library_url = (Configuration.library_url == null) ? null : Configuration.library_url.toString(); 740 747 String library_url_string = library_path_field.getText(); 748 if(old_library_url != null && !old_library_url.equals(library_url_string)) { 749 750 // If the server is remote and the library path's been changed, then GLI client needs restart 751 // If the server is local, GLI is going to work with the collection of GSDLPath anyway, 752 // even if the library path for previewing has changed 753 if (Gatherer.isGsdlRemote) { 754 restart_required = true; 755 restart_message = Dictionary.get("Preferences.General.Manual_Restart_Required"); 756 } 757 if(Gatherer.c_man.getCollection() != null) { 758 // if the gliserver url has changed while a collection is open, 759 // close the open collection of the old library URL 760 Gatherer.c_man.saveCollection(); 761 Gatherer.c_man.closeCollection(); 762 Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(), true, ""); 763 } 764 } 741 765 if (library_url_string.equals("")) { 742 766 Configuration.library_url = null; … … 750 774 } 751 775 } 752 Configuration.setString("general.library_url", true, library_url_string); 776 777 Configuration.setString("general.library_url"+Configuration.gliPropertyNameSuffix(), 778 true, library_url_string); 753 779 754 780 if (Gatherer.isGsdlRemote && !Gatherer.GS3) { 781 String old_gliserver_url = Configuration.gliserver_url.toString(); 755 782 String gliserver_url_string = gliserver_url_field.getText(); 783 if(!old_gliserver_url.equals(gliserver_url_string)) { 784 restart_required = true; 785 restart_message = Dictionary.get("Preferences.General.Manual_Restart_Required"); 786 787 if(Gatherer.c_man.getCollection() != null) { 788 // if the gliserver url has changed while a collection is open, 789 // close the open collection of the old gliserver URL 790 Gatherer.c_man.saveCollection(); 791 Gatherer.c_man.closeCollection(); 792 Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(), true, ""); 793 } 794 } 756 795 if (gliserver_url_string.equals("")) { 757 796 Configuration.gliserver_url = null; … … 767 806 Configuration.setString("general.gliserver_url", true, gliserver_url_string); 768 807 } 808 769 809 770 810 boolean site_changed = false; … … 777 817 Configuration.setSiteAndServlet(new_site, (String)servlet_combobox.getSelectedItem()); 778 818 } 779 819 780 820 Configuration.set("general.use_proxy", true, use_proxy_checkbox.isSelected()); 781 821 Configuration.setString("general.proxy_host", true, proxy_host_field.getText()); … … 788 828 Configuration.set("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC, view_extracted_metadata_checkbox.isSelected()); 789 829 790 // Two options requiring restarting the GLI to apply: interface font, and interface language791 boolean restart_required = false;792 830 793 831 // GLI interface font … … 796 834 Configuration.setString("general.font", true, font_field.getText()); 797 835 restart_required = true; 836 restart_message = Dictionary.get("Preferences.General.Restart_Required"); 798 837 } 799 838 … … 803 842 Configuration.setLocale("general.locale", Configuration.GENERAL_SETTING, ((DictionaryEntry) language_combobox.getSelectedItem()).getLocale()); 804 843 restart_required = true; 844 restart_message = Dictionary.get("Preferences.General.Restart_Required"); 805 845 } 806 846 807 847 // Inform the user that a restart is required, if necessary 808 848 if (restart_required) { 809 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("Preferences.General.Restart_Required"), Dictionary.get("General.Warning"), JOptionPane.WARNING_MESSAGE);849 JOptionPane.showMessageDialog(Gatherer.g_man, restart_message, Dictionary.get("General.Warning"), JOptionPane.WARNING_MESSAGE); 810 850 } 811 851 … … 845 885 if (Gatherer.GS3 && site_changed && Gatherer.c_man.getCollection() != null && !Gatherer.isGsdlRemote) { 846 886 // shut down the collection 847 System.err.println("shutting down t ehcollection");887 System.err.println("shutting down the collection"); 848 888 Gatherer.g_man.saveThenCloseCurrentCollection(); 849 889 } … … 867 907 Configuration.save(); 868 908 if (Gatherer.isGsdlRemote && Gatherer.GS3 && site_changed ){ 869 RemoteGreenstoneServer.downloadCollectionConfigurations();909 Gatherer.remoteGreenstoneServer.downloadCollectionConfigurations(); 870 910 } 871 911 // Refresh the GLI to account for the configuration changes … … 997 1037 if (Gatherer.c_man.getCollection()!=null){ 998 1038 File lock_file = new File(Gatherer.c_man.getLoadedCollectionDirectoryPath() + "gli.lck"); 999 RemoteGreenstoneServer.deleteCollectionFile(Gatherer.c_man.getLoadedCollectionName(),lock_file);1039 Gatherer.remoteGreenstoneServer.deleteCollectionFile(Gatherer.c_man.getLoadedCollectionName(),lock_file); 1000 1040 Gatherer.g_man.closeCurrentCollection(); 1001 1041 } 1002 1042 Configuration.site_name=site; 1003 RemoteGreenstoneServer.set_remote_greenstone_server_authentication_to_null();1004 RemoteGreenstoneServer.downloadCollectionConfigurations();1043 Gatherer.remoteGreenstoneServer.set_remote_greenstone_server_authentication_to_null(); 1044 Gatherer.remoteGreenstoneServer.downloadCollectionConfigurations(); 1005 1045 } 1006 1046 }
Note:
See TracChangeset
for help on using the changeset viewer.