aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-13 15:03:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-13 15:03:31 +0000
commit2f64a9d5a118857b4b9b7fa23e61c91511331fd2 (patch)
tree22807cf8e6deb403538a9bc010dd833f44d6ce7e
parente0fcc4498b3536919e69f36ffbd3153b10c443da (diff)
downloadrpmdrake-2f64a9d5a118857b4b9b7fa23e61c91511331fd2.tar
rpmdrake-2f64a9d5a118857b4b9b7fa23e61c91511331fd2.tar.gz
rpmdrake-2f64a9d5a118857b4b9b7fa23e61c91511331fd2.tar.bz2
rpmdrake-2f64a9d5a118857b4b9b7fa23e61c91511331fd2.tar.xz
rpmdrake-2f64a9d5a118857b4b9b7fa23e61c91511331fd2.zip
Move the "Show automatically selected packages" option in a menu
-rwxr-xr-xrpmdrake21
-rw-r--r--rpmdrake.pm3
2 files changed, 12 insertions, 12 deletions
diff --git a/rpmdrake b/rpmdrake
index b1830495..7902b27a 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -1057,6 +1057,7 @@ Is it ok to continue?",
install => N("Software Packages Installation"),
);
my $status = Gtk2::Label->new;
+ my $checkbox_show_autoselect;
my ($menu, $factory) = create_factory_menu(
$::isEmbedded ? $::Plug : $w->{rwindow},
[ N("/_File"), undef, undef, undef, '<Branch>' ],
@@ -1089,10 +1090,17 @@ Is it ok to continue?",
}, undef, '<StockItem>', 'gtk-default' ],
[ N("/_File") . N("/_Quit"), undef, sub { Gtk2->main_quit }, undef, '<StockItem>', 'gtk-default' ],
[ N("/_View"), undef, undef, undef, '<Branch>' ],
- [ N("/_Options"), undef, undef, undef, '<Branch>' ],
+ if_(!$>,
+ [ N("/_Options"), undef, undef, undef, '<Branch>' ],
+ [ N("/_Options") . N("/_Show automatically selected packages"), undef, sub {
+ $dont_show_selections = !$checkbox_show_autoselect->get_active;
+ }, undef, '<CheckItem>' ],
+ ),
[ N("/_Help"), undef, undef, undef, '<Branch>' ],
[ N("/_Help") . N("/_Help"), undef, sub { rpmdrake::open_help($MODE) }, undef, '<StockItem>', 'gtk-default' ],
);
+ $checkbox_show_autoselect = $factory->get_widget("<main>" . strip_first_underscore(N("/_Options"), N("/_Show automatically selected packages")))
+ and $checkbox_show_autoselect->set_active(!$dont_show_selections);
gtkadd(
$w->{window},
gtkpack_(
@@ -1113,16 +1121,6 @@ Is it ok to continue?",
gtksignal_connect(Gtk2::Button->new(but(N("Search"))), clicked => $find_callback)
),
1, $table,
- ($> ? () : (
- 0, gtkpack_(
- Gtk2::HBox->new(0, 10),
- 1, gtksignal_connect( #- don't show in browse mode
- my $show_selections_button = Gtk2::CheckButton->new(N("Show automatically selected packages")),
- clicked => sub { $dont_show_selections = !$_[0]->get_active },
- ),
- 0, $status
- ),
- )),
0, gtkpack_(
Gtk2::HBox->new(0, 20),
0, my $action_button = gtksignal_connect(
@@ -1134,7 +1132,6 @@ Is it ok to continue?",
),
),
);
- $show_selections_button and $show_selections_button->set_active(!$dont_show_selections);
$action_button->set_sensitive(0) if $>;
$find_entry->grab_focus;
diff --git a/rpmdrake.pm b/rpmdrake.pm
index df32922c..e41f0132 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -70,6 +70,7 @@ our @EXPORT = qw(
update_sources_interactive
add_medium_and_check
check_update_media_version
+ strip_first_underscore
);
our $typical_width;
@@ -773,4 +774,6 @@ sub open_help {
);
}
+sub strip_first_underscore { join '', map { s/_//; $_ } @_ }
+
1;