Eskild Hustvedt


I’ve been thinking of a method of creating simple configuration UIs.

Take the following config file: RunMode = Inetd AuthMode = Closed Restricted = true

To create a simple configuration GUI for this I would write something like this: filename is /etc/example.conf setting RUNMODE can be (Inetd, Daemon) setting AUTHMODE can be (Closed, Open) option RunMode is RUNMODE with name “Run mode” and tooltip “Which mode to run in” option AuthMode is AUTHMODE with name “Authentication mode” and tooltip “Which mode to use for authentication” option Restricted is BOOLEAN with name “Enable restriction” and tooltip “Enable this if you want to enable restriction of user rights”

The initial filename option selects which file the config file is. The first “setting” defines a type of entry in the config file that can be either of the value “Inetd” or “Daemon”. This would create a drop-down widget where you can select “Inetd” and “Daemon”. The second setting defines the same for “Closed” and “Open”. The first “option” defines that the option in the config file “RunMode” is of the type “RUNMODE” and the name of the option that is displayed in the GUI is “Run mode” and it has a tooltip saying “Which mode to run in” The second is the same. The third one defines that the option “Restricted” is of the predefined type “BOOLEAN” (which is predefined to be true/false, this creates a checkbox instead of a drop-down box).

Now begin your slaughtering. This is still just an idea. There is no code yet. What do you think of the concept of creating a whole configuration GUI for an app using a single file like this? I’m thinking it would be okay for daemons and such. What do you think of the syntax? I just grabbed it out of my head today and thought it might work. I want the syntax to be simple and human-readable. The point is that you should be able to hack together a GUI for any program with a simple configuration file in a few minutes.

Flame me.