only storing external tools settings differing from the defaults
This commit is contained in:
parent
8403776cf1
commit
3d1c427c60
1 changed files with 14 additions and 2 deletions
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: GUI.java,v 1.41 2007/04/03 16:21:12 fros4943 Exp $
|
* $Id: GUI.java,v 1.42 2007/04/04 08:04:48 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -2313,7 +2313,19 @@ public class GUI {
|
||||||
public static void saveExternalToolsUserSettings() {
|
public static void saveExternalToolsUserSettings() {
|
||||||
try {
|
try {
|
||||||
FileOutputStream out = new FileOutputStream(externalToolsUserSettingsFile);
|
FileOutputStream out = new FileOutputStream(externalToolsUserSettingsFile);
|
||||||
currentExternalToolsSettings.store(out, "COOJA User Settings");
|
|
||||||
|
Properties differingSettings = new Properties();
|
||||||
|
Enumeration keyEnum = currentExternalToolsSettings.keys();
|
||||||
|
while (keyEnum.hasMoreElements()) {
|
||||||
|
String key = (String) keyEnum.nextElement();
|
||||||
|
String defaultSetting = getExternalToolsDefaultSetting(key, "");
|
||||||
|
String currentSetting = getExternalToolsSetting(key, "");
|
||||||
|
if (!defaultSetting.equals(currentSetting)) {
|
||||||
|
differingSettings.setProperty(key, currentSetting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
differingSettings.store(out, "COOJA External Tools (User specific)");
|
||||||
out.close();
|
out.close();
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
// Could not open settings file for writing, aborting
|
// Could not open settings file for writing, aborting
|
||||||
|
|
Loading…
Add table
Reference in a new issue