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

Proposed by dobey
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntu/oneiric/tomboy/no-more-u1
Merge into: lp:ubuntu/oneiric/tomboy
Diff against target: 2430 lines (+1705/-613)
12 files modified
.pc/02_sync_save_button_sensitive.patch/Tomboy/PreferencesDialog.cs (+1388/-0)
.pc/32_logout_delay.patch/Tomboy/GnomeApplication.cs (+230/-0)
.pc/applied-patches (+2/-0)
Tomboy/GnomeApplication.cs (+6/-0)
Tomboy/PreferencesDialog.cs (+1/-1)
debian/changelog (+34/-0)
debian/control (+1/-2)
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/32_logout_delay.patch (+42/-0)
debian/patches/series (+1/-3)
To merge this branch: bzr merge lp:~dobey/ubuntu/oneiric/tomboy/no-more-u1
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Ubuntu branches Pending
Review via email: mp+146676@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.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

sponsored.

Please ensure you test your branch, you didn't remove the pre-applied patch from the vcs files, so the patches were still here. I had to redo the branch with quilt pop -a, and then, taking your debian/ dir.

Marking as merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.pc/02_sync_save_button_sensitive.patch'
=== added directory '.pc/02_sync_save_button_sensitive.patch/Tomboy'
=== added file '.pc/02_sync_save_button_sensitive.patch/Tomboy/PreferencesDialog.cs'
--- .pc/02_sync_save_button_sensitive.patch/Tomboy/PreferencesDialog.cs 1970-01-01 00:00:00 +0000
+++ .pc/02_sync_save_button_sensitive.patch/Tomboy/PreferencesDialog.cs 2013-02-05 16:50:59 +0000
@@ -0,0 +1,1388 @@
1
2using System;
3using System.Collections.Generic;
4using System.Text;
5using Mono.Unix;
6
7using Tomboy.Sync;
8
9namespace Tomboy
10{
11 public class PreferencesDialog : Gtk.Dialog
12 {
13 Gtk.ListStore syncAddinStore;
14 Dictionary<string, Gtk.TreeIter> syncAddinIters;
15 Gtk.ComboBox syncAddinCombo;
16 SyncServiceAddin selectedSyncAddin;
17 Gtk.VBox syncAddinPrefsContainer;
18 Gtk.Widget syncAddinPrefsWidget;
19 Gtk.Button resetSyncAddinButton;
20 Gtk.Button saveSyncAddinButton;
21 Gtk.CheckButton autosyncCheck;
22 Gtk.SpinButton autosyncSpinner;
23 Gtk.ComboBox rename_behavior_combo;
24 readonly AddinManager addin_manager;
25
26 Gtk.Button font_button;
27 Gtk.Label font_face;
28 Gtk.Label font_size;
29
30 Mono.Addins.Gui.AddinTreeWidget addin_tree;
31
32 Gtk.Button enable_addin_button;
33 Gtk.Button disable_addin_button;
34 Gtk.Button addin_prefs_button;
35 Gtk.Button addin_info_button;
36
37 private Gtk.RadioButton promptOnConflictRadio;
38 private Gtk.RadioButton renameOnConflictRadio;
39 private Gtk.RadioButton overwriteOnConflictRadio;
40
41 /// <summary>
42 /// Keep track of the opened addin prefs dialogs so other windows
43 /// can be interacted with (as opposed to opening these as modal
44 /// dialogs).
45 ///
46 /// Key = Mono.Addins.Addin.Id
47 /// </summary>
48 Dictionary<string, Gtk.Dialog> addin_prefs_dialogs;
49
50 /// <summary>
51 /// Used to keep track of open AddinInfoDialogs.
52 /// Key = Mono.Addins.Addin.Id
53 /// </summary>
54 Dictionary<string, Gtk.Dialog> addin_info_dialogs;
55
56 public PreferencesDialog (AddinManager addin_manager)
57: base ()
58 {
59 this.addin_manager = addin_manager;
60
61 IconName = "tomboy";
62 HasSeparator = false;
63 BorderWidth = 5;
64 Resizable = true;
65 Title = Catalog.GetString ("Tomboy Preferences");
66
67 ActionArea.Layout = Gtk.ButtonBoxStyle.End;
68
69 addin_prefs_dialogs =
70 new Dictionary<string, Gtk.Dialog> ();
71 addin_info_dialogs =
72 new Dictionary<string, Gtk.Dialog> ();
73
74 // Notebook Tabs (Editing, Hotkeys)...
75
76 Gtk.Notebook notebook = new Gtk.Notebook ();
77 notebook.TabPos = Gtk.PositionType.Top;
78 notebook.Show ();
79
80 notebook.AppendPage (MakeEditingPane (),
81 new Gtk.Label (Catalog.GetString ("Editing")));
82 if (! (Services.Keybinder is NullKeybinder))
83 notebook.AppendPage (MakeHotkeysPane (),
84 new Gtk.Label (Catalog.GetString ("Hotkeys")));
85 notebook.AppendPage (MakeSyncPane (),
86 new Gtk.Label (Catalog.GetString ("Synchronization")));
87 notebook.AppendPage (MakeAddinsPane (),
88 new Gtk.Label (Catalog.GetString ("Add-ins")));
89
90 // TODO: Figure out a way to have these be placed in a specific order
91 foreach (PreferenceTabAddin tabAddin in addin_manager.GetPreferenceTabAddins ()) {
92 Logger.Debug ("Adding preference tab addin: {0}", tabAddin.GetType ().Name);
93 try {
94 string tabName;
95 Gtk.Widget tabWidget;
96 if (tabAddin.GetPreferenceTabWidget (this, out tabName, out tabWidget) == true) {
97 notebook.AppendPage (tabWidget, new Gtk.Label (tabName));
98 }
99 } catch (Exception e) {
100 Logger.Warn ("Problems adding preferences tab addin: {0}", tabAddin.GetType ().Name);
101 Logger.Debug ("{0}:\n{1}", e.Message, e.StackTrace);
102 }
103 }
104
105 VBox.PackStart (notebook, true, true, 0);
106
107 addin_manager.ApplicationAddinListChanged += OnAppAddinListChanged;
108
109
110 // Ok button...
111
112 Gtk.Button button = new Gtk.Button (Gtk.Stock.Close);
113 button.CanDefault = true;
114 button.Show ();
115
116 Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
117 AddAccelGroup (accel_group);
118
119 button.AddAccelerator ("activate",
120 accel_group,
121 (uint) Gdk.Key.Escape,
122 0,
123 0);
124
125 AddActionWidget (button, Gtk.ResponseType.Close);
126 DefaultResponse = Gtk.ResponseType.Close;
127
128 Preferences.SettingChanged += HandlePreferencesSettingChanged;
129 }
130
131 void HandlePreferencesSettingChanged (object sender, NotifyEventArgs args)
132 {
133 if (args.Key == Preferences.NOTE_RENAME_BEHAVIOR) {
134 int rename_behavior = (int) args.Value;
135 if (rename_behavior < 0 || rename_behavior > 2) {
136 rename_behavior = 0;
137 Preferences.Set (Preferences.NOTE_RENAME_BEHAVIOR, rename_behavior);
138 }
139 if (rename_behavior_combo.Active != rename_behavior)
140 rename_behavior_combo.Active = rename_behavior;
141 } else if (args.Key == Preferences.SYNC_AUTOSYNC_TIMEOUT) {
142 int timeout = (int) args.Value;
143 if (timeout <= 0 && autosyncCheck.Active)
144 autosyncCheck.Active = false;
145 else if (timeout > 0) {
146 timeout = (timeout >= 5 && timeout < 1000) ? timeout : 5;
147 if (!autosyncCheck.Active)
148 autosyncCheck.Active = true;
149 if ((int) autosyncSpinner.Value != timeout)
150 autosyncSpinner.Value = timeout;
151 }
152 }
153 }
154
155 // Page 1
156 // List of editing options
157 public Gtk.Widget MakeEditingPane ()
158 {
159 Gtk.Label label;
160 Gtk.CheckButton check;
161 Gtk.Alignment align;
162 IPropertyEditorBool peditor, font_peditor, bullet_peditor;
163
164 Gtk.VBox options_list = new Gtk.VBox (false, 12);
165 options_list.BorderWidth = 12;
166 options_list.Show ();
167
168
169 // Spell checking...
170
171 #if FIXED_GTKSPELL
172 if (NoteSpellChecker.GtkSpellAvailable) {
173 check = MakeCheckButton (
174 Catalog.GetString ("_Spell check while typing"));
175 options_list.PackStart (check, false, false, 0);
176
177 peditor = Services.Factory.CreatePropertyEditorToggleButton (
178 Preferences.ENABLE_SPELLCHECKING,
179 check);
180 SetupPropertyEditor (peditor);
181
182 label = MakeTipLabel (
183 Catalog.GetString ("Misspellings will be underlined " +
184 "in red, with correct spelling " +
185 "suggestions shown in the context " +
186 "menu."));
187 options_list.PackStart (label, false, false, 0);
188 }
189 #endif
190
191
192 // WikiWords...
193
194 check = MakeCheckButton (Catalog.GetString ("Highlight _WikiWords"));
195 options_list.PackStart (check, false, false, 0);
196
197 peditor = Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_WIKIWORDS,
198 check);
199 SetupPropertyEditor (peditor);
200
201 label = MakeTipLabel (
202 Catalog.GetString ("Enable this option to highlight " +
203 "words <b>ThatLookLikeThis</b>. " +
204 "Clicking the word will create a " +
205 "note with that name."));
206 options_list.PackStart (label, false, false, 0);
207
208 // Auto bulleted list
209 check = MakeCheckButton (Catalog.GetString ("Enable auto-_bulleted lists"));
210 options_list.PackStart (check, false, false, 0);
211 bullet_peditor =
212 Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_AUTO_BULLETED_LISTS,
213 check);
214 SetupPropertyEditor (bullet_peditor);
215
216 // Custom font...
217 Gtk.HBox font_box = new Gtk.HBox (false, 0);
218 check = MakeCheckButton (Catalog.GetString ("Use custom _font"));
219 font_box.PackStart (check);
220
221 font_peditor =
222 Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_CUSTOM_FONT,
223 check);
224 SetupPropertyEditor (font_peditor);
225
226 font_button = MakeFontButton ();
227 font_button.Sensitive = check.Active;
228 font_box.PackStart (font_button);
229 font_box.ShowAll ();
230 options_list.PackStart (font_box, false, false, 0);
231
232 font_peditor.AddGuard (font_button);
233
234 // Note renaming bahvior
235 Gtk.HBox rename_behavior_box = new Gtk.HBox (false, 0);
236 label = MakeLabel (Catalog.GetString ("When renaming a linked note: "));
237 rename_behavior_box.PackStart (label);
238 rename_behavior_combo = new Gtk.ComboBox (new string [] {
239 Catalog.GetString ("Ask me what to do"),
240 Catalog.GetString ("Never rename links"),
241 Catalog.GetString ("Always rename links")});
242 int rename_behavior = (int) Preferences.Get (Preferences.NOTE_RENAME_BEHAVIOR);
243 if (rename_behavior < 0 || rename_behavior > 2) {
244 rename_behavior = 0;
245 Preferences.Set (Preferences.NOTE_RENAME_BEHAVIOR, rename_behavior);
246 }
247 rename_behavior_combo.Active = rename_behavior;
248 rename_behavior_combo.Changed += (o, e) =>
249 Preferences.Set (Preferences.NOTE_RENAME_BEHAVIOR,
250 rename_behavior_combo.Active);
251 rename_behavior_box.PackStart (rename_behavior_combo);
252 rename_behavior_box.ShowAll ();
253 options_list.PackStart (rename_behavior_box, false, false, 0);
254
255 // New Note Template
256 // Translators: This is 'New Note' Template, not New 'Note Template'
257 label = MakeLabel (Catalog.GetString ("New Note Template"));
258 options_list.PackStart (label, false, false, 0);
259
260 label = MakeTipLabel (
261 Catalog.GetString ("Use the new note template to specify the text " +
262 "that should be used when creating a new note."));
263 options_list.PackStart (label, false, false, 0);
264
265 align = new Gtk.Alignment (0.5f, 0.5f, 0.4f, 1.0f);
266 align.Show ();
267 options_list.PackStart (align, false, false, 0);
268
269 Gtk.Button open_template_button = new Gtk.Button ();
270 open_template_button.Label = Catalog.GetString ("Open New Note Template");
271
272 open_template_button.Clicked += OpenTemplateButtonClicked;
273 open_template_button.Show ();
274 align.Add (open_template_button);
275
276 return options_list;
277 }
278
279 Gtk.Button MakeFontButton ()
280 {
281 Gtk.HBox font_box = new Gtk.HBox (false, 0);
282 font_box.Show ();
283
284 font_face = new Gtk.Label (null);
285 font_face.UseMarkup = true;
286 font_face.Show ();
287 font_box.PackStart (font_face, true, true, 0);
288
289 Gtk.VSeparator sep = new Gtk.VSeparator ();
290 sep.Show ();
291 font_box.PackStart (sep, false, false, 0);
292
293 font_size = new Gtk.Label (null);
294 font_size.Xpad = 4;
295 font_size.Show ();
296 font_box.PackStart (font_size, false, false, 0);
297
298 Gtk.Button button = new Gtk.Button ();
299 button.Clicked += OnFontButtonClicked;
300 button.Add (font_box);
301 button.Show ();
302
303 string font_desc = (string) Preferences.Get (Preferences.CUSTOM_FONT_FACE);
304 UpdateFontButton (font_desc);
305
306 return button;
307 }
308
309 // Page 2
310 // List of Hotkey options
311 public Gtk.Widget MakeHotkeysPane ()
312 {
313 Gtk.Label label;
314 Gtk.CheckButton check;
315 Gtk.Alignment align;
316 Gtk.Entry entry;
317 IPropertyEditorBool keybind_peditor;
318 IPropertyEditor peditor;
319
320 Gtk.VBox hotkeys_list = new Gtk.VBox (false, 12);
321 hotkeys_list.BorderWidth = 12;
322 hotkeys_list.Show ();
323
324
325 // Hotkeys...
326
327 check = MakeCheckButton (Catalog.GetString ("Listen for _Hotkeys"));
328 hotkeys_list.PackStart (check, false, false, 0);
329
330 keybind_peditor =
331 Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_KEYBINDINGS,
332 check);
333 SetupPropertyEditor (keybind_peditor);
334
335 label = MakeTipLabel (
336 Catalog.GetString ("Hotkeys allow you to quickly access " +
337 "your notes from anywhere with a keypress. " +
338 "Example Hotkeys: " +
339 "<b>&lt;Control&gt;&lt;Shift&gt;F11</b>, " +
340 "<b>&lt;Alt&gt;N</b>"));
341 hotkeys_list.PackStart (label, false, false, 0);
342
343 align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
344 align.Show ();
345 hotkeys_list.PackStart (align, false, false, 0);
346
347 Gtk.Table table = new Gtk.Table (4, 2, false);
348 table.ColumnSpacing = 6;
349 table.RowSpacing = 6;
350 table.Show ();
351 align.Add (table);
352
353
354 // Show notes menu keybinding...
355
356 label = MakeLabel (Catalog.GetString ("Show notes _menu"));
357 table.Attach (label, 0, 1, 0, 1);
358
359 entry = new Gtk.Entry ();
360 label.MnemonicWidget = entry;
361 entry.Show ();
362 table.Attach (entry, 1, 2, 0, 1);
363
364 peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_SHOW_NOTE_MENU,
365 entry);
366 SetupPropertyEditor (peditor);
367
368 keybind_peditor.AddGuard (entry);
369
370
371 // Open Start Here keybinding...
372
373 label = MakeLabel (Catalog.GetString ("Open \"_Start Here\""));
374 table.Attach (label, 0, 1, 1, 2);
375
376 entry = new Gtk.Entry ();
377 label.MnemonicWidget = entry;
378 entry.Show ();
379 table.Attach (entry, 1, 2, 1, 2);
380
381 peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_OPEN_START_HERE,
382 entry);
383 SetupPropertyEditor (peditor);
384
385 keybind_peditor.AddGuard (entry);
386
387
388 // Create new note keybinding...
389
390 label = MakeLabel (Catalog.GetString ("Create _new note"));
391 table.Attach (label, 0, 1, 2, 3);
392
393 entry = new Gtk.Entry ();
394 label.MnemonicWidget = entry;
395 entry.Show ();
396 table.Attach (entry, 1, 2, 2, 3);
397
398 peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_CREATE_NEW_NOTE,
399 entry);
400 SetupPropertyEditor (peditor);
401
402 keybind_peditor.AddGuard (entry);
403
404
405 // Open Search All Notes window keybinding...
406
407 label = MakeLabel (Catalog.GetString ("Open \"Search _All Notes\""));
408 table.Attach (label, 0, 1, 3, 4);
409
410 entry = new Gtk.Entry ();
411 label.MnemonicWidget = entry;
412 entry.Show ();
413 table.Attach (entry, 1, 2, 3, 4);
414
415 peditor = Services.Factory.CreatePropertyEditorEntry (
416 Preferences.KEYBINDING_OPEN_RECENT_CHANGES,
417 entry);
418 SetupPropertyEditor (peditor);
419
420 keybind_peditor.AddGuard (entry);
421
422
423 return hotkeys_list;
424 }
425
426 public Gtk.Widget MakeSyncPane ()
427 {
428 Gtk.VBox vbox = new Gtk.VBox (false, 0);
429 vbox.Spacing = 4;
430 vbox.BorderWidth = 8;
431
432 Gtk.HBox hbox = new Gtk.HBox (false, 4);
433
434 Gtk.Label label = new Gtk.Label (Catalog.GetString ("Ser_vice:"));
435 label.Xalign = 0;
436 label.Show ();
437 hbox.PackStart (label, false, false, 0);
438
439 // Populate the store with all the available SyncServiceAddins
440 syncAddinStore = new Gtk.ListStore (typeof (SyncServiceAddin));
441 syncAddinIters = new Dictionary<string,Gtk.TreeIter> ();
442 SyncServiceAddin [] addins = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
443 Array.Sort (addins, CompareSyncAddinsByName);
444 foreach (SyncServiceAddin addin in addins) {
445 Gtk.TreeIter iter = syncAddinStore.Append ();
446 syncAddinStore.SetValue (iter, 0, addin);
447 syncAddinIters [addin.Id] = iter;
448 }
449
450 syncAddinCombo = new Gtk.ComboBox (syncAddinStore);
451 label.MnemonicWidget = syncAddinCombo;
452 Gtk.CellRendererText crt = new Gtk.CellRendererText ();
453 syncAddinCombo.PackStart (crt, true);
454 syncAddinCombo.SetCellDataFunc (crt,
455 new Gtk.CellLayoutDataFunc (ComboBoxTextDataFunc));
456
457 // Read from Preferences which service is configured and select it
458 // by default. Otherwise, just select the first one in the list.
459 string addin_id = Preferences.Get (
460 Preferences.SYNC_SELECTED_SERVICE_ADDIN) as String;
461
462 Gtk.TreeIter active_iter;
463 if (addin_id != null && syncAddinIters.ContainsKey (addin_id)) {
464 active_iter = syncAddinIters [addin_id];
465 syncAddinCombo.SetActiveIter (active_iter);
466 } else {
467 if (syncAddinStore.GetIterFirst (out active_iter) == true) {
468 syncAddinCombo.SetActiveIter (active_iter);
469 }
470 }
471
472 syncAddinCombo.Changed += OnSyncAddinComboChanged;
473
474 syncAddinCombo.Show ();
475 hbox.PackStart (syncAddinCombo, true, true, 0);
476
477 hbox.Show ();
478 vbox.PackStart (hbox, false, false, 0);
479
480 // Get the preferences GUI for the Sync Addin
481 if (active_iter.Stamp != Gtk.TreeIter.Zero.Stamp)
482 selectedSyncAddin = syncAddinStore.GetValue (active_iter, 0) as SyncServiceAddin;
483
484 if (selectedSyncAddin != null)
485 syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
486 if (syncAddinPrefsWidget == null) {
487 Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
488 l.Yalign = 0.5f;
489 l.Yalign = 0.5f;
490 syncAddinPrefsWidget = l;
491 }
492 if (syncAddinPrefsWidget != null && addin_id != null &&
493 syncAddinIters.ContainsKey (addin_id) && selectedSyncAddin.IsConfigured)
494 syncAddinPrefsWidget.Sensitive = false;
495
496 syncAddinPrefsWidget.Show ();
497 syncAddinPrefsContainer = new Gtk.VBox (false, 0);
498 syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
499 syncAddinPrefsContainer.Show ();
500 vbox.PackStart (syncAddinPrefsContainer, true, true, 10);
501
502 // Autosync preference
503 int timeout = (int) Preferences.Get (Preferences.SYNC_AUTOSYNC_TIMEOUT);
504 if (timeout > 0 && timeout < 5) {
505 timeout = 5;
506 Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT, 5);
507 }
508 Gtk.HBox autosyncBox = new Gtk.HBox (false, 5);
509 // Translators: This is and the next string go together.
510 // Together they look like "Automatically Sync in Background Every [_] Minutes",
511 // where "[_]" is a GtkSpinButton.
512 autosyncCheck =
513 new Gtk.CheckButton (Catalog.GetString ("Automaticall_y Sync in Background Every"));
514 autosyncSpinner = new Gtk.SpinButton (5, 1000, 1);
515 autosyncSpinner.Value = timeout >= 5 ? timeout : 10;
516 Gtk.Label autosyncExtraText =
517 // Translators: See above comment for details on
518 // this string.
519 new Gtk.Label (Catalog.GetString ("Minutes"));
520 autosyncCheck.Active = autosyncSpinner.Sensitive = timeout >= 5;
521 EventHandler updateTimeoutPref = (o, e) => {
522 Preferences.Set (Preferences.SYNC_AUTOSYNC_TIMEOUT,
523 autosyncCheck.Active ? (int) autosyncSpinner.Value : -1);
524 };
525 autosyncCheck.Toggled += (o, e) => {
526 autosyncSpinner.Sensitive = autosyncCheck.Active;
527 updateTimeoutPref (o, e);
528 };
529 autosyncSpinner.ValueChanged += updateTimeoutPref;
530
531 autosyncBox.PackStart (autosyncCheck);
532 autosyncBox.PackStart (autosyncSpinner);
533 autosyncBox.PackStart (autosyncExtraText);
534 vbox.PackStart (autosyncBox, false, true, 0);
535
536 Gtk.HButtonBox bbox = new Gtk.HButtonBox ();
537 bbox.Spacing = 4;
538 bbox.LayoutStyle = Gtk.ButtonBoxStyle.End;
539
540 // "Advanced..." button to bring up extra sync config dialog
541 Gtk.Button advancedConfigButton = new Gtk.Button (Catalog.GetString ("_Advanced..."));
542 advancedConfigButton.Clicked += OnAdvancedSyncConfigButton;
543 advancedConfigButton.Show ();
544 bbox.PackStart (advancedConfigButton, false, false, 0);
545 bbox.SetChildSecondary (advancedConfigButton, true);
546
547 resetSyncAddinButton = new Gtk.Button (Gtk.Stock.Clear);
548 resetSyncAddinButton.Clicked += OnResetSyncAddinButton;
549 resetSyncAddinButton.Sensitive =
550 (selectedSyncAddin != null &&
551 addin_id == selectedSyncAddin.Id &&
552 selectedSyncAddin.IsConfigured);
553 resetSyncAddinButton.Show ();
554 bbox.PackStart (resetSyncAddinButton, false, false, 0);
555
556 // TODO: Tabbing should go directly from sync prefs widget to here
557 // TODO: Consider connecting to "Enter" pressed in sync prefs widget
558 saveSyncAddinButton = new Gtk.Button (Gtk.Stock.Save);
559 saveSyncAddinButton.Clicked += OnSaveSyncAddinButton;
560 saveSyncAddinButton.Sensitive =
561 (selectedSyncAddin != null &&
562 (addin_id != selectedSyncAddin.Id || !selectedSyncAddin.IsConfigured));
563 saveSyncAddinButton.Show ();
564 bbox.PackStart (saveSyncAddinButton, false, false, 0);
565
566 syncAddinCombo.Sensitive =
567 (selectedSyncAddin == null ||
568 addin_id != selectedSyncAddin.Id ||
569 !selectedSyncAddin.IsConfigured);
570
571 bbox.Show ();
572 vbox.PackStart (bbox, false, false, 0);
573
574 vbox.ShowAll ();
575 return vbox;
576 }
577
578 private int CompareSyncAddinsByName (SyncServiceAddin addin1, SyncServiceAddin addin2)
579 {
580 return addin1.Name.CompareTo (addin2.Name);
581 }
582
583 private void ComboBoxTextDataFunc (Gtk.CellLayout cell_layout, Gtk.CellRenderer cell,
584 Gtk.TreeModel tree_model, Gtk.TreeIter iter)
585 {
586 Gtk.CellRendererText crt = cell as Gtk.CellRendererText;
587 SyncServiceAddin addin = tree_model.GetValue (iter, 0) as SyncServiceAddin;
588 if (addin == null) {
589 crt.Text = string.Empty;
590 } else {
591 crt.Text = addin.Name;
592 }
593 }
594
595 // Page 3
596 // Extension Preferences
597 public Gtk.Widget MakeAddinsPane ()
598 {
599 Gtk.VBox vbox = new Gtk.VBox (false, 6);
600 vbox.BorderWidth = 6;
601 Gtk.Label l = new Gtk.Label (Catalog.GetString (
602 "The following add-ins are installed"));
603 l.Xalign = 0;
604 l.Show ();
605 vbox.PackStart (l, false, false, 0);
606
607 Gtk.HBox hbox = new Gtk.HBox (false, 6);
608
609 // TreeView of Add-ins
610 Gtk.TreeView tree = new Gtk.TreeView ();
611 addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree);
612
613 tree.Show ();
614
615 Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
616 sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
617 sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
618 sw.ShadowType = Gtk.ShadowType.In;
619 sw.Add (tree);
620 sw.Show ();
621 Gtk.LinkButton get_more_link =
622 new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList",
623 Catalog.GetString ("Get More Add-Ins..."));
624 get_more_link.Show ();
625 Gtk.VBox tree_box = new Gtk.VBox (false, 0);
626 tree_box.Add (sw);
627 tree_box.PackEnd (get_more_link, false, false, 5);
628 tree_box.Show ();
629 hbox.PackStart (tree_box, true, true, 0);
630
631 // Action Buttons (right of TreeView)
632 Gtk.VButtonBox button_box = new Gtk.VButtonBox ();
633 button_box.Spacing = 4;
634 button_box.Layout = Gtk.ButtonBoxStyle.Start;
635
636 // TODO: In a future version, add in an "Install Add-ins..." button
637
638 // TODO: In a future version, add in a "Repositories..." button
639
640 enable_addin_button =
641 new Gtk.Button (Catalog.GetString ("_Enable"));
642 enable_addin_button.Sensitive = false;
643 enable_addin_button.Clicked += OnEnableAddinButton;
644 enable_addin_button.Show ();
645
646 disable_addin_button =
647 new Gtk.Button (Catalog.GetString ("_Disable"));
648 disable_addin_button.Sensitive = false;
649 disable_addin_button.Clicked += OnDisableAddinButton;
650 disable_addin_button.Show ();
651
652 addin_prefs_button =
653 new Gtk.Button (Gtk.Stock.Preferences);
654 addin_prefs_button.Sensitive = false;
655 addin_prefs_button.Clicked += OnAddinPrefsButton;
656 addin_prefs_button.Show ();
657
658 addin_info_button =
659 new Gtk.Button (Gtk.Stock.Info);
660 addin_info_button.Sensitive = false;
661 addin_info_button.Clicked += OnAddinInfoButton;
662 addin_info_button.Show ();
663
664 button_box.PackStart (enable_addin_button);
665 button_box.PackStart (disable_addin_button);
666 button_box.PackStart (addin_prefs_button);
667 button_box.PackStart (addin_info_button);
668
669 button_box.Show ();
670 hbox.PackStart (button_box, false, false, 0);
671
672 hbox.Show ();
673 vbox.PackStart (hbox, true, true, 0);
674 vbox.Show ();
675
676 tree.Selection.Changed += OnAddinTreeSelectionChanged;
677 LoadAddins ();
678
679 return vbox;
680 }
681
682 void OnAddinTreeSelectionChanged (object sender, EventArgs args)
683 {
684 UpdateAddinButtons ();
685 }
686
687 /// <summary>
688 /// Set the sensitivity of the buttons based on what is selected
689 /// </summary>
690 void UpdateAddinButtons ()
691 {
692 Mono.Addins.Addin sinfo =
693 addin_tree.ActiveAddinData as Mono.Addins.Addin;
694
695 if (sinfo == null) {
696 enable_addin_button.Sensitive = false;
697 disable_addin_button.Sensitive = false;
698 addin_prefs_button.Sensitive = false;
699 addin_info_button.Sensitive = false;
700 } else {
701 enable_addin_button.Sensitive = !sinfo.Enabled;
702 disable_addin_button.Sensitive = sinfo.Enabled;
703 addin_prefs_button.Sensitive = addin_manager.IsAddinConfigurable (sinfo);
704 addin_info_button.Sensitive = true;
705 }
706 }
707
708 void LoadAddins ()
709 {
710 object s = addin_tree.SaveStatus ();
711
712 addin_tree.Clear ();
713 foreach (Mono.Addins.Addin ainfo in addin_manager.GetAllAddins ()) {
714 addin_tree.AddAddin (
715 Mono.Addins.Setup.SetupService.GetAddinHeader (ainfo),
716 ainfo,
717 ainfo.Enabled,
718 ainfo.IsUserAddin);
719 }
720
721 addin_tree.RestoreStatus (s);
722 UpdateAddinButtons ();
723 }
724
725 void OnEnableAddinButton (object sender, EventArgs args)
726 {
727 Mono.Addins.Addin sinfo =
728 addin_tree.ActiveAddinData as Mono.Addins.Addin;
729
730 if (sinfo == null)
731 return;
732
733 EnableAddin (sinfo, true);
734 }
735
736 void OnDisableAddinButton (object sender, EventArgs args)
737 {
738 Mono.Addins.Addin sinfo =
739 addin_tree.ActiveAddinData as Mono.Addins.Addin;
740
741 if (sinfo == null)
742 return;
743
744 EnableAddin (sinfo, false);
745 }
746
747 void EnableAddin (Mono.Addins.Addin addin, bool enable)
748 {
749 addin.Enabled = enable;
750 LoadAddins ();
751 }
752
753 void OnAddinPrefsButton (object sender, EventArgs args)
754 {
755 Gtk.Dialog dialog = null;
756 Mono.Addins.Addin addin =
757 addin_tree.ActiveAddinData as Mono.Addins.Addin;
758
759 if (addin == null)
760 return;
761
762 if (addin_prefs_dialogs.ContainsKey (addin.Id) == false) {
763 // A preference dialog isn't open already so create a new one
764 Gtk.Image icon =
765 new Gtk.Image (Gtk.Stock.Preferences, Gtk.IconSize.Dialog);
766 Gtk.Label caption = new Gtk.Label ();
767 caption.Markup = string.Format (
768 "<span size='large' weight='bold'>{0} {1}</span>",
769 addin.Name, addin.Version);
770 caption.Xalign = 0;
771 caption.UseMarkup = true;
772 caption.UseUnderline = false;
773
774 Gtk.Widget pref_widget =
775 addin_manager.CreateAddinPreferenceWidget (addin);
776
777 if (pref_widget == null)
778 pref_widget = new Gtk.Label (Catalog.GetString ("Not Implemented"));
779
780 Gtk.HBox hbox = new Gtk.HBox (false, 6);
781 Gtk.VBox vbox = new Gtk.VBox (false, 6);
782 vbox.BorderWidth = 6;
783
784 hbox.PackStart (icon, false, false, 0);
785 hbox.PackStart (caption, true, true, 0);
786 vbox.PackStart (hbox, false, false, 0);
787
788 vbox.PackStart (pref_widget, true, true, 0);
789 vbox.ShowAll ();
790
791 dialog = new Gtk.Dialog (
792 string.Format (Catalog.GetString ("{0} Preferences"),
793 addin.Name),
794 this,
795 Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.NoSeparator,
796 Gtk.Stock.Close, Gtk.ResponseType.Close);
797
798 dialog.VBox.PackStart (vbox, true, true, 0);
799 dialog.DeleteEvent += AddinPrefDialogDeleted;
800 dialog.Response += AddinPrefDialogResponse;
801
802 // Store this dialog off in the dictionary so it can be
803 // presented again if the user clicks on the preferences button
804 // again before closing the preferences dialog.
805 dialog.Data ["AddinId"] = addin.Id;
806 addin_prefs_dialogs [addin.Id] = dialog;
807 } else {
808 // It's already opened so just present it again
809 dialog = addin_prefs_dialogs [addin.Id];
810 }
811
812 dialog.Present ();
813 }
814
815 [GLib.ConnectBeforeAttribute]
816 void AddinPrefDialogDeleted (object sender, Gtk.DeleteEventArgs args)
817 {
818 // Remove the addin from the addin_prefs_dialogs Dictionary
819 Gtk.Dialog dialog = sender as Gtk.Dialog;
820 dialog.Hide ();
821
822 if (dialog.Data.ContainsKey ("AddinId")) {
823 addin_prefs_dialogs.Remove (dialog.Data ["AddinId"] as String);
824 }
825
826 dialog.Destroy ();
827 }
828
829 void AddinPrefDialogResponse (object sender, Gtk.ResponseArgs args)
830 {
831 AddinPrefDialogDeleted (sender, null);
832 }
833
834 void OnAddinInfoButton (object sender, EventArgs args)
835 {
836 Mono.Addins.Addin addin =
837 addin_tree.ActiveAddinData as Mono.Addins.Addin;
838
839 if (addin == null)
840 return;
841
842 Gtk.Dialog dialog = null;
843 if (addin_info_dialogs.ContainsKey (addin.Id) == false) {
844 dialog = new AddinInfoDialog (
845 Mono.Addins.Setup.SetupService.GetAddinHeader (addin),
846 this);
847 dialog.DeleteEvent += AddinInfoDialogDeleted;
848 dialog.Response += AddinInfoDialogResponse;
849
850 // Store this dialog off in a dictionary so it can be presented
851 // again if the user clicks on the Info button before closing
852 // the original dialog.
853 dialog.Data ["AddinId"] = addin.Id;
854 addin_info_dialogs [addin.Id] = dialog;
855 } else {
856 // It's already opened so just present it again
857 dialog = addin_info_dialogs [addin.Id];
858 }
859
860 dialog.Present ();
861 }
862
863 [GLib.ConnectBeforeAttribute]
864 void AddinInfoDialogDeleted (object sender, Gtk.DeleteEventArgs args)
865 {
866 // Remove the addin from the addin_prefs_dialogs Dictionary
867 Gtk.Dialog dialog = sender as Gtk.Dialog;
868 dialog.Hide ();
869
870 if (dialog.Data.ContainsKey ("AddinId")) {
871 addin_info_dialogs.Remove (dialog.Data ["AddinId"] as String);
872 }
873
874 dialog.Destroy ();
875 }
876
877 void AddinInfoDialogResponse (object sender, Gtk.ResponseArgs args)
878 {
879 AddinInfoDialogDeleted (sender, null);
880 }
881
882 void SetupPropertyEditor (IPropertyEditor peditor)
883 {
884 // Ensure the key exists
885 Preferences.Get (peditor.Key);
886 peditor.Setup ();
887 }
888
889 // Utilities...
890
891 static Gtk.Label MakeLabel (string label_text, params object[] args)
892 {
893 if (args.Length > 0)
894 label_text = String.Format (label_text, args);
895
896 Gtk.Label label = new Gtk.Label (label_text);
897
898 label.UseMarkup = true;
899 label.Justify = Gtk.Justification.Left;
900 label.SetAlignment (0.0f, 0.5f);
901 label.Show ();
902
903 return label;
904 }
905
906 static Gtk.CheckButton MakeCheckButton (string label_text)
907 {
908 Gtk.Label label = MakeLabel (label_text);
909
910 Gtk.CheckButton check = new Gtk.CheckButton ();
911 check.Add (label);
912 check.Show ();
913
914 return check;
915 }
916
917 static Gtk.Label MakeTipLabel (string label_text)
918 {
919 Gtk.Label label = MakeLabel ("<small>{0}</small>", label_text);
920 label.LineWrap = true;
921 label.Xpad = 20;
922 return label;
923 }
924
925 // Font Change handler
926
927 void OnFontButtonClicked (object sender, EventArgs args)
928 {
929 Gtk.FontSelectionDialog font_dialog =
930 new Gtk.FontSelectionDialog (
931 Catalog.GetString ("Choose Note Font"));
932
933 string font_name = (string)
934 Preferences.Get (Preferences.CUSTOM_FONT_FACE);
935 font_dialog.SetFontName (font_name);
936
937 if ((int) Gtk.ResponseType.Ok == font_dialog.Run ()) {
938 if (font_dialog.FontName != font_name) {
939 Preferences.Set (Preferences.CUSTOM_FONT_FACE,
940 font_dialog.FontName);
941
942 UpdateFontButton (font_dialog.FontName);
943 }
944 }
945
946 font_dialog.Destroy ();
947 }
948
949 void UpdateFontButton (string font_desc)
950 {
951 Pango.FontDescription desc =
952 Pango.FontDescription.FromString (font_desc);
953
954 // Set the size label
955 font_size.Text = (desc.Size / Pango.Scale.PangoScale).ToString ();
956
957 desc.UnsetFields (Pango.FontMask.Size);
958
959 // Set the font name label
960 font_face.Markup = String.Format ("<span font_desc='{0}'>{1}</span>",
961 font_desc,
962 desc.ToString ());
963 }
964
965 private void OnAdvancedSyncConfigButton (object sender, EventArgs args)
966 {
967 // Get saved behavior
968 SyncTitleConflictResolution savedBehavior = SyncTitleConflictResolution.Cancel;
969 object dlgBehaviorPref = Preferences.Get (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR);
970 if (dlgBehaviorPref != null && dlgBehaviorPref is int) // TODO: Check range of this int
971 savedBehavior = (SyncTitleConflictResolution)dlgBehaviorPref;
972
973 // Create dialog
974 Gtk.Dialog advancedDlg =
975 new Gtk.Dialog (Catalog.GetString ("Other Synchronization Options"),
976 this,
977 Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator,
978 Gtk.Stock.Close, Gtk.ResponseType.Close);
979 // Populate dialog
980 Gtk.Label label =
981 new Gtk.Label (Catalog.GetString ("When a conflict is detected between " +
982 "a local note and a note on the configured " +
983 "synchronization server:"));
984 label.Wrap = true;
985 label.Xalign = 0;
986
987 promptOnConflictRadio =
988 new Gtk.RadioButton (Catalog.GetString ("Always ask me what to do."));
989 promptOnConflictRadio.Toggled += OnConflictOptionToggle;
990
991 renameOnConflictRadio =
992 new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Rename my local note."));
993 renameOnConflictRadio.Toggled += OnConflictOptionToggle;
994
995 overwriteOnConflictRadio =
996 new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Replace my local note with the server's update."));
997 overwriteOnConflictRadio.Toggled += OnConflictOptionToggle;
998
999 switch (savedBehavior) {
1000 case SyncTitleConflictResolution.RenameExistingNoUpdate:
1001 renameOnConflictRadio.Active = true;
1002 break;
1003 case SyncTitleConflictResolution.OverwriteExisting:
1004 overwriteOnConflictRadio.Active = true;
1005 break;
1006 default:
1007 promptOnConflictRadio.Active = true;
1008 break;
1009 }
1010
1011 Gtk.VBox vbox = new Gtk.VBox ();
1012 vbox.BorderWidth = 18;
1013
1014 vbox.PackStart (promptOnConflictRadio);
1015 vbox.PackStart (renameOnConflictRadio);
1016 vbox.PackStart (overwriteOnConflictRadio);
1017
1018 advancedDlg.VBox.PackStart (label, false, false, 6);
1019 advancedDlg.VBox.PackStart (vbox, false, false, 0);
1020
1021 advancedDlg.ShowAll ();
1022
1023 // Run dialog
1024 advancedDlg.Run ();
1025 advancedDlg.Destroy ();
1026 }
1027
1028 private void OnConflictOptionToggle (object sender, EventArgs args)
1029 {
1030 SyncTitleConflictResolution newBehavior = SyncTitleConflictResolution.Cancel;
1031
1032 if (renameOnConflictRadio.Active)
1033 newBehavior = SyncTitleConflictResolution.RenameExistingNoUpdate;
1034 else if (overwriteOnConflictRadio.Active)
1035 newBehavior = SyncTitleConflictResolution.OverwriteExisting;
1036
1037 Preferences.Set (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR,
1038 (int) newBehavior);
1039 }
1040
1041 private void OnAppAddinListChanged (object sender, EventArgs args)
1042 {
1043 SyncServiceAddin [] newAddinsArray = Tomboy.DefaultNoteManager.AddinManager.GetSyncServiceAddins ();
1044 Array.Sort (newAddinsArray, CompareSyncAddinsByName);
1045 List<SyncServiceAddin> newAddins = new List<SyncServiceAddin> (newAddinsArray);
1046
1047 // Build easier-to-navigate list if addins currently in the combo
1048 List<SyncServiceAddin> currentAddins = new List<SyncServiceAddin> ();
1049 foreach (object [] currentRow in syncAddinStore) {
1050 SyncServiceAddin currentAddin = currentRow [0] as SyncServiceAddin;
1051 if (currentAddin != null)
1052 currentAddins.Add (currentAddin);
1053 }
1054
1055 // Add new addins
1056 // TODO: Would be nice to insert these alphabetically instead
1057 foreach (SyncServiceAddin newAddin in newAddins) {
1058 if (!currentAddins.Contains (newAddin)) {
1059 Gtk.TreeIter iter = syncAddinStore.Append ();
1060 syncAddinStore.SetValue (iter, 0, newAddin);
1061 syncAddinIters [newAddin.Id] = iter;
1062 }
1063 }
1064
1065 // Remove deleted addins
1066 foreach (SyncServiceAddin currentAddin in currentAddins) {
1067 if (!newAddins.Contains (currentAddin)) {
1068 Gtk.TreeIter iter = syncAddinIters [currentAddin.Id];
1069 syncAddinStore.Remove (ref iter);
1070 syncAddinIters.Remove (currentAddin.Id);
1071
1072 // FIXME: Lots of hacky stuff in here...rushing before freeze
1073 if (currentAddin == selectedSyncAddin) {
1074 if (syncAddinPrefsWidget != null &&
1075 !syncAddinPrefsWidget.Sensitive)
1076 OnResetSyncAddinButton (null, null);
1077
1078 Gtk.TreeIter active_iter;
1079 if (syncAddinStore.GetIterFirst (out active_iter) == true) {
1080 syncAddinCombo.SetActiveIter (active_iter);
1081 } else {
1082 OnSyncAddinComboChanged (null, null);
1083 }
1084 }
1085 }
1086 }
1087 }
1088
1089 void OnSyncAddinComboChanged (object sender, EventArgs args)
1090 {
1091 if (syncAddinPrefsWidget != null) {
1092 syncAddinPrefsContainer.Remove (syncAddinPrefsWidget);
1093 syncAddinPrefsWidget.Hide ();
1094 syncAddinPrefsWidget.Destroy ();
1095 syncAddinPrefsWidget = null;
1096 }
1097
1098 Gtk.TreeIter iter;
1099 if (syncAddinCombo.GetActiveIter (out iter)) {
1100 SyncServiceAddin newAddin =
1101 syncAddinStore.GetValue (iter, 0) as SyncServiceAddin;
1102 if (newAddin != null) {
1103 selectedSyncAddin = newAddin;
1104 syncAddinPrefsWidget = selectedSyncAddin.CreatePreferencesControl (OnSyncAddinPrefsChanged);
1105 if (syncAddinPrefsWidget == null) {
1106 Gtk.Label l = new Gtk.Label (Catalog.GetString ("Not configurable"));
1107 l.Yalign = 0.5f;
1108 l.Yalign = 0.5f;
1109 syncAddinPrefsWidget = l;
1110 }
1111
1112 syncAddinPrefsWidget.Show ();
1113 syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
1114
1115 resetSyncAddinButton.Sensitive = false;
1116 saveSyncAddinButton.Sensitive = false;
1117 }
1118 } else {
1119 selectedSyncAddin = null;
1120 resetSyncAddinButton.Sensitive = false;
1121 saveSyncAddinButton.Sensitive = false;
1122 }
1123
1124 }
1125
1126 void OnResetSyncAddinButton (object sender, EventArgs args)
1127 {
1128 if (selectedSyncAddin == null)
1129 return;
1130
1131 // User doesn't get a choice if this is invoked by disabling the addin
1132 // FIXME: null sender check is lame!
1133 if (sender != null) {
1134 // Prompt the user about what they're about to do since
1135 // it's not really recommended to switch back and forth
1136 // between sync services.
1137 HIGMessageDialog dialog =
1138 new HIGMessageDialog (null,
1139 Gtk.DialogFlags.Modal,
1140 Gtk.MessageType.Question,
1141 Gtk.ButtonsType.YesNo,
1142 Catalog.GetString ("Are you sure?"),
1143 Catalog.GetString (
1144 "Clearing your synchronization settings is not recommended. " +
1145 "You may be forced to synchronize all of your notes again " +
1146 "when you save new settings."));
1147 int response = dialog.Run ();
1148 dialog.Destroy ();
1149 if (response != (int) Gtk.ResponseType.Yes)
1150 return;
1151 } else { // FIXME: Weird place for this to go. User should be able to cancel disabling of addin, anyway
1152 HIGMessageDialog dialog =
1153 new HIGMessageDialog (null,
1154 Gtk.DialogFlags.Modal,
1155 Gtk.MessageType.Info,
1156 Gtk.ButtonsType.Ok,
1157 Catalog.GetString ("Resetting Synchronization Settings"),
1158 Catalog.GetString (
1159 "You have disabled the configured synchronization service. " +
1160 "Your synchronization settings will now be cleared. " +
1161 "You may be forced to synchronize all of your notes again " +
1162 "when you save new settings."));
1163 dialog.Run ();
1164 dialog.Destroy ();
1165 }
1166
1167 try {
1168 selectedSyncAddin.ResetConfiguration ();
1169 } catch (Exception e) {
1170 Logger.Debug ("Error calling {0}.ResetConfiguration: {1}\n{2}",
1171 selectedSyncAddin.Id, e.Message, e.StackTrace);
1172 }
1173
1174 Preferences.Set (
1175 Preferences.SYNC_SELECTED_SERVICE_ADDIN,
1176 String.Empty);
1177
1178 // Reset conflict handling behavior
1179 Preferences.Set (
1180 Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR,
1181 Preferences.GetDefault (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR));
1182
1183 SyncManager.ResetClient ();
1184
1185 syncAddinCombo.Sensitive = true;
1186 resetSyncAddinButton.Sensitive = false;
1187 saveSyncAddinButton.Sensitive = true;
1188 if (syncAddinPrefsWidget != null)
1189 syncAddinPrefsWidget.Sensitive = true;
1190 }
1191
1192 /// <summary>
1193 /// Attempt to save/test the connection to the sync addin.
1194 /// </summary>
1195 void OnSaveSyncAddinButton (object sender, EventArgs args)
1196 {
1197 if (selectedSyncAddin == null)
1198 return;
1199
1200 bool saved = false;
1201 string errorMsg = null;
1202 try {
1203 GdkWindow.Cursor = new Gdk.Cursor (Gdk.CursorType.Watch);
1204 GdkWindow.Display.Flush ();
1205 saved = selectedSyncAddin.SaveConfiguration ();
1206 } catch (TomboySyncException syncEx) {
1207 errorMsg = syncEx.Message;
1208 } catch (Exception e) {
1209 Logger.Debug ("Unexpected error calling {0}.SaveConfiguration: {1}\n{2}",
1210 selectedSyncAddin.Id, e.Message, e.StackTrace);
1211 } finally {
1212 GdkWindow.Cursor = null;
1213 GdkWindow.Display.Flush ();
1214 }
1215
1216 HIGMessageDialog dialog;
1217 if (saved) {
1218 Preferences.Set (
1219 Preferences.SYNC_SELECTED_SERVICE_ADDIN,
1220 selectedSyncAddin.Id);
1221
1222 syncAddinCombo.Sensitive = false;
1223 syncAddinPrefsWidget.Sensitive = false;
1224 resetSyncAddinButton.Sensitive = true;
1225 saveSyncAddinButton.Sensitive = false;
1226
1227 SyncManager.ResetClient ();
1228
1229 // Give the user a visual letting them know that connecting
1230 // was successful.
1231 // TODO: Replace Yes/No with Sync/Close
1232 dialog =
1233 new HIGMessageDialog (this,
1234 Gtk.DialogFlags.Modal,
1235 Gtk.MessageType.Info,
1236 Gtk.ButtonsType.YesNo,
1237 Catalog.GetString ("Connection successful"),
1238 Catalog.GetString (
1239 "Tomboy is ready to synchronize your notes. Would you like to synchronize them now?"));
1240 int response = dialog.Run ();
1241 dialog.Destroy ();
1242
1243 if (response == (int) Gtk.ResponseType.Yes)
1244 // TODO: Put this voodoo in a method somewhere
1245 Tomboy.ActionManager ["NoteSynchronizationAction"].Activate ();
1246 } else {
1247 // TODO: Change the SyncServiceAddin API so the call to
1248 // SaveConfiguration has a way of passing back an exception
1249 // or other text so it can be displayed to the user.
1250 Preferences.Set (
1251 Preferences.SYNC_SELECTED_SERVICE_ADDIN,
1252 String.Empty);
1253
1254 syncAddinCombo.Sensitive = true;
1255 syncAddinPrefsWidget.Sensitive = true;
1256 resetSyncAddinButton.Sensitive = false;
1257 saveSyncAddinButton.Sensitive = true;
1258
1259 // Give the user a visual letting them know that connecting
1260 // was successful.
1261 if (errorMsg == null) {
1262 errorMsg = Catalog.GetString ("Please check your information and " +
1263 "try again. The log file {0} may " +
1264 "contain more information about the error.");
1265 string logPath = System.IO.Path.Combine (Services.NativeApplication.LogDirectory,
1266 "tomboy.log");
1267 errorMsg = String.Format (errorMsg, logPath);
1268 }
1269 dialog =
1270 new HIGMessageDialog (this,
1271 Gtk.DialogFlags.Modal,
1272 Gtk.MessageType.Warning,
1273 Gtk.ButtonsType.Close,
1274 Catalog.GetString ("Error connecting"),
1275 errorMsg);
1276 dialog.Run ();
1277 dialog.Destroy ();
1278 }
1279 }
1280
1281 void OnSyncAddinPrefsChanged (object sender, EventArgs args)
1282 {
1283 // Enable/disable the save button based on required fields
1284 if (selectedSyncAddin != null)
1285 saveSyncAddinButton.Sensitive = selectedSyncAddin.AreSettingsValid;
1286 }
1287
1288 void OpenTemplateButtonClicked (object sender, EventArgs args)
1289 {
1290 NoteManager manager = Tomboy.DefaultNoteManager;
1291 Note template_note = manager.GetOrCreateTemplateNote ();
1292
1293 // Open the template note
1294 template_note.Window.Show ();
1295 }
1296 }
1297
1298 // TODO: Figure out how to use Mono.Addins.Gui.AddinInfoDialog here instead.
1299 // The class here is adapted directly from Mono.Addins.Gui.AddinInfoDialog.
1300 class AddinInfoDialog : Gtk.Dialog
1301 {
1302 Mono.Addins.Setup.AddinHeader info;
1303 Gtk.Label info_label;
1304
1305 public AddinInfoDialog (
1306 Mono.Addins.Setup.AddinHeader info,
1307 Gtk.Window parent)
1308: base (info.Name,
1309 parent,
1310 Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.NoSeparator,
1311 Gtk.Stock.Close, Gtk.ResponseType.Close)
1312 {
1313 this.info = info;
1314
1315 // TODO: Change this icon to be an addin/package icon
1316 Gtk.Image icon =
1317 new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog);
1318 icon.Yalign = 0;
1319
1320 info_label = new Gtk.Label ();
1321 info_label.Xalign = 0;
1322 info_label.Yalign = 0;
1323 info_label.UseMarkup = true;
1324 info_label.UseUnderline = false;
1325 info_label.Wrap = true;
1326
1327 Gtk.HBox hbox = new Gtk.HBox (false, 6);
1328 Gtk.VBox vbox = new Gtk.VBox (false, 12);
1329 hbox.BorderWidth = 12;
1330 vbox.BorderWidth = 6;
1331
1332 hbox.PackStart (icon, false, false, 0);
1333 hbox.PackStart (vbox, true, true, 0);
1334
1335 vbox.PackStart (info_label, true, true, 0);
1336
1337 hbox.ShowAll ();
1338
1339 VBox.PackStart (hbox, true, true, 0);
1340
1341 Fill ();
1342 }
1343
1344 void Fill ()
1345 {
1346 StringBuilder sb = new StringBuilder ();
1347 sb.Append ("<b><big>" + info.Name + "</big></b>\n\n");
1348
1349 if (info.Description != string.Empty)
1350 sb.Append (info.Description + "\n\n");
1351
1352 sb.Append ("<small>");
1353
1354 sb.Append (string.Format (
1355 "<b>{0}</b>\n" +
1356 "{1}\n\n",
1357 Catalog.GetString ("Version:"),
1358 info.Version));
1359
1360 if (info.Author != string.Empty)
1361 sb.Append (string.Format (
1362 "<b>{0}</b>\n" +
1363 "{1}\n\n",
1364 Catalog.GetString ("Author:"),
1365 info.Author));
1366
1367 if (info.Copyright != string.Empty)
1368 sb.Append (string.Format (
1369 "<b>{0}</b>\n" +
1370 "{1}\n\n",
1371 Catalog.GetString ("Copyright:"),
1372 info.Copyright));
1373
1374 if (info.Dependencies.Count > 0) {
1375 sb.Append (string.Format (
1376 "<b>{0}</b>\n",
1377 Catalog.GetString ("Add-in Dependencies:")));
1378 foreach (Mono.Addins.Description.Dependency dep in info.Dependencies) {
1379 sb.Append (dep.Name + "\n");
1380 }
1381 }
1382
1383 sb.Append ("</small>");
1384
1385 info_label.Markup = sb.ToString ();
1386 }
1387 }
1388}
01389
=== added directory '.pc/32_logout_delay.patch'
=== added directory '.pc/32_logout_delay.patch/Tomboy'
=== added file '.pc/32_logout_delay.patch/Tomboy/GnomeApplication.cs'
--- .pc/32_logout_delay.patch/Tomboy/GnomeApplication.cs 1970-01-01 00:00:00 +0000
+++ .pc/32_logout_delay.patch/Tomboy/GnomeApplication.cs 2013-02-05 16:50:59 +0000
@@ -0,0 +1,230 @@
1using System;
2using System.Runtime.InteropServices;
3using System.Text;
4using System.IO;
5using System.Xml;
6
7using Mono.Unix;
8using Mono.Unix.Native;
9
10using Hyena;
11
12using DBus;
13using org.gnome.SessionManager;
14
15namespace Tomboy
16{
17 public class GnomeApplication : INativeApplication
18 {
19#if PANEL_APPLET
20 private Gnome.Program program;
21#endif
22 private static string confDir;
23 private static string dataDir;
24 private static string cacheDir;
25 private static ObjectPath session_client_id;
26 private const string tomboyDirName = "tomboy";
27
28 static GnomeApplication ()
29 {
30 dataDir = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory ("XDG_DATA_HOME",
31 Path.Combine (".local", "share")),
32 tomboyDirName);
33 confDir = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory ("XDG_CONFIG_HOME",
34 ".config"),
35 tomboyDirName);
36 cacheDir = Path.Combine (XdgBaseDirectorySpec.GetUserDirectory ("XDG_CACHE_HOME",
37 ".cache"),
38 tomboyDirName);
39
40 // NOTE: Other directories created on demand
41 // (non-existence is an indicator that migration is needed)
42 if (!Directory.Exists (cacheDir))
43 Directory.CreateDirectory (cacheDir);
44 }
45
46 public void Initialize (string locale_dir,
47 string display_name,
48 string process_name,
49 string [] args)
50 {
51 try {
52 SetProcessName (process_name);
53 } catch {} // Ignore exception if fail (not needed to run)
54
55 // Register handler for saving session when logging out of Gnome
56 BusG.Init ();
57 string startup_id = Environment.GetEnvironmentVariable ("DESKTOP_AUTOSTART_ID");
58 if (String.IsNullOrEmpty (startup_id))
59 startup_id = display_name;
60
61 try {
62 SessionManager session = Bus.Session.GetObject<SessionManager> (Constants.SessionManagerInterfaceName,
63 new ObjectPath (Constants.SessionManagerPath));
64 session_client_id = session.RegisterClient (display_name, startup_id);
65
66 ClientPrivate client = Bus.Session.GetObject<ClientPrivate> (Constants.SessionManagerInterfaceName,
67 session_client_id);
68 client.QueryEndSession += OnQueryEndSession;
69 client.EndSession += OnEndSession;
70 } catch (Exception e) {
71 Logger.Debug ("Failed to register with session manager: {0}", e.Message);
72 }
73
74 Gtk.Application.Init ();
75#if PANEL_APPLET
76 program = new Gnome.Program (display_name,
77 Defines.VERSION,
78 Gnome.Modules.UI,
79 args);
80#endif
81 }
82
83 public void RegisterSessionManagerRestart (string executable_path,
84 string[] args,
85 string[] environment)
86 {
87 // Nothing to do, we dropped the .desktop file in the autostart
88 // folder which should be enough to handle this in Gnome
89 }
90
91 public void RegisterSignalHandlers ()
92 {
93 // Connect to SIGTERM and SIGINT, so we don't lose
94 // unsaved notes on exit...
95 Stdlib.signal (Signum.SIGTERM, OnExitSignal);
96 Stdlib.signal (Signum.SIGINT, OnExitSignal);
97 }
98
99 public event EventHandler ExitingEvent;
100
101 public void Exit (int exitcode)
102 {
103 OnExitSignal (-1);
104 System.Environment.Exit (exitcode);
105 }
106
107 public void StartMainLoop ()
108 {
109#if PANEL_APPLET
110 program.Run ();
111#else
112 Gtk.Application.Run ();
113#endif
114 }
115
116 [DllImport("libc")]
117 private static extern int prctl (int option,
118 byte [] arg2,
119 IntPtr arg3,
120 IntPtr arg4,
121 IntPtr arg5);
122
123 // From Banshee: Banshee.Base/Utilities.cs
124 private void SetProcessName (string name)
125 {
126 if (prctl (15 /* PR_SET_NAME */,
127 Encoding.ASCII.GetBytes (name + "\0"),
128 IntPtr.Zero,
129 IntPtr.Zero,
130 IntPtr.Zero) != 0)
131 throw new ApplicationException (
132 "Error setting process name: " +
133 Mono.Unix.Native.Stdlib.GetLastError ());
134 }
135
136 private void OnExitSignal (int signal)
137 {
138 if (ExitingEvent != null)
139 ExitingEvent (null, new EventArgs ());
140
141 if (signal >= 0)
142 System.Environment.Exit (0);
143 }
144
145 private void OnQueryEndSession (uint flags)
146 {
147 Logger.Info ("Received end session query");
148
149 // The session might not actually end but it would be nice to start
150 // some cleanup actions like saving notes here
151
152 // Let the session manager know its OK to continue
153 try {
154 ClientPrivate client = Bus.Session.GetObject<ClientPrivate> (Constants.SessionManagerInterfaceName,
155 session_client_id);
156 client.EndSessionResponse(true, String.Empty);
157 } catch (Exception e) {
158 Logger.Debug("Failed to respond to session manager: {0}", e.Message);
159 }
160 }
161
162 private void OnEndSession (uint flags)
163 {
164 Logger.Info ("Received end session signal");
165
166 if (ExitingEvent != null)
167 ExitingEvent (null, new EventArgs ());
168
169 // Let the session manager know its OK to continue
170 // Ideally we would wait for all the exit events to finish
171 try {
172 ClientPrivate client = Bus.Session.GetObject<ClientPrivate> (Constants.SessionManagerInterfaceName,
173 session_client_id);
174 client.EndSessionResponse (true, String.Empty);
175 } catch (Exception e) {
176 Logger.Debug ("Failed to respond to session manager: {0}", e.Message);
177 }
178 }
179
180 public void OpenUrl (string url, Gdk.Screen screen)
181 {
182 GtkBeans.Global.ShowUri (screen, url);
183 }
184
185 [DllImport ("glib-2.0.dll")]
186 static extern IntPtr g_get_language_names ();
187
188 public void DisplayHelp (string project, string page, Gdk.Screen screen)
189 {
190 string helpUrl = string.Format("http://library.gnome.org/users/{0}/", project);
191
192 var langsPtr = g_get_language_names ();
193 var langs = GLib.Marshaller.NullTermPtrToStringArray (langsPtr, false);
194 var baseHelpDir = Path.Combine (Path.Combine (Defines.DATADIR, "gnome/help"), project);
195 if (Directory.Exists (baseHelpDir)) {
196 foreach (var lang in langs) {
197 var langHelpDir = Path.Combine (baseHelpDir, lang);
198 if (Directory.Exists (langHelpDir))
199 // TODO:Support page
200 helpUrl = String.Format ("ghelp://{0}", langHelpDir);
201 }
202 }
203
204 OpenUrl (helpUrl, screen);
205 }
206
207 public string DataDirectory {
208 get { return dataDir; }
209 }
210
211 public string ConfigurationDirectory {
212 get { return confDir; }
213 }
214
215 public string CacheDirectory {
216 get { return cacheDir; }
217 }
218
219 public string LogDirectory {
220 get { return confDir; }
221 }
222
223 public string PreOneDotZeroNoteDirectory {
224 get {
225 return Path.Combine (Environment.GetEnvironmentVariable ("HOME"),
226 ".tomboy");
227 }
228 }
229 }
230}
0231
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2011-09-26 23:39:59 +0000
+++ .pc/applied-patches 2013-02-05 16:50:59 +0000
@@ -1,4 +1,5 @@
101_dllmaps.patch101_dllmaps.patch
202_sync_save_button_sensitive.patch
203_u1_as_default_sync.patch303_u1_as_default_sync.patch
304_app_indicator.patch404_app_indicator.patch
405_add_start_u1_note.patch505_add_start_u1_note.patch
@@ -6,3 +7,4 @@
620_remove_pcfile_requires720_remove_pcfile_requires
730_fix_manpage_syntax830_fix_manpage_syntax
831_prevent_inadvertent_deletion_of_notes.patch931_prevent_inadvertent_deletion_of_notes.patch
1032_logout_delay.patch
911
=== modified file 'Tomboy/GnomeApplication.cs'
--- Tomboy/GnomeApplication.cs 2011-07-06 10:06:49 +0000
+++ Tomboy/GnomeApplication.cs 2013-02-05 16:50:59 +0000
@@ -67,6 +67,7 @@
67 session_client_id);67 session_client_id);
68 client.QueryEndSession += OnQueryEndSession;68 client.QueryEndSession += OnQueryEndSession;
69 client.EndSession += OnEndSession;69 client.EndSession += OnEndSession;
70 client.Stop += OnStop;
70 } catch (Exception e) {71 } catch (Exception e) {
71 Logger.Debug ("Failed to register with session manager: {0}", e.Message);72 Logger.Debug ("Failed to register with session manager: {0}", e.Message);
72 }73 }
@@ -142,6 +143,10 @@
142 System.Environment.Exit (0);143 System.Environment.Exit (0);
143 }144 }
144145
146 private void OnStop () {
147 Exit(0);
148 }
149
145 private void OnQueryEndSession (uint flags)150 private void OnQueryEndSession (uint flags)
146 {151 {
147 Logger.Info ("Received end session query");152 Logger.Info ("Received end session query");
@@ -175,6 +180,7 @@
175 } catch (Exception e) {180 } catch (Exception e) {
176 Logger.Debug ("Failed to respond to session manager: {0}", e.Message);181 Logger.Debug ("Failed to respond to session manager: {0}", e.Message);
177 }182 }
183 Exit (0);
178 }184 }
179 185
180 public void OpenUrl (string url, Gdk.Screen screen)186 public void OpenUrl (string url, Gdk.Screen screen)
181187
=== modified file 'Tomboy/PreferencesDialog.cs'
--- Tomboy/PreferencesDialog.cs 2011-08-23 22:47:32 +0000
+++ Tomboy/PreferencesDialog.cs 2013-02-05 16:50:59 +0000
@@ -1113,7 +1113,7 @@
1113 syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);1113 syncAddinPrefsContainer.PackStart (syncAddinPrefsWidget, false, false, 0);
11141114
1115 resetSyncAddinButton.Sensitive = false;1115 resetSyncAddinButton.Sensitive = false;
1116 saveSyncAddinButton.Sensitive = false;1116 saveSyncAddinButton.Sensitive = true;
1117 }1117 }
1118 } else {1118 } else {
1119 selectedSyncAddin = null;1119 selectedSyncAddin = null;
11201120
=== modified file 'debian/changelog'
--- debian/changelog 2011-09-26 23:39:59 +0000
+++ debian/changelog 2013-02-05 16:50:59 +0000
@@ -1,3 +1,37 @@
1tomboy (1.8.0-1ubuntu1.1.2) oneiric-proposed; urgency=low
2
3 * debian/patches/02_sync_save_button_sensitive.patch:
4 * debian/patches/03_u1_as_default_sync.patch:
5 * debian/patches/05_add_start_u1_note.patch:
6 * debian/patches/06_use_ubuntu_sso.patch:
7 - Remove patches to default to Ubuntu One for notes sync. (LP: #1115460)
8
9 -- Rodney Dawes <rodney.dawes@ubuntu.com> Mon, 04 Feb 2013 15:04:45 -0500
10
11tomboy (1.8.0-1ubuntu1.1.1) oneiric-proposed; urgency=low
12
13 * debian/patches/32_logout_delay.patch:
14 - Fix the issue where tomboy is delaying the session logout.
15 (LP: #880299)
16
17 [ Stéphane Graber ]
18 * Change version number to 1.8.0-1ubuntu1.1.1 to avoid conflicting
19 with Precise's 1.8.0-1ubuntu1.2 (which should have been -1ubuntu2)
20
21 -- Omer Akram <om26er@ubuntu.com> Tue, 17 Jan 2012 22:51:08 +0500
22
23tomboy (1.8.0-1ubuntu1.1) oneiric-proposed; urgency=low
24
25 [ Iain Lane ]
26 * debian/control: Remove syncdaemon BD which is no longer required due to
27 the dropping of the SSO patch in 1.8.0-1ubuntu1
28
29 [ Ken VanDine ]
30 * debian/patches/02_sync_save_button_sensitive.patch
31 - Set save button sensitive when needed (LP: #845321)
32
33 -- Ken VanDine <ken.vandine@canonical.com> Fri, 14 Oct 2011 09:38:21 -0400
34
1tomboy (1.8.0-1ubuntu1) oneiric; urgency=low35tomboy (1.8.0-1ubuntu1) oneiric; urgency=low
236
3 [ Iain Lane ]37 [ Iain Lane ]
438
=== modified file 'debian/control'
--- debian/control 2011-07-06 10:06:49 +0000
+++ debian/control 2013-02-05 16:50:59 +0000
@@ -27,8 +27,7 @@
27 libmono-addins-gui-cil-dev (>= 0.3),27 libmono-addins-gui-cil-dev (>= 0.3),
28 liblaunchpad-integration-cil-dev,28 liblaunchpad-integration-cil-dev,
29 libappindicator0.1-cil-dev,29 libappindicator0.1-cil-dev,
30 libproxy-dev,30 libproxy-dev
31 libsyncdaemon-1.0-dev
32Standards-Version: 3.9.231Standards-Version: 3.9.2
33Homepage: http://www.gnome.org/projects/tomboy/32Homepage: http://www.gnome.org/projects/tomboy/
34Vcs-Git: git://git.debian.org/pkg-cli-apps/packages/tomboy.git33Vcs-Git: git://git.debian.org/pkg-cli-apps/packages/tomboy.git
3534
=== removed file 'debian/patches/03_u1_as_default_sync.patch'
--- debian/patches/03_u1_as_default_sync.patch 2011-09-26 23:39:59 +0000
+++ debian/patches/03_u1_as_default_sync.patch 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1Index: tomboy/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs
2===================================================================
3--- tomboy.orig/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs 2011-09-26 22:25:08.135886195 +0100
4+++ tomboy/Tomboy/Addins/WebSyncService/WebSyncServiceAddin.cs 2011-09-26 23:37:26.202367732 +0100
5@@ -97,6 +97,8 @@
6 string serverPref;
7 Api.OAuth oauth;
8 GetConfigSettings (out oauth, out serverPref);
9+ if (string.IsNullOrEmpty (serverPref))
10+ serverPref = "https://one.ubuntu.com/notes/";
11 prefsWidget = new WebSyncPreferencesWidget (oauth, serverPref, requiredPrefChanged);
12 return prefsWidget;
13 }
140
=== removed file 'debian/patches/05_add_start_u1_note.patch'
--- debian/patches/05_add_start_u1_note.patch 2011-07-06 10:06:49 +0000
+++ debian/patches/05_add_start_u1_note.patch 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
1Index: tomboy-1.7.1/Tomboy/NoteManager.cs
2===================================================================
3--- tomboy-1.7.1.orig/Tomboy/NoteManager.cs 2011-07-06 09:58:29.039428045 +0100
4+++ tomboy-1.7.1/Tomboy/NoteManager.cs 2011-07-06 09:58:36.719133213 +0100
5@@ -294,6 +294,24 @@
6 "Also, if you type the name of another note in your " +
7 "current note, it will automatically be linked for you." +
8 "</note-content>");
9+ string u1_note_content =
10+ Catalog.GetString ("<note-content>" +
11+ "Ubuntu One\n\n" +
12+ "<bold>Tomboy is better with Ubuntu One</bold> - " +
13+ "the personal cloud that brings your digital life together.\n\n" +
14+ "Ubuntu One does more than sync your files - whether you need " +
15+ "to access your contacts, notes or bookmarks from any computer or " +
16+ "the web, enjoy your favorite music from a cloud integrated store " +
17+ "or stream your entire collection to iPhone and Android mobile phones " +
18+ "- we've raised the bar on personal clouds. Learn more at " +
19+ "<link:url>http://one.ubuntu.com/</link:url>.\n\n" +
20+ "Already have an Ubuntu One account? Setup Tomboy to sync with your " +
21+ "personal cloud by clicking Edit > Preferences and then the Synchronization "+
22+ "tab. Select \"Tomboy Web\" from the list of services and then click the "+
23+ "\"Connect to Server\" button. A web browser will appear with a few " +
24+ "additional instructions.\n\n" +
25+ "You can even enable automatic sync with Ubuntu One!" +
26+ "</note-content>");
27
28 try {
29 Note start_note = Create (Catalog.GetString ("Start Here"),
30@@ -305,6 +323,9 @@
31 links_note_content);
32 links_note.QueueSave (ChangeType.ContentChanged);
33
34+ Note u1_note = Create ("Ubuntu One", u1_note_content);
35+ u1_note.QueueSave (ChangeType.ContentChanged);
36+
37 if (!Tomboy.IsPanelApplet)
38 start_note.Window.Show ();
39 } catch (Exception e) {
400
=== removed file 'debian/patches/06_use_ubuntu_sso.patch'
--- debian/patches/06_use_ubuntu_sso.patch 2011-08-23 22:47:32 +0000
+++ debian/patches/06_use_ubuntu_sso.patch 1970-01-01 00:00:00 +0000
@@ -1,555 +0,0 @@
1Index: tomboy/Tomboy/Addins/WebSyncService/Makefile.am
2===================================================================
3--- tomboy.orig/Tomboy/Addins/WebSyncService/Makefile.am 2011-08-23 22:54:40.127231333 +0100
4+++ tomboy/Tomboy/Addins/WebSyncService/Makefile.am 2011-08-23 23:11:21.488427309 +0100
5@@ -27,6 +27,8 @@
6 $(srcdir)/WebSyncPreferencesWidget.cs \
7 $(srcdir)/WebSyncServer.cs \
8 $(srcdir)/WebSyncServiceAddin.cs \
9+ $(srcdir)/U1SyncServiceAddin.cs \
10+ $(srcdir)/U1SyncPreferencesWidget.cs \
11 $(srcdir)/Tests/*.cs \
12 $(srcdir)/Api/*.cs \
13 $(srcdir)/Api/Tests/*.cs \
14Index: tomboy/Tomboy/Addins/WebSyncService/U1SyncPreferencesWidget.cs
15===================================================================
16--- /dev/null 1970-01-01 00:00:00.000000000 +0000
17+++ tomboy/Tomboy/Addins/WebSyncService/U1SyncPreferencesWidget.cs 2011-08-23 23:18:01.453092749 +0100
18@@ -0,0 +1,290 @@
19+// Permission is hereby granted, free of charge, to any person obtaining
20+// a copy of this software and associated documentation files (the
21+// "Software"), to deal in the Software without restriction, including
22+// without limitation the rights to use, copy, modify, merge, publish,
23+// distribute, sublicense, and/or sell copies of the Software, and to
24+// permit persons to whom the Software is furnished to do so, subject to
25+// the following conditions:
26+//
27+// The above copyright notice and this permission notice shall be
28+// included in all copies or substantial portions of the Software.
29+//
30+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37+//
38+// Copyright (c) 2010 Canonical, Ltd. (http://www.canonical.com)
39+//
40+// Authors:
41+// Rodrigo Moya <rodrigo.moya@canonical.com>
42+//
43+
44+using System;
45+using System.Runtime.InteropServices;
46+using System.Web;
47+using GLib;
48+
49+using Mono.Unix;
50+using Tomboy.WebSync.Api;
51+#if !WIN32
52+using HL = System.Net;
53+#else
54+using HL = MonoHttp;
55+#endif
56+
57+namespace Tomboy.WebSync
58+{
59+ public class U1SyncPreferencesWidget : Gtk.VBox
60+ {
61+ private Api.OAuth oauth;
62+ private Gtk.Button authButton;
63+ private SyncdaemonAuthentication sdAuth;
64+
65+ public U1SyncPreferencesWidget (Api.OAuth oauth, string server) : base (false, 5)
66+ {
67+ sdAuth = new SyncdaemonAuthentication ();
68+ sdAuth.CredentialsFound += OnCredentialsFound;
69+ sdAuth.AuthenticationCancelled += OnAuthCancelled;
70+ sdAuth.AuthenticationError += OnAuthError;
71+
72+ this.oauth = oauth;
73+
74+ authButton = new Gtk.Button ();
75+ if (!Auth.IsAccessToken) {
76+ if (this.sdAuth.HasCredentials ()) {
77+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
78+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
79+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
80+ Auth.ConsumerKey = sdAuth.ConsumerKey;
81+ Auth.ConsumerSecret = sdAuth.ConsumerSecret;
82+ Auth.Token = sdAuth.Token;
83+ Auth.TokenSecret = sdAuth.TokenSecret;
84+
85+ authButton.Label = Catalog.GetString ("Already registered");
86+ authButton.Sensitive = false;
87+
88+ } else
89+ authButton.Label = Catalog.GetString ("Register this computer");
90+ } else {
91+ authButton.Label = Catalog.GetString ("Already registered");
92+ authButton.Sensitive = false;
93+ }
94+ authButton.Clicked += OnAuthButtonClicked;
95+
96+ Add (authButton);
97+
98+ ShowAll ();
99+ }
100+
101+ public string Server {
102+ get {
103+ return "https://one.ubuntu.com/notes/";
104+ }
105+ }
106+
107+ public Api.OAuth Auth {
108+ get { return oauth; }
109+ set {
110+ oauth = value;
111+ if (oauth == null) {
112+ authButton.Label =
113+ Catalog.GetString ("Register this computer");
114+ authButton.Sensitive = true;
115+ }
116+ }
117+ }
118+
119+ public void OnAuthButtonClicked (object sender, EventArgs args)
120+ {
121+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
122+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
123+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
124+ Auth.ConsumerKey = "";
125+ Auth.ConsumerSecret = "";
126+ Auth.Realm = "";
127+ Auth.Token = "";
128+ Auth.TokenSecret = "";
129+
130+ authButton.Label = Catalog.GetString ("Authenticating...");
131+ authButton.Sensitive = false;
132+
133+ // Call com.ubuntu.sso
134+ sdAuth.LoginOrRegister ();
135+ }
136+
137+ public void OnCredentialsFound (object sender, EventArgs args)
138+ {
139+ Auth.AuthorizeLocation = "https://one.ubuntu.com/oauth/authorize/";
140+ Auth.AccessTokenBaseUrl = "https://one.ubuntu.com/oauth/access/";
141+ Auth.RequestTokenBaseUrl = "https://one.ubuntu.com/oauth/request/";
142+ Auth.ConsumerKey = sdAuth.ConsumerKey;
143+ Auth.ConsumerSecret = sdAuth.ConsumerSecret;
144+ Auth.Token = sdAuth.Token;
145+ Auth.TokenSecret = sdAuth.TokenSecret;
146+
147+ authButton.Label = Catalog.GetString ("Authentication complete. Press Save to start synchronizing");
148+ }
149+
150+ public void OnAuthCancelled (object sender, EventArgs args)
151+ {
152+ authButton.Label = Catalog.GetString ("Register this computer");
153+ authButton.Sensitive = false;
154+ }
155+
156+ public void OnAuthError (object sender, EventArgs args)
157+ {
158+ }
159+
160+
161+ }
162+
163+ class SyncdaemonAuthentication
164+ {
165+ private IntPtr syncdaemon = IntPtr.Zero;
166+ private IntPtr handle = IntPtr.Zero;
167+ private IntPtr credentials = IntPtr.Zero;
168+
169+ [DllImport("syncdaemon-1.0")]
170+ static extern IntPtr syncdaemon_daemon_new ();
171+
172+ [DllImport("syncdaemon-1.0")]
173+ static extern IntPtr syncdaemon_daemon_get_authentication (IntPtr daemon);
174+
175+ [DllImport("gobject-2.0")]
176+ static extern uint g_signal_connect_data (IntPtr obj, IntPtr name, Delegate cb, IntPtr data, IntPtr p, int flags);
177+
178+ public SyncdaemonAuthentication ()
179+ {
180+ IntPtr native_name;
181+
182+ this.syncdaemon = syncdaemon_daemon_new ();
183+ this.handle = syncdaemon_daemon_get_authentication (this.syncdaemon);
184+
185+ native_name = Marshaller.StringToPtrGStrdup ("credentials_found");
186+ g_signal_connect_data (this.handle, native_name,
187+ new CredentialsFoundDelegate (credentials_found_cb),
188+ new IntPtr (0), new IntPtr (0), 0);
189+ GLib.Marshaller.Free (native_name);
190+
191+ native_name = Marshaller.StringToPtrGStrdup ("authorization_cancelled");
192+ g_signal_connect_data (this.handle, native_name,
193+ new AuthCancelledDelegate (auth_cancelled_cb),
194+ new IntPtr (0), new IntPtr (0), 0);
195+ GLib.Marshaller.Free (native_name);
196+
197+ native_name = Marshaller.StringToPtrGStrdup ("error");
198+ g_signal_connect_data (this.handle, native_name,
199+ new AuthErrorDelegate (auth_error_cb),
200+ new IntPtr (0), new IntPtr (0), 0);
201+ GLib.Marshaller.Free (native_name);
202+
203+ }
204+
205+ [GLib.CDeclCallback]
206+ delegate void CredentialsFoundDelegate (IntPtr auth, IntPtr credentials, IntPtr user_data);
207+
208+ void credentials_found_cb (IntPtr auth, IntPtr credentials, IntPtr user_data)
209+ {
210+ Logger.Debug ("credentials_found_cb called");
211+ if (this.CredentialsFound != null)
212+ this.CredentialsFound (this, new EventArgs ());
213+ }
214+
215+ [GLib.CDeclCallback]
216+ delegate void AuthCancelledDelegate (IntPtr auth, IntPtr user_data);
217+
218+ void auth_cancelled_cb (IntPtr auth, IntPtr user_data)
219+ {
220+ Logger.Debug ("auth_cancelled_cb called");
221+ if (this.AuthenticationCancelled != null)
222+ this.AuthenticationCancelled (this, new EventArgs ());
223+ }
224+
225+ [GLib.CDeclCallback]
226+ delegate void AuthErrorDelegate (IntPtr auth, IntPtr error, IntPtr user_data);
227+
228+ void auth_error_cb (IntPtr auth, IntPtr error, IntPtr user_data)
229+ {
230+ Logger.Debug ("auth_error_cb called");
231+ if (this.AuthenticationError != null)
232+ this.AuthenticationError (this, new EventArgs ());
233+ }
234+
235+ [DllImport("syncdaemon-1.0")]
236+ static extern IntPtr syncdaemon_authentication_find_credentials (IntPtr auth);
237+
238+ private IntPtr FindCredentials ()
239+ {
240+ if (IntPtr.Zero == this.credentials)
241+ this.credentials = syncdaemon_authentication_find_credentials (this.handle);
242+
243+ return this.credentials;
244+ }
245+
246+ [DllImport("syncdaemon-1.0")]
247+ static extern string syncdaemon_credentials_get_consumer_key (IntPtr credentials);
248+
249+ public string ConsumerKey {
250+ get {
251+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
252+ return syncdaemon_credentials_get_consumer_key (raw);
253+ }
254+ }
255+
256+ [DllImport("syncdaemon-1.0")]
257+ static extern string syncdaemon_credentials_get_consumer_secret (IntPtr credentials);
258+
259+ public string ConsumerSecret {
260+ get {
261+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
262+ return syncdaemon_credentials_get_consumer_secret (raw);
263+ }
264+ }
265+
266+ [DllImport("syncdaemon-1.0")]
267+ static extern string syncdaemon_credentials_get_token (IntPtr credentials);
268+
269+ public string Token {
270+ get {
271+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
272+ return syncdaemon_credentials_get_token (raw);
273+ }
274+ }
275+
276+ [DllImport("syncdaemon-1.0")]
277+ static extern string syncdaemon_credentials_get_token_secret (IntPtr credentials);
278+
279+ public string TokenSecret {
280+ get {
281+ IntPtr raw = syncdaemon_authentication_find_credentials (this.handle);
282+ return syncdaemon_credentials_get_token_secret (raw);
283+ }
284+ }
285+
286+ [DllImport("syncdaemon-1.0")]
287+ static extern bool syncdaemon_authentication_has_credentials (IntPtr auth);
288+
289+ public bool HasCredentials ()
290+ {
291+ return syncdaemon_authentication_has_credentials (this.handle);
292+ }
293+
294+ [DllImport("syncdaemon-1.0")]
295+ static extern void syncdaemon_authentication_login_or_register (IntPtr auth);
296+
297+ public void LoginOrRegister ()
298+ {
299+ syncdaemon_authentication_login_or_register (this.handle);
300+ }
301+
302+ public event EventHandler CredentialsFound;
303+
304+ public event EventHandler AuthenticationCancelled;
305+
306+ public event EventHandler AuthenticationError;
307+ }
308+}
309Index: tomboy/Tomboy/Addins/WebSyncService/U1SyncServiceAddin.cs
310===================================================================
311--- /dev/null 1970-01-01 00:00:00.000000000 +0000
312+++ tomboy/Tomboy/Addins/WebSyncService/U1SyncServiceAddin.cs 2011-08-23 23:14:17.277675713 +0100
313@@ -0,0 +1,229 @@
314+// Permission is hereby granted, free of charge, to any person obtaining
315+// a copy of this software and associated documentation files (the
316+// "Software"), to deal in the Software without restriction, including
317+// without limitation the rights to use, copy, modify, merge, publish,
318+// distribute, sublicense, and/or sell copies of the Software, and to
319+// permit persons to whom the Software is furnished to do so, subject to
320+// the following conditions:
321+//
322+// The above copyright notice and this permission notice shall be
323+// included in all copies or substantial portions of the Software.
324+//
325+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
326+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
327+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
328+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
329+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
330+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
331+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
332+//
333+// Copyright (c) 2010 Canonical, Ltd. (http://www.canonical.com)
334+//
335+// Authors:
336+// Rodrigo Moya <rodrigo.moya@canonical.com>
337+//
338+
339+using System;
340+
341+using Mono.Unix;
342+
343+using Tomboy.Sync;
344+
345+namespace Tomboy.WebSync
346+{
347+ public class U1SyncServiceAddin : SyncServiceAddin
348+ {
349+ private bool initialized;
350+ private U1SyncPreferencesWidget prefsWidget;
351+
352+ private const string serverUrlPrefPath =
353+ "/apps/tomboy/sync/ubuntuone/server";
354+ private const string accessTokenBaseUrlPrefPath =
355+ "/apps/tomboy/sync/ubuntuone/oauth_access_token_base_url";
356+ private const string authorizeLocationPrefPath =
357+ "/apps/tomboy/sync/ubuntuone/oauth_authorize_location";
358+ private const string consumerKeyPrefPath =
359+ "/apps/tomboy/sync/ubuntuone/oauth_consumer_key";
360+ private const string consumerSecretPrefPath =
361+ "/apps/tomboy/sync/ubuntuone/oauth_consumer_secret";
362+ private const string realmPrefPath =
363+ "/apps/tomboy/sync/ubuntuone/oauth_realm";
364+ private const string requestTokenBaseUrlPrefPath =
365+ "/apps/tomboy/sync/ubuntuone/oauth_request_token_base_url";
366+ private const string tokenPrefPath =
367+ "/apps/tomboy/sync/ubuntuone/oauth_token";
368+ private const string tokenSecretPrefPath =
369+ "/apps/tomboy/sync/ubuntuone/oauth_token_secret";
370+
371+ public U1SyncServiceAddin ()
372+ {
373+ }
374+
375+ #region SyncServiceAddin Overrides
376+
377+ public override string Id {
378+ get { return "ubuntuone"; }
379+ }
380+
381+ public override string Name {
382+ get {
383+ return Catalog.GetString ("Ubuntu One");
384+ }
385+ }
386+
387+ public override bool IsConfigured {
388+ get {
389+ string serverPref;
390+ Api.OAuth oauth;
391+ GetConfigSettings (out oauth, out serverPref);
392+ return !string.IsNullOrEmpty (serverPref) &&
393+ oauth != null &&
394+ oauth.IsAccessToken;
395+ }
396+ }
397+
398+ public override bool IsSupported {
399+ get {
400+ return true; // TODO: Ever false?
401+ }
402+ }
403+
404+ public override Gtk.Widget CreatePreferencesControl (EventHandler requiredPrefChanged)
405+ {
406+ string serverPref;
407+ Api.OAuth oauth;
408+ GetConfigSettings (out oauth, out serverPref);
409+ prefsWidget = new U1SyncPreferencesWidget (oauth, serverPref);
410+ return prefsWidget;
411+ }
412+
413+ public override SyncServer CreateSyncServer ()
414+ {
415+ string serverPref;
416+ Api.OAuth oauth;
417+ GetConfigSettings (out oauth, out serverPref);
418+ return new WebSyncServer (serverPref, oauth);
419+ }
420+
421+ public override void PostSyncCleanup ()
422+ {
423+ }
424+
425+ public override void ResetConfiguration ()
426+ {
427+ SaveConfigSettings (null, null);
428+ prefsWidget.Auth = null;
429+ }
430+
431+ public override bool SaveConfiguration ()
432+ {
433+ // TODO: Is this really sufficient validation?
434+ // Should we try a REST API request?
435+ if (prefsWidget.Auth == null ||
436+ prefsWidget.Auth.ConsumerKey == null ||
437+ prefsWidget.Auth.ConsumerSecret == null ||
438+ prefsWidget.Auth.Token == null ||
439+ prefsWidget.Auth.TokenSecret == null)
440+ return false;
441+ SaveConfigSettings (prefsWidget.Auth, prefsWidget.Server);
442+ return true;
443+ }
444+
445+ #endregion
446+
447+ #region ApplicationAddin Overrides
448+
449+ public override void Initialize ()
450+ {
451+ initialized = true;
452+ }
453+
454+ public override void Shutdown ()
455+ {
456+ initialized = false;
457+ }
458+
459+ public override bool Initialized {
460+ get { return initialized; }
461+ }
462+
463+ #endregion
464+
465+ #region Private Members
466+
467+ private void GetConfigSettings (out Api.OAuth oauthConfig, out string serverPref)
468+ {
469+ serverPref = (string)
470+ Preferences.Get (serverUrlPrefPath);
471+
472+ oauthConfig = new Api.OAuth ();
473+ oauthConfig.AccessTokenBaseUrl =
474+ Preferences.Get (accessTokenBaseUrlPrefPath) as string;
475+ oauthConfig.AuthorizeLocation =
476+ Preferences.Get (authorizeLocationPrefPath) as string;
477+ oauthConfig.ConsumerKey =
478+ Preferences.Get (consumerKeyPrefPath) as string;
479+ oauthConfig.ConsumerSecret =
480+ Preferences.Get (consumerSecretPrefPath) as string;
481+ oauthConfig.Realm =
482+ Preferences.Get (realmPrefPath) as string;
483+ oauthConfig.RequestTokenBaseUrl =
484+ Preferences.Get (requestTokenBaseUrlPrefPath) as string;
485+ oauthConfig.Token =
486+ Preferences.Get (tokenPrefPath) as string;
487+ oauthConfig.TokenSecret =
488+ Preferences.Get (tokenSecretPrefPath) as string;
489+
490+ // The fact that the configuration was saved at all
491+ // implies that the token is an access token.
492+ // TODO: Any benefit in actually storing this bool, in
493+ // case of weird circumstances?
494+ oauthConfig.IsAccessToken =
495+ !String.IsNullOrEmpty (oauthConfig.Token);
496+ }
497+
498+ private void SaveConfigSettings (Api.OAuth oauthConfig, string serverPref)
499+ {
500+ Preferences.Set (serverUrlPrefPath, GetConfigString (serverPref));
501+ Preferences.Set (accessTokenBaseUrlPrefPath,
502+ oauthConfig != null ?
503+ GetConfigString (oauthConfig.AccessTokenBaseUrl) :
504+ String.Empty);
505+ Preferences.Set (authorizeLocationPrefPath,
506+ oauthConfig != null ?
507+ GetConfigString (oauthConfig.AuthorizeLocation) :
508+ String.Empty);
509+ Preferences.Set (consumerKeyPrefPath,
510+ oauthConfig != null ?
511+ GetConfigString (oauthConfig.ConsumerKey) :
512+ String.Empty);
513+ Preferences.Set (consumerSecretPrefPath,
514+ oauthConfig != null ?
515+ GetConfigString (oauthConfig.ConsumerSecret) :
516+ String.Empty);
517+ Preferences.Set (realmPrefPath,
518+ oauthConfig != null ?
519+ GetConfigString (oauthConfig.Realm) :
520+ String.Empty);
521+ Preferences.Set (requestTokenBaseUrlPrefPath,
522+ oauthConfig != null ?
523+ GetConfigString (oauthConfig.RequestTokenBaseUrl) :
524+ String.Empty);
525+ Preferences.Set (tokenPrefPath,
526+ oauthConfig != null ?
527+ GetConfigString (oauthConfig.Token) :
528+ String.Empty);
529+ Preferences.Set (tokenSecretPrefPath,
530+ oauthConfig != null ?
531+ GetConfigString (oauthConfig.TokenSecret) :
532+ String.Empty);
533+ }
534+
535+ private string GetConfigString (string val)
536+ {
537+ return val ?? String.Empty;
538+ }
539+
540+ #endregion
541+ }
542+}
543Index: tomboy/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml
544===================================================================
545--- tomboy.orig/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml 2011-08-23 22:54:40.139230862 +0100
546+++ tomboy/Tomboy/Addins/WebSyncService/WebSyncService.addin.xml 2011-08-23 23:11:21.488427309 +0100
547@@ -18,4 +18,8 @@
548 <Extension path="/Tomboy/SyncServiceAddins">
549 <SyncServiceAddin type="Tomboy.WebSync.WebSyncServiceAddin" />
550 </Extension>
551+
552+ <Extension path="/Tomboy/SyncServiceAddins">
553+ <SyncServiceAddin type="Tomboy.WebSync.U1SyncServiceAddin" />
554+ </Extension>
555 </Addin>
5560
=== added file 'debian/patches/32_logout_delay.patch'
--- debian/patches/32_logout_delay.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/32_logout_delay.patch 2013-02-05 16:50:59 +0000
@@ -0,0 +1,42 @@
1From 84797b9a9df3c84b329fbed946478f0171f5163c Mon Sep 17 00:00:00 2001
2From: Jared Jennings <jjennings@src.gnome.org>
3Date: Mon, 16 Jan 2012 16:51:04 +0000
4Subject: Sam Lin has provided a patch to address slow Logouts
5
6Sam added Stop signal callback in Tomboy and it solved the issue.
7bgo #650029
8---
9diff --git a/Tomboy/GnomeApplication.cs b/Tomboy/GnomeApplication.cs
10index b076003..b2ef6f0 100644
11--- a/Tomboy/GnomeApplication.cs
12+++ b/Tomboy/GnomeApplication.cs
13@@ -67,6 +67,7 @@ namespace Tomboy
14 session_client_id);
15 client.QueryEndSession += OnQueryEndSession;
16 client.EndSession += OnEndSession;
17+ client.Stop += OnStop;
18 } catch (Exception e) {
19 Logger.Debug ("Failed to register with session manager: {0}", e.Message);
20 }
21@@ -142,6 +143,10 @@ namespace Tomboy
22 System.Environment.Exit (0);
23 }
24
25+ private void OnStop () {
26+ Exit(0);
27+ }
28+
29 private void OnQueryEndSession (uint flags)
30 {
31 Logger.Info ("Received end session query");
32@@ -175,6 +180,7 @@ namespace Tomboy
33 } catch (Exception e) {
34 Logger.Debug ("Failed to respond to session manager: {0}", e.Message);
35 }
36+ Exit (0);
37 }
38
39 public void OpenUrl (string url, Gdk.Screen screen)
40--
41cgit v0.9.0.2
42
043
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-09-26 23:39:59 +0000
+++ debian/patches/series 2013-02-05 16:50:59 +0000
@@ -1,9 +1,7 @@
101_dllmaps.patch101_dllmaps.patch
203_u1_as_default_sync.patch
304_app_indicator.patch204_app_indicator.patch
405_add_start_u1_note.patch
5#06_use_ubuntu_sso.patch
611_lpi.patch311_lpi.patch
720_remove_pcfile_requires420_remove_pcfile_requires
830_fix_manpage_syntax530_fix_manpage_syntax
931_prevent_inadvertent_deletion_of_notes.patch631_prevent_inadvertent_deletion_of_notes.patch
732_logout_delay.patch

Subscribers

People subscribed via source and target branches

to all changes: