aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xedit-urpm-sources.pl16
-rw-r--r--rpmdrake.spec3
2 files changed, 18 insertions, 1 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl
index 5850b108..c9f9abbe 100755
--- a/edit-urpm-sources.pl
+++ b/edit-urpm-sources.pl
@@ -250,6 +250,20 @@ sub mainwindow {
$list_tv = Gtk2::TreeView->new_with_model($list);
$list_tv->get_selection->set_mode('browse');
$list_tv->set_rules_hint(1);
+ $list_tv->set_reorderable(1);
+
+ my $reorder_ok = 1;
+ $list->signal_connect(row_deleted => sub {
+ my ($model) = @_;
+ my @medias;
+ $model->foreach(sub {
+ my (undef, $path) = @_;
+ my $name = $model->get($path, 1);
+ push @medias, find { $_->{name} eq $name } @{$urpm->{media}};
+ 0;
+ }, undef);
+ @{$urpm->{media}} = @medias;
+ });
$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("Media"), Gtk2::CellRendererText->new, 'text' => 1));
@@ -263,10 +277,12 @@ sub mainwindow {
});
my $reread_media = sub {
+ $reorder_ok = 0;
$urpm = urpm->new;
$urpm->read_config;
$list->clear;
$list->append_set([ 0 => !$_->{ignore}, 1 => $_->{name} ])->free foreach @{$urpm->{media}};
+ $reorder_ok = 1;
};
$reread_media->();
diff --git a/rpmdrake.spec b/rpmdrake.spec
index 01dca6c8..c0218a81 100644
--- a/rpmdrake.spec
+++ b/rpmdrake.spec
@@ -99,8 +99,9 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorarch}/*.pm
%changelog
-* Tue May 20 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-21mdk
+* Thu May 22 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-21mdk
- fix some distlint DIRM
+- let medias be reorderable in the medias editor
* Fri May 16 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-20mdk
- perl-URPM API change: gives architecture in ask_remove