Goldenseal Pro Progress: Resources (Mar 23)

Goldenseal estimating and accounting software is built from three components. There is C++ source code that runs business functions and the user interface. There’s construction accounting and estimating data in the starter files. And in between, there are resources: text, layouts, icons and other program details.

The source code is compiled into machine language, with no easy way to see it. The estimating data is totally visible and easy to change. Resources are in between.

In the original Goldenseal for Mac, resources were built into the app file. Anyone could use an app called ResEdit to change them. One user actually converted all the text to Spanish. Other changes were possible if you hacked the right resources. Sadly, ResEdit never made it out of Mac OS 9. It was still possible to hack Goldenseal while it ran on PPC Macs, but the switch to Intel zapped all user access to resources. Meanwhile, the Windows version never had resource access at all.

We are still trying to figure how best to handle resources in Goldenseal Pro.

These days, the Mac hides resources inside what’s called a package or bundle. You can see the resources for any app: just right-click on the icon and choose Show Package Contents from the menu. Early on we wrote temporary code that exported all the resources out of the current Goldenseal, and into the Pro version. Those resources were in the bundle, and user accessible.

Apple really likes XML as a way to store data (it’s similar to the HTML that builds web pages). We tried XML at first, but didn’t like it. The text is hard to read: stuff like <tag><anothertag>blahblahblah</anothertag></tag>. Just one wrong punctuation mark, and it crashes. So, we switched everything to plain text. It’s easy to edit in Excel or TextEdit, and reads are 10x to 100x faster.

Qt also manages resources. It wasn’t hard to re-use most of the existing stuff when we switched over. Unfortunately, Qt hides them somewhere. If you open the app bundle, they aren’t visible. There may be some way to make Qt resources act more like Cocoa, but so far we haven’t discovered the secret.

It may be a moot point. Apple has toughened its security: to run Goldenseal Pro on newer Macs we must jump through hoops to guarantee that the app comes from a legitimate source. That probably means that users can’t hack app resources any more. The changes will be considered a security threat and it just won’t run.

We could store resources and other data outside the app bundle, but that makes installation and updates more difficult. Having just two things to keep track of (app and company file) is simpler for everyone.

Aside from the Goldenseal app, there is also your own accounting data, stored in your company file. One of the first things we wrote was a translator which converts existing Goldenseal files into Goldenseal Pro format. It even makes a few improvements along the way.

There is one piece of data that gets lost in the move: pictures. The current Goldenseal stores them in an obsolete format (PICT) which neither Cocoa nor Qt support. Fortunately, there are websites that convert PICT files to .jpg, .png or whatever. When we launch the Pro version we’ll provide links and instructions so you can salvage any pictures you may have stashed away.

Dennis Kolva
Programming Director

Author: Dennis Kolva

Programming Director for Turtle Creek Software. Design & planning of accounting and estimating software.