aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2013-12-20 22:57:09 +0100
committerAngelo Naselli <anaselli@linux.it>2013-12-20 22:57:09 +0100
commit74a56097f5e947cc1cead759e469b1cfe61e688f (patch)
treefe00365ec96cc5b93b7cd35114ad0063cfe07ea3
parent07c8c0c5374db1c2f9cf11b3c3f501e130e5f4aa (diff)
downloadmanatools-74a56097f5e947cc1cead759e469b1cfe61e688f.tar
manatools-74a56097f5e947cc1cead759e469b1cfe61e688f.tar.gz
manatools-74a56097f5e947cc1cead759e469b1cfe61e688f.tar.bz2
manatools-74a56097f5e947cc1cead759e469b1cfe61e688f.tar.xz
manatools-74a56097f5e947cc1cead759e469b1cfe61e688f.zip
Aligned to Yui-mga changes
-rw-r--r--AdminPanel/Rpmdragora/gui.pm22
-rwxr-xr-xmodules/rpmdragora/rpmdragora30
2 files changed, 27 insertions, 25 deletions
diff --git a/AdminPanel/Rpmdragora/gui.pm b/AdminPanel/Rpmdragora/gui.pm
index b031f30c..66d41fda 100644
--- a/AdminPanel/Rpmdragora/gui.pm
+++ b/AdminPanel/Rpmdragora/gui.pm
@@ -403,13 +403,14 @@ my ($common, $w, %wtree, %ptree, %pix, @table_item_list);
sub set_node_state {
my ($tblItem, $state, $detail_list) = @_;
return if $state eq 'XXX' || !$state;
- $tblItem->addCell($state,"/usr/share/rpmdrake/icons/state_$state.png") if(ref $tblItem eq "yui::YTableItem");
+ $detail_list->parent()->parent()->startMultipleChanges();
+ $tblItem->addCell($state,"/usr/share/rpmdrake/icons/state_$state.png") if(ref $tblItem eq "yui::YCBTableItem");
if(to_bool(member($state, qw(base installed to_install)))){
# it should be parent()->setChecked(1)
- $detail_list->selectItem($tblItem, 1);
+ $detail_list->checkItem($tblItem, 1);
# $tblItem->setSelected(1);
}else{
- $detail_list->selectItem($tblItem, 0);
+ $detail_list->checkItem($tblItem, 0);
# $tblItem->setSelected(0);
}
if(!to_bool($state ne 'base')){
@@ -488,10 +489,10 @@ sub add_node {
$release = "" if(!defined($release));
$arch = "" if(!defined($arch));
#my $newTableItem = new yui::YTableItem(format_name_n_summary($name, get_summary($leaf)),
- my $newTableItem = new yui::YTableItem($name."\n".get_summary($leaf),
- $version,
- $release,
- $arch);
+ my $newTableItem = new yui::YCBTableItem($name."\n".get_summary($leaf),
+ $version,
+ $release,
+ $arch);
$w->{detail_list}->addItem($newTableItem);
set_node_state($newTableItem, $state, $w->{detail_list});
# $ptree{$leaf} = [ $newTableItem->label() ];
@@ -604,10 +605,11 @@ sub fast_toggle {
}
# toggle_nodes($w->{tree}->window, $w->{detail_list_model}, \&set_leaf_state, $w->{detail_list_model}->get($iter, $pkg_columns{state}),
my $state;
- if($item->selected){
- $state = "to_remove";
- }else{
+#pasmatt checked should be to install no?
+ if($item->checked()){
$state = "to_install";
+ }else{
+ $state = "to_remove";
}
toggle_nodes($w->{tree}, $w->{detail_list}, \&set_leaf_state, $state, $name);
update_size($common);
diff --git a/modules/rpmdragora/rpmdragora b/modules/rpmdragora/rpmdragora
index 1a3b8d08..03cd666c 100755
--- a/modules/rpmdragora/rpmdragora
+++ b/modules/rpmdragora/rpmdragora
@@ -146,20 +146,23 @@ sub tree_callback {
sub detaillist_changeditem_callback {
my ($detail_list, $options) = @_;
my $changedItem = $detail_list->changedItem();
+ return if (!$changedItem);
+
# handles installist and droplist
my $index=0;
- if ($changedItem->selected()) {
+ if ($changedItem->checked()) {
# to be installed if not in to be removed list
my $found = 0;
- foreach $index (0 .. scalar(@itemsToBeRemoved)) {
+ foreach $index (0 .. scalar(@itemsToBeRemoved) -1) {
my $currItem = $itemsToBeRemoved[$index];
- if(ref $currItem eq "yui::YItem") {
+#pasmatt why? changedItem is YCBTableItem now so it's what you're looking for
+# if(ref $currItem eq "yui::YCBTableItem") {
if ($currItem->label() == $changedItem->label()) {
$found = 1;
splice (@itemsToBeRemoved, $index ,1);
last;
}
- }
+# }
}
if ($found == 0) {
push(@itemsToBeInstalled, $changedItem);
@@ -171,15 +174,15 @@ sub detaillist_changeditem_callback {
else {
# to be removed if not in to be installed list
my $found = 0;
- foreach $index (0 .. scalar(@itemsToBeInstalled)) {
+ foreach $index (0 .. scalar(@itemsToBeInstalled)-1) {
my $currItem = $itemsToBeInstalled[$index];
- if(ref $currItem eq "yui::YItem") {
+# if(ref $currItem eq "yui::YCBTableItem") {
if ($currItem->label() == $changedItem->label()) {
$found = 1;
splice (@itemsToBeInstalled, $index ,1);
last;
}
- }
+# }
}
if ($found == 0) {
push(@itemsToBeRemoved, $changedItem);
@@ -507,6 +510,8 @@ sub run_treeview_dialog {
title => N("ToInst"),
}
);
+ ## check column is first no title needed here, but we need to add it
+ $detail_list_header->addColumn("");
foreach my $col (@columns{@columns}) {
#OLD $detail_list->append_column(
# $col->{widget} =
@@ -542,10 +547,9 @@ sub run_treeview_dialog {
$detail_list_header->addColumn(N("Status"));
# it should be istanciated this way
- # $detail_list = $mgaFactory->createTable($hbox_middle,$detail_list_header,$yui::YTableCheckBoxOnLastColumn);
- $detail_list = $mgaFactory->createCBTable($hbox_middle,$detail_list_header,$yui::YTableCheckBoxOnFirstColumn);
+ $detail_list = $mgaFactory->createCBTable($hbox_middle,$detail_list_header,$yui::YCBTableCheckBoxOnFirstColumn);
$detail_list->setWeight(0,50);
- $detail_list->setNotify(1);
+ $detail_list->setImmediateMode(1);
#OLD compute_main_window_size($w);
=comment
@@ -1181,12 +1185,8 @@ yui::YUI::app()->setApplicationIcon($wm_icon);
my $MGAPlugin = "mga";
-#yui::YUILoader::loadExternalWidgets($MGAPlugin);
-
$factory = yui::YUI::widgetFactory;
-$extWidgets = yui::YExternalWidgets::externalWidgets($MGAPlugin);
-$mgaFactory = $extWidgets->externalWidgetFactory();
-# $mgaFactory = bless($extWidgets,'yui::YMGAWidgetFactory');
+$mgaFactory = yui::YExternalWidgets::externalWidgetFactory($MGAPlugin);
$mgaFactory = yui::YMGAWidgetFactory::getYMGAWidgetFactory($mgaFactory);
$optFactory = yui::YUI::optionalWidgetFactory;