~ubuntu-branches/ubuntu/gutsy/tomboy/gutsy-updates

« back to all changes in this revision

Viewing changes to Tomboy/NoteManager.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2007-01-20 11:01:48 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20070120110148-stezrp0p2loo69y4
Tags: 0.5.4-0ubuntu1
* New upstream release:
  + Fix bullet serialization (#319221)
  + Fix NoteOfTheDay plugin from creating too many notes (#382190)
  + Fix "Start Here" note keybinding if note is renamed (#315222)
  + Fix Evolution Plugin to use Evolution exchange account (#397390)
  + Fix corrupted text when typing with search open (#397223)
  + And others (#394501, #383765, #397700, #397717, #350707)
* debian/control:
  + Enable note of the day plugin again

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
                ArrayList notes;
16
16
                PluginManager plugin_mgr;
17
17
                TrieController trie_controller;
 
18
                
 
19
                static string start_note_uri = String.Empty;
 
20
 
 
21
                static NoteManager ()
 
22
                {
 
23
                        // Watch the START_NOTE_URI setting and update it so that the
 
24
                        // StartNoteUri property doesn't generate a call to
 
25
                        // Preferences.Get () each time it's accessed.
 
26
                        start_note_uri =
 
27
                                Preferences.Get (Preferences.START_NOTE_URI) as string;
 
28
                        Preferences.SettingChanged += OnSettingChanged;
 
29
                }
 
30
                
 
31
                static void OnSettingChanged (object sender, GConf.NotifyEventArgs args)
 
32
                {
 
33
                        switch (args.Key) {
 
34
                        case Preferences.START_NOTE_URI:
 
35
                                start_note_uri = args.Value as string;
 
36
                                break;
 
37
                        }
 
38
                }
18
39
 
19
40
                public NoteManager (string directory) : 
20
41
                        this (directory, Path.Combine (directory, "Backup")) 
150
171
                                Note start_note = Create (Catalog.GetString ("Start Here"),
151
172
                                                                start_note_content);
152
173
                                start_note.Save ();
 
174
                                Preferences.Set (Preferences.START_NOTE_URI, start_note.Uri);
153
175
 
154
176
                                Note links_note = Create (Catalog.GetString ("Using Links in Tomboy"),
155
177
                                                                links_note_content);
189
211
                        foreach (Note note in notesCopy) {
190
212
                                plugin_mgr.LoadPluginsForNote (note);
191
213
                        }
 
214
                        
 
215
                        // Make sure that a Start Note Uri is set in the preferences.  This
 
216
                        // has to be done here for long-time Tomboy users who won't go
 
217
                        // through the CreateStartNotes () process.
 
218
                        if (StartNoteUri == String.Empty) {
 
219
                                // Attempt to find an existing Start Here note
 
220
                                Note start_note = Find (Catalog.GetString ("Start Here"));
 
221
                                if (start_note != null)
 
222
                                        Preferences.Set (Preferences.START_NOTE_URI, start_note.Uri);
 
223
                        }
192
224
                }
193
225
 
194
226
                void OnExitingEvent (object sender, EventArgs args)
365
397
                                                                 note_a.ChangeDate);
366
398
                        }
367
399
                }
 
400
                
 
401
                public static string StartNoteUri
 
402
                {
 
403
                        get { return start_note_uri; }
 
404
                }
368
405
 
369
406
                public ArrayList Notes 
370
407
                {