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

« back to all changes in this revision

Viewing changes to Tomboy/NoteWindow.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2007-02-26 22:14:12 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20070226221412-1mc3m280nwkm1691
Tags: 0.5.9-0ubuntu1
* New upstream release:
  + This is a bugfix-only release...
  + Fix crash when dragging email with blank subject from
    Evolution (#408859).
  + Fix link uris when drag & drop from nautilus with multiple
    files (#412355).
  + Fix drag & drop behavior to insert dropped uris at mouse
    location (#330964).
  + Fix to only show sticky note importer if external sticky
    notes exist (#404739).
  + Fix to open search dialog in foreground (#411924, Wouter Bolsterlee).
  + Use default GNOME font settings by default (#358974, Wouter Bolsterlee).
  + Remove author names from official Tomboy plugins (#410314).
  + Update minimum requirements: gtk/gdk 2.6.0, gtk-sharp 2.6.0 (#412130).
  + Install DBus service file to --prefix when not auto detected.
  + Disable NoteOfTheDayPlugin by default.
* debian/control:
  + Update build dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
                        if (has_url) {
95
95
                                UriList uri_list = new UriList (selection_data);
96
 
                                StringBuilder insert = new StringBuilder ();
 
96
                                bool more_than_one = false;
 
97
                                
 
98
                                // Place the cursor in the position where the uri was
 
99
                                // dropped, adjusting x,y by the TextView's VisibleRect.
 
100
                                Gdk.Rectangle rect = VisibleRect;
 
101
                                int adjustedX = x + rect.X;
 
102
                                int adjustedY = y + rect.Y;
 
103
                                Gtk.TextIter cursor = GetIterAtLocation (adjustedX, adjustedY);
 
104
                                Buffer.PlaceCursor (cursor);
 
105
                                
 
106
                                Gtk.TextTag link_tag = Buffer.TagTable.Lookup ("link:url");
97
107
 
98
108
                                foreach (Uri uri in uri_list) {
99
109
                                        Logger.Log ("Got Dropped URI: {0}", uri);
100
 
 
101
 
                                        // FIXME: The space here is a hack
102
 
                                        // around a bug in the URL Regex which
103
 
                                        // matches across newlines.
104
 
                                        if (insert.Length > 0)
105
 
                                                insert.Append (" \n");
106
 
 
107
 
                                        if (uri.IsFile) 
108
 
                                                insert.Append (uri.LocalPath);
 
110
                                        string insert;
 
111
                                        if (uri.IsFile)
 
112
                                                insert = uri.LocalPath;
109
113
                                        else
110
 
                                                insert.Append (uri.ToString ());
111
 
                                }
112
 
 
113
 
                                if (insert.Length > 0) {
114
 
                                        Gtk.TextIter insert_iter = 
115
 
                                                Buffer.GetIterAtMark (Buffer.InsertMark);
116
 
                                        Buffer.InsertWithTags (ref insert_iter,
117
 
                                                               insert.ToString (),
118
 
                                                               Buffer.TagTable.Lookup ("link:url"));
119
 
                                }
120
 
 
121
 
                                Gtk.Drag.Finish (context, insert.Length > 0, false, time);
 
114
                                                insert = uri.ToString ();
 
115
                                        
 
116
                                        if (insert == null || insert.Trim () == String.Empty)
 
117
                                                continue;
 
118
                                        
 
119
                                        if (more_than_one) {
 
120
                                                cursor = Buffer.GetIterAtMark (Buffer.InsertMark);
 
121
                                                
 
122
                                                // FIXME: The space here is a hack
 
123
                                                // around a bug in the URL Regex which
 
124
                                                // matches across newlines.
 
125
                                                if (cursor.LineOffset == 0)
 
126
                                                        Buffer.Insert (ref cursor, " \n");
 
127
                                                else
 
128
                                                        Buffer.Insert (ref cursor, ", ");
 
129
                                        }
 
130
                                        
 
131
                                        Buffer.InsertWithTags (ref cursor, insert, link_tag);
 
132
                                        more_than_one = true;
 
133
                                }
 
134
 
 
135
                                Gtk.Drag.Finish (context, more_than_one, false, time);
122
136
                        } else {
123
137
                                base.OnDragDataReceived (context, x, y, selection_data, info, time);
124
138
                        }