summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-07-06 20:13:44 +0000
committerNorbert Preining <preining@logic.at>2008-07-06 20:13:44 +0000
commit04a0c6e37fd510f7f6d45d7baffdd3b9922d05a5 (patch)
treebb2737cdad36fec61cea6456559dcc2dde184d73 /Master
parent0dfc0d45e16b7b3aeb74201840bb910c7051d2fa (diff)
tlmgrgui:
- more transient/grabs, - add some buttons to the default location dialog, - do not show context paper configuration if context is not installed - add some actions (mktexlsr, updmap-sys, fmtutil-sys --all) to the Configuration panel - layout several dialogs a bit nicer, add spacing to many of them - add new translations - make the translation function ___ show up the original label if neither the language nor en itself gives a translation git-svn-id: svn://tug.org/texlive/trunk@9304 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl82
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/lang/de4
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/lang/en.sample4
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl33
4 files changed, 96 insertions, 27 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
index 46208718e95..e4b00cdc4ae 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
@@ -18,7 +18,7 @@ my $default_srcfiles = ($localtlpdb->option_install_srcfiles ? ___"yes" : ___"no
#
my $back_config_set = $back_config->Labelframe(-text => ___"defaultsettings");
-$back_config_set->pack;
+$back_config_set->pack(-fill => "both", -padx => "2m", -pady => "2m");
my $back_config_set_l1 = $back_config_set->Label(-text => ___"defaultsource", -anchor => "w");
my $back_config_set_m1 = $back_config_set->Label(-textvariable => \$default_location);
@@ -68,7 +68,10 @@ $back_config_set_r4->grid(-row => 4, -column => 3,
#############
-my $back_config_pap = $back_config->Labelframe(-text => ___"papersettings");
+my $lower = $back_config->Frame;
+$lower->pack(-fill => "both");
+
+my $back_config_pap = $lower->Labelframe(-text => ___"papersettings");
my $back_config_pap_l1 = $back_config_pap->Label(-text => ___"defaultpaperall", -anchor => "w");
@@ -97,13 +100,18 @@ chomp(@{$papers{"dvipdfm"}});
chomp(@{$papers{"dvipdfmx"}});
@{$papers{"dvips"}} = `tlmgr dvips paper --list`;
chomp(@{$papers{"dvips"}});
-@{$papers{"context"}} = `tlmgr context paper --list`;
-chomp(@{$papers{"context"}});
+if (defined($localtlpdb->get_package("bin-context"))) {
+ @{$papers{"context"}} = `tlmgr context paper --list`;
+ chomp(@{$papers{"context"}});
+}
my %defaultpaper;
my $row = 2;
my (%l,%m,%r);
foreach my $p (sort keys %papers) {
+ if (($p eq "context") && !defined($localtlpdb->get_package("bin-context"))) {
+ next;
+ }
my @pap = @{$papers{$p}};
$defaultpaper{$p} = $pap[0];
$l{$p} = $back_config_pap->Label(-text => ___("defaultpaperfor") . " $p", -anchor => "w");
@@ -119,26 +127,64 @@ foreach my $p (sort keys %papers) {
$row++;
}
-$back_config_pap->pack;
+$back_config_pap->pack(-side => 'left', -fill => "both", -padx => "2m", -pady => "2m");
+
+
+my $back_config_act = $lower->Labelframe(-text => ___"actions");
+
+
+$back_config_act->Button(-text => ___"reinitlsr",
+ -command => sub { run_program_show_output("mktexlsr"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m");
+$back_config_act->Button(-text => ___"recreateformats",
+ -command => sub { run_program_show_output("fmtutil-sys --all"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m");
+$back_config_act->Button(-text => ___"updatemaps",
+ -command => sub { run_program_show_output("updmap-sys"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m");
+
+$back_config_act->pack(-side => 'right', -fill => "both", -padx => "2m", -pady => "2m", -expand => 1, -ipadx => "2m", -ipady => "2m");
+
+
sub menu_default_location {
my $val = $default_location;
my $sw = $mw->Toplevel(-title => ___"changedefaultsrc");
- $sw->Label(-text => ___"newdefaultsrc")->pack;
- my $entry = $sw->Entry(-text => $location, -width => 30);
- $entry->pack;
+ $sw->transient($mw);
+ $sw->grab();
+ $sw->Label(-text => ___"newdefaultsrc")->pack(-padx => "2m", -pady => "2m");
+
+ my $f1 = $sw->Frame;
+ my $entry = $f1->Entry(-text => $val, -width => 50);
+ $entry->pack(-side => "left",-padx => "2m", -pady => "2m");
+
+ my $f2 = $sw->Frame;
+ $f2->Button(-text => ___"choosedir",
+ -command => sub {
+ my $var = $sw->chooseDirectory;
+ if (defined($var)) {
+ $entry->delete(0,"end");
+ $entry->insert(0,$var);
+ }
+ })->pack(-side => "left",-padx => "2m", -pady => "2m");
+ $f2->Button(-text => ___"defaultnet",
+ -command => sub {
+ $entry->delete(0,"end");
+ $entry->insert(0,$TeXLiveURL);
+ })->pack(-side => "left",-padx => "2m", -pady => "2m");
+ $f1->pack;
+ $f2->pack;
+
my $f = $sw->Frame;
- $f->Button(-text => 'ok',
+ my $okbutton = $f->Button(-text => ___"ok",
-command => sub { $default_location = $entry->get;
$localtlpdb->option_location($default_location);
$localtlpdb->save;
- $sw->destroy })->pack(-side => 'left');
- $f->Button(-text => 'cancel',
- -command => sub { $sw->destroy })->pack(-side => 'right');
+ $sw->destroy })->pack(-side => 'left',-padx => "2m", -pady => "2m");
+ my $cancelbutton = $f->Button(-text => ___"cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right',-padx => "2m", -pady => "2m");
$f->pack(-expand => 'x');
+ $sw->bind('<Return>', [ $okbutton, 'Invoke' ]);
+ $sw->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
}
-
sub toggle_setting() {
my ($key) = @_;
if ($key eq "formats") {
@@ -174,16 +220,20 @@ sub change_paper {
sub select_paper {
my $prog = shift;
my $foo = $back_config->Toplevel(-title => ___("paperfor") . " $prog");
+ $foo->transient($mw);
+ $foo->grab();
my $var = $defaultpaper{$prog};
my $opt = $foo->BrowseEntry(-label => ___("defaultpaperfor") . " $prog", -variable => \$var);
foreach my $p (sort @{$papers{$prog}}) {
$opt->insert("end",$p);
}
- $opt->pack;
+ $opt->pack(-padx => "2m", -pady => "2m");
my $f = $foo->Frame;
- $f->Button(-text => ___"ok", -command => sub { change_paper($prog,$var); $foo->destroy; })->pack(-side => "left");
- $f->Button(-text => ___"cancel", -command => sub { $foo->destroy; })->pack(-side => "left");
+ my $okbutton = $f->Button(-text => ___"ok", -command => sub { change_paper($prog,$var); $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f->Button(-text => ___"cancel", -command => sub { $foo->destroy; })->pack(-side => "left", -padx => "2m", -pady => "2m");
$f->pack;
+ $foo->bind('<Return>', [ $okbutton, 'Invoke' ]);
+ $foo->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
}
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/lang/de b/Master/texmf/scripts/texlive/tlmgrgui/lang/de
index 9fcfb7eecdf..a1b58670f8a 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui/lang/de
+++ b/Master/texmf/scripts/texlive/tlmgrgui/lang/de
@@ -70,6 +70,10 @@ completerem: TeX Live 2008 wurde vollständig entfernt
loadtlpdbwait: Laden der lokalen TeX Live Database\nDas kann einige Zeit dauern, bitte warten!
loadremotetlpdbwait: Laden der remote TeX Live Database\nDas kann einige Zeit dauern, bitte warten!
runupdater: Einige Pakete konnten nicht mit dem GUI erneuert werden!\nBitte starten Sie TEXROOT/tlpkg/installer/updater.bat ein mal,\nsonst ist das update nicht vollständig!\nACHTUNG: Sie müssen vorher dieses Programm beenden!"
+actions: Aktionen
+reinitlsr: Reinit file database
+recreateformats: Alle Formate neu erstellen
+updatemaps: Font map database erneuern
# Local Variables:
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/lang/en.sample b/Master/texmf/scripts/texlive/tlmgrgui/lang/en.sample
index ff51b404cd2..6722d5cc2c1 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui/lang/en.sample
+++ b/Master/texmf/scripts/texlive/tlmgrgui/lang/en.sample
@@ -75,6 +75,10 @@ completerem: TeX Live 2008 had been removed
loadtlpdbwait: Loading local TeX Live Database\nThis may take some time, please wait!
loadremotetlpdbwait: Loading remote TeX Live Database\nThis may take some time, please wait!
runupdater: Some package cannot be updated using the GUI!\nPlease run TEXROOT/tlpkg/installer/updater.bat once!\nOtherwise the updates will not be complete!\nNOTE: You have to QUIT this program first!
+actions: Actions
+reinitlsr: Reinit file database
+recreateformats: Recreate all formats
+updatemaps: Update font map database
# Local Variables:
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl
index 1c83a6128f0..4259fc8914f 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui-real.pl
@@ -115,6 +115,10 @@ $TRANS{'en'} = {
loadtlpdbwait => "Loading local TeX Live Database\nThis may take some time, please wait!",
loadremotetlpdbwait => "Loading remote TeX Live Database\nThis may take some time, please wait!",
runupdater => "Some package cannot be updated using the GUI!\nPlease run TEXROOT/tlpkg/installer/updater.bat once!\nOtherwise the updates will not be complete!\nNOTE: You have to QUIT this program first!",
+ actions => "Actions",
+ reinitlsr => "Reinit file database",
+ recreateformats => "Recreate all formats",
+ updatemaps => "Update font map database",
};
@@ -127,7 +131,8 @@ sub ___ ($) {
return $TRANS{"en"}->{$s} if !defined($LANG);
# if the translation is defined return it
return $TRANS{$LANG}->{"$s"} if defined($TRANS{$LANG}->{"$s"});
- return $TRANS{"en"}->{$s};
+ return $TRANS{"en"}->{$s} if defined($TRANS{"en"}->{$s});
+ return "$s";
}
my $opt_location;
@@ -288,7 +293,9 @@ In case of problems, please contact: texlive\@tug.org",
$about->pack(-side => 'right');
$quit->pack(-side => 'right');
-$top->Label(-text => ___"currentsource" . " ")->pack(-side => 'left');
+$mw->bind('<Escape>', [ $quit, 'Invoke' ]);
+
+$top->Label(-text => ___("currentsource") . " ")->pack(-side => 'left');
$top->Label(-textvariable => \$location, -relief => "sunken")->pack(-side => 'left');
$balloon->attach(
@@ -604,10 +611,12 @@ sub menu_edit_location {
my $key = shift;
my $val;
my $sw = $mw->Toplevel(-title => ___"changesrc");
+ $sw->transient($mw);
+ $sw->grab();
+ $sw->Label(-text => ___"newsource")->pack(-padx => "2m", -pady => "2m");
+ my $entry = $sw->Entry(-text => $location, -width => 30);
+ $entry->pack();
my $f1 = $sw->Frame;
- $f1->Label(-text => ___"newsource")->pack(-side => "left");
- my $entry = $f1->Entry(-text => $location, -width => 30);
- $entry->pack(-side => "left");
$f1->Button(-text => ___"choosedir",
-command => sub {
my $var = $sw->chooseDirectory;
@@ -615,21 +624,23 @@ sub menu_edit_location {
$entry->delete(0,"end");
$entry->insert(0,$var);
}
- })->pack(-side => "left");
+ })->pack(-side => "left", -padx => "2m", -pady => "2m");
$f1->Button(-text => ___"defaultnet",
-command => sub {
$entry->delete(0,"end");
$entry->insert(0,$TeXLiveURL);
- })->pack(-side => "left");
+ })->pack(-side => "left", -padx => "2m", -pady => "2m");
$f1->pack;
my $f = $sw->Frame;
- $f->Button(-text => 'Ok',
+ my $okbutton = $f->Button(-text => 'Ok',
-command => sub { $location = $entry->get;
run_update_functions() ;
- $sw->destroy })->pack(-side => 'left');
- $f->Button(-text => 'Cancel',
- -command => sub { $sw->destroy })->pack(-side => 'right');
+ $sw->destroy })->pack(-side => 'left', -padx => "2m", -pady => "2m");
+ my $cancelbutton = $f->Button(-text => 'Cancel',
+ -command => sub { $sw->destroy })->pack(-side => 'right', -padx => "2m", -pady => "2m");
$f->pack(-expand => 'x');
+ $sw->bind('<Return>', [ $okbutton, 'Invoke' ]);
+ $sw->bind('<Escape>', [ $cancelbutton, 'Invoke' ]);
}
sub run_update_functions {