Merge lp:~dobey/ubuntu/raring/tomboy/no-more-u1 into lp:ubuntu/raring/tomboy

Proposed by dobey
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntu/raring/tomboy/no-more-u1
Merge into: lp:ubuntu/raring/tomboy
Diff against target: 681 lines (+10/-636)
6 files modified
debian/changelog (+10/-0)
debian/patches/02_sync_save_button_sensitive.patch (+0/-25)
debian/patches/03_u1_as_default_sync.patch (+0/-13)
debian/patches/05_add_start_u1_note.patch (+0/-39)
debian/patches/06_use_ubuntu_sso.patch (+0/-555)
debian/patches/series (+0/-4)
To merge this branch: bzr merge lp:~dobey/ubuntu/raring/tomboy/no-more-u1
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+146512@code.launchpad.net

Description of the change

* debian/patches/02_sync_save_button_sensitive.patch:
* debian/patches/03_u1_as_default_sync.patch:
* debian/patches/05_add_start_u1_note.patch:
* debian/patches/06_use_ubuntu_sso.patch:
  - Remove patches to default to Ubuntu One for notes sync. (LP: #1115460)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-09-25 11:01:34 +0000
3+++ debian/changelog 2013-02-04 20:34:25 +0000
4@@ -1,3 +1,13 @@
5+tomboy (1.12.0-1ubuntu2) raring; urgency=low
6+
7+ * debian/patches/02_sync_save_button_sensitive.patch:
8+ * debian/patches/03_u1_as_default_sync.patch:
9+ * debian/patches/05_add_start_u1_note.patch:
10+ * debian/patches/06_use_ubuntu_sso.patch:
11+ - Remove patches to default to Ubuntu One for notes sync. (LP: #1115460)
12+
13+ -- Rodney Dawes <rodney.dawes@ubuntu.com> Mon, 04 Feb 2013 13:11:52 -0500
14+
15 tomboy (1.12.0-1ubuntu1) quantal; urgency=low
16
17 * Rebase on Debian experimental, remaining changes
18
19=== removed file 'debian/patches/02_sync_save_button_sensitive.patch'
20--- debian/patches/02_sync_save_button_sensitive.patch 2012-05-03 21:17:32 +0000
21+++ debian/patches/02_sync_save_button_sensitive.patch 1970-01-01 00:00:00 +0000
22@@ -1,25 +0,0 @@
23-Description: Ensure the save button is sensitive when setting up WebSync.
24-This is a work around, but gets us back to where we were in Natty. Upstream
25-relies on the entries changing to set the button sensitive, however we
26-pre-populate the fields with ubuntuone settings. If these don't get changed
27-the user can not save the settings even after successful auth. Ideally it
28-should become sensitive when Auth.IsAccessToken becomes true.
29-Author: Ken VanDine <ken.vandine@ubuntu.com>
30-Bug-Ubuntu: https://launchpad.net/bugs/845321
31-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=473332
32-Forwarded: not-needed
33-
34-=== modified file 'Tomboy/PreferencesDialog.cs'
35-Index: tomboy/Tomboy/PreferencesDialog.cs
36-===================================================================
37---- tomboy.orig/Tomboy/PreferencesDialog.cs 2012-05-03 21:16:57.692547228 +0100
38-+++ tomboy/Tomboy/PreferencesDialog.cs 2012-05-03 21:17:00.604547100 +0100
39-@@ -1113,7 +1113,7 @@
40- syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
41-
42- resetSyncAddinButton.Sensitive = false;
43-- saveSyncAddinButton.Sensitive = false;
44-+ saveSyncAddinButton.Sensitive = true;
45- }
46- } else {
47- selectedSyncAddin = null;
48
49=== removed file 'debian/patches/03_u1_as_default_sync.patch'
50--- debian/patches/03_u1_as_default_sync.patch 2012-05-03 21:17:32 +0000
51+++ debian/patches/03_u1_as_default_sync.patch 1970-01-01 00:00:00 +0000
52@@ -1,13 +0,0 @@
53-Index: tomboy/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs
54-===================================================================
55---- tomboy.orig/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs 2012-05-03 21:16:57.656547230 +0100
56-+++ tomboy/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs 2012-05-03 21:17:00.788547091 +0100
57-@@ -97,6 +97,8 @@
58- string serverPref;
59- Api.OAuth oauth;
60- GetConfigSettings (out oauth, out serverPref);
61-+ if (string.IsNullOrEmpty (serverPref))
62-+ serverPref = "https://one.ubuntu.com/notes/";
63- prefsWidget = new WebSyncPreferencesWidget (oauth, serverPref, requiredPrefChanged);
64- return prefsWidget;
65- }
66
67=== removed file 'debian/patches/05_add_start_u1_note.patch'
68--- debian/patches/05_add_start_u1_note.patch 2012-05-03 21:17:32 +0000
69+++ debian/patches/05_add_start_u1_note.patch 1970-01-01 00:00:00 +0000
70@@ -1,39 +0,0 @@
71-Index: tomboy/Tomboy/NoteManager.cs
72-===================================================================
73---- tomboy.orig/Tomboy/NoteManager.cs 2012-05-03 21:17:00.972547084 +0100
74-+++ tomboy/Tomboy/NoteManager.cs 2012-05-03 21:17:01.280547071 +0100
75-@@ -298,6 +298,24 @@
76- "Also, if you type the name of another note in your " +
77- "current note, it will automatically be linked for you." +
78- "</note-content>");
79-+ string u1_note_content =
80-+ Catalog.GetString ("<note-content>" +
81-+ "Ubuntu One\n\n" +
82-+ "<bold>Tomboy is better with Ubuntu One</bold> - " +
83-+ "the personal cloud that brings your digital life together.\n\n" +
84-+ "Ubuntu One does more than sync your files - whether you need " +
85-+ "to access your contacts, notes or bookmarks from any computer or " +
86-+ "the web, enjoy your favorite music from a cloud integrated store " +
87-+ "or stream your entire collection to iPhone and Android mobile phones " +
88-+ "- we've raised the bar on personal clouds. Learn more at " +
89-+ "<link:url>http://one.ubuntu.com/</link:url>.\n\n" +
90-+ "Already have an Ubuntu One account? Setup Tomboy to sync with your " +
91-+ "personal cloud by clicking Edit > Preferences and then the Synchronization "+
92-+ "tab. Select \"Tomboy Web\" from the list of services and then click the "+
93-+ "\"Connect to Server\" button. A web browser will appear with a few " +
94-+ "additional instructions.\n\n" +
95-+ "You can even enable automatic sync with Ubuntu One!" +
96-+ "</note-content>");
97-
98- try {
99- Note start_note = Create (Catalog.GetString ("Start Here"),
100-@@ -309,6 +327,9 @@
101- links_note_content);
102- links_note.QueueSave (ChangeType.ContentChanged);
103-
104-+ Note u1_note = Create ("Ubuntu One", u1_note_content);
105-+ u1_note.QueueSave (ChangeType.ContentChanged);
106-+
107- if (!Tomboy.IsPanelApplet)
108- start_note.Window.Show ();
109- } catch (Exception e) {
110
111=== removed file 'debian/patches/06_use_ubuntu_sso.patch'
112--- debian/patches/06_use_ubuntu_sso.patch 2011-08-23 22:47:32 +0000
113+++ debian/patches/06_use_ubuntu_sso.patch 1970-01-01 00:00:00 +0000
114@@ -1,555 +0,0 @@
115-Index: tomboy/Tomboy/Addins/WebSyncService/Makefile.am
116-===================================================================
117---- tomboy.orig/Tomboy/Addins/WebSyncService/Makefile.am 2011-08-23 22:54:40.127231333 +0100
118-+++ tomboy/Tomboy/Addins/WebSyncService/Makefile.am 2011-08-23 23:11:21.488427309 +0100
119-@@ -27,6 +27,8 @@
120- $(srcdir)/WebSyncPreferencesWidget.cs \
121- $(srcdir)/WebSyncServer.cs \
122- $(srcdir)/WebSyncServiceAddin.cs \
123-+ $(srcdir)/U1SyncServiceAddin.cs \
124-+ $(srcdir)/U1SyncPreferencesWidget.cs \
125- $(srcdir)/Tests/*.cs \
126- $(srcdir)/Api/*.cs \
127- $(srcdir)/Api/Tests/*.cs \
128-Index: tomboy/Tomboy/Addins/WebSyncService/U1SyncPreferencesWidget.cs
129-===================================================================
130---- /dev/null 1970-01-01 00:00:00.000000000 +0000
131-+++ tomboy/Tomboy/Addins/WebSyncService/U1SyncPreferencesWidget.cs 2011-08-23 23:18:01.453092749 +0100
132-@@ -0,0 +1,290 @@
133-+// Permission is hereby granted, free of charge, to any person obtaining
134-+// a copy of this software and associated documentation files (the
135-+// "Software"), to deal in the Software without restriction, including
136-+// without limitation the rights to use, copy, modify, merge, publish,
137-+// distribute, sublicense, and/or sell copies of the Software, and to
138-+// permit persons to whom the Software is furnished to do so, subject to
139-+// the following conditions:
140-+//
141-+// The above copyright notice and this permission notice shall be
142-+// included in all copies or substantial portions of the Software.
143-+//
144-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
145-+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
146-+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
147-+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
148-+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
149-+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
150-+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
151-+//
152-+// Copyright (c) 2010 Canonical, Ltd. (http://www.canonical.com)
153-+//
154-+// Authors:
155-+// Rodrigo Moya <rodrigo.moya@canonical.com>
156-+//
157-+
158-+using System;
159-+using System.Runtime.InteropServices;
160-+using System.Web;
161-+using GLib;
162-+
163-+using Mono.Unix;
164-+using Tomboy.WebSync.Api;
165-+#if !WIN32
166-+using HL = System.Net;
167-+#else
168-+using HL = MonoHttp;
169-+#endif
170-+
171-+namespace Tomboy.WebSync
172-+{
173-+ public class U1SyncPreferencesWidget : Gtk.VBox
174-+ {
175-+ private Api.OAuth oauth;
176-+ private Gtk.Button authButton;
177-+ private SyncdaemonAuthentication sdAuth;
178-+
179-+ public U1SyncPreferencesWidget (Api.OAuth oauth, string server) : base (false, 5)
180-+ {
181-+ sdAuth = new SyncdaemonAuthentication ();
182-+ sdAuth.CredentialsFound += OnCredentialsFound;
183-+ sdAuth.AuthenticationCancelled += OnAuthCancelled;
184-+ sdAuth.AuthenticationError += OnAuthError;
185-+
186-+ this.oauth = oauth;
187-+
188-+ authButton = new Gtk.Button ();
189-+ if (!Auth.IsAccessToken) {
190-+ if (this.sdAuth.HasCredentials ()) {
191-+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
192-+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
193-+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
194-+ Auth.ConsumerKey = sdAuth.ConsumerKey;
195-+ Auth.ConsumerSecret = sdAuth.ConsumerSecret;
196-+ Auth.Token = sdAuth.Token;
197-+ Auth.TokenSecret = sdAuth.TokenSecret;
198-+
199-+ authButton.Label = Catalog.GetString ("Already registered");
200-+ authButton.Sensitive = false;
201-+
202-+ } else
203-+ authButton.Label = Catalog.GetString ("Register this computer");
204-+ } else {
205-+ authButton.Label = Catalog.GetString ("Already registered");
206-+ authButton.Sensitive = false;
207-+ }
208-+ authButton.Clicked += OnAuthButtonClicked;
209-+
210-+ Add (authButton);
211-+
212-+ ShowAll ();
213-+ }
214-+
215-+ public string Server {
216-+ get {
217-+ return "https://one.ubuntu.com/notes/";
218-+ }
219-+ }
220-+
221-+ public Api.OAuth Auth {
222-+ get { return oauth; }
223-+ set {
224-+ oauth = value;
225-+ if (oauth == null) {
226-+ authButton.Label =
227-+ Catalog.GetString ("Register this computer");
228-+ authButton.Sensitive = true;
229-+ }
230-+ }
231-+ }
232-+
233-+ public void OnAuthButtonClicked (object sender, EventArgs args)
234-+ {
235-+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
236-+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
237-+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
238-+ Auth.ConsumerKey = "";
239-+ Auth.ConsumerSecret = "";
240-+ Auth.Realm = "";
241-+ Auth.Token = "";
242-+ Auth.TokenSecret = "";
243-+
244-+ authButton.Label = Catalog.GetString ("Authenticating...");
245-+ authButton.Sensitive = false;
246-+
247-+ // Call com.ubuntu.sso
248-+ sdAuth.LoginOrRegister ();
249-+ }
250-+
251-+ public void OnCredentialsFound (object sender, EventArgs args)
252-+ {
253-+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
254-+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
255-+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
256-+ Auth.ConsumerKey = sdAuth.ConsumerKey;
257-+ Auth.ConsumerSecret = sdAuth.ConsumerSecret;
258-+ Auth.Token = sdAuth.Token;
259-+ Auth.TokenSecret = sdAuth.TokenSecret;
260-+
261-+ authButton.Label = Catalog.GetString ("Authentication complete. Press Save to start synchronizing");
262-+ }
263-+
264-+ public void OnAuthCancelled (object sender, EventArgs args)
265-+ {
266-+ authButton.Label = Catalog.GetString ("Register this computer");
267-+ authButton.Sensitive = false;
268-+ }
269-+
270-+ public void OnAuthError (object sender, EventArgs args)
271-+ {
272-+ }
273-+
274-+
275-+ }
276-+
277-+ class SyncdaemonAuthentication
278-+ {
279-+ private IntPtr syncdaemon = IntPtr.Zero;
280-+ private IntPtr handle = IntPtr.Zero;
281-+ private IntPtr credentials = IntPtr.Zero;
282-+
283-+ [DllImport("syncdaemon-1.0")]
284-+ static extern IntPtr syncdaemon_daemon_new ();
285-+
286-+ [DllImport("syncdaemon-1.0")]
287-+ static extern IntPtr syncdaemon_daemon_get_authentication (IntPtr daemon);
288-+
289-+ [DllImport("gobject-2.0")]
290-+ static extern uint g_signal_connect_data (IntPtr obj, IntPtr name, Delegate cb, IntPtr data, IntPtr p, int flags);
291-+
292-+ public SyncdaemonAuthentication ()
293-+ {
294-+ IntPtr native_name;
295-+
296-+ this.syncdaemon = syncdaemon_daemon_new ();
297-+ this.handle = syncdaemon_daemon_get_authentication (this.syncdaemon);
298-+
299-+ native_name = Marshaller.StringToPtrGStrdup ("credentials_found");
300-+ g_signal_connect_data (this.handle, native_name,
301-+ new CredentialsFoundDelegate (credentials_found_cb),
302-+ new IntPtr (0), new IntPtr (0), 0);
303-+ GLib.Marshaller.Free (native_name);
304-+
305-+ native_name = Marshaller.StringToPtrGStrdup ("authorization_cancelled");
306-+ g_signal_connect_data (this.handle, native_name,
307-+ new AuthCancelledDelegate (auth_cancelled_cb),
308-+ new IntPtr (0), new IntPtr (0), 0);
309-+ GLib.Marshaller.Free (native_name);
310-+
311-+ native_name = Marshaller.StringToPtrGStrdup ("error");
312-+ g_signal_connect_data (this.handle, native_name,
313-+ new AuthErrorDelegate (auth_error_cb),
314-+ new IntPtr (0), new IntPtr (0), 0);
315-+ GLib.Marshaller.Free (native_name);
316-+
317-+ }
318-+
319-+ [GLib.CDeclCallback]
320-+ delegate void CredentialsFoundDelegate (IntPtr auth, IntPtr credentials, IntPtr user_data);
321-+
322-+ void credentials_found_cb (IntPtr auth, IntPtr credentials, IntPtr user_data)
323-+ {
324-+ Logger.Debug ("credentials_found_cb called");
325-+ if (this.CredentialsFound != null)
326-+ this.CredentialsFound (this, new EventArgs ());
327-+ }
328-+
329-+ [GLib.CDeclCallback]
330-+ delegate void AuthCancelledDelegate (IntPtr auth, IntPtr user_data);
331-+
332-+ void auth_cancelled_cb (IntPtr auth, IntPtr user_data)
333-+ {
334-+ Logger.Debug ("auth_cancelled_cb called");
335-+ if (this.AuthenticationCancelled != null)
336-+ this.AuthenticationCancelled (this, new EventArgs ());
337-+ }
338-+
339-+ [GLib.CDeclCallback]
340-+ delegate void AuthErrorDelegate (IntPtr auth, IntPtr error, IntPtr user_data);
341-+
342-+ void auth_error_cb (IntPtr auth, IntPtr error, IntPtr user_data)
343-+ {
344-+ Logger.Debug ("auth_error_cb called");
345-+ if (this.AuthenticationError != null)
346-+ this.AuthenticationError (this, new EventArgs ());
347-+ }
348-+
349-+ [DllImport("syncdaemon-1.0")]
350-+ static extern IntPtr syncdaemon_authentication_find_credentials (IntPtr auth);
351-+
352-+ private IntPtr FindCredentials ()
353-+ {
354-+ if (IntPtr.Zero == this.credentials)
355-+ this.credentials = syncdaemon_authentication_find_credentials (this.handle);
356-+
357-+ return this.credentials;
358-+ }
359-+
360-+ [DllImport("syncdaemon-1.0")]
361-+ static extern string syncdaemon_credentials_get_consumer_key (IntPtr credentials);
362-+
363-+ public string ConsumerKey {
364-+ get {
365-+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
366-+ return syncdaemon_credentials_get_consumer_key (raw);
367-+ }
368-+ }
369-+
370-+ [DllImport("syncdaemon-1.0")]
371-+ static extern string syncdaemon_credentials_get_consumer_secret (IntPtr credentials);
372-+
373-+ public string ConsumerSecret {
374-+ get {
375-+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
376-+ return syncdaemon_credentials_get_consumer_secret (raw);
377-+ }
378-+ }
379-+
380-+ [DllImport("syncdaemon-1.0")]
381-+ static extern string syncdaemon_credentials_get_token (IntPtr credentials);
382-+
383-+ public string Token {
384-+ get {
385-+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
386-+ return syncdaemon_credentials_get_token (raw);
387-+ }
388-+ }
389-+
390-+ [DllImport("syncdaemon-1.0")]
391-+ static extern string syncdaemon_credentials_get_token_secret (IntPtr credentials);
392-+
393-+ public string TokenSecret {
394-+ get {
395-+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
396-+ return syncdaemon_credentials_get_token_secret (raw);
397-+ }
398-+ }
399-+
400-+ [DllImport("syncdaemon-1.0")]
401-+ static extern bool syncdaemon_authentication_has_credentials (IntPtr auth);
402-+
403-+ public bool HasCredentials ()
404-+ {
405-+ return syncdaemon_authentication_has_credentials (this.handle);
406-+ }
407-+
408-+ [DllImport("syncdaemon-1.0")]
409-+ static extern void syncdaemon_authentication_login_or_register (IntPtr auth);
410-+
411-+ public void LoginOrRegister ()
412-+ {
413-+ syncdaemon_authentication_login_or_register (this.handle);
414-+ }
415-+
416-+ public event EventHandler CredentialsFound;
417-+
418-+ public event EventHandler AuthenticationCancelled;
419-+
420-+ public event EventHandler AuthenticationError;
421-+ }
422-+}
423-Index: tomboy/Tomboy/Addins/WebSyncService/U1SyncServiceAddin.cs
424-===================================================================
425---- /dev/null 1970-01-01 00:00:00.000000000 +0000
426-+++ tomboy/Tomboy/Addins/WebSyncService/U1SyncServiceAddin.cs 2011-08-23 23:14:17.277675713 +0100
427-@@ -0,0 +1,229 @@
428-+// Permission is hereby granted, free of charge, to any person obtaining
429-+// a copy of this software and associated documentation files (the
430-+// "Software"), to deal in the Software without restriction, including
431-+// without limitation the rights to use, copy, modify, merge, publish,
432-+// distribute, sublicense, and/or sell copies of the Software, and to
433-+// permit persons to whom the Software is furnished to do so, subject to
434-+// the following conditions:
435-+//
436-+// The above copyright notice and this permission notice shall be
437-+// included in all copies or substantial portions of the Software.
438-+//
439-+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
440-+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
441-+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
442-+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
443-+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
444-+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
445-+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
446-+//
447-+// Copyright (c) 2010 Canonical, Ltd. (http://www.canonical.com)
448-+//
449-+// Authors:
450-+// Rodrigo Moya <rodrigo.moya@canonical.com>
451-+//
452-+
453-+using System;
454-+
455-+using Mono.Unix;
456-+
457-+using Tomboy.Sync;
458-+
459-+namespace Tomboy.WebSync
460-+{
461-+ public class U1SyncServiceAddin : SyncServiceAddin
462-+ {
463-+ private bool initialized;
464-+ private U1SyncPreferencesWidget prefsWidget;
465-+
466-+ private const string serverUrlPrefPath =
467-+ "/apps/tomboy/sync/ubuntuone/server";
468-+ private const string accessTokenBaseUrlPrefPath =
469-+ "/apps/tomboy/sync/ubuntuone/oauth_access_token_base_url";
470-+ private const string authorizeLocationPrefPath =
471-+ "/apps/tomboy/sync/ubuntuone/oauth_authorize_location";
472-+ private const string consumerKeyPrefPath =
473-+ "/apps/tomboy/sync/ubuntuone/oauth_consumer_key";
474-+ private const string consumerSecretPrefPath =
475-+ "/apps/tomboy/sync/ubuntuone/oauth_consumer_secret";
476-+ private const string realmPrefPath =
477-+ "/apps/tomboy/sync/ubuntuone/oauth_realm";
478-+ private const string requestTokenBaseUrlPrefPath =
479-+ "/apps/tomboy/sync/ubuntuone/oauth_request_token_base_url";
480-+ private const string tokenPrefPath =
481-+ "/apps/tomboy/sync/ubuntuone/oauth_token";
482-+ private const string tokenSecretPrefPath =
483-+ "/apps/tomboy/sync/ubuntuone/oauth_token_secret";
484-+
485-+ public U1SyncServiceAddin ()
486-+ {
487-+ }
488-+
489-+ #region SyncServiceAddin Overrides
490-+
491-+ public override string Id {
492-+ get { return "ubuntuone"; }
493-+ }
494-+
495-+ public override string Name {
496-+ get {
497-+ return Catalog.GetString ("Ubuntu One");
498-+ }
499-+ }
500-+
501-+ public override bool IsConfigured {
502-+ get {
503-+ string serverPref;
504-+ Api.OAuth oauth;
505-+ GetConfigSettings (out oauth, out serverPref);
506-+ return !string.IsNullOrEmpty (serverPref) &&
507-+ oauth != null &&
508-+ oauth.IsAccessToken;
509-+ }
510-+ }
511-+
512-+ public override bool IsSupported {
513-+ get {
514-+ return true; // TODO: Ever false?
515-+ }
516-+ }
517-+
518-+ public override Gtk.Widget CreatePreferencesControl (EventHandler requiredPrefChanged)
519-+ {
520-+ string serverPref;
521-+ Api.OAuth oauth;
522-+ GetConfigSettings (out oauth, out serverPref);
523-+ prefsWidget = new U1SyncPreferencesWidget (oauth, serverPref);
524-+ return prefsWidget;
525-+ }
526-+
527-+ public override SyncServer CreateSyncServer ()
528-+ {
529-+ string serverPref;
530-+ Api.OAuth oauth;
531-+ GetConfigSettings (out oauth, out serverPref);
532-+ return new WebSyncServer (serverPref, oauth);
533-+ }
534-+
535-+ public override void PostSyncCleanup ()
536-+ {
537-+ }
538-+
539-+ public override void ResetConfiguration ()
540-+ {
541-+ SaveConfigSettings (null, null);
542-+ prefsWidget.Auth = null;
543-+ }
544-+
545-+ public override bool SaveConfiguration ()
546-+ {
547-+ // TODO: Is this really sufficient validation?
548-+ // Should we try a REST API request?
549-+ if (prefsWidget.Auth == null ||
550-+ prefsWidget.Auth.ConsumerKey == null ||
551-+ prefsWidget.Auth.ConsumerSecret == null ||
552-+ prefsWidget.Auth.Token == null ||
553-+ prefsWidget.Auth.TokenSecret == null)
554-+ return false;
555-+ SaveConfigSettings (prefsWidget.Auth, prefsWidget.Server);
556-+ return true;
557-+ }
558-+
559-+ #endregion
560-+
561-+ #region ApplicationAddin Overrides
562-+
563-+ public override void Initialize ()
564-+ {
565-+ initialized = true;
566-+ }
567-+
568-+ public override void Shutdown ()
569-+ {
570-+ initialized = false;
571-+ }
572-+
573-+ public override bool Initialized {
574-+ get { return initialized; }
575-+ }
576-+
577-+ #endregion
578-+
579-+ #region Private Members
580-+
581-+ private void GetConfigSettings (out Api.OAuth oauthConfig, out string serverPref)
582-+ {
583-+ serverPref = (string)
584-+ Preferences.Get (serverUrlPrefPath);
585-+
586-+ oauthConfig = new Api.OAuth ();
587-+ oauthConfig.AccessTokenBaseUrl =
588-+ Preferences.Get (accessTokenBaseUrlPrefPath) as string;
589-+ oauthConfig.AuthorizeLocation =
590-+ Preferences.Get (authorizeLocationPrefPath) as string;
591-+ oauthConfig.ConsumerKey =
592-+ Preferences.Get (consumerKeyPrefPath) as string;
593-+ oauthConfig.ConsumerSecret =
594-+ Preferences.Get (consumerSecretPrefPath) as string;
595-+ oauthConfig.Realm =
596-+ Preferences.Get (realmPrefPath) as string;
597-+ oauthConfig.RequestTokenBaseUrl =
598-+ Preferences.Get (requestTokenBaseUrlPrefPath) as string;
599-+ oauthConfig.Token =
600-+ Preferences.Get (tokenPrefPath) as string;
601-+ oauthConfig.TokenSecret =
602-+ Preferences.Get (tokenSecretPrefPath) as string;
603-+
604-+ // The fact that the configuration was saved at all
605-+ // implies that the token is an access token.
606-+ // TODO: Any benefit in actually storing this bool, in
607-+ // case of weird circumstances?
608-+ oauthConfig.IsAccessToken =
609-+ !String.IsNullOrEmpty (oauthConfig.Token);
610-+ }
611-+
612-+ private void SaveConfigSettings (Api.OAuth oauthConfig, string serverPref)
613-+ {
614-+ Preferences.Set (serverUrlPrefPath, GetConfigString (serverPref));
615-+ Preferences.Set (accessTokenBaseUrlPrefPath,
616-+ oauthConfig != null ?
617-+ GetConfigString (oauthConfig.AccessTokenBaseUrl) :
618-+ String.Empty);
619-+ Preferences.Set (authorizeLocationPrefPath,
620-+ oauthConfig != null ?
621-+ GetConfigString (oauthConfig.AuthorizeLocation) :
622-+ String.Empty);
623-+ Preferences.Set (consumerKeyPrefPath,
624-+ oauthConfig != null ?
625-+ GetConfigString (oauthConfig.ConsumerKey) :
626-+ String.Empty);
627-+ Preferences.Set (consumerSecretPrefPath,
628-+ oauthConfig != null ?
629-+ GetConfigString (oauthConfig.ConsumerSecret) :
630-+ String.Empty);
631-+ Preferences.Set (realmPrefPath,
632-+ oauthConfig != null ?
633-+ GetConfigString (oauthConfig.Realm) :
634-+ String.Empty);
635-+ Preferences.Set (requestTokenBaseUrlPrefPath,
636-+ oauthConfig != null ?
637-+ GetConfigString (oauthConfig.RequestTokenBaseUrl) :
638-+ String.Empty);
639-+ Preferences.Set (tokenPrefPath,
640-+ oauthConfig != null ?
641-+ GetConfigString (oauthConfig.Token) :
642-+ String.Empty);
643-+ Preferences.Set (tokenSecretPrefPath,
644-+ oauthConfig != null ?
645-+ GetConfigString (oauthConfig.TokenSecret) :
646-+ String.Empty);
647-+ }
648-+
649-+ private string GetConfigString (string val)
650-+ {
651-+ return val ?? String.Empty;
652-+ }
653-+
654-+ #endregion
655-+ }
656-+}
657-Index: tomboy/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml
658-===================================================================
659---- tomboy.orig/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml 2011-08-23 22:54:40.139230862 +0100
660-+++ tomboy/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml 2011-08-23 23:11:21.488427309 +0100
661-@@ -18,4 +18,8 @@
662- <Extension path="/Tomboy/SyncServiceAddins">
663- <SyncServiceAddin type="Tomboy.WebSync.WebSyncServiceAddin" />
664- </Extension>
665-+
666-+ <Extension path="/Tomboy/SyncServiceAddins">
667-+ <SyncServiceAddin type="Tomboy.WebSync.U1SyncServiceAddin" />
668-+ </Extension>
669- </Addin>
670
671=== modified file 'debian/patches/series'
672--- debian/patches/series 2012-08-06 18:13:55 +0000
673+++ debian/patches/series 2013-02-04 20:34:25 +0000
674@@ -1,7 +1,3 @@
675 01_dllmaps.patch
676-02_sync_save_button_sensitive.patch
677-03_u1_as_default_sync.patch
678 04_app_indicator.patch
679-05_add_start_u1_note.patch
680-#06_use_ubuntu_sso.patch
681 20_remove_pcfile_requires

Subscribers

People subscribed via source and target branches

to all changes: