Merge lp:~laney/do-plugins/notificationpref into lp:do-plugins

Proposed by Iain Lane
Status: Merged
Merged at revision: not available
Proposed branch: lp:~laney/do-plugins/notificationpref
Merge into: lp:do-plugins
Diff against target: None lines
To merge this branch: bzr merge lp:~laney/do-plugins/notificationpref
Reviewer Review Type Date Requested Status
Do Plugins Team Pending
Review via email: mp+4030@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

This branch adds an extra preference to the microblogging plugin which allows users to disable notifications for new direct messages. I prefer not to be notified of this event, and I'm sure many other users also do too. The pref defaults to true so there will be no change for anyone who is used to the current behaviour.

One obvious improvement is to not poll the service if the pref is disabled (for both of the microblogging notification preferences).

551. By Jason Smith

Speed fix

552. By Alex Launi

Merge Fix to not show direct messages

Revision history for this message
Alex Launi (alexlauni) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Microblogging/gtk-gui/Microblogging.GenConfig.cs'
2--- Microblogging/gtk-gui/Microblogging.GenConfig.cs 2009-01-05 01:32:46 +0000
3+++ Microblogging/gtk-gui/Microblogging.GenConfig.cs 2009-02-28 02:17:00 +0000
4@@ -1,7 +1,7 @@
5 // ------------------------------------------------------------------------------
6 // <autogenerated>
7 // This code was generated by a tool.
8-// Mono Runtime Version: 2.0.50727.42
9+//
10 //
11 // Changes to this file may cause incorrect behavior and will be lost if
12 // the code is regenerated.
13@@ -23,6 +23,8 @@
14
15 private Gtk.CheckButton show_updates_chk;
16
17+ private Gtk.CheckButton show_dms_chk;
18+
19 private Gtk.Label GtkLabel1;
20
21 protected virtual void Build() {
22@@ -61,6 +63,19 @@
23 w1.Expand = false;
24 w1.Fill = false;
25 w1.Padding = ((uint)(5));
26+ // Container child vbox2.Gtk.Box+BoxChild
27+ this.show_dms_chk = new Gtk.CheckButton();
28+ this.show_dms_chk.CanFocus = true;
29+ this.show_dms_chk.Name = "show_dms_chk";
30+ this.show_dms_chk.Label = Mono.Unix.Catalog.GetString("Show direct messages");
31+ this.show_dms_chk.Active = true;
32+ this.show_dms_chk.DrawIndicator = true;
33+ this.show_dms_chk.UseUnderline = true;
34+ this.vbox2.Add(this.show_dms_chk);
35+ Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox2[this.show_dms_chk]));
36+ w2.Position = 1;
37+ w2.Expand = false;
38+ w2.Fill = false;
39 this.GtkAlignment.Add(this.vbox2);
40 this.frame1.Add(this.GtkAlignment);
41 this.GtkLabel1 = new Gtk.Label();
42@@ -69,14 +84,15 @@
43 this.GtkLabel1.UseMarkup = true;
44 this.frame1.LabelWidget = this.GtkLabel1;
45 this.vbox1.Add(this.frame1);
46- Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox1[this.frame1]));
47- w4.Position = 0;
48+ Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.vbox1[this.frame1]));
49+ w5.Position = 0;
50 this.Add(this.vbox1);
51 if ((this.Child != null)) {
52 this.Child.ShowAll();
53 }
54 this.Show();
55 this.show_updates_chk.Clicked += new System.EventHandler(this.OnShowUpdatesChkClicked);
56+ this.show_dms_chk.Clicked += new System.EventHandler(this.OnShowDMsChkClicked);
57 }
58 }
59 }
60
61=== modified file 'Microblogging/gtk-gui/generated.cs'
62--- Microblogging/gtk-gui/generated.cs 2009-01-05 01:32:46 +0000
63+++ Microblogging/gtk-gui/generated.cs 2009-02-28 02:17:00 +0000
64@@ -1,7 +1,7 @@
65 // ------------------------------------------------------------------------------
66 // <autogenerated>
67 // This code was generated by a tool.
68-// Mono Runtime Version: 2.0.50727.42
69+//
70 //
71 // Changes to this file may cause incorrect behavior and will be lost if
72 // the code is regenerated.
73
74=== modified file 'Microblogging/src/GenConfig.cs'
75--- Microblogging/src/GenConfig.cs 2009-02-27 04:50:49 +0000
76+++ Microblogging/src/GenConfig.cs 2009-02-28 02:17:00 +0000
77@@ -32,11 +32,17 @@
78 {
79 this.Build();
80 show_updates_chk.Active = Microblog.Preferences.ShowNotifications;
81+ show_dms_chk.Active = Microblog.Preferences.ShowDirectMessages;
82 }
83
84 protected virtual void OnShowUpdatesChkClicked (object sender, EventArgs e)
85 {
86 Microblog.Preferences.ShowNotifications = show_updates_chk.Active;
87 }
88+
89+ protected virtual void OnShowDMsChkClicked (object sender, EventArgs e)
90+ {
91+ Microblog.Preferences.ShowDirectMessages = show_dms_chk.Active;
92+ }
93 }
94 }
95
96=== modified file 'Microblogging/src/Microblog.cs'
97--- Microblogging/src/Microblog.cs 2009-02-27 04:50:49 +0000
98+++ Microblogging/src/Microblog.cs 2009-02-28 02:17:00 +0000
99@@ -92,7 +92,8 @@
100
101 static void DirectMessageFound (object sender, TimelineUpdatedEventArgs args)
102 {
103- notifications.Notify (new DirectMessageNotification (args.Screenname, args.Screenname, args.Icon));
104+ if (!Preferences.ShowDirectMessages) return;
105+ notifications.Notify (new DirectMessageNotification (args.Screenname, args.Status, args.Icon));
106 }
107
108 static void ServiceChanged (object sender, EventArgs args)
109
110=== modified file 'Microblogging/src/Preferences.cs'
111--- Microblogging/src/Preferences.cs 2008-12-22 03:41:02 +0000
112+++ Microblogging/src/Preferences.cs 2009-02-28 02:17:00 +0000
113@@ -36,9 +36,11 @@
114 const string PasswordKey = "{0}/Password";
115 const string MicroblogServiceKey = "Service";
116 const string ShowNotificationsKey = "ShowFriendUpdates";
117+ const string ShowDirectMessagesKey = "ShowFriendDirectMessages";
118
119 const string MicroblogServiceDefault = "twitter";
120 const bool ShowNotificationsDefault = true;
121+ const bool ShowDirectMessagesDefault = true;
122
123 #endregion
124
125@@ -66,6 +68,11 @@
126 set { prefs.Set<bool> (ShowNotificationsKey, value); }
127 }
128
129+ public bool ShowDirectMessages {
130+ get { return prefs.Get<bool> (ShowDirectMessagesKey, ShowDirectMessagesDefault); }
131+ set { prefs.Set<bool> (ShowDirectMessagesKey, value); }
132+ }
133+
134 public string MicroblogService {
135 get { return active_service; }
136 set {

Subscribers

People subscribed via source and target branches