To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dev.macOpen lugnet.cad.dev.mac in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / Macintosh / 521
520  |  522
Subject: 
Re: Central location for LDraw prefs
Newsgroups: 
lugnet.cad.dev.mac
Date: 
Sun, 7 Sep 2003 04:47:50 GMT
Viewed: 
1938 times
  
In lugnet.cad.dev.mac, Don Heyse wrote:
In lugnet.cad.dev.mac, James Reynolds wrote:
How about org.ldraw.mac.folder or something?

Are there other settings that should be global for all LDraw applications?

The latest version of ldglite will come with a script to update
the ~/.MacOSX/environment.plist file with the LDRAWDIR setting.
See here for details.

  http://developer.apple.com/qa/qa2001/qa1067.html

If you want to test the script before the release, I'm sure Tom
could email you the current version.

Dang.  So already there has to be 2 locations: ~/.MacOSX/environment.plist, and
Library/Preferences/*pref name*

That is ok.  What if we all agree that if our app changes the ldraw directory,
it will change it in both places?  Same with the script.

Eventually, that is.

That's a reasonable goal.  We made some similar progress recently in
Windows with the ldraw.ini file.  So, where is the Library/Preferences/*
usage documented.  I don't know anything about it.  Could you point
me to a document like qa1067.html that spells out how the information
is stored/retreived from there?

By the way, how do you feel about /Library/ldraw/ as the default
location for the ldraw directory?  As of version 1.0.11 ldglite
looks there by default on OSX if it's not told otherwise.

These two pages discuss everything you could want to know.

http://developer.apple.com/documentation/MacOSX/Conceptual/SystemOverview/SoftwareConfig/chapter_11_section_4.html

http://developer.apple.com/documentation/Cocoa/Conceptual/UserDefaults/

The preferences format:

The most common preference file format is an xml file with the file extension
".plist" with this DTD:
http://www.apple.com/DTDs/PropertyList-1.0.dtd

I propose the code to be:

        <key>LDRAWDIR</key>
        <string>/Library/ldraw</string>

Or exactly:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>LDRAWDIR</key>
        <string>/Library/ldraw</string>
</dict>
</plist>

This file can be saved at:

~/Library/Preferences/org.ldraw.ldrawdir.plist (for the current user only)
/Library/Preferences/org.ldraw.ldrawdir.plist (for all users of the computer)

The default permissions for /Libray/ is:

drwxrwxr-x   34 root   admin

The default user is in the admin group, but any non-admin user, like kids who
use their parents' computer or users of a computer lab, is not in the admin
group.  So the ldraw folder and a global preference file may not be writable.

So perhaps applications should check /Library and ~/Library for both ldraw dir
and org.ldraw.ldrawdir.plist.  So:

/Library/ldraw
~/Library/ldraw
/Library/Preferences/org.ldraw.ldrawdir.plist
~/Library/Preferences/org.ldraw.ldrawdir.plist.

What do you think?  Is this too much trouble?

James



Message has 1 Reply:
  Re: Central location for LDraw prefs
 
(...) Unless I'm misunderstanding, I think you would be much better off if you drop ".ldrawdir" from the plist filename above. That way the file can contain other settings in the future in addition to the LDRAWDIR setting you have now. Or put (...) (21 years ago, 7-Sep-03, to lugnet.cad.dev.mac)

Message is in Reply To:
  Re: Central location for LDraw prefs
 
(...) That's a reasonable goal. We made some similar progress recently in Windows with the ldraw.ini file. So, where is the Library/Preferences/* usage documented. I don't know anything about it. Could you point me to a document like qa1067.html (...) (21 years ago, 7-Sep-03, to lugnet.cad.dev.mac)

18 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR