aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/edit_urpm_sources.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index 1ee810ad..8c5ad385 100644
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -646,11 +646,16 @@ sub edit_parallel {
local $::main_window = $w->{real_window};
my $name_entry;
- my $medias_ls = Gtk2::ListStore->new("Glib::String");
- my $medias = Gtk2::TreeView->new_with_model($medias_ls);
- $medias->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
- $medias->set_headers_visible(0);
- $medias->get_selection->set_mode('browse');
+ my ($medias_ls, $hosts_ls) = (Gtk2::ListStore->new("Glib::String"), Gtk2::ListStore->new("Glib::String"));
+
+ my ($medias, $hosts) = map {
+ my $list = Gtk2::TreeView->new_with_model($_);
+ $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
+ $list->set_headers_visible(0);
+ $list->get_selection->set_mode('browse');
+ $list;
+ } $medias_ls, $hosts_ls;
+
$medias_ls->append_set([ 0 => $_ ]) foreach @{$edited->{medias}};
my $add_media = sub {
@@ -687,11 +692,6 @@ sub edit_parallel {
}
};
- my $hosts_ls = Gtk2::ListStore->new("Glib::String");
- my $hosts = Gtk2::TreeView->new_with_model($hosts_ls);
- $hosts->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0));
- $hosts->set_headers_visible(0);
- $hosts->get_selection->set_mode('browse');
my $hosts_list;
if ($edited->{protocol} eq 'ssh') { $hosts_list = [ split /:/, $edited->{command} ] }
elsif ($edited->{protocol} eq 'ka-run') { push @$hosts_list, $1 while $edited->{command} =~ /-m (\S+)/g }