#!/usr/bin/perl
require 5.000; use English; use strict 'vars', 'refs', 'subs';

my $VERSION = "0.54";
use Glade::PerlGenerate;

my $base = $ARGV[0] || 'project1.glade';
# Strip off any suffix (if it exists)
$base =~ s/(.*)\..*$/$1/;

my $project_options_file = "$base.glade2perl.xml";
# Default $project_options_file is eg 'Example/BusForm.glade2perl.xml'

my $log_file = "$base.glade2perl.log";
# Default $log_file is eg 'Example/BusForm.glade2perl.log'

Glade::PerlGenerate->options(    
#    'log_file'         => $log_file,                # Save diagnostics to disk
    'verbose'          => 0,                        # Turn off diagnostics
#    'verbose'          => 2,                        # Some diagnostics
#    'verbose'          => 4,                        # More diagnostics
#    'verbose'          => 10,                       # All diagnostics
    'write_source'     => 'True',                   # We DO want source
    'dont_show_UI'     => 'True',                   # We DON'T want to show UI
    'options_set'      => 'Glade/Build Source',     # Glade set the options
    'project_options'  => $project_options_file,    # Read/write project_options file
);

# Read and build a Glade file
Glade::PerlGenerate->Form_from_Glade_File( 'glade_filename' => $ARGV[0] ) && 

exit 0; # to return a C or shell type success

1;      # else return a C or shell failure
