Wednesday, December 29, 2010

This is Photobomb


The last couple of days I made some good solid progress on Photobomb:
  1. Refactored items on the goocanvas into PhotobombItems to make changes easier, and code easier to maintain.
  2. Fixed the Gwibber tab to pull images from the Gwibber sqlite database.
  3. Removed Python threads from throughout the application while keeping the UI from freezing during long running actions (thanks gobject.idle_add!).
  4. Added a "download-error" event to UrlFetchProgressBox and handled download errors better.
There are still a few things I want to get to, but I am making steady progress.

Anyway, I was talking to some folks about Photobomb, and they kept referring to it as an "Image Editor". To me, and image editor is used to open an image, modify the image, and save the image. Photobomb is decidedly not that! Photobomb integrates with your social desktop, allowing you to mashup images from your devices, the web, your feeds, and your web cam. Photobomb also lets you share those mashups into your feeds. So, it's a social app.

Here's a 5 minute video I made to try to help explain Photobomb ...

Monday, December 27, 2010

New Personal Goal: Photobomb for Natty


I'm on holiday for the next week, yeah! I've started filling some of my free time by resurrecting Photobomb (again). There have been some technical improvements to the APIs I've been using, and also, I've learned some ways to do a few things better. I'm hoping that by spending a few hours a day, I can pretty much complete Photobomb by the end of this week, and then work on getting it into Universe for Natty.

Things I accomplished so far:
  1. I fixed the WebcamBox quidget so that it doesn't hang if you try to tell it play when it hasn't been realized. The effect of this is that I can put the webcam tab on the end of the tabs, much nicer.
  2. Then I went on to complete how the UI is organized. I want Photobomb to work really well on netbooks running Unity in Natty. Since I started Photobomb on Lucid, apps have gotten slightly less horizontal space but more vertical space. I moved the toolbar from the right, and added it as a tab on the left. Even when making the tabs wider, this reclaimed lots of vertical space.
  3. I added delete and duplicate! So now you can delete or duplicate the selected item. I was going to add cut, copy, and paste, but I think delete and duplicate works better for this app.
  4. When I started Photobomb, I simply created GooCanvas items like goocanvas.Imate, goocanvas.Path, and goocanvas.Text. Each of these types of items interact with different parts of the toolbar slightly differently, so there were lots of places in the code where I had to use code like "if type(self.selected_item) == goocanvas.Path:". Whenever I find myself type checking, I know that subclassing is in my future. Also, goocanvas.Items only let you write to their opacity properties, so for the increase and decrease opacity functions, I've been tracking opacity externally, in a dictionary, rather than as a property on the items. Refactoring was clearly in order before I continued to add features, so I created photobomb_item.py, and added PhotobombImage, PhotobombPath, and PhotobombText, then implemented common properties on each. It was only after doing this that it was reasonable code factoring to create the duplicate function. I'm not quite done this part, though.
Here's a quick video showing the new layout and the duplicate function in action:


There's still a lot on my Todo list before I'll consider Photobomb ready for general availability.
  1. Complete the refactoring into PhotobombItems. This will drag me into my first experience with multiple inheritance in Python. I think that it will be simple for this particular application. Every PhotobombItem will derive from PhotobombItem to pick up common properties and functions, but also from the appropriate goocanvas.Item (Image, Path, or Text for now). I'll probably do this one next, as I will use that to fix the opacity controls.
  2. I want to move common editing commands into their own toolbar which is always available. The new found vertical space from Unity provides this luxury.
  3. I use Python threading code in directory tab, and also the web tab. Python Thread code is notoriously difficult, and indeed, there are a number of hangs or situations where Photobomb doesn't quite quit all the way due to threads running and colliding. I will replace threads with a combination of UrlFetchProgressbox, and gobject.timeout_add. In fact, I am considering creating quidgets to handle common asynchronous activities that I have mistakenly used Threads for in the past. Depending on how it goes, I may create DirectoryScannerProgressBox, DictionaryScannerProgressBox, XMLScannerProgressBox, and JSONScannerProgressBox. I would intend for these to work in very similar ways, but make it super simple to perform long running tasks without blocking the UI or resorting the Threads.
  4. I will change the Gwibber page to use libgwibber, and also the poster button to use libgwibber.
  5. I'll make the webcam tab present the webcam image on a button instead of using a separate button. This will be more consistent with the other tabs.
  6. I want to add an undo/redo stack (which should be lots easier after I'm done with the PhotobombItem refactoring).
  7. For the toolbar tab, I didn't really do any code refactoring, I just grabbed the table of buttons, removed them from the main window, and packed them into the tab. I should really do a proper job of making the toolbox into a proper widget that rips signals. In this way, the UI will become much easier to modify in the future, and generally the photobomb code will become reusable.
  8. Since Photobomb has no preferences, I may as well remove the preferences code. All it does it start up desktopcouch and then not use it.
  9. Finally, the global menu means I can add in a menu bar without sacrificing any vertical space. This will have a few benefits. It will mean users can access the toolbar functions without changing to the toolbar tab, it will be way easier for me to add key commands for the functions, and I can add certain functions only to the menu. For example, the export and microblog commands may be better hanging out on the file menu, rather than be part of the toolbar.
If you want to play with latest Photobomb, get it from trunk.

Friday, December 10, 2010

Hot New Quickly Template Features

The Quickly Ubuntu Application template for Natty has cool new features already. Here's a couple of videos to highlight these changes.

Here are some changes contributed by Mike Terry. What he's done is:
  1. Reduce the code in the generate boiler plate down to about 65 lines. This makes it a lot easier to hack on and maintain.
  2. Make it so that you don't have to use the builder to access widgets that you've added in glade. Instead of "self.builder.get_object("entry1").set_text("hi"), you can just do self.ui.entry.set_text("hi"). In other words, Quickly just knows.
  3. The third thing demoed here is the new auto signals feature. Instead of picking a signal handler name, and defining it in Glade and in your code, if you follow some simple conventions when you name your function, Quickly will just know it's a signal handler, and it will work.




In this second video, you can see the much much much improved preferences system contributed by Tony Byrne. By following some naming conventions, and adding 2 lines of code, you can persist and access user settings with ease.

Alpha 1 Unity Checkpoint


While attending a sprint this week, I've gone ahead and updated my Dell mini 10v to Ubuntu 11.04 Alpha 1, and also took some updates on Tuesday.

I have to say, I am finding Unity to be running really really well on this computer. I can use the spider diagram to provide a more structured description to what I think is going well, and also, how far we still have to go before we have a shippable product.

Up
  • Launcher Appeal (6-7): The Launcher looks a lot nice n autohide mode.
  • Launcher Functionality (3-6): Significantly improved now that the launcher includes autohide and quicklists allow me to pin and unpin apps to the launcher. It's still too hard to use with workspaces, but code for that landed this week, so next week, I hope to pop this up to 7! Jason is absolutely rocking the Launcher functionality.
  • Application Window Management (5-6): Little tick marks in the launcher items show how many windows are open. Meta-W shows all the windows in a workspace. I think they should add an item for Meta-W to the launcher. That would make it really easy and discoverable to find your apps.
Down
  • Indicator Quality (6-4): Starting this week, there has been these times when the indicators stop responding to mouse clicks, or become don't activate for a really long time.

Unchanged
  • Launcher Performance (8): The launcher is even faster on my Dell mini 10v than on my desktop at home. I assume this is because I use a computer with a shared memory graphics chip (i965) for my desktop, but with a large screen. So the combination laptop graphics chip with desktop screen is not ideal. However, it's still plenty fast and snappy on my desktop. I'm tempted to pop this up to 9, but I want to see how it's working for folks with proprietary drivers first.
  • Application Launch Time (8): Nothing seems to have changed here.
  • Everything dash related. I could pop up Find and Launch apps since they tied the Ubuntu button to the Applications directory as a temporary measure until the dash is ready. However, I think I'll just wait until it's their real deal.
  • Indicator functionality hasn't changed, expect I hear there is code in trunk to bring back keyboard access and navigation! This has been a real productivity killer for me, so I can't wait until next week.
  • Global Menu Integration. However, I hear that there is a team working on Mozilla/Unity integration. I'll also be looking forward to when they can turn the shotwell menus back to the global menus.

Thursday, December 2, 2010

Log those Unity Crash Reports!


Natty Alpha 1 is baked and available!

This alpha is exciting to me because the Unity Launcher is already pretty usable. I'm using it daily, and am already addicted. The move to the new compiz has really really sped things up. Of course, I can't recommend to an average user that they rely daily on alpha software. This is fresh code, and it stresses more fresh code in the graphics stack. This means crashers.

However, you don't have to be a hacker to really help get Unity into shape stating right now. A great way to help Ubuntu and the Unity team right now is to get them as many crash reports as we can, so they can these issues fixed asap and move on to adding those features we are so much waiting for.

Way 1: Tonight, before the packages get updated, run Ubuntu Alpha 1 from a live session when it become available. If there are crashers, Apport, the crash report system, will kick in and help you log crash reports easily. If you can't get to it right away, no problems, but you'll want to use the current daily build to make sure you are testing up to date packages.

Way 2: Install Alpha 1 on a test machine. Enable Apport, and start upload crash reports when there are crashers. It's really easy to do, instructions are on the wiki. If you go this route, you can update daily and help by reporting new crashers as you encounter them.