Menu

Home

Fredegar

Rocket science it is not: PunyKit, a puny WebKit-based browser.

PunyKit is a browser I created in about an hour or so, maybe less. It is a QtWebKit centred application that displays the page in a "mobile browser similar" manner, and keeps that oh-so-useful WebInspector open in a separate window next to it.

AND - and this is where suddenly it started getting useful - it also updates the pages when you change something.

To use it - on the screen there is an address bar and two buttons. The "PushButton" button just loads whatever is in the address bar. The first button, which has ... written on it, opens a file dialog box, from which you can open any directory or even just a file. If you open a directory, it will search for the index.html file and display it. If you open a file it will open that file. Any time you change the files in the directory you opened using this buttons, the page will reload. So you edit the files in whatever editor, then save them, then switch back to PunyKit - and the files there are all reloaded for you.

What I'm aiming for is something that is as close to the iPhone simulator as possible, but with a web-inspector and (Yay!) works on machines which weren't made by the Apple corporation. Still early days and (ironically) I wrote it to use on my MacBook, but hey. It's good.

Building

SO, this is a project that is written in Qt. To build it, check out the Git sources. If you haven't installed Qt, then you will need to do that. Best way to do that is to install the Qt SDK from Nokia, but remember to do a custom setup and take NEARLY EVERYTHING OUT - unless you want to be writing code for Symbian/MeeGo/Maemo Nokia phones as well? You only need the bare minimal install. If you're on a Linux machine, then Qt is even easier to install. You just need to install it using the version management tool (it needs g++ and 'build essentials', but if you are a Linux user you probably know this).

Once that's all done then you can make it on the command line using

qmake punykit.pro
make (or whatever passes for make on your machine)

Alternatively, just open it in QtCreator and press Ctrl+B.

The code itself isn't rocket science or complex. I think that I put more effort into writing this description. It's really just a QtWebKit instance with a couple of extras dings added, nothing major.

To use: type the address into the address bar. Press enter. Alternatively, you can push the button with "Push Button" written enticingly on it. If you change the code on your project then (wait for it) Ctrl+R will refresh the page.

TODO

Of course, I just wrote this already so it does very very little. I'm thinking that in time, it would be AWESOME to be able to point the address bar at a directory, and then have Qt watch the files there for changes. When a file changes, the page updates automatically {this is now done}. Also, I'm thinking that the application should store the last page you were working on and go to that one next time you open - kind of useful. But I have an HTML5 application to write, and these little tweaks can come along later.