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.

Monday, September 15, 2008

Can't Leaf the Area Very Easily

For those following the events in U.S. weather, the midwest was hit with a major windstorm last night -- gale force gusts, to be precise. It's amazing how loss of power puts everything into perspective, even if it's only for a few hours. I needed a good reminder to keep me grounded in what really matters. In retrospect, I count myself very much blessed. The worst of it was about 24 hours without Internet access, which was quite annoying, about 4 hours without power, and a bunch of branches and leaves in my back yard.

Others were not nearly so lucky. The street I live on, for example, is currently a detour for a major state route that has a huge fallen tree across it. I'm also quite glad I don't subscribe to the digital phone package that Time Warner pushes alongside its RoadRunner service. Both my in-laws and some very good friends of the family were not only without power, but also without a source of communication by not having a cell phone or a landline. Over 450 school districts -- not schools, but districts -- were closed for today.

Over 230 schools were closed in my area , including my own, so I had an unexpected -- but nonetheless welcome -- day off. With my newly-found spare time, I spent the morning hacking on the DeskPanel, the proposed R2 retooling of the Deskbar. Progress? Igor, it's alive, I tell you. ALIVE!! HAHAHAHAHAHA!! Well, it's certainly comparable to Dr. Frankenstein's monster -- the sources aren't exactly pretty. Then again, the Deskbar's sources wouldn't have won any beauty contests to start with. *shrug* Anyway, the changes are more evolution than revolution -- more reorganization and some minor improvements here and there. While it's definitely a work in progress, I finally have some eye candy for all of you. I won't comment on them, but with the cat out of the bag on the last of my summer projects, I should be publishing the revisions I made to my desktop RFC in the next day or so.

Saturday, September 13, 2008

Filer 1.0 Beta 3 is *Finally* Out the Door

Yep. It's out at last. This is the version that's been sitting on my hard drive for the last three weeks while I've been trying to keep up with the usual massive changes to my life that occur when I go from summer break into the school year. It was quite a pain because I wanted to redo the icon for the app in addition to coming up with icons for the AutoFiler and its settings app.

Normally I try to have fun with icons for my apps. The fortune cookie I used for Fortuna and the Metroid-inspired icon for Seeker come to mind when I say this -- they were fun to create, especially Seeker's. The Filer and the DeskPanel projects are supposed to be system-level applications, so the icons really should follow the isometric perspective like the rest. Unfortunately, isometric icons are a pain in the neck to draw. Oh well.

The big feature to this release is the AutoFiler that I just mentioned. Karl vom Dorff (of Haikuware fame) suggested a daemon to automatically file items in certain folders. Hazel, the app which I used as inspiration for some of the features for the Filer, requires a folder for each rule. I didn't want to have this requirement, but having it as an option makes the Filer more useful than before. The main use I see for it is for a downloads folder. Point the AutoFiler at your browser's download folder and set up rules for your files. Here's an example rule:

Name ends with .zip
Terminal command... unzip %FULLPATH% -d /boot/home/Desktop
Move it to the Trash

The part that I also see could be really cool is if I managed to get the program bundle code working properly under R5, you could conceivably install programs with literally one click -- your browser downloads the bundle, the AutoFiler invokes the Filer on the download folder, and the Filer installs it. One click. Now that's ease of use.

Monday, September 8, 2008

Still Busy and Still Hacking

The school year is in full swing now... the third week of school already, and the last two went very fast. There hasn't been as much code as I would like, but it can't be helped. This year is quite different because of the move my school is making to a new, multimillion dollar facility, which, when it comes to schools, isn't really saying much. I was supposed to be teaching Band at the new building and Computers at our big campus in Columbus, but enrollment was down, so I'm doing custodial work. At first, I didn't really like it much, but it's growing on me. It used to be that I just fixed computers around the building, and now I fix other stuff, too. My wife and I work a cross between first and second shift, so it's been quite a lifestyle adjustment for the family. I've started to get the hang of it, so I've been able to make the non-work part of my life fit in again, like code.

I've got a new release for the Filer pretty much ready to go out the door. It's been held up for a while because I haven't had time to get it packaged up and handle the inevitable busyness -- in a good way -- that follows a release. I'm still hacking away at the new Deskbar, tentatively titled DeskPanel. It's been a real pain in the neck. I slapped together some icons that, while not my best work, look halfway decent. The layout code has been a real problem. I walked away after 3 hours of fighting with it. I also cleaned up some of the interface-related code that handles the Programs menu, but most of the time was spent on layout. A major pain. Hopefully, I'll have more good news to relate next time. TTFN.