> I've done this by having an abstract settings class and two > implementation (GConfSettings and PlainfileSettings). Based on the > configure run that checks if gconf is available or not, the > respective subclass will be used. The plainfile settings can > e.g. use the ini-file routines of glib.
I've wondered about things like this from time to time. I use the full Gnome environment on my desktop, but the programs I write rarely need Gnome. Most of them are little handy utilities that I pop up from time to time, or that just sit there minimised in the taskbar for when I want them. Certainly nothing that requires the full weight of Gnome dependancies. However, a few of them could do with stashing a few settings in a config file, such as the suggestion above. But I'm uncertain exactly how to write a program that will use gconf if it exists, but not fail if it doesn't. Then there's the various Gnome settings which are supposed to affect the look and feel of a Gnome app, some of which may be relevant to a GTK-only app also. Gnome provides a few extra widgets that aren't neccesary, but would be nice to use if they're available (doesn't Gnome provide a nicer file selection dialog?). And so I'm wondering if anyone knows a general solution to writing a program that; a) will decide at run-time, whether to use Gnome components, and won't fail to run if they're not actially installed on the system. b) can check whether gconf or other components are running, and only use them if they are (rather than starting up the whole gconf system). Fredderic _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list