2015-04-28 19:30:19 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
this.EXPORTED_SYMBOLS = ["TransientPrefs"];
|
|
|
|
|
|
|
|
Components.utils.import("resource://gre/modules/Preferences.jsm");
|
|
|
|
|
2015-09-15 21:19:45 +03:00
|
|
|
var prefVisibility = new Map;
|
2015-04-28 19:30:19 +03:00
|
|
|
|
|
|
|
/* Use for preferences that should only be visible when they've been modified.
|
|
|
|
When reset to their default state, they remain visible until restarting the
|
|
|
|
application. */
|
|
|
|
|
|
|
|
this.TransientPrefs = {
|
2016-12-30 02:34:54 +03:00
|
|
|
prefShouldBeVisible(prefName) {
|
2015-04-28 19:30:19 +03:00
|
|
|
if (Preferences.isSet(prefName))
|
|
|
|
prefVisibility.set(prefName, true);
|
|
|
|
|
|
|
|
return !!prefVisibility.get(prefName);
|
|
|
|
}
|
|
|
|
};
|