diff options
Diffstat (limited to 'Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl')
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl new file mode 100644 index 00000000000..85a8cbcce79 --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl @@ -0,0 +1,150 @@ +# guinb2.pl +# $Id$ +# +# Copyright 2009 Tomasz Luczak, Norbert Preining +# +# GUI for tlmgr +# + +####################################### GUI remove packages +# frame .back.f2 +$back_f2 = $back->Frame(); + +####################### row 1 + +# frame .back.f2.f1 -relief ridge -borderwidth 2 +our $back_f2_f1 = $back_f2->Frame(-relief => "ridge", -borderwidth => 2); +# label .back.f2.f1.l -text "Removing packages" \ +# -foreground blue -font {helvetica 10 bold} +$back_f2_f1_l = $back_f2_f1->Label(-text => "Removing packages", + -foreground => "blue", -font => "helvetica 10 bold"); +# label .back.f2.f1.l1 -text "Use Ctrl or Shift or drag to select more" +our $back_f2_f1_l1 = $back_f2_f1->Label(-text => "Use Ctrl or Shift or drag to select more"); + +# grid .back.f2.f1 -row 1 -column 1 -columnspan 3 -padx 2m -pady 2m -sticky nwe +$back_f2_f1->grid(-row => 1, -column => 1, -columnspan => 3, + -padx => "2m", -pady => "2m", -sticky => "nwe"); +# pack .back.f2.f1.l .back.f2.f1.l1 -side top +$back_f2_f1_l->pack(-side => "top"); +$back_f2_f1_l1->pack(-side => "top"); + +####################### row 2 col 1 +# list of packages +# labelframe .back.f2.f21 -text "Select packages for removal" +our $back_f2_f21 = $back_f2->Labelframe(-text => "Select packages for removal"); +# grid .back.f2.f21 -row 2 -column 1 -sticky nswe -padx 2m -pady 1m +$back_f2_f21->grid(-row => 2, -column => 1, -sticky => "nswe", + -padx => "2m", -pady => "1m"); +# search field +# frame .back.f2.f21.f +our $back_f2_f21_f = $back_f2_f21->Frame(); +# pack .back.f2.f21.f -pady 1m +$back_f2_f21_f->pack(-pady => "1m"); +# label .back.f2.f21.f.l -text "Search" +our $back_f2_f21_f_l = $back_f2_f21_f->Label(-text => "Search"); +# entry .back.f2.f21.f.e -validate key -validatecommand { +# set searchListRm [.back.f2.f21.lb get 0 end] +# set listPositionRm [lsearch $searchListRm " %P*"] +# if {$listPositionRm ne -1} then { +# .back.f2.f21.lb yview $listPositionRm +# .back.f2.f21.lb selection set $listPositionRm +# } +# return 1 +# } +our $back_f2_f21_f_e = $back_f2_f21_f->Entry( + -validate => "key", + -validatecommand => sub { validate_search_input($back_f2_f21_lb, $back_f2_f23_t, $_[0], @alllocalpackages); } ); +# button .back.f2.f21.f.b -text "Next" -command {} +our $back_f2_f21_f_b = $back_f2_f21_f->Button(-text => "Next", + -command => sub { find_next_search_match($back_f2_f21_lb, $back_f2_f21_f_e, $back_f2_f23_t, @alllocalpackages); }); +# pack .back.f2.f21.f.l .back.f2.f21.f.e .back.f2.f21.f.b -anchor w -side left -padx 1m -pady 1m +$back_f2_f21_f_l->pack(-anchor => "w", -side => "left", + -padx => "1m", -pady => "1m"); +$back_f2_f21_f_e->pack(-anchor => "w", -side => "left", + -padx => "1m", -pady => "1m"); +$back_f2_f21_f_b->pack(-anchor => "w", -side => "left", + -padx => "1m", -pady => "1m"); + +# listbox .back.f2.f21.lb -width 40 -height 24 \ +# -selectmode extended \ +# -yscrollcommand ".back.f2.f21.scry set" \ +# -xscrollcommand ".back.f2.f21.scrx set" +our $back_f2_f21_scry; +our $back_f2_f21_scrx; +our $back_f2_f21_lb = $back_f2_f21->Listbox(-width => 30, -height => 24, + -listvariable => \@alllocalpackages, + -selectmode => "extended", + -yscrollcommand => sub { $back_f2_f21_scry->set(@_); }, + -xscrollcommand => sub { $back_f2_f21_scrx->set(@_); }); +$back_f2_f21_lb->bind('<<ListboxSelect>>', + sub { update_info_window ($back_f2_f21_lb, $back_f2_f23_t, @alllocalpackages); }); +# scrollbar .back.f2.f21.scrx -command ".back.f2.f21.lb xview" -orient horizontal +$back_f2_f21_scrx = $back_f2_f21->Scrollbar( + -command => sub { $back_f2_f21_lb->xview(@_); }, -orient => "horizontal"); +# scrollbar .back.f2.f21.scry -command ".back.f2.f21.lb yview" -orient vertical +$back_f2_f21_scry = $back_f2_f21->Scrollbar( + -command => sub { $back_f2_f21_lb->yview(@_); }, -orient => "vertical"); +# pack .back.f2.f21.scrx -side bottom -fill x +# pack .back.f2.f21.scry -side right -fill y +# pack .back.f2.f21.lb -fill y -expand 1 +$back_f2_f21_scrx->pack(-side => "bottom", -fill => "x"); +$back_f2_f21_scry->pack(-side => "right", -fill => "y"); +$back_f2_f21_lb->pack(-fill => "y", -expand => 1); + +###################### row2 col 2 +# buttons +# labelframe .back.f2.f22 -text "Buttons" +our $back_f2_f22 = $back_f2->Labelframe(-text => "Buttons"); +# grid .back.f2.f22 -row 2 -column 2 -sticky nswe -pady 1m +$back_f2_f22->grid(-row => 2, -column => 2, -sticky => "nswe", -pady => "1m"); + +# button .back.f2.f22.b1 -text "Remove" -command {} +our $back_f2_f22_b1 = $back_f2_f22->Button(-text => "Remove", + -command => sub { my @l = $back_f2_f21_lb->curselection; + my @pl; + foreach my $i (@l) { + my $foo = $alllocalpackages[$i]; + $foo =~ s/^\s*(\(i\) )?//; + push @pl, $foo; + } + remove_selected_packages(@pl); }); +# button .back.f2.f22.b2 -text "Quit" -command {} +our $back_f2_f22_b2 = $back_f2_f22->Button(-text => "Quit", + -command => sub { $mw->destroy; exit(0); }); + +# pack .back.f2.f22.b1 .back.f2.f22.b2 .back.f2.f22.b3 \ +# -side top -anchor center -padx 2m -pady 2m +$back_f2_f22_b1->pack(-side => "top", -anchor => "center", -padx => "2m", -pady => "2m"); +$back_f2_f22_b2->pack(-side => "top", -anchor => "center", -padx => "2m", -pady => "2m"); + +####################### row 2 col 3 +# text: info +# labelframe .back.f2.f23 -text "Info on the selected item" +our $back_f2_f23 = $back_f2->Labelframe(-text => "Info on the selected item"); +# grid .back.f2.f23 -row 2 -column 3 -sticky nswe -padx 2m -pady 1m +$back_f2_f23->grid(-row => 2, -column => 3, -sticky => "nswe", + -padx => "2m", -pady => "1m"); +# set f323 .back.f2.f23 +# text $f323.t -width 65 -wrap word \ +# -yscrollcommand "$f323.scry set" +our $back_f2_f23_scry; +our $back_f2_f23_t = $back_f2_f23->Text(-width => 45, -wrap => "word", + -yscrollcommand => sub { $back_f2_f23_scry->set(@_); } ); +# $f323.t insert end "\nAttention: to display package information, the CD drive with the TeX Live CD should be selected in the \"Add packages\" tab.\n\nFirst fill in the list using the \"Search\" button, then select an item and click the \"Remove\" button to remove the package." +$back_f2_f23_t->insert("end", "\nAttention: to display package information, the CD drive with the TeX Live CD should be selected in the \"Add packages\" tab.\n\nFirst fill in the list using the \"Search\" button, then select an item and click the \"Remove\" button to remove the package."); +# scrollbar $f323.scry -command "$f323.t yview" -orient vertical +$back_f2_f23_scry = $back_f2_f23->Scrollbar( + -command => sub { $back_f2_f23_t->yview(@_); }, -orient => "vertical"); +# pack $f323.scry -side right -fill y +$back_f2_f23_scry->pack(-side => "right", -fill => "y"); +# pack $f323.t -expand 1 -fill both +$back_f2_f23_t->pack(-expand => 1, -fill => "both"); + + +# EOF +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # |