| Index: lib/ui.js |
| =================================================================== |
| --- a/lib/ui.js |
| +++ b/lib/ui.js |
| @@ -23,6 +23,7 @@ |
| let {Policy} = require("contentPolicy"); |
| 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"); |
| @@ -1196,10 +1197,26 @@ |
| FilterStorage.resetHitCounts(); |
| Prefs.savestats = false; |
| + if (Prefs.sendstats) |
| + this.toggleSendStats(); |
| } |
| else |
| Prefs.savestats = true; |
| }, |
| + |
|
kzar
2015/03/23 13:11:05
Nit: Trailing whitespace
saroyanm
2015/04/07 15:23:09
Done.
|
| + /** |
| + * Toggles "Send stats" option. |
| + */ |
| + toggleSendStats: function(window) |
| + { |
| + if (Prefs.sendstats) |
| + { |
| + FilterHits.resetFilterHits(); |
| + Prefs.sendstats = false; |
| + } |
| + else |
| + Prefs.sendstats = true; |
| + }, |
| /** |
| * Sets the current filter subscription in a single-subscription scenario, |
| @@ -1539,6 +1556,7 @@ |
| setChecked(prefix + "disabled", !Prefs.enabled); |
| setChecked(prefix + "frameobjects", Prefs.frameobjects); |
| setChecked(prefix + "savestats", Prefs.savestats); |
| + setChecked(prefix + "sendstats", Prefs.sendstats); |
| let {defaultToolbarPosition, statusbarPosition} = require("appSupport"); |
| let hasToolbar = defaultToolbarPosition; |
| @@ -1947,6 +1965,7 @@ |
| ["abp-command-togglepagewhitelist", "command", function() { UI.toggleFilter(pageWhitelist); }], |
| ["abp-command-toggleobjtabs", "command", UI.togglePref.bind(UI, "frameobjects")], |
| ["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")], |