Commit 172e3383 authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid

Added script to convert glade preferences into gconf schema files. See

2007-02-09  Johannes Schmid <jhs@gnome.org>

	* scripts/glade2schema.pl:
	Added script to convert glade preferences into gconf schema files.
	See #406061

svn path=/trunk/; revision=2803
parent f817b038
2007-02-09 Johannes Schmid <jhs@gnome.org>
* scripts/glade2schema.pl:
Added script to convert glade preferences into gconf schema files.
See #406061
2007-02-08 Naba Kumar <naba@gnome.org>
* src/anjuta-app.c: Destroy toolbar menuitem when the toolbar
......
#!/usr/bin/perl
use XML::Parser;
%datatypes = (
"bool" => "bool",
"int" => "int",
"string" => "string",
"text" => "string",
"float" => "float",
"color" => "string",
"font" => "string"
);
%boolean = (
0 => "FALSE",
1 => "TRUE"
);
$schema_path = "/schemas/apps/anjuta/preferences/";
$key_path ="/apps/anjuta/preferences/";
my $parser = new XML::Parser(Style => "Stream");
print "<gconfschemafile>\n";
print "\t<schemalist>\n";
$parser->parsefile($ARGV[0]);
print "\t<\schemalist>\n";
print "<\gconfschemafile>\n";
sub StartTag {
my $parser = shift;
my $key = shift;
if ($key =~ /widget/) {
my $k = $_{"id"};
if ($k =~ /preferences_{color|entry|font|spin|text|toggle}*/) {
my ($name, $type, $default, $flags, $propkey) = $k =~ /([^:]*):([^:]*):([^:]*):(\d):(.*)/;
if ($type =~ /bool/) {
$default = $boolean{$default};
}
print "\t\t<schema>\n";
print "\t\t\t<key>$schema_path$propkey</key>\n";
print "\t\t\t<applyto>$key_path$propkey</applyto>\n";
print "\t\t\t<owner>anjuta</owner>\n";
print "\t\t\t<type>$datatypes{$type}<\\type>\n";
print "\t\t\t<default>$default</default>\n";
print "\t\t</schema>\n\n";
}
}
}
sub EndTag {}
sub Text {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment