Merge lp:~jpds/do-plugins/notification-error-messages into lp:do-plugins

Proposed by Alex Launi
Status: Merged
Merged at revision: 590
Proposed branch: lp:~jpds/do-plugins/notification-error-messages
Merge into: lp:do-plugins
Diff against target: None lines
To merge this branch: bzr merge lp:~jpds/do-plugins/notification-error-messages
Reviewer Review Type Date Requested Status
Chris S. Approve
Review via email: mp+4953@code.launchpad.net

This proposal supersedes a proposal from 2009-03-13.

To post a comment you must log in.
Revision history for this message
Jonathan Davies (jpds) wrote : Posted in a previous version of this proposal

Instead of returning Do saying that there was an error pasting text, throw a notification bubble if no text is provided.

Revision history for this message
Chris S. (cszikszoy) :
review: Approve
Revision history for this message
Chris S. (cszikszoy) wrote :

We should formalize how plugins interact with the user. Using the notification system seems to be a great way to gracefully display errors or small messages.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'LocateFiles/src/LocateFilesAction.cs'
--- LocateFiles/src/LocateFilesAction.cs 2009-02-28 18:23:20 +0000
+++ LocateFiles/src/LocateFilesAction.cs 2009-03-14 14:26:14 +0000
@@ -67,6 +67,13 @@
67 67
68 files = new List<Item> ();68 files = new List<Item> ();
69 query = (items.First () as ITextItem).Text;69 query = (items.First () as ITextItem).Text;
70
71 if (string.IsNullOrEmpty(query))
72 {
73 Services.Notifications.Notify("Locate Files",
74 "No text provided for searching.");
75 yield break;
76 }
70 77
71 locate = new System.Diagnostics.Process ();78 locate = new System.Diagnostics.Process ();
72 locate.StartInfo.FileName = "locate";79 locate.StartInfo.FileName = "locate";
@@ -90,13 +97,16 @@
90 results++;97 results++;
91 files.Add (Services.UniverseFactory.NewFileItem (path) as Item);98 files.Add (Services.UniverseFactory.NewFileItem (path) as Item);
92 }99 }
100
93 if (results > 0) {101 if (results > 0) {
94 files.Sort (new IFileItemNameComparer (query));102 files.Sort (new IFileItemNameComparer (query));
95 foreach (Item file in files)103 foreach (Item file in files)
96 yield return file;104 yield return file;
105 } else {
106 Services.Notifications.Notify("Locate Files",
107 Error + query);
108 yield break;
97 }109 }
98 else
99 yield return new TextItem (Error + query);
100 }110 }
101111
102 // Order files by (A) position of query in the file name and112 // Order files by (A) position of query in the file name and
103113
=== modified file 'Pastebin/src/Pastebin.cs'
--- Pastebin/src/Pastebin.cs 2009-01-22 04:43:21 +0000
+++ Pastebin/src/Pastebin.cs 2009-03-13 23:11:47 +0000
@@ -65,7 +65,9 @@
65 catch (Exception e)65 catch (Exception e)
66 {66 {
67 Log<Pastebin>.Error (e.ToString ());67 Log<Pastebin>.Error (e.ToString ());
68 url = "An error occured while pasting.";68 Services.Notifications.Notify("Pastebin",
69 "An error occured while pasting.");
70 yield break;
69 }71 }
70 72
71 return url;73 return url;
7274
=== modified file 'Pastebin/src/PastebinAction.cs'
--- Pastebin/src/PastebinAction.cs 2009-01-02 06:17:21 +0000
+++ Pastebin/src/PastebinAction.cs 2009-03-13 23:00:12 +0000
@@ -96,6 +96,13 @@
96 text += titem.Text;96 text += titem.Text;
97 }97 }
98 98
99 if (string.IsNullOrEmpty(text))
100 {
101 Services.Notifications.Notify("Pastebin",
102 "No text provided for pasting.");
103 yield break;
104 }
105
99 IPastebinProvider pastebinProvider = null;106 IPastebinProvider pastebinProvider = null;
100 107
101 if (modifierItems.Any ()) {108 if (modifierItems.Any ()) {
102109
=== modified file 'RememberTheMilk/src/RTMNewTask.cs'
--- RememberTheMilk/src/RTMNewTask.cs 2009-01-29 16:58:01 +0000
+++ RememberTheMilk/src/RTMNewTask.cs 2009-03-16 12:53:58 +0000
@@ -78,6 +78,12 @@
78 {78 {
79 string listId = String.Empty;79 string listId = String.Empty;
80 string taskData = (items.First () as ITextItem).Text;80 string taskData = (items.First () as ITextItem).Text;
81
82 if (string.IsNullOrEmpty(taskData)) {
83 Services.Notifications.Notify("Remember The Milk",
84 "No title provided for new task.");
85 yield break;
86 }
81 87
82 if (modifierItems.FirstOrDefault () != null)88 if (modifierItems.FirstOrDefault () != null)
83 listId = (modifierItems.FirstOrDefault () as RTMListItem).Id;89 listId = (modifierItems.FirstOrDefault () as RTMListItem).Id;

Subscribers

People subscribed via source and target branches