Browse Source

Added a dialog box to tutorial so that people can find the documentation in

/usr/share/doc/gbootroot/html/index.html.
master
freesource 23 years ago
parent
commit
e18c02ed8e
  1. 46
      BootRoot/YardBox.pm

46
BootRoot/YardBox.pm

@ -42,7 +42,8 @@ my($check,$dep,$space,$create,$test);
my($filename,$filesystem_size,$kernel,$template_dir,$template,$tmp,$mnt); my($filename,$filesystem_size,$kernel,$template_dir,$template,$tmp,$mnt);
my ($text, $changed_text, $changed_text_from_template); my ($text, $changed_text, $changed_text_from_template);
my $save_as; my $save_as;
my ($replacements_window, $filesystem_window, $path_window, $shortcut); my ($replacements_window, $filesystem_window, $path_window, $tutorial,
$shortcut);
my ($search_window, $question_window, $offset); my ($search_window, $question_window, $offset);
my $Shortcuts; my $Shortcuts;
my @entry; my @entry;
@ -214,7 +215,8 @@ my @menu_items = ( { path => '/File',
type => '<LastBranch>' }, type => '<LastBranch>' },
{ path => '/Help/help_tearoff', { path => '/Help/help_tearoff',
type => '<Tearoff>' }, type => '<Tearoff>' },
{ path => '/_Help/Tutorial' }, { path => '/_Help/Tutorial',
callback => \&tutorial },
{ path => '/_Help/Shortcuts', { path => '/_Help/Shortcuts',
callback => \&shortcut } ); callback => \&shortcut } );
@ -231,6 +233,7 @@ sub yard {
$error = kernel_version_check($kernel); $error = kernel_version_check($kernel);
# Yard: kernel,kernel version # Yard: kernel,kernel version
# Becomes $ENV{'RELEASE'} # Becomes $ENV{'RELEASE'}
return if $error && $error eq "ERROR"; return if $error && $error eq "ERROR";
} }
open(CONTENTS, "<$changed_text") or open(CONTENTS, "<$changed_text") or
@ -1113,6 +1116,7 @@ sub saved {
# rindex and index makes things easy # rindex and index makes things easy
# This can be added to other widgets.
sub search { sub search {
if (not defined $search_window) { if (not defined $search_window) {
@ -1661,6 +1665,44 @@ sub save_as {
} # end sub save_as } # end sub save_as
sub tutorial {
if (not defined $tutorial) {
$tutorial = Gtk::Dialog->new();
$tutorial->signal_connect("destroy", \&destroy_window, \$tutorial);
$tutorial->signal_connect("delete_event", \&destroy_window, \$tutorial);
$tutorial->set_title("Tutorial");
$tutorial->border_width(12);
$tutorial->set_position('center');
my $label = Gtk::Label->
new("Tutorial is in /usr/share/doc/gbootroot/html/index.html.");
$label->set_justify( 'left' );
# $label->set_pattern("_________");
$tutorial->vbox->pack_start( $label, $false, $false, 2 );
$label->show();
my $button = Gtk::Button->new("OK");
$button->signal_connect("clicked", sub {
$tutorial->destroy;
});
$button->can_default(1);
$tutorial->action_area->pack_start($button, $false, $false,0);
$button->grab_default;
$button->show;
}
if (!visible $tutorial) {
$tutorial->show();
}
else {
$tutorial->destroy();
}
} # end sub tutorial
sub shortcut { sub shortcut {
if (not defined $shortcut) { if (not defined $shortcut) {

Loading…
Cancel
Save