On Jun 27, 2007, at 6:22 AM, Simen Haugen wrote:

> dApp contains both UserSettingProvider and PreferenceManager. What is
> the intended difference between these two?

        UserSettingProvider is the class that is used to handle the  
persistence of settings. Normally you never use this, but if for some  
reason you wanted to use your own class for this, you would change  
this (well, you'd actually change UserSettingProviderClass) to your  
custom class.

        PreferenceManager is a property of all objects in Dabo, and provides  
a way for each object to persist itself if needed.

        Originally Dabo used an INI-style text file for storing preferences;  
with the 0.7 release, we switched to an SQLite database for this.  
None of the code that was written had to be changed, since we just  
changed the setting in dApp, and the rest "just worked".

        In practice you will probably never need to use any of this. The  
intended programmatic interface is to use  
self.Application.setUserSetting("mySetting", "someValue") to store  
'mySetting', and self.Application.getUserSetting("mySetting") to  
retrieve it.

> Also, the api says dApp contains PreferenceDialogClass, but it don't.

        It does indeed have that property; it's just None for now. You can  
either provide your own code by adding an 'onEditPreferences' handler  
to that form, or by creating a generic pref dialog class that is used  
throughout the app. Here's the onEditPreferences handler in dApp:

def onEditPreferences(self, evt):
        try:
                self.ActiveForm.onEditPreferences(evt)
        except:
                if self.PreferenceDialogClass:
                        dlgPref = self.PreferenceDialogClass()
                        dlgPref.show()
                        if dlgPref.Modal:
                                dlgPref.release()
                else:
                        dabo.infoLog.write(_("Stub: dApp.onEditPreferences()"))


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
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