In The Beginning...
Years ago, when I first heard that Ubuntu Touch would have apps written in QML, I decided to write a Qt based front end for MuttonChop!. My logic was, if Ubuntu is using QML then there will be support for Qt. With my favorite text editor at the ready, I began to hack together some Python code to make a Qt application using Pyside.
Since all of my MuttonChop! related projects are named after sideburn sporting figures from California history, this project was named after Commodore John F Stockton. The project name has stayed, but from the very beginning the project strayed from being a MuttonChop! controller to something completely different.
Once the basics of the main UI window for Stockton had been coded, I thought "hey, why not just add a WebKit WebView to access the Mobile UI for MuttonChop?". Being lazy and not wanting to code another MuttonChop UI, I did just that. From there, a URL input was added to give the end user a way of changing the URL displayed in the WebView.
After that, I opened a URL in Stockton, resized the window, and moves the window to a specific location on my desktop. Suddenly there was a need to always have a Stockton window open in a fixed location on my desktop when Stockon is launched with a certain url. Bang zoom, clacking the keyboard, and the main features of Stockon were done.
Fast-Forward a Bit...
Problems Were Encountered
CORS... fucking CORS!
Fortunately, the WebKit1 library fully allows developers to configure a WebView to load local files and let those local files make XmlHttpRequests to remote web servers. Thanks WebKit1!
Sadly, WebKit2 doesn't seem to have this feature.
For some unknown reason, not all of my code works as expected and it is good to be able to debug stuff. By setting the "enable-developer-extras" property to True, I was able to um.... enable developer extras, and this adds "inspect element" to the contextual menu when one right-clicks on a stockton webview.
Wooooweee! After updating the code, not only did I have a fine desktop application, I also had a rudimentary HTML5 compliant browser that would run on an n900.
I prefer Gtk
It's true, aesthetically I prefer Gtk to Qt. Although I think I might prefer Qt to Gtk from a developer point of view.
Anyway, I figured it was time to port Stockton from Python2 to Python3, and this necessitated switching from Pyside to either PyQt or Gtk. In this regard, I went with Gtk. At the same time that I was porting to Gtk, I also attempted to port to WebKit2. Lamentably, it was during the port that I discovered WebKit2 lacked the ability to disable that CORS crap. Oh well, I submitted a bug for the missing WebKit2 feature, and switched to WebKit1.
While porting the code, I was fortunate to find https://lazka.github.io/pgi-docs/ which is an indispensable documentation source when using Python and Gobject Introspection to access various libraries from Python. Since the documentation is in HTML format, I downloaded the docs, and run them in Stockton... because I can. :)
Now quit reading, and go create a solution to a problem.
Oh yea, if you are interested in such things the source is available at https://gitlab.com/jezra/stockton