[yast-devel] Browser with functional links
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@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Monday 13 August 2007 12:12, Benji Weber wrote:
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. ... Does anyone have any thoughts on how to do this even better, or potential applications for this?
We discussed this in last year's YaST2 workshop. A very useful application would be to use Wikipedia links (like, say, "wikipedia:NFS") in the help texts so we don't have to reinvent the wheel for all kinds of technical explanations what things like "NFS" etc. is all about. In most cases, this would not work during the installation yet (no internet connection set up at that point yet), but it would really be useful later in the installed system. CU -- Stefan Hundhammer <sh@suse.de> Penguin by conviction. YaST2 Development SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Nürnberg, Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (2)
-
Benji Weber
-
Stefan Hundhammer