diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-07-25 16:39:55 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-07-25 16:39:55 +0200 |
commit | bd44a69f12145fb57f20dd56c1d74e024a29c786 (patch) | |
tree | 7b429f274c17b87e9c31a0f5e31334389786f4b1 | |
parent | f878f645949c72576b91486edee780847ba02a3e (diff) | |
download | manatools-bd44a69f12145fb57f20dd56c1d74e024a29c786.tar manatools-bd44a69f12145fb57f20dd56c1d74e024a29c786.tar.gz manatools-bd44a69f12145fb57f20dd56c1d74e024a29c786.tar.bz2 manatools-bd44a69f12145fb57f20dd56c1d74e024a29c786.tar.xz manatools-bd44a69f12145fb57f20dd56c1d74e024a29c786.zip |
Added key table filling
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm index 23a1ab83..0ca66ff5 100644 --- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm +++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm @@ -1247,6 +1247,57 @@ sub keys_callback() { my $keyTbl = $factory->createTable($hbox, $yTableHeader, $multiselection); $keyTbl->setKeepSorting(1); + my ($current_medium, $current_medium_nb, @keys); + + my $read_conf = sub { + $urpm->parse_pubkeys(root => $urpm->{root}); + @keys = map { [ split /[,\s]+/, $_->{'key-ids'} ] } @{$urpm->{media}}; + }; + + my $write = sub { + $something_changed = 1; + urpm::media::write_config($urpm); + $urpm = fast_open_urpmi_db(); + $read_conf->(); +# $media_list->get_selection->signal_emit('changed'); + }; + $read_conf->(); + my $key_name = sub { + exists $urpm->{keys}{$_[0]} ? $urpm->{keys}{$_[0]}{name} + : N("no name found, key doesn't exist in rpm keyring!"); + }; + + my $sel_changed = sub { + my $item = $mediaTbl->selectedItem(); + if ($item) { + $current_medium = $item->label(); + $current_medium_nb = $item->index(); + + yui::YUI::app()->busyCursor(); + yui::YUI::ui()->blockEvents(); + $dialog->startMultipleChanges(); + + + $keyTbl->deleteAllItems(); + my $itemColl = new yui::YItemCollection; + foreach ( @{$keys[$current_medium_nb]} ) { + my $it = new yui::YTableItem (sprintf("%s (%s)", $_, $key_name->($_))); + # NOTE row is $item->index() + $it->setLabel( $_ ); + $itemColl->push($it); + $it->DISOWN(); + } + $keyTbl->addItems($itemColl); + + $dialog->recalcLayout(); + $dialog->doneMultipleChanges(); + yui::YUI::ui()->unblockEvents(); + yui::YUI::app()->normalCursor(); + } + }; + + $sel_changed->(); + my $rightContent = $factory->createRight($hbox_content); $rightContent->setWeight($yui::YD_HORIZ,1); my $topContent = $factory->createTop($rightContent); @@ -1281,6 +1332,13 @@ sub keys_callback() { if ($widget == $closeButton) { last; } + elsif ($widget == $addButton) { + } + elsif ($widget == $remButton) { + } + elsif ($widget == $mediaTbl) { + $sel_changed->(); + } } } |