#!/usr/bin/perl -w
#
# This is an example of a subclass of the generated application
#
# You can safely edit this file, any changes that you make will be preserved
# and this file will not be overwritten by the next run of Glade::PerlGenerate
#
#==============================================================================
#=== This is the 'Subcrashman' class                              
#==============================================================================
package Subcrashman;

my $window;
my $version = "0.2";
use CSL::DBs;

#my $db = "dbi:Pg:dbname=csdb;host=onnophris";
my $db = $CSL::DBs::csdb;
use Data::Dumper;
require 5.000; use strict 'vars', 'refs', 'subs';

# UI class 'Subcrashman' (version 0.01)
# 
# Copyright (c) Date Wed Nov 20 13:40:18 CST 2002
# Author David Dynerman <dynerman\@cookie.cs.wisc.edu>
#
# Unspecified copying policy, please contact the author\n#  David Dynerman <dynerman\@cookie.cs.wisc.edu>
#
#==============================================================================
# This perl source file was automatically generated by 
# Glade::PerlGenerate version 0.56 - Wed Apr 19 02:28:58 BST 2000
# Copyright (c) Author Dermot Musgrove <dermot.musgrove\@virgin.net>
#
# from Glade file /afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/crashman.glade
# Wed Nov 20 13:40:18 CST 2002
#==============================================================================

BEGIN {
    use vars qw( 
                 @ISA
                 %fields
                 $VERSION
             );
    # Existing signal handler modules
    use src::crashman;
    # We need the Gnome bindings as well
    use Gnome;
    # Uncomment the line below to enable gettext checking
#    use Glade::PerlSource;
    # Tell interpreter who we are inheriting from
    @ISA     = qw( crashman );
    # Uncomment the line below to enable gettext checking
#    @ISA      = qw( crashman Glade::PerlSource );
    $VERSION = '0.01';
    # Inherit the AUTOLOAD dynamic methods from crashman
    *AUTOLOAD = \&crashman::AUTOLOAD;
} # End of sub BEGIN

%fields = (
# Insert any extra data access methods that you want to add to 
#   our inherited super-constructor (or overload)
    USERDATA    => undef,
    VERSION     => '0.01',
);

sub DESTROY {
    # This sub will be called on object destruction
} # End of sub DESTROY

#==============================================================================
#=== Below are the overloaded class constructors
#==============================================================================
sub new {
    my $that  = shift;
    # Allow indirect constructor so that we can call eg. 
    #   $window1 = BusFrame->new; $window2 = $window1->new;
    my $class = ref($that) || $that;

    # Call our super-class constructor to get an object and reconsecrate it
    my $self = bless $that->SUPER::new(), $class;

    # Add our own data access methods to the inherited constructor
    my($element);
    foreach $element (keys %fields) {
        $self->{_permitted_fields}->{$element} = $fields{$element};
    }
    @{$self}{keys %fields} = values %fields;
    return $self;
} # End of sub new

sub run {
    my ($class) = @_;
    Gnome->init('crashman', '0.01');
    # Uncomment the line below to enable gettext checking
#    $class->check_gettext_strings;
    my $window = $class->new;
    # Insert your subclass user data key/value pairs 
    $window->USERDATA({
#        'Key1'   => 'Value1',
#        'Key2'   => 'Value2',
#        'Key3'   => 'Value3',
    });
    $window->TOPLEVEL->show;
#    my $window2 = $window->new;
#    $window2->TOPLEVEL->show;
    &log_action("crashman $version started");
    &load_disks($window->{FORM});

    Gtk->main;
    # Uncomment the line below to enable gettext checking
#    $window->write_gettext_strings("__", '/afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/src/crashman.pot');
    return $window;
} # End of sub run
#===============================================================================
#=== Below are (overloaded) default signal handlers for 'crashman' class 
#===============================================================================
sub about_Form {
    my ($class) = @_;
    my $gtkversion = 
        Gtk->major_version.".".
        Gtk->minor_version.".".
        Gtk->micro_version;
    my $name = $0;
    #
    # Create a Gnome::About '$ab'
    my $ab = new Gnome::About(
        "Subcrashman", 
        "0.01", 
        _("Copyright")." Wed Nov 20 13:40:18 CST 2002", 
        "David Dynerman <dynerman\@cookie.cs.wisc.edu>", 
        _("No description")."\n".
        "Gtk ".     _("version").": $gtkversion\n".
        "Gtk-Perl "._("version").": $Gtk::VERSION\n".
        _("run from file").": $name\n".
        "# Unspecified copying policy, please contact the author\n# ", 
        "$Glade::PerlRun::pixmaps_directory/glade2perl_logo.xpm", 
    );
    $ab->set_title(_("About")." Subcrashman" );
    $ab->position('mouse' );
    $ab->set_policy(1, 1, 0 );
    $ab->set_modal(1 );
    $ab->show;
} # End of sub about_Form

sub destroy_Form {
    my ($class, $data, $object, $instance) = @_;
    Gtk->main_quit; 
} # End of sub destroy_Form

sub toplevel_hide    { shift->get_toplevel->hide    }
sub toplevel_close   { shift->get_toplevel->close   }
sub toplevel_destroy { shift->get_toplevel->destroy }


#==============================================================================
#=== Below are (overloaded) signal handlers for 'crashman' class 
#==============================================================================
sub on_crashman_clist_button_press_event {
    my ($class, $data, $object, $instance, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_clist_button_press_event";
    # Get ref to hash of all widgets on our form
    my $form = $__PACKAGE__::all_forms->{$instance};

    return unless $event->{button} == 3;
    
    my $menu = Gtk::Menu->new();

    my @menuItems;
    my $clist = $form->{crashman_clist};
    if(defined $clist->selection()) 
    {
	my $row_info = $clist->get_row_data($clist->selection());
	if($row_info->{status} eq "Checked Out")
	{
	    push @menuItems, "Check In";
	}
	if($row_info->{status} eq "Renewal Requested")
	{
	    push @menuItems, "Approve Renewal";
	}
	if($row_info->{status} eq "Checked In")
	{
	    push @menuItems, "Make Available";
	}
	if($row_info->{status} eq "Assigned")
	{
	    push @menuItems, "Check Out";
	}
	push @menuItems, undef;
    }
    push @menuItems, "Add New Crash Disk";
    foreach my $menuText (@menuItems)
    {
       my $menuItem;
       if($menuText)
       {
	   $menuItem = Gtk::MenuItem->new($menuText);
       } 
       else
       {
	   $menuItem = Gtk::MenuItem->new();
       }
       $menuItem->show;
       $menu->append($menuItem);
       $menuItem->signal_connect("activate", "Subcrashman::select_popup", $form, $menuText);
   }
    
    $menu->popup(undef, undef, $event->{button}, $event->{time}, undef);
} # End of sub on_crashman_clist_button_press_event    

sub select_popup {
    my ($class, $form, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_clist_click_column";
    # Get ref to hash of all widgets on our form

    my $clist = $form->{crashman_clist};

    my $row_number = $clist->selection();
    my $row_info = $clist->get_row_data($row_number);

    if($event eq "Check In")
    {
	&check_disk_in($row_info);
    }
    elsif ($event eq "Check Out")
    {
	&check_disk_out($row_info);
	
#my $user_name = Subinput_window->run("Username:", "Check out to");
	#return unless $user_name;
#	if(getpwnam($user_name))
#	{
#	    my $comment = Subinput_window->run("Comment:", "Enter a comment");
#	    &check_disk_out($row_info, $user_name, $comment);
#	}
#	else
#	{
#	    my $box = Gnome::MessageBox->new("The user $user_name doesn't exist", "error", "OK");
#	    $box->show;
#	    return;
#	}



    }
    elsif ($event eq "Make Available")
    {
	&make_disk_available($row_info);
    }
    elsif ($event eq "Add New Crash Disk")
    {
	my $disk_name = Subinput_window->run("New disk name:", "New Disk");
	&add_new_crash_disk($disk_name);
    }
    elsif ($event eq "Approve Renewal")
    {
	&renew_disk($row_info);
    }
    &load_disks($form);
}

sub on_crashman_clist_select_row {
    my ($class, $data, $object, $instance, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_clist_select_row";
    # Get ref to hash of all widgets on our form
    my $form = $__PACKAGE__::all_forms->{$instance};
    my $comment_area = $form->{comment_area};
    #if($form->{crashman_clist}->get_row_data($event)->{status} eq "Available")
    #{
#	$form->{scrolledwindow2}->hide();
#	return;
#    }
    $comment_area->set_point(0);
    $comment_area->forward_delete($comment_area->get_length());
    $comment_area->insert(undef, undef, undef, $form->{crashman_clist}->get_row_data($event)->{status}." - ".$form->{crashman_clist}->get_row_data($event)->{comment});
    $form->{scrolledwindow2}->show();
}

sub on_crashman_clist_unselect_row {
    my ($class, $data, $object, $instance, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_clist_select_row";
    # Get ref to hash of all widgets on our form
    my $form = $__PACKAGE__::all_forms->{$instance}; 
    $form->{scrolledwindow2}->hide();
}

sub on_crashman_clist_click_column {
    my ($class, $data, $object, $instance, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_clist_click_column";
    # Get ref to hash of all widgets on our form
    my $form = $__PACKAGE__::all_forms->{$instance};

    &load_disks($form, $event);
}

sub on_crashman_destroy {
    my ($class, $data, $object, $instance, $event) = @_;
    my $me = __PACKAGE__."->on_crashman_destroy";
    # Get ref to hash of all widgets on our form
    my $form = $__PACKAGE__::all_forms->{$instance};

    # REPLACE the lines below with the actions to be taken when __PACKAGE__."->on_crashman_destroy." is called
#    __PACKAGE__->show_skeleton_message($me, \@_, __PACKAGE__, "$Glade::PerlRun::pixmaps_directory/glade2perl_logo.xpm");
    &log_action("crashman $version exited");
    Gtk->exit(0);

} # End of sub on_crashman_destroy

sub load_disks {
    my ($form, $sort) = @_;
    my $clist = $form->{crashman_clist};
    $clist->set_column_auto_resize(0, 1);
    $clist->set_column_auto_resize(1, 1);
    $clist->set_column_auto_resize(2, 1);
    #my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");
    my $command_string = "select * from disks ";
    if($sort == 1)
    {
	$command_string.="order by user_name"; 
    }
    elsif($sort == 2)
    {
	$command_string.="order by status";
    }
    else
    {
	$command_string.="order by disk_id";
    }
    my $sh = $database_handle->prepare($command_string);
    $sh->execute();

    my %crash_disks;
    $clist->freeze();
    $clist->clear();
    while(my $row = $sh->fetchrow_hashref)
    {
	$crash_disks{$row->{disk_id}} = $row;
	$row->{due_date} =~ s/(\d+)-0*(\d+)-0*(\d+)/$2\/$3\/$1/;
	my $row_number = $clist->append($row->{disk_name}, $row->{user_name}, $row->{due_date});
	my %row = %$row;
	$clist->set_row_data($row_number, \%row);
    }
    $database_handle->disconnect();
    $clist->thaw();
    
}

sub check_disk_in {
    my $disk_info = $_[0];
    my $disk_id = $disk_info->{disk_id};

#    my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");

    my $update_string = "update disks set user_name = null, status='Checked In', comment='Needs to be erased', due_date=null where disk_id='$disk_id';";
    my $sh = $database_handle->prepare($update_string);
    $sh->execute();

    $database_handle->disconnect();

    &log_action("Checked in disk: $disk_info->{disk_name}");
}

sub make_disk_available {
    my $disk_info = $_[0];
    my $disk_id = $disk_info->{disk_id};

#    my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");

    my $update_string = "update disks set status = 'Available', comment = null where disk_id='$disk_id';";
    my $sh = $database_handle->prepare($update_string);
    $sh->execute();

    $database_handle->disconnect();

    &log_action("Made Disk Available: $disk_info->{disk_name}");
}

sub check_disk_out {
    my $disk_info = $_[0];
    my $disk_id = $disk_info->{disk_id};
    my $due_date = $disk_info->{due_date};
    my $comment = $disk_info->{comment};

#    my $database_handle = DBI->connect($CSL::DBs::csdb);    
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");

    my $update_string = "update disks set status = 'Checked Out' where disk_id='$disk_id';";
    my $sh = $database_handle->prepare($update_string);
    $sh->execute();

    $database_handle->disconnect();

    &log_action("Checked $disk_info->{disk_name} out to $disk_info->{user_name}, due on: $due_date, comment: $comment");
}

sub renew_disk {
    my $disk_info = $_[0];
    my $disk_id = $disk_info->{disk_id};
    my $comment = $disk_info->{comment};

#    my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");
    my $current_date = "";
    $comment .= " renewal approved - new due date: $disk_info->{due_date}";
    my $update_string = "update disks set status = 'Checked Out', comment = '$comment' where disk_id='$disk_id'";
    my $sh = $database_handle->prepare($update_string);


    $sh->execute();
    $database_handle->disconnect();

    &log_action("Renewed $disk_info->{disk_name} to $disk_info->{user_name}, now due on $disk_info->{due_date} comment: $comment");
}


sub get_current_semester {
    my $month = (localtime())[4];
    if($month >= 8)
    {
	return "Fall";
    }
    if($month >= 5)
    {
	return "Summer";
    }
    if($month >= 0)
    {	
	return "Spring";
    }
}

sub add_new_crash_disk {
    my $disk_name = $_[0];

#    my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");
    my $query_string = "select * from disks where disk_name = '$disk_name'";
    my $sh = $database_handle->prepare($query_string);
    $sh->execute();
    if($sh->fetchrow_hashref)
    {
	$database_handle->disconnect();
	my $box = Gnome::MessageBox->new("The disk $disk_name is already in the database!", "error", "OK");
	$box->show;
	return;
    }

    $sh = $database_handle->prepare("select max(disk_id) from disks;");
    $sh->execute();
    my $high_id = $sh->fetchrow_hashref->{max};
    my $new_disk_id = $high_id + 1;

    $sh = $database_handle->prepare("insert into disks values ('$new_disk_id', '$disk_name', null, 'Available', null, null);");
    $sh->execute();

    $database_handle->disconnect();
    &log_action("Added new crash disk: $disk_name id: $new_disk_id");
}

sub log_action {
#    my $database_handle = DBI->connect($CSL::DBs::csdb);
    my $database_handle = DBI->connect($db);
    $database_handle->do("set search_path to crashman");
    
    my $query_string = "insert into log select current_user, current_timestamp, '$_[0]';";
    my $sh = $database_handle->prepare($query_string);
    $sh->execute();
    $database_handle->disconnect();
}
#==============================================================================
#=== This is the 'Subinput_window' class                              
#==============================================================================
package Subinput_window;
require 5.000; use strict 'vars', 'refs', 'subs';
# UI class 'Subinput_window' (version 0.01)
# 
# Copyright (c) Date Wed Nov 20 13:40:18 CST 2002
# Author David Dynerman <dynerman\@cookie.cs.wisc.edu>
#
# Unspecified copying policy, please contact the author\n#  David Dynerman <dynerman\@cookie.cs.wisc.edu>
#
#==============================================================================
# This perl source file was automatically generated by 
# Glade::PerlGenerate version 0.56 - Wed Apr 19 02:28:58 BST 2000
# Copyright (c) Author Dermot Musgrove <dermot.musgrove\@virgin.net>
#
# from Glade file /afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/crashman.glade
# Wed Nov 20 13:40:18 CST 2002
#==============================================================================

BEGIN {
    use vars qw( 
                 @ISA
                 %fields
                 $VERSION
             );
    # Existing signal handler modules
    use src::crashman;
    # We need the Gnome bindings as well
    use Gnome;
    # Uncomment the line below to enable gettext checking
#    use Glade::PerlSource;
    # Tell interpreter who we are inheriting from
    @ISA     = qw( input_window );
    # Uncomment the line below to enable gettext checking
#    @ISA      = qw( input_window Glade::PerlSource );
    $VERSION = '0.01';
    # Inherit the AUTOLOAD dynamic methods from input_window
    *AUTOLOAD = \&input_window::AUTOLOAD;
} # End of sub BEGIN

%fields = (
# Insert any extra data access methods that you want to add to 
#   our inherited super-constructor (or overload)
    USERDATA    => undef,
    VERSION     => '0.01',
);

sub DESTROY {
    # This sub will be called on object destruction
} # End of sub DESTROY

#==============================================================================
#=== Below are the overloaded class constructors
#==============================================================================
sub new {
    my $that  = shift;
    # Allow indirect constructor so that we can call eg. 
    #   $window1 = BusFrame->new; $window2 = $window1->new;
    my $class = ref($that) || $that;

    # Call our super-class constructor to get an object and reconsecrate it
    my $self = bless $that->SUPER::new(), $class;

    # Add our own data access methods to the inherited constructor
    my($element);
    foreach $element (keys %fields) {
        $self->{_permitted_fields}->{$element} = $fields{$element};
    }
    @{$self}{keys %fields} = values %fields;
    return $self;
} # End of sub new

sub run {
    my ($class) = @_;
    Gnome->init('crashman', '0.01');
    # Uncomment the line below to enable gettext checking
#    $class->check_gettext_strings;
    my $window = $class->new;
    # Insert your subclass user data key/value pairs 
    $window->USERDATA({
#        'Key1'   => 'Value1',
#        'Key2'   => 'Value2',
#        'Key3'   => 'Value3',
    });
    $window->TOPLEVEL->show;
#    my $window2 = $window->new;
#    $window2->TOPLEVEL->show;
    $window->{FORM}{input_label}->set_text(@_[1]);
    $window->{FORM}{input_window}->title(@_[2]);
    Gtk->main;
    # Uncomment the line below to enable gettext checking
#    $window->write_gettext_strings("__", '/afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/src/crashman.pot');
    my $user_name = $window->{FORM}{input_text}->get_text();
    $window->{FORM}{input_window}->destroy();
    return $user_name;
} # End of sub run
#===============================================================================
#=== Below are (overloaded) default signal handlers for 'input_window' class 
#===============================================================================
sub about_Form {
    my ($class) = @_;
    my $gtkversion = 
        Gtk->major_version.".".
        Gtk->minor_version.".".
        Gtk->micro_version;
    my $name = $0;
    #
    # Create a Gnome::About '$ab'
    my $ab = new Gnome::About(
        "Subcrashman", 
        "0.01", 
        _("Copyright")." Wed Nov 20 13:40:18 CST 2002", 
        "Davcreatid Dynerman <dynerman\@cookie.cs.wisc.edu>", 
        _("No description")."\n".
        "Gtk ".     _("version").": $gtkversion\n".
        "Gtk-Perl "._("version").": $Gtk::VERSION\n".
        _("run from file").": $name\n".
        "# Unspecified copying policy, please contact the author\n# ", 
        "$Glade::PerlRun::pixmaps_directory/glade2perl_logo.xpm", 
    );
    $ab->set_title(_("About")." Subcrashman" );
    $ab->position('mouse' );
    $ab->set_policy(1, 1, 0 );
    $ab->set_modal(1 );
    $ab->show;
} # End of sub about_Form

sub destroy_Form {
    my ($class, $data, $object, $instance) = @_;
    Gtk->main_quit; 
} # End of sub destroy_Form

sub on_input_ok_clicked {
    Gtk->main_quit;
}

sub on_input_cancel_clicked {
    Gtk->main_quit;
}
sub toplevel_hide    { shift->get_toplevel->hide    }
sub toplevel_close   { shift->get_toplevel->close   }
sub toplevel_destroy { shift->get_toplevel->destroy }
#sub on


# UI class 'Subrenew_window' (version 0.01)
# 
# Copyright (c) Date Mon Dec 16 14:09:52 CST 2002
# Author David Dynerman <dynerman\@camel.cs.wisc.edu>
#
# Unspecified copying policy, please contact the author\n#  David Dynerman <dynerman\@camel.cs.wisc.edu>
#
#==============================================================================
# This perl source file was automatically generated by 
# Glade::PerlGenerate version 0.56 - Wed Apr 19 02:28:58 BST 2000
# Copyright (c) Author Dermot Musgrove <dermot.musgrove\@virgin.net>
#
# from Glade file /afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/crashman.glade
# Mon Dec 16 14:09:52 CST 2002
#==============================================================================
package Subrenew_window;
BEGIN {
    use vars qw( 
                 @ISA
                 %fields
                 $VERSION
             );
    # Existing signal handler modules
    use src::crashman;
    # Uncomment the line below to enable gettext checking
#    use Glade::PerlSource;
    # Tell interpreter who we are inheriting from
    @ISA     = qw( renew_window );
    # Uncomment the line below to enable gettext checking
#    @ISA      = qw( renew_window Glade::PerlSource );
    $VERSION = '0.01';
    # Inherit the AUTOLOAD dynamic methods from renew_window
    *AUTOLOAD = \&renew_window::AUTOLOAD;
} # End of sub BEGIN

%fields = (
# Insert any extra data access methods that you want to add to 
#   our inherited super-constructor (or overload)
    USERDATA    => undef,
    VERSION     => '0.01',
);

sub DESTROY {
    # This sub will be called on object destruction
} # End of sub DESTROY

#==============================================================================
#=== Below are the overloaded class constructors
#==============================================================================
sub new {
    my $that  = shift;
    # Allow indirect constructor so that we can call eg. 
    #   $window1 = BusFrame->new; $window2 = $window1->new;
    my $class = ref($that) || $that;

    # Call our super-class constructor to get an object and reconsecrate it
    my $self = bless $that->SUPER::new(), $class;

    # Add our own data access methods to the inherited constructor
    my($element);
    foreach $element (keys %fields) {
        $self->{_permitted_fields}->{$element} = $fields{$element};
    }
    @{$self}{keys %fields} = values %fields;
    return $self;
} # End of sub new

sub run {
    my ($class) = @_;
    Gtk->init;
    # Uncomment the line below to enable gettext checking
#    $class->check_gettext_strings;
    my $window = $class->new;
    # Insert your subclass user data key/value pairs 
    $window->USERDATA({
#        'Key1'   => 'Value1',
#        'Key2'   => 'Value2',
#        'Key3'   => 'Value3',
    });
    $window->TOPLEVEL->show;
#    my $window2 = $window->new;
#    $window2->TOPLEVEL->show;
    my $current_sem = &Subcrashman::get_current_semester();
    my $renew_sem;
    my $disk_info = @_[1];
    if($current_sem eq "Fall") 
    {
	$renew_sem = "Spring";
    }
    elsif($current_sem eq "Spring")
    {
	$renew_sem = "Summer";
    }
    elsif($current_sem eq "Summer")
    {
	$renew_sem = "Fall";
    }
    $window->{FORM}{due_date_combo}->set_popdown_strings("", $renew_sem);
    
    Gtk->main;
    # Uncomment the line below to enable gettext checking
#    $window->write_gettext_strings("__", '/afs/cs.wisc.edu/u/d/y/dynerman/private/work/crashman/src/crashman.pot');
      
    my $date = $window->{FORM}{due_date_entry}->get_text();
    $window->{FORM}{renew_window}->destroy();  
    return $date;
} # End of sub run
#===============================================================================
#=== Below are (overloaded) default signal handlers for 'renew_window' class 
#===============================================================================
sub about_Form {
    my ($class) = @_;
    my $gtkversion = 
        Gtk->major_version.".".
        Gtk->minor_version.".".
        Gtk->micro_version;
    my $name = $0;
    my $message = 
        __PACKAGE__." ("._("version")." 0.01 - Mon Dec 16 14:09:52 CST 2002)\n".
        _("Written by")." David Dynerman <dynerman\@camel.cs.wisc.edu> \n\n".
        _("No description")." \n\n".
        "Gtk ".     _("version").": $gtkversion\n".
        "Gtk-Perl "._("version").": $Gtk::VERSION\n".
        _("run from file").": $name";
    __PACKAGE__->message_box($message, _("About")." \u".__PACKAGE__, [_('Dismiss'), _('Quit Program')], 1,
        "$Glade::PerlRun::pixmaps_directory/glade2perl_logo.xpm", 'left' );
} # End of sub about_Form

sub destroy_Form {
    my ($class, $data, $object, $instance) = @_;
    Gtk->main_quit; 
} # End of sub destroy_Form

sub toplevel_hide    { shift->get_toplevel->hide    }
sub toplevel_close   { shift->get_toplevel->close   }
sub toplevel_destroy { shift->get_toplevel->destroy }


#==============================================================================
#=== Below are (overloaded) signal handlers for 'renew_window' class 
#==============================================================================
sub on_renew_cancel_clicked {
    Gtk->main_quit();
}

sub on_renew_ok_clicked {
    Gtk->main_quit;   
}


#==============================================================================
#=== Below are (overloaded) signal handlers for 'input_window' class 
#==============================================================================


1;

__END__

#===============================================================================
#==== Documentation
#===============================================================================
=pod

=head1 NAME

Subcrashman - version 0.01 Wed Nov 20 13:40:18 CST 2002

No description

=head1 SYNOPSIS

 use Subcrashman;

 if ($we_want_to_subclass_this_class) {
   # Inherit the AUTOLOAD dynamic methods from Subcrashman
   *AUTOLOAD = \&Subcrashman::AUTOLOAD;

   # Tell interpreter who we are inheriting from
   use vars qw( @ISA ); @ISA = qw( Subcrashman );
 }
 
 To construct the window object and show it call
 
 Gtk->init;
 my $window = Subcrashman->new;
 $window->TOPLEVEL->show;
 Gtk->main;
 
 OR use the shorthand for the above calls
 
 Subcrashman->run;

=head1 DESCRIPTION

Unfortunately, the author has not yet written any documentation :-(

=head1 AUTHOR

David Dynerman <dynerman\@cookie.cs.wisc.edu>

=cut







