Sunday, September 21, 2008

All About the DeskPanel

I try my best to make the commandment about keeping the Sabbath day and make it a day of rest, doing stuff that I think is fun and/or relaxing. Even though it takes significant effort and energy, writing code is one activity that fits -- it's fun and I enjoy it. My wife and my son were sick today, so I stayed home from church and kept things going. I did have some spare time that I threw at the DeskPanel, too. What did I accomplish? The running app list works properly except for doing drag and drop on program entries to open them and some more problems with layout have been fixed. I also whipped up a quick shutdown / restart window to go with the Quit item in the Computer menu (see screenshots from last post). I don't have a shot handy of the shutdown window, but it looks pretty decent and is reminicent of the logout window that Xfce4 uses. I removed some quick-and-dirty hacks in favor of some proper code. The last thing I did at the end of my coding run this afternoon was shut down my machine using the DeskPanel. It felt good.

The DeskPanel has been probably the most complicated piece of code I've worked on since my app_server days. There are some sections of the Deskbar's code that work some BeOS black magic and other parts that are not so pretty. BNavMenu is one massive class. It's what gives us those wildly-convenient navigational menus accessed by right-clicking on a folder in Tracker. It's also the code that powers the Deskbar's Applications and Preferences menus. The nice part is that it wasn't too difficult to unbolt certain important sections of code and place them elsewhere for the reorganizational part of the DeskPanel.

Some of you may be wondering what the big deal about all the effort I'm putting into this extended-from-summer project. It's all about organization and simplification. At the risk of being boring, allow me to go into some details about some of the new tricks it does.

First of all, there is the Programs menu, the first of the three screenshots from the last post. Gone are the days of "one menu to rule them all." The only thing you'll find in this menu are programs. I added a permanent Run Program item which could easily one day turn into a swiss-army knife command prompt that you could type in stuff like map "1313 mockingbird lane, schenectady, ny, 12345" and do a Google Maps lookup on the address or define grace and get a lookup from an online (or offline) dictionary. As for the actual program shortcuts and the categories in the Programs menu, it's a case of smoke and mirrors. The main menu is a listing of /boot/home/config/be/Programs, but the items in it are queries for the category attribute. This attribute is a new indexed attribute which is used for Programs menu entries. Tagging an application with a particular category suddenly adds it to the menu under the appropriate category. The actual category entries are just saved queries with custom icons to make them look nice. I think it works quite well, and unlike the current situation with the Deskbar, there are no symlinks to break. You can even add a folder to the list simply by tagging a folder with the appropriate category.

The Computer menu is pretty straightforward -- items related to the system in general. I'll probably be renaming About this System to About Haiku (or BeOS or Zeta, as appropriate) and adding an item named About this Computer to fire up a small, relatively simple system info app (like a less-technical version of BePCInfo). I've mentioned the System Settings app started by the Computer menu item of the same name -- a launcher for the various preferences apps in the same vein as the OS X system settings app, but without the resizing and the Back button. The Quit item removes the "Are you sure?" messages that exist in Haiku right now without having accidental reboots and shutdowns that can happen in R5 at the moment.

I personally think the Bookmarks menu is really, really convenient. All your NetPositive bookmarks can be accessed with a couple of clicks, you can add bookmarks just by dropping items on the Bookmarks button, and organizing them is as simple as file management. The Recent Documents / Folders / Applications menus are still there and as useful as ever. This menu is one feature that makes me wish the DeskPanel were ready to replace the Deskbar right now.

The other stuff is in a state of change, but not in a bad way. The running programs list, now that it is debugged, works just as well as the Deskbar's except for two things: you can run so many programs that not all of them are visible in the list and, as I mentioned before, you can't open a file by dropping it on an entry in the list. I'm still working on a good solution to the first issue and the second is just incomplete code, so no big deal. There are other things that should be attended to before release, such as the preferences app for the DeskPanel other little things. I also need to formalize the way that add-ons are added to the Deskbar. Right now, they're all hard-coded, but the addons themselves are written in a way that they can be added and removed on the fly.

Overall, a lot has been acccomplished on the DeskPanel, but there is still quite a bit to do. Instead of just having an incomplete and/or buggy demo, I'm going to give it a good solid go and make a proper app. It'll take longer, but it'll be worth it. While it will be quite a while before a stable R1 is released, if I have anything to do with it, when it finally arrives it'll be possible to create a tricked-out R1 install that will be pretty sweet and a usable, productive, and free environment for people to work with.


  1. ok, i want remind you only the importance of serach bar, in kde and winodws vista, that search bar are so much useful, the search interfaz on all the graphic system are very powerful tool.

  2. Hey...Schenectady?! Thats where I live!