[gtkmvc-users] Regarding a previous discussion about GConf
Brought to you by:
cavada
From: Steve M. <smc...@gm...> - 2010-06-15 01:01:43
|
> Hi, > desktops like Windows, the Mac, and Gnome provide a key/value storage for user settings. Applications can request notification of external modification of their preferences. GTK does not abstract that functionality. > > I found two independant implementations using gtkmvc on Gnome, so there is demand for support in the framework: > http://github.com/bouvard/nostaples/blob/master/utils/state.py > http://bazaar.launchpad.net/%7Esmcgrath23/gvoicebox/trunk/annotate/head%3A/gvoicebox/models/prefs.py > > The most flexible way might be an Adapter class. Using a special Model class like gVoicebox means that either all or no properties of a particular model have to live in GConf. Nostaples works around that by explicitly replacing the setters for some properties. Our SQLObject persistence works similarly, using a metaclass for prettier syntax. > > Whatever we do, it should be easily replacable with a mock or dumb file implementation to support other environments. I am constantly annoyed by Glade not remembering how I want the sidebar on the Mac... > > Outside modification (e.g. using gconf-editor) can introduce bogus information. Schemas don't prevent that. gVoicebox ignores the problem, Nostaples checks against an internal list of possible values (not just types). Currently gtkmvc does not support validation. > > Opinions please :) Just for the record, my implementation of GConf (Second link above) should definitely not be used by anyone with a history of high blood pressure, mental illness, or seizures. I looked at it today intending to re-use it in another pygtkmvc application, and it gave me heartburn. I agree that having a sane GConf model included in pygtkmvc would rock. My implementation rapidly de-generated into a horrible mess, relying on several layers of mapping between properties, GConf keys, and their value types. It was my intention to whip this into shape, and hopefully have a drop-in module that could use GConf under Gnome, the Windows registry on win32, and flat files or perhaps sqlite on other platforms. Also, on a not-quite-related note, I've been using the gtkmvc-application template for Quickly, and I am so happy that it exists. Regards, -Steve McGrath -- If it ain't broke, you're not using a new enough version |