diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js
index b4bf75c..f98200f 100644
--- a/src/chrome/content/options.js
+++ b/src/chrome/content/options.js
@@ -7,27 +7,20 @@ const Cu = Components.utils;
Cu.import("resource://firetray/FiretrayHandler.jsm");
Cu.import("resource://firetray/commons.js");
-/**
- * firetray namespace.
- */
-if ("undefined" == typeof(firetray)) {
- var firetray = {};
-};
-
const TREEROW_ACCOUNT_OR_SERVER_TYPE_NAME = 0;
const TREEROW_ACCOUNT_OR_SERVER_TYPE_EXCLUDED = 1;
const TREEROW_ACCOUNT_OR_SERVER_TYPE_ORDER = 2;
const TREELEVEL_SERVER_TYPES = 0;
const TREELEVEL_EXCLUDED_ACCOUNTS = 1;
-firetray.UIOptions = {
+var firetrayUIOptions = {
strings: null,
onLoad: function(e) {
- window.removeEventListener('load', arguments.callee, true);
-
this.strings = document.getElementById("firetray-options-strings");
+ this.initWindowAndIconControls();
+
if(firetray.Handler.inMailApp) {
Cu.import("resource://firetray/FiretrayMessaging.jsm");
this.initMailControls();
@@ -35,12 +28,9 @@ firetray.UIOptions = {
let mailTab = document.getElementById("mail_tab");
this.hideElement(mailTab, true);
}
-
},
onQuit: function(e) {
- window.removeEventListener('unload', arguments.callee, true);
-
// cleaning: removeEventListener on cells
// NOTE: not sure this is necessary on window close
let tree = document.getElementById("ui_tree_mail_accounts");
@@ -72,6 +62,16 @@ firetray.UIOptions = {
} catch(e) {}
},
+ initWindowAndIconControls: function() {
+ this.disableHidesOptions(!firetray.Utils.prefService.getBoolPref('hides_on_close'));
+ },
+
+ disableHidesOptions: function(doDisable) {
+ LOG("doDisable="+doDisable);
+ document.getElementById('ui_hides_single_window').disabled = doDisable;
+ // TODO: NOT IMPLEMENTED YET: document.getElementById('ui_hides_on_minimize').disabled = doDisable;
+ },
+
initMailControls: function() {
this.populateExcludedFoldersList();
this.populateTreeAccountsOrServerTypes();
@@ -229,7 +229,7 @@ firetray.UIOptions = {
'ancestor::xul:treeitem[1]/descendant::xul:treechildren//xul:treerow');
LOG("subRows="+subRows);
for (let i=0; i
+ accesskey="&bool_hides_on_close.accesskey;"
+ onclick="firetrayUIOptions.disableHidesOptions(this.checked);"/>
+
-
@@ -65,11 +66,11 @@
+ oncommand="firetrayUIOptions.updateNotificationSettings()" />
+ oncommand="firetrayUIOptions.updateNotificationSettings()" />
+ oncommand="firetrayUIOptions.updateNotificationSettings()" />
+ oncommand="firetrayUIOptions.updateNotificationSettings()" />
+ oncommand="firetrayUIOptions.chooseMailIconFile()" />
@@ -106,7 +107,7 @@
@@ -123,7 +124,7 @@
observes="broadcaster-notification-disabled"
preference-editable="true"
preference="pref_string_mail_accounts"
- onsynctopreference="return firetray.UIOptions.saveTreeAccountsOrServerTypes();">
+ onsynctopreference="return firetrayUIOptions.saveTreeAccountsOrServerTypes();">
-
-
+
+
diff --git a/src/defaults/preferences/prefs.js b/src/defaults/preferences/prefs.js
index f165ad3..a1db399 100644
--- a/src/defaults/preferences/prefs.js
+++ b/src/defaults/preferences/prefs.js
@@ -8,7 +8,7 @@ pref("browser.tabs.warnOnClose", false);
pref("extensions.firetray.hides_on_close", true);
pref("extensions.firetray.hides_on_minimize", true);
-pref("extensions.firetray.hides_single_window", true); // FIXME: should default to 'false'
+pref("extensions.firetray.hides_single_window", false);
pref("extensions.firetray.mail_notification", 1);
pref("extensions.firetray.icon_text_color", "#000000");