4
namespace Tomboy.Bugzilla
6
public class BugzillaLink : DynamicNoteTag
10
public BugzillaLink ()
15
public override void Initialize (string element_name)
17
base.Initialize (element_name);
19
Underline = Pango.Underline.Single;
23
CanSpellCheck = false;
29
get { return (string) Attributes ["uri"]; }
30
set { Attributes ["uri"] = value; }
33
protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.TextIter end)
35
if (BugUrl != string.Empty) {
36
Logger.Log ("Opening url '{0}'...", BugUrl);
37
Gnome.Url.Show (BugUrl);
42
public override Gdk.Pixbuf Image
49
System.Uri uri = new System.Uri(BugUrl);
53
string host = uri.Host;
54
string imageDir = "~/.tomboy/BugzillaIcons/";
56
string imagePath = imageDir.Replace ("~", Environment.GetEnvironmentVariable ("HOME")) + host + ".png";
59
Icon = new Gdk.Pixbuf (imagePath);
60
} catch (GLib.GException) {
61
Icon = new Gdk.Pixbuf(null, "stock_bug.png");