Revision: 17127
          http://sourceforge.net/p/gate/code/17127
Author:   johann_p
Date:     2013-11-23 15:30:46 +0000 (Sat, 23 Nov 2013)
Log Message:
-----------
If the gate config file was not modified during the session and 
the save options flag was/is set to false, do not
touch the options file at all.

Modified Paths:
--------------
    gate/trunk/src/main/gate/gui/MainFrame.java

Modified: gate/trunk/src/main/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/main/gate/gui/MainFrame.java 2013-11-23 02:21:17 UTC (rev 
17126)
+++ gate/trunk/src/main/gate/gui/MainFrame.java 2013-11-23 15:30:46 UTC (rev 
17127)
@@ -3816,12 +3816,18 @@
           }
           else {
             // don't save options on close
-            // save the option not to save the options
+            // save the option not to save the options, but only if it was 
+            // changed in this session             
             OptionsMap originalUserConfig = Gate.getOriginalUserConfig();
-            originalUserConfig.put(GateConstants.SAVE_OPTIONS_ON_EXIT, false);
-            userConfig.clear();
-            userConfig.putAll(originalUserConfig);
-            Gate.writeUserConfig();
+            // if the original value of this was true, it has been changed, so
+            // save the config file, otherwise leave the options file 
untouched.
+            
if(originalUserConfig.getBoolean(GateConstants.SAVE_OPTIONS_ON_EXIT)) {
+              originalUserConfig.put(GateConstants.SAVE_OPTIONS_ON_EXIT, 
false);
+              // restore the original options, with only the save options 
value modified
+              userConfig.clear();
+              userConfig.putAll(originalUserConfig);
+              Gate.writeUserConfig();
+            }
           }
           }
           catch(GateException error) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to