[tomboy-list] html//blogging
Matt Price
matt.price at utoronto.ca
Mon May 5 20:23:20 PDT 2008
On Tue, 2008-04-29 at 22:32 -0700, Sandy Armstrong wrote:
> On 4/29/08, Matt Price <matt.price at utoronto.ca> wrote:
> >
> > i've just discovered tomboy-blogposter ( http://flukkost.nu/blog/tomboyblogposter/ ) which i'm really liking a
> > lot. blog postings are like notes, and now that there are notebooks to
> > store them in tomboy is an obvious place to write them in. the only
> > issue is that blogs really need html links in them, because you're
> > often referring to stuff from the web. am i wrong in thinking that
> > tomboy doesn't allow 'hidden' html links in text? that is, can i write
> > here the way i might in an html document? if not, would it be
> > desirable or distracting to have such a feature? 'cause for me, right
> > now, it'd be great to have.
>
> Currently there is no way to do this from Tomboy, but somebody could
> write an addin to do it pretty easily (like how the bugzilla addin
> works). We are thinking about adding this functionality to Tomboy in
> the future.
>
> Sandy
so finally trying to understand the Bugzilla plugin code a little
better. if i understand it correctly, the bugzilla plugin works
exclusively through drag and drop -- so, for instance, if you paste a
bugzilla url in to a note, you get an ordinary link with no special
bugzilla properties. the <link:href> tag i am using would not work by
dragging, but by pasting a url somewhere. is there some obvious code in
the tomboy source tree (or on the web somewhere) that shows how to
acquire the clipoard data and add it to the note? i'm imagining that,
instead of this code in BugzillaNoteAddin.cs:
>
> void DropUriList (Gtk.DragDataReceivedArgs args)
> {
> if (args.SelectionData.Length > 0) {
> string uriString = Encoding.UTF8.GetString (args.SelectionData.Data);
>
> string bugIdGroup = "bugid";
> string regexString =
> @"show_bug\.cgi\?(\S+\&){0,1}id=(?<" + bugIdGroup + @">\d{5,})";
>
> Match match = Regex.Match (uriString, regexString);
> if (match.Success) {
> int bugId = int.Parse (match.Groups [bugIdGroup].Value);
> if (InsertBugzilla (args.X, args.Y, uriString, bugId)) {
> Gtk.Drag.Finish (args.Context, true, false, args.Time);
> g_signal_stop_emission_by_name(Window.Editor.Handle,
> "drag_data_received");
> }
> }
> }
> }
i want something more like:
void PasteUriList (Gtk.ClipboardDataRecievedArgs args)
{
string uriString = Encoding.UTF8.GetString (args.SelectionData.Data);
string highlightedText = Gtk.HighlightedText.value ;
InsertHref (uriString, highlightedText ) ;
}
while InsertHref would, i guess, create an xml link:href object, with
value highightedText and attribute uri, and replace the highlighted text
with that object. this is pretty simple, obviously, but it feels harder
b/c i have never tried c# before (or even c), and also b/c i don't have
any feel for the available gtk/tomboy methods.
anyway6, any comments or help would be appreciated. thanks!
matt
--
Matt Price
matt.price at utoronto.ca
More information about the Tomboy-list
mailing list