~ubuntu-branches/ubuntu/lucid/tomboy/lucid-proposed

« back to all changes in this revision

Viewing changes to Tomboy/Plugins/Evolution.cs

Tags: upstream-0.3.9+dfsg
ImportĀ upstreamĀ versionĀ 0.3.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
using System.Runtime.InteropServices;
9
9
using System.Diagnostics;
10
10
 
11
 
using Mono.Posix;
 
11
using Mono.Unix;
 
12
using Mono.Unix.Native;
12
13
 
13
14
using Tomboy;
14
15
 
32
33
                        SetupAccountUrlToUidMap ();
33
34
                } 
34
35
                catch (Exception e) {
35
 
                        Console.WriteLine ("Evolution: Error reading accounts: {0}", e);
 
36
                        Logger.Log ("Evolution: Error reading accounts: {0}", e);
36
37
                }
37
38
        }
38
39
 
76
77
                            Uri uri = new Uri (source_url.InnerText);
77
78
                            source_url_to_uid [uri] = uid;
78
79
                        } catch (System.UriFormatException) {
79
 
                            Console.WriteLine (
 
80
                            Logger.Log (
80
81
                                    "Evolution: Unable to parse account source URI \"{0}\"",
81
82
                                    source_url.InnerText);
82
83
                        }
152
153
 
153
154
                        if (match) {
154
155
                                account_uid = (string) source_url_to_uid [source_uri];
155
 
                                Console.WriteLine ("Evolution: Matching account '{0}'...", 
 
156
                                Logger.Log ("Evolution: Matching account '{0}'...", 
156
157
                                                   account_uid);
157
158
                                break;
158
159
                        }
254
255
                } catch (Exception e) {
255
256
                        string message = String.Format ("Error running Evolution: {0}", 
256
257
                                                        e.Message);
257
 
                        Console.WriteLine (message);
 
258
                        Logger.Log (message);
258
259
                        HIGMessageDialog dialog = 
259
260
                                new HIGMessageDialog (editor.Toplevel as Gtk.Window,
260
261
                                                      Gtk.DialogFlags.DestroyWithParent,
364
365
 
365
366
                UriList uri_list = new UriList (uri_string);
366
367
                foreach (Uri uri in uri_list) {
367
 
                        Console.WriteLine ("Evolution: Dropped URI: {0}", uri.LocalPath);
 
368
                        Logger.Log ("Evolution: Dropped URI: {0}", uri.LocalPath);
368
369
 
369
370
                        int mail_fd = Syscall.open (uri.LocalPath, OpenFlags.O_RDONLY);
370
371
                        if (mail_fd == -1)
386
387
                                subject_list.Add (subject);
387
388
                                message.Dispose ();
388
389
 
389
 
                                Console.WriteLine ("Evolution: Message Subject: {0}", subject);
 
390
                                Logger.Log ("Evolution: Message Subject: {0}", subject);
390
391
                        };
391
392
 
392
393
                        parser.Dispose ();
409
410
 
410
411
                xuid_list = new ArrayList ();
411
412
 
412
 
                Console.WriteLine ("Evolution: Dropped XUid: uri = '{0}'", list [0]);
 
413
                Logger.Log ("Evolution: Dropped XUid: uri = '{0}'", list [0]);
413
414
 
414
415
                for (int i = 1; i < list.Length; i++) {
415
416
                        if (list [i] == string.Empty)
419
420
                                EvoUtils.EmailUriFromDropUri (list [0] /* evo account uri */,
420
421
                                                              list [i] /* message uid */);
421
422
 
422
 
                        Console.WriteLine ("Evolution: Translating XUid uid='{0}' to uri='{1}'", 
 
423
                        Logger.Log ("Evolution: Translating XUid uid='{0}' to uri='{1}'", 
423
424
                                           list [i],
424
425
                                           launch_uri);
425
426
 
440
441
                                cursor = Buffer.GetIterAtMark (Buffer.InsertMark);
441
442
 
442
443
                                if (cursor.LineOffset == 0) 
443
 
                                        Buffer.Insert (cursor, "\n");
 
444
                                        Buffer.Insert (ref cursor, "\n");
444
445
                                else
445
 
                                        Buffer.Insert (cursor, ", ");
 
446
                                        Buffer.Insert (ref cursor, ", ");
446
447
                        }
447
448
 
448
449
                        string launch_uri = (string) xuid_list [message_idx++];
453
454
 
454
455
                        cursor = Buffer.GetIterAtMark (Buffer.InsertMark);
455
456
                        start_offset = cursor.Offset;
456
 
                        Buffer.Insert (cursor, subject);
 
457
                        Buffer.Insert (ref cursor, subject);
457
458
 
458
459
                        Gtk.TextIter start = Buffer.GetIterAtOffset (start_offset);
459
460
                        Gtk.TextIter end = Buffer.GetIterAtMark (Buffer.InsertMark);