Solipsism Gradient

Rainer Brockerhoff’s blog

Browsing Posts in Travel

Also, yikes. 26 days without posting! I plead temporary insanity brought on by tax filing time, and Twitter – the latter being a more convenient outlet for short links and thoughts.

Anyway, taxes are filed and we’re now having a short working vacation in the hills of Petrópolis, an old town north of Rio de Janeiro. Dorinha is taking a short English immersion course (excellent BTW), and I’m coding again, yay!

I’m patching up some loose ends in Klicko in preparation to cloning its preference panel for the next version of Quay, as I’ve mentioned before. While doing that, I’m also trying to refactor my code into a tighter and more readable form. Some of that might be interesting…

For instance, the automatic update checker has a dialog button to “Open System Preferences” and this should go to the Klicko preference panel. Now, System Preferences may already be running but with another panel selected; in any event, the Klicko panel should be opened and ready for the user to see update details. There are several ways to accomplish this.

Most people probably will consider, at first, writing an AppleScript to open System Preferences and then select the Klicko preferences panel. This is unnecessarily complex, and I’ve looked at several solutions. The simplest one-liner to do so from Cocoa would be:

[[NSWorkspace sharedWorkspace] openFile:@"/full/path/to/my.prefPane"];

There’s a non-obvious down-side to that: NSPreferencePane is generic and may be implemented by other apps for their preference plug-ins. Someone’s application might use it and declare .prefPane in its Info.plist. This would in my opinion be a mistake, in that double-clicking or running the code above might (or not) open that other app instead of System Preferences!

The solution I finally hit upon uses Launch Services to open the correct application with the preference panel, like this:

FSRef ref;
if (LSFindApplicationForInfo(0, CFSTR("com.apple.systempreferences"), NULL, &ref, NULL)==noErr) {
   LSApplicationParameters parms = {0,kLSLaunchDefaults,&ref,NULL,NULL,NULL,NULL};
   NSArray* args = [NSArray arrayWithObject:[NSURL fileURLWithPath:@"/full/path/to/my.prefPane"]];
   if (LSOpenURLsWithRole((CFArrayRef)args, kLSRolesAll, NULL, &parms, NULL, 0)==noErr) {
      // success!
   }
}

This code first finds the System Preferences app by its bundle ID, and makes a FSRef for it. The FSRef is then pointed to from the LSApplicationParameters structure, and passed to LSOpenURLsWithRole; this will run System Preferences if it’s not already running, and tell it to open the panel.

It’s tempting to pass the panel’s path as an argument inside of LSApplicationParameters. This does indeed work if System Preferences is not already running, but unfortunately it’s ignored if it is.

WWDC 2009

No comments

At first I thought I wouldn’t make it, but now I’m very happy to announce that I’m going to WWDC 2009.

I’ll arrive in San Francisco around noon on June 4th (Thursday), and will leave, also around noon, on June 16th (Tuesday). I’ll be glad to meet with anyone who’s interested…

More as it happens!

Week off

No comments

Early tomorrow we’re leaving for a short (6-day) trip to Tocantins, or more specifically, the Jalapão State Park.

It should be good to unwind a little from 2008, and I plan to bring back some good pictures. For the first time in several years, I won’t take a laptop; there’s supposed to be very little infrastructure at the campground. Hopefully the withdrawal symptoms will be mild… icon_wink.gif

Unfortunately, this means I’ll be unable to answer email, do product support, or even approve new users here at the forum. All will back to normal on the 16th, so please bear with me.

Travel updates

No comments

Oops. I just realized I forgot to update my travel maps. Here’s the current world map (44 countries visited):

and here’s zooming in on Europe (28 countries visited):

Re: Off we go.

No comments

Now at the train station in Kiel (Germany). In a few hours we’ll go back on the ship for the last leg of our trip, visiting Stockholm, St. Petersburg, Helsinki and Talinn.

Kirkwall and Lerwick were great and the Scots very friendly. I have over a hundred selected pictures ready to upload but little time to do all before coming back home. Hopefully at least a dozen will be up today. More anon.

Re: Off we go.

No comments

Typing this in an Internet café in Reykjavik, Iceland. Very nice town! Yesterday we’ve also been to Akureyri where we visited the thermal baths.

Everything’s going very well. Before going back to Kiel we’ll also look in briefly at Kirkwall and Lerwick in Scotland. Hopefully some more pictures will be ready for publication by then…

Re: Off we go.

No comments

Found a nice Internet café at Honningsvåg, Norway – the world’s northernmost town. Cold and windy.

Our Norway stops before this have been in Geiranger and Gravdal; both very beautiful places, at least in the summer. Tomorrow the ship leaves for Iceland (stops at Akureyri and Reykjavik) and then goes back to Kiel over Scotland (Kirkwall and Lerwick). More from there, I hope…

Update : I managed to upload a few more pictures from the start of our trip; no time to tag them properly or describe the location, though.

Re: Off we go.

No comments

Early tomorrow we go onto the ship (Costa Victoria). I’ll have sparse or no Internet connection there, so updates will be few and far between; sorry about that. More anon.

Photos licensed by Creative Commons license. Unless otherwise noted, content © 2002-2024 by Rainer Brockerhoff. Iravan child theme by Rainer Brockerhoff, based on Arjuna-X, a WordPress Theme by SRS Solutions. jQuery UI based on Aristo.