aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-02-22 13:32:27 +0000
committerThierry Vignaud <tv@mandriva.org>2007-02-22 13:32:27 +0000
commitab1a2b92e8487b56949be9424250fd9ad9bfb657 (patch)
tree57ddc8d3e9cf2b00cf0083cb298b02020354d041 /Rpmdrake
parent538c5aa7fb42c95179734da8486edae738af4307 (diff)
downloadrpmdrake-ab1a2b92e8487b56949be9424250fd9ad9bfb657.tar
rpmdrake-ab1a2b92e8487b56949be9424250fd9ad9bfb657.tar.gz
rpmdrake-ab1a2b92e8487b56949be9424250fd9ad9bfb657.tar.bz2
rpmdrake-ab1a2b92e8487b56949be9424250fd9ad9bfb657.tar.xz
rpmdrake-ab1a2b92e8487b56949be9424250fd9ad9bfb657.zip
(mainwindow) make "edit" button insensitive if no selection
Diffstat (limited to 'Rpmdrake')
-rwxr-xr-xRpmdrake/edit_urpm_sources.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index 18723f46..9bf889f8 100755
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -893,10 +893,10 @@ sub mainwindow() {
my $list = Gtk2::ListStore->new("Glib::Boolean", "Glib::Boolean", "Glib::String");
$list_tv = Gtk2::TreeView->new_with_model($list);
$list_tv->get_selection->set_mode('browse');
- my ($up_button, $dw_button, $remove_button);
+ my ($up_button, $dw_button, $remove_button, $edit_button);
$list_tv->get_selection->signal_connect(changed => sub {
my ($model, $iter) = $_[0]->get_selected;
- $remove_button and $remove_button->set_sensitive(defined $iter);
+ $_ and $_->set_sensitive(defined $iter) foreach $remove_button, $edit_button;
return if !$iter;
my $curr_path = $model->get_path($iter);
my $first_path = $model->get_path($model->get_iter_first);
@@ -927,8 +927,8 @@ sub mainwindow() {
},
);
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Enabled?"), my $tr = Gtk2::CellRendererToggle->new, 'active' => 0));
- $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates?"), my $cu = Gtk2::CellRendererToggle->new, 'active' => 1));
+ $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Enabled"), my $tr = Gtk2::CellRendererToggle->new, 'active' => 0));
+ $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Updates"), my $cu = Gtk2::CellRendererToggle->new, 'active' => 1));
$list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"), Gtk2::CellRendererText->new, 'text' => 2));
my $reread_media; #- closure defined later
@@ -998,7 +998,7 @@ sub mainwindow() {
clicked => sub { remove_callback() and $reread_media->() },
),
gtksignal_connect(
- Gtk2::Button->new(but(N("Edit..."))),
+ $edit_button = Gtk2::Button->new(but(N("Edit..."))),
clicked => sub {
my $name = edit_callback(); defined $name and $reread_media->($name);
}