Browse Source

Set up the yard/templates dir so things are symlinked and -l is viewd as

read-only.  Made $combo global so it can be manipulated by YardBox.  Made all
references to Gtk version a variable .. had missed that.
master
freesource 24 years ago
parent
commit
d774c883d6
  1. 44
      gbootroot

44
gbootroot

@ -1,6 +1,6 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# gBootRoot Copyright (C) 2000 # gBootRoot Copyright (C) 2000, 2001
# Lead Developer and Project Coordinator # Lead Developer and Project Coordinator
# Jonathan Rosenbaum <freesource@users.sourceforge.net> # Jonathan Rosenbaum <freesource@users.sourceforge.net>
# #
@ -121,6 +121,8 @@ my $home_uml_kernel = "$home/uml_kernel/";
my $home_yard = "$home/yard"; my $home_yard = "$home/yard";
my $template_dir = "$home_yard/templates/"; my $template_dir = "$home_yard/templates/";
my $home_yard_replacements = "$home_yard/replacements"; my $home_yard_replacements = "$home_yard/replacements";
my $global_yard_replacements = "/usr/share/gbootroot/yard/replacements";
my $global_yard_templates = "/usr/share/gbootroot/yard/templates";
my $initrd; my $initrd;
my $compress; my $compress;
@ -173,7 +175,7 @@ my $obj_count_root = 0;
my ($lib_strip_check,$bin_strip_check); my ($lib_strip_check,$bin_strip_check);
my ($bz2_toggle,$gz_toggle); my ($bz2_toggle,$gz_toggle);
my ($bz2_toggle_root,$gz_toggle_root,$compression_off); my ($bz2_toggle_root,$gz_toggle_root,$compression_off);
my ($combo); #my ($main::combo); made this totally global
my ($adj2,$adj3); my ($adj2,$adj3);
my @strings; my @strings;
my ($root_device,$root_filename,$method,$template,$filesystem_size, my ($root_device,$root_filename,$method,$template,$filesystem_size,
@ -260,10 +262,21 @@ if (!-e "$home_uml_kernel/.options") {
# $HOME/.gbootroot/yard/templates # $HOME/.gbootroot/yard/templates
home_builder($template_dir); home_builder($template_dir);
if ( -d $global_yard_templates ) {
opendir(DIR,$global_yard_templates) if -d $template_dir;
my @templates = grep { m,\.yard$, } readdir(DIR);
closedir(DIR);
foreach ( @templates ) {
if (!-e "$template_dir/$_" && !-l "$template_dir/$_") {
symlink_builder("$global_yard_templates/$_","$template_dir/$_");
}
}
}
# $HOME/.gbootroot/yard/replacements # $HOME/.gbootroot/yard/replacements
home_builder($home_yard_replacements); home_builder($home_yard_replacements);
# Basically so different users get the same things in # Basically so different users get the same things in
# their personal directories. # their personal directories.
sub symlink_builder { sub symlink_builder {
@ -354,13 +367,14 @@ elsif (Gtk->minor_version < 2) {
sub et { sub et {
error_window("gBootRoot is presently being developed with gtk-perl" . error_window("gBootRoot is presently being developed with gtk-perl" .
" version $gtk_perl_version.\nYou are using a" . " version $gtk_perl_version.\nYou are using a" .
" version of gtk-perl < 0.7002. You may still be able\n" . " version of gtk-perl < $gtk_perl_version." .
" You may still be able\n" .
" to use this program, but you may encounter problems." . " to use this program, but you may encounter problems." .
" See the FAQ\nfor places to get a newer gtk-perl version." . " See the FAQ\nfor places to get a newer gtk-perl version." .
" \n\nThe most common error reported:\n\"Can't locate" . " \n\nThe most common error reported:\n\"Can't locate" .
" object method\""); " object method\"");
#,"center"); #,"center");
print "Using a version of gtk-perl < 0.7002\n"; print "Using a version of gtk-perl < $gtk_perl_version\n";
} }
my $window = Gtk::Window->new("toplevel"); my $window = Gtk::Window->new("toplevel");
@ -965,7 +979,7 @@ sub advanced_root_section {
opendir(DIR,$template_dir) if -d $template_dir; opendir(DIR,$template_dir) if -d $template_dir;
@strings = grep { m,\.yard$, } readdir(DIR); @strings = grep { m,\.yard$, } readdir(DIR);
closedir(DIR); closedir(DIR);
$combo->set_popdown_strings( @strings ) if @strings; $main::combo->set_popdown_strings( @strings ) if @strings;
} ); } );
$ear4->set_text($entry_advanced[6]) if $entry_advanced[6]; $ear4->set_text($entry_advanced[6]) if $entry_advanced[6];
@ -986,26 +1000,26 @@ sub advanced_root_section {
# Template # Template
# $::contents_file # $::contents_file
label_advanced("Template:",0,1,7,8,$table_advanced_root); label_advanced("Template:",0,1,7,8,$table_advanced_root);
$combo = Gtk::Combo->new(); $main::combo = Gtk::Combo->new();
$combo->entry->set_text($entry_advanced[7]) if $entry_advanced[7]; $main::combo->entry->set_text($entry_advanced[7]) if $entry_advanced[7];
#$button_count_root_open = 1 + $button_count_root_open; #$button_count_root_open = 1 + $button_count_root_open;
#print $button_count_root_open; #print $button_count_root_open;
#if ($button_count_root_open > 1) { #if ($button_count_root_open > 1) {
# $combo->set_popdown_strings( @strings ) # $main::combo->set_popdown_strings( @strings )
# if $entry_advanced[7] ne ""; # if $entry_advanced[7] ne "";
#} #}
$tooltips->set_tip( Gtk::Combo::entry($combo), $tooltips->set_tip( Gtk::Combo::entry($main::combo),
"Choose a Template for the Method.", "Choose a Template for the Method.",
"" ); "" );
$entry_advanced[7] = $combo->entry->get_text(); # nothing selected $entry_advanced[7] = $main::combo->entry->get_text(); # nothing selected
$combo->entry->signal_connect("changed", sub { $main::combo->entry->signal_connect("changed", sub {
$entry_advanced[7] = $combo->entry->get_text(); $entry_advanced[7] = $main::combo->entry->get_text();
$ars->{template} = $entry_advanced[7]; $ars->{template} = $entry_advanced[7];
ars($ars); ars($ars);
} ); } );
$table_advanced_root->attach($combo,1,3,7,8, $table_advanced_root->attach($main::combo,1,3,7,8,
['expand','fill'],['fill','shrink'],0,0); ['expand','fill'],['fill','shrink'],0,0);
show $combo; show $main::combo;
#_______________________________________ #_______________________________________
# Generate - UML - Accept buttons # Generate - UML - Accept buttons
@ -1380,8 +1394,10 @@ sub Generate {
if ($method eq "yard") { if ($method eq "yard") {
if (!$main::yard_window) {
yard(); yard();
} }
}
} # end sub Generate } # end sub Generate

Loading…
Cancel
Save