diff options
author | Norbert Preining <preining@logic.at> | 2008-05-02 16:27:33 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-05-02 16:27:33 +0000 |
commit | 2d3ec7a37b3ee9b2048d1a2352709dea121e1e30 (patch) | |
tree | f1ac5af80d4f9e02e1cd92a1818c8a0d91167db1 /Master | |
parent | 00fbe3660d924502d80b22ee3e02680ee2a3e4e5 (diff) |
add tlmgrgui start
git-svn-id: svn://tug.org/texlive/trunk@7807 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/guinb1.pl | 191 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/guinb1.tcl | 84 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/guinb2.pl | 136 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/guinb2.tcl | 70 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl | 105 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.tcl | 24 |
6 files changed, 610 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/guinb1.pl b/Master/texmf/scripts/texlive/tlmgrgui/guinb1.pl new file mode 100644 index 00000000000..0744385220b --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/guinb1.pl @@ -0,0 +1,191 @@ +# guinb1.pl +# $Id$ +# +# Copyright 2009 Tomasz Luczak, Norbert Preining +# +# GUI for tlmgr +# + + +# frame .back.f1 +$back_f1 = $back->Frame; + +####################### row 1 + +# frame .back.f1.f1 -relief ridge -borderwidth 2 +our $back_f1_f1 = $back_f1->Frame(-relief => 'ridge', -borderwidth => 2); +# label .back.f1.f1.l -text "Adding packages" \ +# -foreground blue -font {helvetica 10 bold} +our $back_f1_f1_l = $back_f1_f1->Label(-text => 'Adding packages', + -foreground => "blue", -font => "helvetica 10 bold"); +# label .back.f1.f1.l1 -text "Use Ctrl or Shift or drag to select more" +our $back_f1_f1_l1 = $back_f1_f1->Label(-text => "Use Ctrl or Shift or drag to select more"); +# grid .back.f1.f1 -row 1 -column 1 -columnspan 3 -padx 2m -pady 2m -sticky nwe +$back_f1_f1->grid(-row => 1, -column => 1, -columnspan => 3, + -padx => "2m", -pady => "2m", -sticky => "nwe"); +# pack .back.f1.f1.l .back.f1.f1.l1 -side top +$back_f1_f1_l->pack(-side => "top"); +$back_f1_f1_l1->pack(-side => "top"); + + +####################### row 2 col 1 +# listbox: packages +#labelframe .back.f1.f21 -text "Select packages to install" +our $back_f1_f21 = $back_f1->Labelframe(-text => "Select packages to install"); +# grid .back.f1.f21 -row 2 -column 1 -rowspan 2 \ +# -sticky nswe -padx 2m -pady 1m +$back_f1_f21->grid(-row => 2, -column => 1, -rowspan => 2, + -sticky => "nswe", -padx => "2m", -pady => "1m"); + + +# search field +# frame .back.f1.f21.f +our $back_f1_f21_f = $back_f1_f21->Frame; +# pack .back.f1.f21.f -pady 1m +$back_f1_f21_f->pack(-pady => "1m"); +# label .back.f1.f21.f.l -text "Search" +our $back_f1_f21_f_l = $back_f1_f21_f->Label(-text => "Search"); +# entry .back.f1.f21.f.e -validate key -validatecommand { +# set searchListAdd [.back.f1.f21.lb get 0 end] +# set listPositionAdd [lsearch $searchListAdd " %P*"] +# if {$listPositionAdd ne -1} then { +# .back.f1.f21.lb yview $listPositionAdd +# .back.f1.f21.lb selection set $listPositionAdd +# } +# return 1 +# } +our $back_f1_f21_f_e = $back_f1_f21_f->Entry( + -validate => "key", -validatecommand => sub { print "TO BE DONE\n"; }); +# button .back.f1.f21.f.b -text "Next" -command {} +our $back_f1_f21_f_b = $back_f1_f21_f->Button(-text => "Next", + -command => sub { print "TO BE DONE\n"; }); +# pack .back.f1.f21.f.l .back.f1.f21.f.e .back.f1.f21.f.b \ +# -anchor w -side left -padx 1m -pady 1m +$back_f1_f21_f_l->pack(-anchor => "w", -side => "left", -padx => "1m", -pady => "1m"); +$back_f1_f21_f_e->pack(-anchor => "w", -side => "left", -padx => "1m", -pady => "1m"); +$back_f1_f21_f_b->pack(-anchor => "w", -side => "left", -padx => "1m", -pady => "1m"); + +# listbox .back.f1.f21.lb -width 40 -height 24 \ +# -selectmode extended \ +# -yscrollcommand ".back.f1.f21.scry set" \ +# -xscrollcommand ".back.f1.f21.scrx set" +our $back_f1_f21_scry; +our $back_f1_f21_scrx; +$back_f1_f21_lb = $back_f1_f21->Listbox(-width => 30, -height => 24, + -listvariable => \@allpackages, + -selectmode => "extended", + -yscrollcommand => sub { $back_f1_f21_scry->set(@_); }, + -xscrollcommand => sub { $back_f1_f21_scrx->set(@_); } ); +# scrollbar .back.f1.f21.scrx -command ".back.f1.f21.lb xview" -orient horizontal +$back_f1_f21_scrx = $back_f1_f21->Scrollbar( + -command => sub { $back_f1_f21_lb->xview(@_); }, -orient => "horizontal"); +# scrollbar .back.f1.f21.scry -command ".back.f1.f21.lb yview" -orient vertical +$back_f1_f21_scry = $back_f1_f21->Scrollbar( + -command => sub { $back_f1_f21_lb->yview(@_); }, -orient => "vertical"); +# pack .back.f1.f21.scrx -side bottom -fill x +$back_f1_f21_scrx->pack(-side => "bottom", -fill => "x"); +# pack .back.f1.f21.scry -side right -fill y +$back_f1_f21_scry->pack(-side => "right", -fill => "y"); +# pack .back.f1.f21.lb -fill y -expand 1 +$back_f1_f21_lb->pack(-fill => "y", -expand => 1); + +###################### row2 col 2 +# Buttons +# labelframe .back.f1.f22 -text "Buttons" +our $back_f1_f22 = $back_f1->Labelframe(-text => "Buttons"); +# grid .back.f1.f22 -row 2 -column 2 -rowspan 2 \ +# -sticky nswe -pady 1m +$back_f1_f22->grid(-row => 2, -column => 2, -rowspan =>2, + -sticky => "nswe", -pady => "1m"); + +## Buttons +# button .back.f1.f22.b1 -text "Search" -command {} +our $back_f1_f22_b1 = $back_f1_f22->Button(-text => "Search"); +# button .back.f1.f22.b2 -text "Install" -command {} +our $back_f1_f22_b2 = $back_f1_f22->Button(-text => "Install"); +# button .back.f1.f22.b3 -text "Info" -command {} +our $back_f1_f22_b3 = $back_f1_f22->Button(-text => "Info"); + +# pack .back.f1.f22.b1 .back.f1.f22.b2 .back.f1.f22.b3 \ +# -side top -anchor center -padx 2m -pady 2m +$back_f1_f22_b1->pack(-side => "top", -anchor => "center", + -padx => "2m", -pady => "2m"); +$back_f1_f22_b2->pack(-side => "top", -anchor => "center", + -padx => "2m", -pady => "2m"); +$back_f1_f22_b3->pack(-side => "top", -anchor => "center", + -padx => "2m", -pady => "2m"); + +######################## row 2 col 3 +## CD-ROM +# labelframe .back.f1.f23 -text "CD/DVD" +our $back_f1_f23 = $back_f1->Labelframe(-text => "Location"); +# grid .back.f1.f23 -row 2 -column 3 -sticky nswe -padx 2m -pady 1m +$back_f1_f23->grid(-row => 2, -column => 3, -sticky => "nswe", + -padx => "2m", -pady => "1m"); + +## CD-ROM +# button .back.f1.f23.b -text "CD/DVD" -command {} +our $back_f1_f23_b = $back_f1_f23->Button(-text => "Change", + -command => sub { menu_edit_location(); }); +# label .back.f1.f23.l -width 30 -textvariable dircd -relief sunken -anchor w +our $back_f1_f23_l = $back_f1_f23->Label(-width => 30, -textvariable => \$location, -relief => "sunken", -anchor => "w"); +# pack .back.f1.f23.b -side left -padx 2m -pady 2m +$back_f1_f23_b->pack(-side => "left", -padx => "2m", -pady => "2m"); +# pack .back.f1.f23.l -side left -padx 2m -pady 2m -expand 1 -fill x +$back_f1_f23_l->pack(-side => "left", -padx => "2m", -pady => "2m", + -expand => 1, -fill => "x"); + + +####################### row 3 col 3 +## text: info +# labelframe .back.f1.f33 -text "Info on the selected item" +our $back_f1_f33 = $back_f1->Labelframe(-text => "Info on the selected item"); +# grid .back.f1.f33 -row 3 -column 3 -sticky nswe -padx 2m -pady 1m +$back_f1_f33->grid(-row => 3, -column => 3, -sticky => "nswe", + -padx => "2m", -pady => "1m"); + + + +# text .back.f1.f33.t -width 65 -wrap word \ +# -yscrollcommand ".back.f1.f33.scry set" +our $back_f1_f33_scry; +our $back_f1_f33_t = $back_f1_f33->Text(-width => 45, -wrap => "word", + -yscrollcommand => sub { $back_f1_f33_scry->set(@_); }); +# .back.f1.f33.t insert end "\nAttention. Please check if a CD drive with the TeX Live CD\n is properly selected.\n\nFirst fill in the list using the \"Search\" button, then select an item and click the \"Install\" or \"Info\" button." +# +$back_f1_f33_t->insert("end", "\nAttention. Please check if a CD drive with the TeX Live CD\n is properly selected.\n\nFirst fill in the list using the \"Search\" button, then select an item and click the \"Install\" or \"Info\" button."); + +#scrollbar .back.f1.f33.scry -command ".back.f1.f33.t yview" -orient vertical +$back_f1_f33_scry = $back_f1_f33->Scrollbar( + -command => sub { $back_f1_f33_t->yview(@_); }, -orient => "vertical"); + +# pack .back.f1.f33.scry -side right -fill y + +$back_f1_f33_scry->pack(-side => "right", -fill => "y"); + +# pack .back.f1.f33.t -expand 1 -fill y +$back_f1_f33_t->pack(-expand => 1, -fill => "both"); + + +############### + +sub menu_edit_location { + my $key = shift; + my $val = $location; + my $sw = $mw->Toplevel(-title => "Change Location"); + $sw->Label(-text => "New location: ")->pack; + my $entry = $sw->Entry(-text => $location, -width => 30); + $entry->pack; + my $f = $sw->Frame; + $f->Button(-text => 'ok', + -command => sub { $location = $entry->get; + init_install_media($location) ; + $sw->destroy })->pack(-side => 'left'); + $f->Button(-text => 'cancel', + -command => sub { $sw->destroy })->pack(-side => 'right'); + $f->pack(-expand => 'x'); +} + + +1; + diff --git a/Master/texmf/scripts/texlive/tlmgrgui/guinb1.tcl b/Master/texmf/scripts/texlive/tlmgrgui/guinb1.tcl new file mode 100644 index 00000000000..66fbde6431f --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/guinb1.tcl @@ -0,0 +1,84 @@ +# -*-Tcl-*- +### TL install packages +## 2005-2008 Tomasz Luczak tlu@technodat.com.pl +# $Id$ +####################################### GUI add packages +frame .back.f1 +####################### row 1 + +frame .back.f1.f1 -relief ridge -borderwidth 2 +label .back.f1.f1.l -text "Adding packages" \ + -foreground blue -font {helvetica 10 bold} +label .back.f1.f1.l1 -text "Use Ctrl or Shift or drag to select more" +grid .back.f1.f1 -row 1 -column 1 -columnspan 3 -padx 2m -pady 2m -sticky nwe +pack .back.f1.f1.l .back.f1.f1.l1 -side top + +####################### row 2 col 1 +# listbox: packages +labelframe .back.f1.f21 -text "Select packages to install" +grid .back.f1.f21 -row 2 -column 1 -rowspan 2 \ + -sticky nswe -padx 2m -pady 1m +# search field +frame .back.f1.f21.f +pack .back.f1.f21.f -pady 1m +label .back.f1.f21.f.l -text "Search" +entry .back.f1.f21.f.e -validate key -validatecommand { + set searchListAdd [.back.f1.f21.lb get 0 end] + set listPositionAdd [lsearch $searchListAdd " %P*"] + if {$listPositionAdd ne -1} then { + .back.f1.f21.lb yview $listPositionAdd + .back.f1.f21.lb selection set $listPositionAdd + } + return 1 +} +button .back.f1.f21.f.b -text "Next" -command {} +pack .back.f1.f21.f.l .back.f1.f21.f.e .back.f1.f21.f.b \ + -anchor w -side left -padx 1m -pady 1m + +listbox .back.f1.f21.lb -width 40 -height 24 \ + -selectmode extended \ + -yscrollcommand ".back.f1.f21.scry set" \ + -xscrollcommand ".back.f1.f21.scrx set" +scrollbar .back.f1.f21.scrx -command ".back.f1.f21.lb xview" -orient horizontal +scrollbar .back.f1.f21.scry -command ".back.f1.f21.lb yview" -orient vertical +pack .back.f1.f21.scrx -side bottom -fill x +pack .back.f1.f21.scry -side right -fill y +pack .back.f1.f21.lb -fill y -expand 1 +###################### row2 col 2 +# Buttons +labelframe .back.f1.f22 -text "Buttons" +grid .back.f1.f22 -row 2 -column 2 -rowspan 2 \ + -sticky nswe -pady 1m + +## Buttons +button .back.f1.f22.b1 -text "Search" -command {} +button .back.f1.f22.b2 -text "Install" -command {} +button .back.f1.f22.b3 -text "Info" -command {} + +pack .back.f1.f22.b1 .back.f1.f22.b2 .back.f1.f22.b3 \ + -side top -anchor center -padx 2m -pady 2m + +######################## row 2 col 3 +## CD-ROM +labelframe .back.f1.f23 -text "CD/DVD" +grid .back.f1.f23 -row 2 -column 3 -sticky nswe -padx 2m -pady 1m + +## CD-ROM +button .back.f1.f23.b -text "CD/DVD" -command {} +label .back.f1.f23.l -width 30 -textvariable dircd -relief sunken -anchor w +pack .back.f1.f23.b -side left -padx 2m -pady 2m +pack .back.f1.f23.l -side left -padx 2m -pady 2m -expand 1 -fill x + +####################### row 3 col 3 +## text: info +labelframe .back.f1.f33 -text "Info on the selected item" +grid .back.f1.f33 -row 3 -column 3 -sticky nswe -padx 2m -pady 1m + +text .back.f1.f33.t -width 65 -wrap word \ + -yscrollcommand ".back.f1.f33.scry set" +.back.f1.f33.t insert end "\nAttention. Please check if a CD drive with the TeX Live CD\n is properly selected.\n\nFirst fill in the list using the \"Search\" button, then select an item and click the \"Install\" or \"Info\" button." +scrollbar .back.f1.f33.scry -command ".back.f1.f33.t yview" -orient vertical +pack .back.f1.f33.scry -side right -fill y +pack .back.f1.f33.t -expand 1 -fill y + +# EOF diff --git a/Master/texmf/scripts/texlive/tlmgrgui/guinb2.pl b/Master/texmf/scripts/texlive/tlmgrgui/guinb2.pl new file mode 100644 index 00000000000..e69d307a9b1 --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/guinb2.pl @@ -0,0 +1,136 @@ +# 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 { } ); +# button .back.f2.f21.f.b -text "Next" -command {} +our $back_f2_f21_f_b = $back_f2_f21_f->Button(-text => "Next", + -command => sub {}); +# 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(@_); }); +# 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 "Search" -command {} +our $back_f2_f22_b1 = $back_f2_f22->Button(-text => "Search", -command => sub {}); +# button .back.f2.f22.b2 -text "Remove" -command {} +our $back_f2_f22_b2 = $back_f2_f22->Button(-text => "Remove", -command => sub {}); +# button .back.f2.f22.b3 -text "Info" -command {} +our $back_f2_f22_b3 = $back_f2_f22->Button(-text => "Info", -command => sub {}); + +# 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"); +$back_f2_f22_b3->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 + diff --git a/Master/texmf/scripts/texlive/tlmgrgui/guinb2.tcl b/Master/texmf/scripts/texlive/tlmgrgui/guinb2.tcl new file mode 100644 index 00000000000..661517d303b --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/guinb2.tcl @@ -0,0 +1,70 @@ +# -*-Tcl-*- +### TL remove packages +## 2005-2008 Tomasz Luczak tlu@technodat.com.pl +# $Id$ +####################################### GUI remove packages +frame .back.f2 +####################### row 1 + +frame .back.f2.f1 -relief ridge -borderwidth 2 +label .back.f2.f1.l -text "Removing packages" \ + -foreground blue -font {helvetica 10 bold} +label .back.f2.f1.l1 -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 +pack .back.f2.f1.l .back.f2.f1.l1 -side top + +####################### row 2 col 1 +# list of packages +labelframe .back.f2.f21 -text "Select packages for removal" +grid .back.f2.f21 -row 2 -column 1 -sticky nswe -padx 2m -pady 1m +# search field +frame .back.f2.f21.f +pack .back.f2.f21.f -pady 1m +label .back.f2.f21.f.l -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 +} +button .back.f2.f21.f.b -text "Next" -command {} +pack .back.f2.f21.f.l .back.f2.f21.f.e .back.f2.f21.f.b -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" +scrollbar .back.f2.f21.scrx -command ".back.f2.f21.lb xview" -orient horizontal +scrollbar .back.f2.f21.scry -command ".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 +###################### row2 col 2 +# buttons +labelframe .back.f2.f22 -text "Buttons" +grid .back.f2.f22 -row 2 -column 2 -sticky nswe -pady 1m + +button .back.f2.f22.b1 -text "Search" -command {} +button .back.f2.f22.b2 -text "Remove" -command {} +button .back.f2.f22.b3 -text "Info" -command {} + +pack .back.f2.f22.b1 .back.f2.f22.b2 .back.f2.f22.b3 \ + -side top -anchor center -padx 2m -pady 2m + +####################### row 2 col 3 +# text: info +labelframe .back.f2.f23 -text "Info on the selected item" +set f323 .back.f2.f23 +grid .back.f2.f23 -row 2 -column 3 -sticky nswe -padx 2m -pady 1m +text $f323.t -width 65 -wrap word \ + -yscrollcommand "$f323.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." +scrollbar $f323.scry -command "$f323.t yview" -orient vertical +pack $f323.scry -side right -fill y +pack $f323.t -expand 1 -fill both + +# EOF diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl new file mode 100644 index 00000000000..4b80677b6eb --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.pl @@ -0,0 +1,105 @@ +#!/usr/bin/env perl +# +# $Id$ +# +# Copyright 2009 Tomasz Luczak, Norbert Preining +# +# GUI for tlmgr +# + +our $Master; + +BEGIN { + $^W = 1; + $Master = `kpsewhich -var-value=SELFAUTOPARENT`; + chomp($Master); + unshift (@INC, "$Master/tlpkg"); +} + +use TeXLive::TLMedia; +use TeXLive::TLPDB; +use TeXLive::TLUtils qw(setup_programs); + +use Tk; +use Tk::Dialog; + + +our $back_f1; +our $back_f2; + +our $localtlpdb = TeXLive::TLPDB->new ("root" => "$Master"); +die("cannot find tlpdb!") unless (defined($localtlpdb)); +our @alllocalpackages = $localtlpdb->list_packages; +setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform); + +our $location = $localtlpdb->option_location; + +our $tlmediasrc; +our $tlmediatlpdb; +our @allpackages; + +init_install_media($location); + +# wm title . "tlmgr 2008" +our $mw = MainWindow->new(-title => "tlmgr 2008"); + +# frame .top +our $top = $mw->Frame; + + +# button .top.b1 -text "Adding packages" -command { +# pack forget .back.f2 +# pack .back.f1 +# } + +our $b1 = $top->Button(-text => "Adding packages", + -command => sub { $back_f2->packForget; $back_f1->pack; }); + +# button .top.b2 -text "Removing packages" -command { +# pack forget .back.f1 +# pack .back.f2 +# } +our $b2 = $top->Button(-text => "Removing packages", + -command => sub { $back_f1->packForget; $back_f2->pack; }); + +# pack .top.b1 .top.b2 -side left +$b1->pack(-side => 'left'); +$b2->pack(-side => 'left'); + +# frame .back -borderwidth 2 +our $back = $mw->Frame(-borderwidth => 2); + +# pack .top .back -side top -fill both -expand 1 +$top->pack(-side => 'top', -fill => 'both', -expand => 1); +$back->pack(-side => 'top', -fill => 'both', -expand => 1); + +require("guinb1.pl"); +require("guinb2.pl"); + +# pack .back.f1 +$back_f1->pack; +Tk::MainLoop(); + + +sub init_install_media { + my $newroot = shift; + if (defined($tlmediatlpdb) && ($tlmediatlpdb->root eq $newroot)) { + # nothing to be done + } else { + $tlmediasrc = TeXLive::TLMedia->new($newroot); + $tlmediatlpdb = $tlmediasrc->tlpdb; + @allpackages = $tlmediatlpdb->list_packages; + } +} + + + +__END__ + + +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.tcl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.tcl new file mode 100644 index 00000000000..04537c05abb --- /dev/null +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui2.tcl @@ -0,0 +1,24 @@ +#!/bin/sh +# the next line restarts using wish \ +exec wish "$0" "$@" + +wm title . "tlmgr 2008" + +frame .top +button .top.b1 -text "Adding packages" -command { + pack forget .back.f2 + pack .back.f1 +} +button .top.b2 -text "Removing packages" -command { + pack forget .back.f1 + pack .back.f2 +} +pack .top.b1 .top.b2 -side left +frame .back -borderwidth 2 +pack .top .back -side top -fill both -expand 1 + +source guinb1.tcl +source guinb2.tcl + +pack .back.f1 +# EOF
\ No newline at end of file |