Wednesday, 12 August 2009

Echo New Icon GTK Ready

I've finally got the design from my previous blogpost implemented. Writing gtk applications in ruby is as fun as in C, but making the widgets behave (especially in terms of positioning/size) as I'd like them to seems unbelievably hard. My workflow was this time a bit different from usual, as I was just adding the widgets one by one, with the help of glade researched what to set and how in order to be where they are and when the layout was ready implemented the signals. LOL, the result file was, despite being only 150 lines long, pretty hard to read. >_< So next step was to properly outline the program design – most importantly I've prepared myself a diagram with widgets relations – and implement it. Of course, the source is now much more readable, but also a bit long – not counting the licence at the start, it's about 240 lines.

Next I was thinking what is the best way to present it to user. Burying it in menus is suboptimal, having to launch it by hand isn't exactly useful as well, but adding it to nautilus' pop-up menu (just like e.g. nautilus-open-terminal extension does) feels about right. The problem is, of course, that nautilus extensions can be written either in C or python, but my app is in ruby. The decision what do wasn't hard – writing ruby bindings to nautilus extensions is out of my league and I'd like to keep all the echo-artist scripts architecture independent if possible, so I went with python. I'd say I like ruby more, but at the same time I must emphasize that making conclusions based on 40 lines of code is out of question :-) The nautilus extension is available in git as well. Now, I've prepared packages for people who want to start using it already at put them in my fedorapeople space because I don't want to update the echo-artist package in Fedora repos until it is in good enough shape.

I've prepared a short screen-cast to showcase the new functionality:

Download the video to see in your favourite video player.

2 comments:

Thomas said...

Nicely done, but why the extra "has been created" dialog and not simply return? Maybe selecting the just created file.

nicu said...

When embedding clips using the HTML5 VIDEO tag I prefer to add the controls attribute, this way is more obvious you embedded a clip not a static image - if the clip is short and displayed in a very large page, like Planet Fedora, until you get to it the playback ended and what you see appear to be just a PNG.