[Gtk-sharp-list] GConf replacement

Pablo Baena pbaena@uol.com.ar
27 Apr 2003 18:35:40 +0000


--=-HLzbzY/C2WYMpxq0v5fe
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Currently it is at http://gnomencoder.sourceforge.net. Beware that it is
very very new code, and not very tested (seems to work fine though, but
I didn't stressed it beyond the typical).

You can copy the base_types/ge_settings.cs and
gnome/ge_settings_glade.cs files and use them in your programs (I didn't
make them a separate dll because they're too small). Just try to update
them frequently as I'm cleaning them. If you have suggestions don't
hesitate to tell me about it.

Cheers!

On Sun, 2003-04-27 at 16:50, Martin Willemoes Hansen wrote:

> Sounds very nifty, I for one could use it. Hope you will distribute your
> class library.
> 
> On Sat, 2003-04-26 at 11:15, Pablo Baena wrote:
> > Hi! I told you some time ago that I was avoiding gconf because of a
> > few issues. Well, I finished some prototype of what I'm doing to
> > replace gconf# in my project.
> > 
> > The nifty thing works this way. First you define an interface like
> > this:
> > 
> > 
> > 	interface IMySettings 
> > 	{
> > 		[GeSettings.Property ("GnoMencoder", 
> > 				      "/dev/cdroms/cdrom0", 
> > 				      "DVD Device")]
> > 		string DVDDevice 
> > 		{
> > 			get; 
> > 			set;
> > 		}
> > 	}
> > The arguments of the attribute are: name of the app, default value and
> > description, respectively.
> > 
> > Then you pass the interface to a magic machine like this:
> > 
> > 
> > IMySettings mySettings = (IMySettings) 
> > 	GeSettings.Builder.Build (typeof(IMySettings));
> > Et voilá, you'll have a mySettings.DVDDevice to use as any other
> > property, only that any changes to it will be recorded in a XML file
> > on your home directory for future sessions, and all get operations
> > will retrieve that setting from said XML file (without you having to
> > know _anything_ about XML).
> > 
> > With this we avoided all the steps we had to make with gconf#, that
> > were:
> > 
> > * create a GConf schema (learn how to make one)
> > * run gconf-schemagen over it to create the class
> > * have root priviledges to install the schema
> > 
> > And there is more! With another class I created (it is apart so one
> > doesn't have to depend on gtk# for other uses), one can do this:
> > 
> > 
> > 
> > 	interface IMySettings 
> > 	{
> > 		[GeSettings.Property ("GnoMencoder", 
> > 				      "/dev/cdroms/cdrom0", 
> > 				      "DVD Device",
> > 				      WidgetName="dvddevice_entry")]
> > 		string DVDDevice 
> > 		{
> > 			get; 
> > 			set;
> > 		}
> > 	}
> > And, with this function:
> > 
> > 
> > IMySettings mySettings = (IMySettings) 
> > 	GeSettings.GladeBuilder.Build (typeof(IMySettings), gxml);
> > we'll have the property associated with the widget on the glade
> > resource, which will update the value on the Changed events and
> > display the value on Realized.
> > 
> > The classes are in a very very alpha state yet, and aren't optimized
> > in any way, so I didn't released them to the public. Anyway, the
> > quality is poor because they're 'inside use only' and it serves its
> > purpose for what I'm doing. If there is enough interest on making them
> > available independently, I can do the work. It only supports storing
> > string settings by now, doesn't monitor the settings for external
> > changes as GConf does and only supports Entry widgets, but that can
> > change, and I can do it without adding anything complicated to the
> > API.
> > 
> > Do you think I should make it releasable?
> > 
> > Cheers!
> > 
> > PS: I hate to reinvent the wheel, but I just don't like gconf. It is
> > good at what it does, but complicates something that should be MUCH
> > easier.
> > 
> > -- 
> > Pablo Baena <pbaena@uol.com.ar>

-- 
Pablo Baena <pbaena@uol.com.ar>

--=-HLzbzY/C2WYMpxq0v5fe
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.7">
</HEAD>
<BODY>
Currently it is at <A HREF="http://gnomencoder.sourceforge.net">http://gnomencoder.sourceforge.net</A>. Beware that it is very very new code, and not very tested (seems to work fine though, but I didn't stressed it beyond the typical).<BR>
<BR>
You can copy the base_types/ge_settings.cs and gnome/ge_settings_glade.cs files and use them in your programs (I didn't make them a separate dll because they're too small). Just try to update them frequently as I'm cleaning them. If you have suggestions don't hesitate to tell me about it.<BR>
<BR>
Cheers!<BR>
<BR>
On Sun, 2003-04-27 at 16:50, Martin Willemoes Hansen wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373" SIZE="3"><I>Sounds very nifty, I for one could use it. Hope you will distribute your
class library.

On Sat, 2003-04-26 at 11:15, Pablo Baena wrote:
&gt; Hi! I told you some time ago that I was avoiding gconf because of a
&gt; few issues. Well, I finished some prototype of what I'm doing to
&gt; replace gconf# in my project.
&gt; 
&gt; The nifty thing works this way. First you define an interface like
&gt; this:
&gt; 
&gt; 
&gt; 	interface IMySettings 
&gt; 	{
&gt; 		[GeSettings.Property (&quot;GnoMencoder&quot;, 
&gt; 				      &quot;/dev/cdroms/cdrom0&quot;, 
&gt; 				      &quot;DVD Device&quot;)]
&gt; 		string DVDDevice 
&gt; 		{
&gt; 			get; 
&gt; 			set;
&gt; 		}
&gt; 	}
&gt; The arguments of the attribute are: name of the app, default value and
&gt; description, respectively.
&gt; 
&gt; Then you pass the interface to a magic machine like this:
&gt; 
&gt; 
&gt; IMySettings mySettings = (IMySettings) 
&gt; 	GeSettings.Builder.Build (typeof(IMySettings));
&gt; Et voil&#225;, you'll have a mySettings.DVDDevice to use as any other
&gt; property, only that any changes to it will be recorded in a XML file
&gt; on your home directory for future sessions, and all get operations
&gt; will retrieve that setting from said XML file (without you having to
&gt; know _anything_ about XML).
&gt; 
&gt; With this we avoided all the steps we had to make with gconf#, that
&gt; were:
&gt; 
&gt; * create a GConf schema (learn how to make one)
&gt; * run gconf-schemagen over it to create the class
&gt; * have root priviledges to install the schema
&gt; 
&gt; And there is more! With another class I created (it is apart so one
&gt; doesn't have to depend on gtk# for other uses), one can do this:
&gt; 
&gt; 
&gt; 
&gt; 	interface IMySettings 
&gt; 	{
&gt; 		[GeSettings.Property (&quot;GnoMencoder&quot;, 
&gt; 				      &quot;/dev/cdroms/cdrom0&quot;, 
&gt; 				      &quot;DVD Device&quot;,
&gt; 				      WidgetName=&quot;dvddevice_entry&quot;)]
&gt; 		string DVDDevice 
&gt; 		{
&gt; 			get; 
&gt; 			set;
&gt; 		}
&gt; 	}
&gt; And, with this function:
&gt; 
&gt; 
&gt; IMySettings mySettings = (IMySettings) 
&gt; 	GeSettings.GladeBuilder.Build (typeof(IMySettings), gxml);
&gt; we'll have the property associated with the widget on the glade
&gt; resource, which will update the value on the Changed events and
&gt; display the value on Realized.
&gt; 
&gt; The classes are in a very very alpha state yet, and aren't optimized
&gt; in any way, so I didn't released them to the public. Anyway, the
&gt; quality is poor because they're 'inside use only' and it serves its
&gt; purpose for what I'm doing. If there is enough interest on making them
&gt; available independently, I can do the work. It only supports storing
&gt; string settings by now, doesn't monitor the settings for external
&gt; changes as GConf does and only supports Entry widgets, but that can
&gt; change, and I can do it without adding anything complicated to the
&gt; API.
&gt; 
&gt; Do you think I should make it releasable?
&gt; 
&gt; Cheers!
&gt; 
&gt; PS: I hate to reinvent the wheel, but I just don't like gconf. It is
&gt; good at what it does, but complicates something that should be MUCH
&gt; easier.
&gt; 
&gt; -- 
&gt; Pablo Baena &lt;</FONT><A HREF="mailto:pbaena@uol.com.ar"><FONT SIZE="3">pbaena@uol.com.ar</FONT></A><FONT COLOR="#737373" SIZE="3">&gt;</I></FONT></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Pablo Baena &lt;<A HREF="mailto:pbaena@uol.com.ar">pbaena@uol.com.ar</A>&gt;
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>

--=-HLzbzY/C2WYMpxq0v5fe--