Index: lib/ui.js |
=================================================================== |
--- a/lib/ui.js |
+++ b/lib/ui.js |
@@ -24,6 +24,7 @@ |
let {FilterListener} = require("filterListener"); |
let {FilterStorage} = require("filterStorage"); |
let {FilterNotifier} = require("filterNotifier"); |
+let {FilterHits} = require("filterHits"); |
let {RequestNotifier} = require("requestNotifier"); |
let {Filter} = require("filterClasses"); |
let {Subscription, SpecialSubscription, DownloadableSubscription} = require("subscriptionClasses"); |
@@ -1154,12 +1155,33 @@ |
return; |
FilterStorage.resetHitCounts(); |
+ Prefs.savestats = false; |
+ if(Prefs.sendstats) |
+ { |
+ this.toggleSendStats(); |
+ return; |
+ } |
+ |
FilterListener.setDirty(0); // Force saving to disk |
- Prefs.savestats = false; |
} |
else |
Prefs.savestats = true; |
}, |
+ |
+ /** |
+ * Toggles "Send stats" option. |
+ */ |
+ toggleSendStats: function(window) |
+ { |
+ if (Prefs.sendstats) |
+ { |
+ FilterHits.resetFilterHits(); |
+ FilterListener.setDirty(0); // Force saving to disk |
+ Prefs.sendstats = false; |
+ } |
+ else |
+ Prefs.sendstats = true; |
+ }, |
/** |
* Sets the current filter subscription in a single-subscription scenario, |
@@ -1500,6 +1522,7 @@ |
setChecked(prefix + "frameobjects", Prefs.frameobjects); |
setChecked(prefix + "slowcollapse", !Prefs.fastcollapse); |
setChecked(prefix + "savestats", Prefs.savestats); |
+ setChecked(prefix + "sendstats", Prefs.sendstats); |
let {defaultToolbarPosition, statusbarPosition} = require("appSupport"); |
let hasToolbar = defaultToolbarPosition; |
@@ -1905,6 +1928,7 @@ |
["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects")], |
["abp-command-togglecollapse", "command", UI.togglePref.bind(UI, "fastcollapse")], |
["abp-command-togglesavestats", "command", UI.toggleSaveStats.bind(UI)], |
+ ["abp-command-togglesendstats", "command", UI.toggleSendStats.bind(UI)], |
["abp-command-togglesync", "command", UI.toggleSync.bind(UI)], |
["abp-command-toggleshowintoolbar", "command", UI.toggleToolbarIcon.bind(UI)], |
["abp-command-toggleshowinstatusbar", "command", UI.togglePref.bind(UI, "showinstatusbar")], |