Showing posts with label UI. Show all posts
Showing posts with label UI. Show all posts

Indicator-jenkins is now even more awesome

My latest hobby project, indicator-jenkins is now even better (I wrote about this previously, in case you missed it).

New features since my last blog post:

  • The code is now much nicer, and will be much easier to extend. My long-term goal is to support other types of CI servers (I'll probably have to change the project name I guess).
  • Desktop notifications are generated for each new build of a monitored project. The notification includes the status and health report of the last build.
  • LOTS of bug-fixes, especially around the settings UI. I'm still not happy with the settings dialog UI, but it's at least usable now.
To get it installed, do the following:

$ sudo add-apt-repository ppa:thomir/indicator-jenkins
$ sudo apt-get install indicator-jenkins

Then launch indicator-jenkins from the unity dash or command line (Note: Launching it from the command line generates a LOT of debug output - I will turn this off in future releases).

Introducing: indicator-jenkins

For my day job I've been monitoring a jenkins instance (specifically, the public Ubuntu QA jenkins instance) using my web browser. This is obviously suboptimal - I'd like to be able to see the state of the jenkins jobs I'm interested at a glance, without having to open my web browser.

I couldn't find a solution to my problem, so I created one: indicator-jenkins is a panel indicator for your desktop manager of choice. It allows you to select one or more jobs from a jenkins server, and follow the job state without having to open your browser.

The project is hosted on launchpad, and is built daily into my PPA. To install it (I'm assuming you're running Ubuntu):

$ sudo add-apt-repository ppa:thomir/indicator-jenkins
$ sudo apt-get update
$ sudo apt-get install indicator-jenkins

Once it's installed you can launch it in a couple of different ways:

  • From a terminal - jut run indicator-jenkins. If you run it on the terminal you'll get a lot of debugging output (useful if you want to submit a patch, or figure out why it's not working).
  • From the unity dash - open the dash, and search for 'jenkins' - it's probably going to be the first link.

Once it's running you should see the jenkins icon in your panel. To set it up, click the icon to open the settings dialog, enter the URL of the jenkins instance you want to look at, hit the refresh button, and pick the job(s) you want to monitor. Click OK and you're done! It's simpler than it sounds - see for yourself:

Right now it's pretty rough-and-ready - there are many features I'd like to add:
  • Integrate desktop notifications, so you can be alerted when a job state changes.
  • Customise panel icon based on job state (i.e.- show a red icon if any of the monitored jobs are failing).
  • Allow user to customise refresh period.
  • Allow user to monitor jobs from more than one jenkins server.
  • Show more information about a jenkins job. For a start, show stability as well as current status, and maybe in the future show unity test pass/failure rates for projects that have that information.
How it's Made:

The entire application is written in python. We make use of several python modules:
  • The python-appindicator package gives us the ability to create an icon on the menu, and the python gtk2 bindings are used to create the menu and settings dialog.
  • The python 'multiprocessing' module is used to spin up worker processes to fetch the data from jenkins. Initially the application used threads for this, but python's threading support isn't great, and it was taking too long. 
  • The python 'json' module is used to save and load settings.
  • The python-jenkins package is used to communicate with the jenkins server.
This is a great example of python's "batteries included" approach to programming. All you have to do is provide the glue between already-existing python modules.

Another Microsoft UI Fail

...this time in Microsoft Outlook. Could the programmer who was too lazy to write their code properly please go back to school? There is no excuse for this:

You want me to take this string, split it on comma characters, and re-join it with semi-colons instead? Sure, I'll do that you you, with my meat-fingers, because I'm really good at that, and computers are known to be terrible and SIMPLE TEXT MANIPULATION.

KDE 4.2: First Impressions

As you may already know, KDE4.2 was released a few days ago. I was interested in writing a plasmoid in python (more on that in a future post), which meant that I had to upgrade.

So what did I think of KDE4.2 after experiencing KDE4.1?

In a word: Brilliant!

KDE4.2 is a breath of fresh air after 4.1. Many of the crashes I experienced in KDE4.1 have been fixed. For example, in 4.1, every time I opened the "Display" configuration dialog my laptop would freeze, and needed to be hard rebooted in order to get it working again. Every time I launched a full-screen application (like a game) my laptop would freeze. I couldn't kill the X server with Ctrl+Alt+Backspace without my laptop freezing... there's a whole list.

KDE4.2 fixes almost all these bugs, and even throws in some nice performance tweaks at the same time. Things feel more responsive - menus are faster to open, and some applications seem faster to load (although I haven't done any actual timing tests - so this is all subjective). Finally, it looks very nice:


It looks good, and it's responsive on my three year old laptop!

A big congratulations to all the KDE developers that made this happen. I believe I've committed a whopping 10 lines of code to KDE4, so I'm glad that other people have more commitment than I do ;)

piwup: A Picasaweb Image Uploader for Linux

One of my pet peeves has always been that unless you want to run google's picasa application under Linux, the only way to upload photos to your picasaweb account is via a klunky web interface that only allows you to select 5 images at a time. When I come back from a trip I have hundreds of photos, so this gets tiresome very quickly.

There is a kipi plugin that is supposed to be able to do this, but it has not yet hit the Linux distribution I am using, and I'm not about to start compiling plugins from source. Besides, half the fun is in making the application!

This is definitely not a finished application! I got it to the point where I could upload my images in a batch, but it needs more work before it's useful to anyone else. Here's a few sample screen shots:

Selecting images to upload.

Uploading the first image.

The application still has a long way to go. Just some of the things yet to complete are:
  • Remove hard coded items from the code (account details, service host, album name), and make these configurable via a nice configuration dialog. Make sure password is stored in a secure form - via the KDE wallet perhaps.
  • Make the GUI half-decent. Originally I just wanted something to work - I need to go back and do it again with a proper menu and image thumbnail support.
  • Bug fixes too numerous to mention here... this is some rouch, cheap and nasty code!

Perhaps, once I get all this done I will attempt to get it officially released into some distros. I think it's a useful application, and the kipi plugin version doesn't seem to be moving along much. Yes, I realize that I'd be better off spending my time improving the kipi plugin, but to be honest I can't be bothered right now - this was a learning experiment for me as much as it was about making an application that solved one of my problems.

The entire application is written in C++ and Qt4. The more I use Qt the more I like it. This application was simplicity itself to make, and I look forward to continued development.

On C++ programming IDEs

I've been doing a bit of programming work under Linux for the last few days, and I'm very disappointed with the selection of integrated development environments on offer. Read on for my complaints.

First though, a bit of history. I usually write code under Windows for my job. I use Microsoft's visual studio 6. For those of you who haven't tried it, compiling code with the VS6 C++ compiler is a bit like pulling teeth. For example, Microsoft thinks that the following is perfectly valid code:

for (int i = 0; i < 10; i++);
printf("After loop, i = %d", i);


However, The scope of the variable "i" is limited to the contents of the for loop (in this case it's en empty loop), and so shouldn't be available to the printf line. This becomes even more painful when you want multiple for loops within a function, and you want to be able to use the "i" variable for each loop. Under windows, you can do this:


for (int i = 0; i < 10; i++)
{
// do something
}


for (i = 0; i < 10; i++)
{
// do something else
}


Note that I don't need to re-declare "i" in the second loop, since it already exists? If you try and compile this code under a compiler that observes the C++ standard, you'll get compilation errors. So, how do you turn this into cross-compiler code? AFAIK the only way is to use a second variable inside the second for loop, OR to wrap each for loop in it's own additional scope block, like this:


{
for (int i = 0; i < 10; i++)
{
// do something
}
}

{
for (int i = 0; i < 10; i++)
{
// do something else
}
}


However, I digress from the true subject of this post. For all it's compiler digressions, the user interface actually isn't that bad. Sure, the toolbars seem to move to random positions on your screen every time you debug a project. Sure, you can't use it on a second screen because all the tooltips draw themselves on the first screen, and yes, if you want decent code completion you need to use a plugin like visual assist X, and no, there's no code folding either. But apart from all that, the UI is just right. It's not overcomplicated, it's easy to use.... simple!


So, let's look at KDevelop, KDE development environment. I have several problems with it:

  1. Code completion requires the user to jump through waaaay too many hoops. As far as I'm concerned it should be turned on by default, or, if that ruffles too many feathers, have one checkbox to turn it on. I shouldn't have to root around in the KDevelop settings, and project settings, add the library include directories I want to use for the project, exit KDevelop, install ctags, re-load project, tweak settings, and then find that code completion is actually not that brilliant.
  2. The User interface is way too cluttered. Many of the menus are so full of entries that they cascade off the bottom of my screen. There are so many toolbars and sidebars that I can barely see my work. Many of the sidebars don't even work properly! The documentation sidebar seems particularly useless. I could probably find out what I have to do to get it going, but my point is that it should work out of the box! When I fire up KDevelop, I want to write some code, not mess about with the environment.
The best development environment should be completely transparent to the programmer. OK, so none of the IDEs I've used to date achieve this, but a man can dream, right?


In the mean time, I'm going back to my old IDE: Kate, with the scons build system, activated from the console, and gdb as a debugger. What more could you want?