diff options
author | Norbert Preining <preining@logic.at> | 2009-12-08 06:44:21 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-12-08 06:44:21 +0000 |
commit | 27cd8d14d5b658b8d8b6f1cbc29ab098677465fc (patch) | |
tree | a8addf1db8a149d9c18f88ce946a19278aa5c70f /Master/tlpkg | |
parent | b7d60c710558fa5142e40afd945fa10a91a823c2 (diff) |
tlmgrgui2:
- make ready for translations
- move the "Loaded repository: ..." to the main window
- get rid of some frames
- move the [all] [none] next to the [Reset filters]
- don't show Architectures conf menu entry on Windows
git-svn-id: svn://tug.org/texlive/trunk@16326 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/dev/tlmgrgui2.pl | 207 |
1 files changed, 123 insertions, 84 deletions
diff --git a/Master/tlpkg/dev/tlmgrgui2.pl b/Master/tlpkg/dev/tlmgrgui2.pl index 4e4eeac435d..60d13547435 100644 --- a/Master/tlpkg/dev/tlmgrgui2.pl +++ b/Master/tlpkg/dev/tlmgrgui2.pl @@ -144,23 +144,25 @@ $::action_button_state = ($::we_can_save ? "normal" : "disabled"); my $tlmgrrev = give_version(); chomp($tlmgrrev); -our $top = $mw->Frame; +#our $top = $mw->Frame; my $menu = $mw->Menu(); my $menu_file = $menu->Menu(); my $menu_options = $menu->Menu(); my $menu_actions = $menu->Menu(); my $menu_help = $menu->Menu(); -$menu->add('cascade', -label => "File", -menu => $menu_file); -$menu->add('cascade', -label => "Options", -menu => $menu_options); -$menu->add('cascade', -label => "Actions", -menu => $menu_actions); -$menu->add('cascade', -label => "Help", -menu => $menu_help); -$menu->add('separator'); -$menu->add('command', -label => "Loaded repository: none", - -command => sub { $location = $tlpdb_location; - update_loaded_location_string(); - run_update_functions(); - }); +$menu->add('cascade', -label => __("File"), -menu => $menu_file); +$menu->add('cascade', -label => __("Options"), -menu => $menu_options); +$menu->add('cascade', -label => __("Actions"), -menu => $menu_actions); +# on win32 people expect to have the Help button on the right side +if (win32()) { $menu->add('separator'); } +$menu->add('cascade', -label => __("Help"), -menu => $menu_help); +#$menu->add('separator'); +#$menu->add('command', -label => __("Loaded repository:") . __("none"), +# -command => sub { $location = $tlpdb_location; +# update_loaded_location_string(); +# run_update_functions(); +# }); # -activebackground => $menu->cget(-background)); # @@ -174,20 +176,20 @@ $menu_file->add('command', run_update_functions(); }); if (defined($cmdline_location)) { - $menu_file->add('command', -label => "Load cmd line repository: $cmdline_location", + $menu_file->add('command', -label => __("Load cmd line repository:") . " $cmdline_location", -command => sub { $location = $cmdline_location; update_loaded_location_string(); run_update_functions(); }); } -$menu_file->add('command', -label => "Load default net repository: $TeXLiveURL", +$menu_file->add('command', -label => __("Load default net repository:") . " $TeXLiveURL", -command => sub { $location = $TeXLiveURL; update_loaded_location_string(); run_update_functions(); }); -$menu_file->add('command', -label => "Load other repository ...", +$menu_file->add('command', -label => __("Load other repository ..."), -command => sub { menu_edit_location(); }); $menu_file->add('separator'); $menu_file->add('command', -label => __("Quit"), @@ -200,8 +202,10 @@ $menu_options->add('command', -label => __("General ..."), -command => sub { do_general_settings(); }); $menu_options->add('command', -label => __("Paper ..."), -command => sub { do_paper_settings(); }); -$menu_options->add('command', -label => __("Architectures ..."), - -command => sub { do_arch_settings(); }); +if (!win32()) { + $menu_options->add('command', -label => __("Architectures ..."), + -command => sub { do_arch_settings(); }); +} $menu_options->add('separator'); $menu_options->add('checkbutton', -label => __("Debug"), -onvalue => ($::opt_verbosity == 0 ? 1 : $::opt_verbosity), @@ -305,7 +309,7 @@ $mw->configure(-menu => $menu); our $back_f1 = $mw->Frame(); # pack .top .back -side top -fill both -expand 1 -$top->pack(-fill => 'x', @p_ii); +#$top->pack(-fill => 'x', @p_ii); $back_f1->pack(@x_xy); #require ("do_listframe.pl"); @@ -316,18 +320,25 @@ my $list_frame = $back_f1->Labelframe(-text => "Packages"); my $g = $list_frame->Scrolled('HList', -scrollbars => "se", -bd => 0, -command => \&show_extended_info, # does not work, double click! -columns => 7, -header => 1, - -borderwidth => 0, -padx => 0, -pady => 0, + -borderwidth => 0, #-padx => 0, -pady => 0, -separator => "/", -selectmode => "none"); +my $loaded_button = $back_f1->Button(-text => __("Loaded repository:") . __(" none"), + -relief => 'flat', + -command => sub { $location = $tlpdb_location; + update_loaded_location_string(); + run_update_functions(); + }); +$loaded_button->pack(-anchor => 'e', -padx => 0, -pady => 0, -ipadx => 0, -ipady => 0); # install screen -my $top_frame = $back_f1->Labelframe(-text => "Display configuration"); -$top_frame->pack(@x_x, @p_ii); +my $top_frame = $back_f1->Labelframe(-text => __("Display configuration")); +$top_frame->pack(@x_x, -padx => '2m'); my $filter_frame = $top_frame->Frame(); $filter_frame->pack; -my $filter_status = $filter_frame->Labelframe(-text => "Status"); +my $filter_status = $filter_frame->Labelframe(-text => __("Status")); $filter_status->pack(@left, @p_ii); my $status_all = 0; @@ -335,65 +346,80 @@ my $status_only_installed = 1; my $status_only_not_installed = 2; my $status_only_updated = 3; my $status_value = 0; -$filter_status->Radiobutton(-text => "all", -command => \&update_grid, +$filter_status->Radiobutton(-text => __("all"), -command => \&update_grid, -variable => \$status_value, -value => $status_all)->pack(@a_w); -$filter_status->Radiobutton(-text => "installed", -command => \&update_grid, +$filter_status->Radiobutton(-text => __("installed"), -command => \&update_grid, -variable => \$status_value, -value => $status_only_installed)->pack(@a_w); -$filter_status->Radiobutton(-text => "not installed", -command => \&update_grid, +$filter_status->Radiobutton(-text => __("not installed"), -command => \&update_grid, -variable => \$status_value, -value => $status_only_not_installed)->pack(@a_w); -$filter_status->Radiobutton(-text => "with updates", -command => \&update_grid, +$filter_status->Radiobutton(-text => __("with updates"), -command => \&update_grid, -variable => \$status_value, -value => $status_only_updated)->pack(@a_w); -my $filter_category = $filter_frame->Labelframe(-text => "Category"); +my $filter_category = $filter_frame->Labelframe(-text => __("Category")); $filter_category->pack(@left, @x_y, @p_ii); my $show_packages = 1; my $show_collections = 1; my $show_schemes = 1; -$filter_category->Checkbutton(-text => "packages", -command => \&update_grid, +$filter_category->Checkbutton(-text => __("packages"), -command => \&update_grid, -variable => \$show_packages)->pack(@a_w); -$filter_category->Checkbutton(-text => "collections", -command => \&update_grid, +$filter_category->Checkbutton(-text => __("collections"), -command => \&update_grid, -variable => \$show_collections)->pack(@a_w); -$filter_category->Checkbutton(-text => "schemes", -command => \&update_grid, +$filter_category->Checkbutton(-text => __("schemes"), -command => \&update_grid, -variable => \$show_schemes)->pack(@a_w); -my $filter_match = $filter_frame->Labelframe(-text => "Match"); +my $filter_match = $filter_frame->Labelframe(-text => __("Match")); $filter_match->pack(@left, @x_y, @p_ii); my $match_string = 0; -$filter_match->Checkbutton(-text => "matching:", +$filter_match->Checkbutton(-text => __("matching:"), + -command => \&update_grid, -variable => \$match_string)->pack(@a_w); my $match_entry = $filter_match->Entry(-width => 15, -validate => 'key', )->pack(@a_w, -padx => '2m', @x_x); $match_entry->configure(-validate => 'key', - -validatecommand => sub { $match_string = 1; update_grid(); return 1; }); + -validatecommand => sub { my $new_val = shift; + if (!$new_val) { + $match_string = 0; + } else { + $match_string = 1; + } + update_grid(); return 1; }); -my $filter_selection = $filter_frame->Labelframe(-text => "Selection"); +my $filter_selection = $filter_frame->Labelframe(-text => __("Selection")); $filter_selection->pack(@left, @x_y, @p_ii); my $selection_value = 0; $filter_selection->Radiobutton(-text => "all", -command => \&update_grid, -variable => \$selection_value, -value => 0)->pack(@a_w); -$filter_selection->Radiobutton(-text => "selected", -command => \&update_grid, - -variable => \$selection_value, -value => 1)->pack(@a_w); -$filter_selection->Radiobutton(-text => "not selected", -command => \&update_grid, - -variable => \$selection_value, -value => 2)->pack(@a_w); +$filter_selection->Radiobutton(-text => __("selected"), + -command => \&update_grid, -variable => \$selection_value, -value => 1) + ->pack(@a_w); +$filter_selection->Radiobutton(-text => __("not selected"), + -command => \&update_grid, -variable => \$selection_value, -value => 2) + ->pack(@a_w); -my $filter_button = $filter_frame->Labelframe(-text => "Action"); +my $filter_button = $filter_frame->Frame; +#my $filter_button = $filter_frame->Labelframe(-text => __("Action")); $filter_button->pack(@left, @x_y, @p_ii); -#$filter_button->Button(-text => "Apply filters", +#$filter_button->Button(-text => __("Apply filters"), # -command => sub { update_grid(); })->pack(@a_c, @p_ii); -$filter_button->Button(-text => "Reset filters", +$filter_button->Button(-text => __("Select all"), + -command => [ \&update_grid, 1 ])->pack(@x_x, @a_c); +$filter_button->Button(-text => __("Select none"), + -command => [ \&update_grid, 0 ])->pack(@x_x, @a_c); + +$filter_button->Button(-text => __("Reset filters"), -command => sub { $status_value = $status_all; $show_packages = 1; $show_collections = 1; $show_schemes = 1; $selection_value = 0; $match_string = 0; update_grid(); - })->pack(@left, @a_c, @p_ii); + })->pack(@x_x, @a_c); ########## Packages ####################### -#my $list_frame = $back_f1->Labelframe(-text => "Packages"); +#my $list_frame = $back_f1->Labelframe(-text => __("Packages"); $list_frame->pack(@x_xy, @p_ii); #my $g = $list_frame->Scrolled('HList', -scrollbars => "se", -bd => 0, # -command => \&show_extended_info, # does not work, double click! @@ -413,23 +439,23 @@ my @htype = qw/-relief ridge/; #my $all_none; #$all_none = $g->Checkbutton(-command => [\&update_grid, $all_none->{'Value'} ]); #$g->headerCreate(0, @htype, -itemtype => 'window', -widget => $all_none); -my $f = $g->Frame(); -my $bi = $f->Button(-padx => 1, -pady => 3, - -text => 'all', -command => [ \&update_grid, 1 ]); -my $bii= $f->Button(-padx => 1, -pady => 3, - -text => 'none', -command => [ \&update_grid, 0 ]); -$bi->pack(@left); -$bii->pack(@right); -$g->headerCreate(0, @htype, -itemtype => 'window', -widget => $f); -$g->headerCreate(1, @htype, -itemtype => 'text', -text => "Package"); -$g->headerCreate(2, @htype, -itemtype => 'text', -text => "Local\nRevision"); -$g->headerCreate(3, @htype, -itemtype => 'text', -text => "Remote\nRevision"); -$g->headerCreate(4, @htype, -itemtype => 'text', -text => "Local\nVersion"); -$g->headerCreate(5, @htype, -itemtype => 'text', -text => "Remote\nVersion"); -$g->headerCreate(6, @htype, -itemtype => 'text', -text => "Short Desc"); - -$g->columnWidth(4, -char => 10); -$g->columnWidth(5, -char => 10); +#my $f = $g->Frame(); +#my $bi = $f->Button(-padx => 1, -pady => 3, +# -text => 'all', -command => [ \&update_grid, 1 ]); +#my $bii= $f->Button(-padx => 1, -pady => 3, +# -text => 'none', -command => [ \&update_grid, 0 ]); +#$bi->pack(@left); +#$bii->pack(@right); +#$g->headerCreate(0, @htype, -itemtype => 'window', -widget => $f); +$g->headerCreate(0, @htype, -itemtype => 'text', -text => ""); +$g->headerCreate(1, @htype, -itemtype => 'text', -text => __("Package name")); +$g->headerCreate(2, @htype, -itemtype => 'text', -text => __("Local rev. (ver.)")); +$g->headerCreate(3, @htype, -itemtype => 'text', -text => __("Remote rev. (ver.)")); +$g->headerCreate(4, @htype, -itemtype => 'text', -text => __("Short description")); + +$g->columnWidth(0, 40); +$g->columnWidth(2, -char => 15); +$g->columnWidth(3, -char => 15); setup_list(); update_grid(); @@ -441,12 +467,12 @@ sub show_extended_info { my $sw = $mw->Toplevel(-title => __("Details on:") . $p); $sw->transient($mw); - $sw->Label(-text => "Package:")->grid( + $sw->Label(-text => __("Package:"))->grid( $sw->Label(-text => $p), -sticky => "nw"); - $sw->Label(-text => "Category:")->grid( + $sw->Label(-text => __("Category:"))->grid( $sw->Label(-text => $Packages{$p}{'tlp'}->category), -sticky => "nw"); - $sw->Label(-text => "Short Desc:")->grid( + $sw->Label(-text => __("Short description:"))->grid( $sw->Label(-wraplength => '500', -justify => 'left', -text => $Packages{$p}{'tlp'}->shortdesc), -sticky => "nw"); @@ -455,19 +481,29 @@ sub show_extended_info { # -width => 50, -wrap => 'word', -relief => 'flat'); #$t->insert("1.0", $Packages{$p}{'tlp'}->longdesc); #$sw->Label(-text => "Long Desc:")->grid($t, -sticky => 'nw'); - $sw->Label(-text => "Long Desc:")->grid( + $sw->Label(-text => __("Long description:"))->grid( $sw->Label(-wraplength => '500', -justify => 'left', -text => $Packages{$p}{'tlp'}->longdesc), -sticky => "nw"); - $sw->Label(-text => "Installed:")->grid( - $sw->Label(-text => ($Packages{$p}{'installed'} ? "Yes" : "No")), + $sw->Label(-text => __("Installed:"))->grid( + $sw->Label(-text => ($Packages{$p}{'installed'} ? __("Yes") : __("No"))), -sticky => "nw"); - $sw->Label(-text => "Local Revision:")->grid( + $sw->Label(-text => __("Local Revision:"))->grid( $sw->Label(-text => $Packages{$p}{'localrevision'}), -sticky => "nw"); - $sw->Label(-text => "Remote Revision:")->grid( + if (defined($Packages{$p}{'localcatalogueversion'})) { + $sw->Label(-text => __("Local Catalogue Version:"))->grid( + $sw->Label(-text => $Packages{$p}{'localcatalogueversion'}), + -sticky => "nw"); + } + $sw->Label(-text => __("Remote Revision:"))->grid( $sw->Label(-text => $Packages{$p}{'remoterevision'}), -sticky => "nw"); + if (defined($Packages{$p}{'remotecatalogueversion'})) { + $sw->Label(-text => __("Remote Catalogue Version:"))->grid( + $sw->Label(-text => $Packages{$p}{'remotecatalogueversion'}), + -sticky => "nw"); + } $sw->Button(-text => __("Ok"), -width => 10, -command => sub { $sw->destroy; })->grid(-columnspan => 2); @@ -516,15 +552,17 @@ sub update_grid { $Packages{$p}{'cb'}->configure(-background => ($i%2?'gray90':'gray70')); $g->itemCreate($p, 1, -itemtype => 'text', -style => $st, -text => $Packages{$p}{'displayname'}); - $g->itemCreate($p, 2, -itemtype => 'text', -style => $st, - -text => ($Packages{$p}{'localrevision'} || '')); - $g->itemCreate($p, 3, -itemtype => 'text', -style => $st, - -text => ($Packages{$p}{'remoterevision'} || '')); + my $t = ($Packages{$p}{'localrevision'} || ''); + if ($Packages{$p}{'localcatalogueversion'}) { + $t .= " ($Packages{$p}{'localcatalogueversion'})"; + } + $g->itemCreate($p, 2, -itemtype => 'text', -style => $st, -text => $t); + $t = ($Packages{$p}{'remoterevision'} || ''); + if ($Packages{$p}{'remotecatalogueversion'}) { + $t .= " ($Packages{$p}{'remotecatalogueversion'})"; + } + $g->itemCreate($p, 3, -itemtype => 'text', -style => $st, -text => $t); $g->itemCreate($p, 4, -itemtype => 'text', -style => $st, - -text => ($Packages{$p}{'localcatalogueversion'} || '')); - $g->itemCreate($p, 5, -itemtype => 'text', -style => $st, - -text => ($Packages{$p}{'remotecatalogueversion'} || '')); - $g->itemCreate($p, 6, -itemtype => 'text', -style => $st, -text => $Packages{$p}{'tlp'}->shortdesc); $i++; } @@ -597,13 +635,14 @@ sub MatchesFilters { ####### actions frame -my $bot_frame = $back_f1->Labelframe(-text => "Actions"); +#my $bot_frame = $back_f1->Labelframe(-text => "Actions"); +my $bot_frame = $back_f1->Frame; $bot_frame->pack(@x_x, @p_ii); my $actions_frame = $bot_frame->Frame; $actions_frame->pack(); -my $with_sel_frame = $actions_frame->Labelframe(-text => "with selected"); +my $with_sel_frame = $actions_frame->Labelframe(-text => __("with selected")); $with_sel_frame->pack(@left, @p_ii); @@ -621,26 +660,26 @@ my $action_apply_filter = 1; # -variable => \$action_apply_filter, -value => 0)->pack(@left, @p_ii); # -$with_sel_frame->Button(-text => 'Install', +$with_sel_frame->Button(-text => __('Install'), -state => $::action_button_state, -command => sub { install_selected_packages(); } )->pack(@left, @p_ii); -$with_sel_frame->Button(-text => 'Update', +$with_sel_frame->Button(-text => __('Update'), -state => $::action_button_state, -command => sub { update_selected_packages(); } )->pack(@left, @p_ii); -$with_sel_frame->Button(-text => 'Remove', +$with_sel_frame->Button(-text => __('Remove'), -state => $::action_button_state, -command => sub { remove_selected_packages(); } )->pack(@left, @p_ii); -$with_sel_frame->Button(-text => 'Backup', +$with_sel_frame->Button(-text => __('Backup'), -state => $::action_button_state, -command => sub { backup_selected_packages(); } )->pack(@left, @p_ii); -my $with_all_frame = $actions_frame->Labelframe(-text => "with all"); +my $with_all_frame = $actions_frame->Labelframe(-text => __("with all")); $with_all_frame->pack(@left, @p_ii); -$with_all_frame->Button(-text => 'Update all', +$with_all_frame->Button(-text => __('Update all'), -state => $::action_button_state, -command => sub { update_all_packages(); } )->pack(@a_c,@left,@p_ii); @@ -1558,7 +1597,7 @@ sub menu_edit_location { sub update_loaded_location_string { my $arg = shift; $arg || ($arg = $location); - $menu->entryconfigure('end', -label => "Loaded repository: $arg"); + $loaded_button->configure(-text => "Loaded repository: $arg"); } sub run_update_functions { |