Thread: Editor widget
View Single Post
Old 02-03-2014, 05:40 PM   #1
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Editor widget

I currently have an application which consists of a large-ish dialog containing (amongst other things) a QWebView widget showing the contents of a single html file (or unicode string). This is working fine.

I would be interested in adding an extra widget showing the Code view equivalent and am wondering whether I can use one of the Editor's widgets for this. TextEdit in calibre/gui2/tweak_book/editor/text.py looks hopeful. Is it possible to use this class to edit a selected single html file? If so, could you show me a bit of sample code showing how I might add an 'edit html file including a theme' widget into an existing dialog?

My current sort-of-editing method is to use a subprocess.call to my standard PC text editor, which does have some benefits, but is not ideal. I'm only exploring ideas for now so any pointers would be appreciated

Last edited by jackie_w; 02-03-2014 at 05:43 PM.
jackie_w is offline   Reply With Quote