Mailinglist Archive: yast-devel (52 mails)

< Previous Next >
[yast-devel] Browser with functional links
  • From: "Benji Weber" <b.weber@xxxxxxxxxxxxx>
  • Date: Mon, 13 Aug 2007 11:12:05 +0100
  • Message-id: <d6b310ce0708130312m6f777b69l3dc645fb4cd86432@xxxxxxxxxxxxxx>
Hi,

Posting this here incase anyone else hadn't thought of this before.

There are a number of exciting things that would be possible with a
web page & usable links within YaST. The registration module just
launches an external browser.

There is of course the Rich Text widget that provides a useful subset
of html, and by combining with the xdg-open utility we can have links
that open in the appropriate browser or application for the user's
desktop environment.

e.g. a link to a webpage will open in konqueror/firefox depending on
user's browser. Link to a pdf would open in kpdf on KDE, link to an
irc:// link would open in konversation/xchat etc.

Sample code:

{
        string OPEN_CMD = "xdg-open";
            UI::OpenDialog(`opt(`centered),
                        `MinHeight(22,
                                `MinWidth(68,
                                        `VBox(
                                                `RichText(`id(`rtext),"")
                                        )
                                )
                        )
                );
        UI::ChangeWidget(`rtext,`Value,"<body bgcolor=\"White\">\
                                                                        <h1>Browser demo</h1>\
                                                                        <p>Example of page with functional links within YaST</p>\
                                                                        <li><a href=\"http://example.com\";>This link should open in
your browser</a></li>\
                                                                        <li><a href=\"irc://irc.freenode.net/#yast\">This link should
connect you to the YaST channel</a></li>\
                                                                        <li><a
href=\"http://wiki.novell.com/images/d/d8/Quick_Reference_11_UNIX-Linux_Troubleshooting.pdf\";>This
link should open in your PDF viewer</a></li>\
                                                                        </body>");
        any input =  UI::UserInput();
    while(is(input,string))
        {
                SCR::Execute(.target.bash, OPEN_CMD + " '" + (string)input + "'");
                input = UI::UserInput();
        }
}

You can do relatively complex things, for example here is a screenshot
of yaloki's irc support page running inside YaST
http://bw.uwcs.co.uk/yast-browser-qt.png ;.

Minor annoyances include requiring absolute paths for images.

Does anyone have any thoughts on how to do this even better, or
potential applications for this?

_
Benjamin Weber
-- 
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups