Merge lp:~nijaba/libnotify-mozilla/inbox-only into lp:libnotify-mozilla/0.1

Proposed by Nick Barcet
Status: Merged
Merged at revision: 55
Proposed branch: lp:~nijaba/libnotify-mozilla/inbox-only
Merge into: lp:libnotify-mozilla/0.1
Diff against target: 54 lines (+18/-1)
2 files modified
content/options.xul (+8/-0)
content/overlay.js (+10/-1)
To merge this branch: bzr merge lp:~nijaba/libnotify-mozilla/inbox-only
Reviewer Review Type Date Requested Status
Ruben Verweij (community) Approve
Review via email: mp+48700@code.launchpad.net

Commit message

Add preference to only notify when inbox receives new mail. (Fix bug #713699)

Description of the change

Add preference to only notify when inbox receives new mail. (bug #713699)

To post a comment you must log in.
Revision history for this message
Ruben Verweij (ruben-verweij) wrote :

Thank you very much for this fix! I will release it in a new version.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'content/options.xul'
2--- content/options.xul 2010-09-04 18:29:19 +0000
3+++ content/options.xul 2011-02-05 16:11:58 +0000
4@@ -48,6 +48,7 @@
5 <preference id="pref_indicator" name="extensions.tbindicator.showIndicator" type="bool"/>
6 <preference id="pref_news" name="extensions.tbindicator.showNews" type="bool"/>
7 <preference id="pref_rss" name="extensions.tbindicator.showRSS" type="bool"/>
8+ <preference id="pref_inbox" name="extensions.tbindicator.onlyInbox" type="bool"/>
9 </preferences>
10
11 <hbox align="center">
12@@ -81,6 +82,13 @@
13 </vbox>
14 <checkbox preference="pref_rss" id="rss"/>
15 </hbox>
16+ <hbox align="center">
17+ <vbox align="center">
18+ <label control="inbox" value="Display notifications only for Inbox: "/>
19+ </vbox>
20+ <checkbox preference="pref_inbox" id="inbox"/>
21+ </hbox>
22+
23 <hbox align="center">
24 <button label="Send test notification" oncommand="sendNotification('Test Notification', 'From Thunderbird Indicator', 'notification-message-email', 'email.arrived');"/>
25 </hbox>
26
27=== modified file 'content/overlay.js'
28--- content/overlay.js 2010-10-16 13:21:04 +0000
29+++ content/overlay.js 2011-02-05 16:11:58 +0000
30@@ -82,6 +82,9 @@
31 if(!this.prefs.prefHasUserValue("showRSS")) {
32 this.prefs.setBoolPref("showRSS", false);
33 }
34+ if(!this.prefs.prefHasUserValue("onlyInbox")) {
35+ this.prefs.setBoolPref("onlyInbox", false);
36+ }
37
38 this.initIndicators();
39 },
40@@ -147,7 +150,13 @@
41
42 // Also return true if the folder is checked for new messages, otherwise return false
43 if ((aFolder.flags & FLR_FLAG_CHECK_NEW) == FLR_FLAG_CHECK_NEW){
44- return true;
45+ var onlyInbox = this.prefs.getBoolPref("onlyInbox");
46+ if (onlyInbox) {
47+ //don't warn for anything but Inbox
48+ return false;
49+ } else {
50+ return true;
51+ }
52 }else{
53 return false;
54 }

Subscribers

People subscribed via source and target branches