diff options
author | Norbert Preining <preining@logic.at> | 2010-04-13 14:36:10 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-04-13 14:36:10 +0000 |
commit | 81c4cf5c36abf03b4702857142e7c11fc16158d8 (patch) | |
tree | 3ef35fe6b7d9fb707b3fa9ab0c289e90cdf89972 | |
parent | cfdc7ebde08b8f8600be0a71901c899030ebfda1 (diff) |
tlmgr GUI: make the mode a checkbutton with "Expert options" as text and
warn on switch
git-svn-id: svn://tug.org/texlive/trunk@17841 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui.pl | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui.pl index 23da51e8f24..7454001d042 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui.pl @@ -483,8 +483,9 @@ sub setup_menu_system { -command => sub { do_arch_settings(); }); } $menu_options->add('separator'); - $menu_options->add('command', -label => __("GUI mode ..."), - -command => sub { do_gui_mode_settings(); }); + $menu_options->add('checkbutton', -label => __("Expert options"), + -variable => \$mode_expert, + -command => sub { do_and_warn_gui_mode_settings(); }); if ($mode_expert) { $menu_options->add('checkbutton', -label => __("Enable debugging output"), -onvalue => ($::opt_verbosity == 0 ? 1 : $::opt_verbosity), @@ -1213,33 +1214,15 @@ sub do_paper_settings { -command => sub { $sw->destroy; })->pack(-side => 'left', -padx => "3m"); } - -sub do_gui_mode_settings { - my $sw = $mw->Toplevel(-title => __("GUI mode")); - $sw->transient($mw); - $sw->grab(); - - my $txt; - my $newmode; - if ($mode_expert) { - $txt = "Do you want to switch to normal GUI mode?"; - $newmode = 0; - } else { - $txt = "Do you want to switch to expert GUI mode?"; - $newmode = 1; +sub do_and_warn_gui_mode_settings { + my $ans = $mw->Dialog(-text => __("Changes will take effect after restart"), + -title => __("Expert options"), + -default_button => 'Ok', + -buttons => [__("Ok"), __("Cancel")])->Show; + if ($ans eq __("Ok")) { + $config{"gui_expertmode"} = $mode_expert; + write_config_file(); } - $txt .= "\n\n" . "(Changes will take effect after restart)"; - $sw->Label(-text => $txt)->pack(@p_iii); - my $lower = $sw->Frame; - $lower->pack(-fill => "y", @p_iii); - - $lower->Button(-text => __("Yes"), - -command => sub { - $config{"gui_expertmode"} = $newmode; - write_config_file(); - $sw->destroy; })->pack(@left, -padx => "3m"); - $lower->Button(-text => __("Cancel"), - -command => sub { $sw->destroy; })->pack(@left, -padx => "3m"); } # |