Nate Lowrie wrote:
> On Feb 16, 2008 4:43 PM, Michael Hipp <[EMAIL PROTECTED]> wrote:
>> johnf wrote:
>> I take it the preferences are stored in a "special" database table for
>> that purpose?
>>
>> Are there any docs on how to set this up and include it in an
>> application? Or example code? The wiki doesn't seem to know anything
>> about it.
> 
> Michael,
> 
> Preferences are stored in a standard fashion across Dabo.  The first
> thing you must know is that all applications must have a base
> preference key.  This key allows you to store preferences for multiple
> applications without them interfering with each other.  The dApp
> object has a property, BasePrefKey. It gets set to a string key that
> you want for you app.  Set it before you do app.start().  Example is:
> 
> app = dabo.dApp()
> app.mainFormClass = MyMainForm
> app.BasePrefKey = "MyApplicationKey"
> app.start()
> 
> Now you are all set to start storing preferences.  Each dabo object
> has what is know as a PreferenceManager.  It is a dPref object that is
> set to the BasePrefKey.  The preference manager has several important
> functions: addKey, hasKey, deleteAllPrefs, deletePref, getPrefKeys,
> and getPrefs.
> 
> You can use these to set pref keys.  Or, you can do it the quick and dirty 
> way:
> 
> self.PreferenceManager.MyPrefKey = "MyStringValue"
> 
> Now, if you do self.PreferenceManager.hasKey("MyPrefKey"), you get true.
> 
> This is just scratching the surface but should get you started.  Dabo
> has a standard preferences dialog that might be of use to you as well.
>    I didn't liked the way that it looked, so I rolled my own.  If you
> do an svn checkout on "https:svn.thewidgetfoundry.com/skyline/" you
> should be able to find examples in there of it.  Contact me off list
> if you can't get that to work...

Thanks. That's good stuff. I ran some of the apps in your Applications 
directory. I like the resistor color coder.

It took a while to figure out that where the prefs are being stored - 
evidently in username\Application Data\Dabo\DaboPreferences.db as an 
SQLite db.

Any difficulty in storing that in my "main" Postgres database as a 
certain table? Some settings I need would be particular to the user but 
many would be system-wide.

Michael



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to