42 #include "NCPkgFilterInstSummary.h"
50 NCPkgFilterInstSummary::NCPkgFilterInstSummary ( YWidget *parent, std::string label,
NCPackageSelector *pkger)
51 : NCMultiSelectionBox ( parent, label)
58 NCPkgFilterInstSummary::~NCPkgFilterInstSummary()
63 void NCPkgFilterInstSummary::createLayout()
65 del =
new YItem ( _(
"Delete" ),
true);
66 items.push_back (del);
67 inst =
new YItem ( _(
"Install" ),
true);
68 items.push_back (inst);
69 update =
new YItem ( _(
"Update" ),
true);
70 items.push_back (update);
71 taboo =
new YItem ( _(
"Taboo" ),
true);
72 items.push_back (taboo);
73 protect =
new YItem ( _(
"Protected" ),
true);
74 items.push_back (protect);
75 keep =
new YItem ( _(
"Keep" ));
76 items.push_back (keep);
77 dontinstall =
new YItem ( _(
"Do not install" ));
78 items.push_back (dontinstall);
83 bool NCPkgFilterInstSummary::check( ZyppObj opkg, ZyppSel slb )
90 switch ( slb->status() )
94 case S_AutoDel: show = del->selected();
break;
96 case S_AutoInstall: show = inst->selected();
break;
97 case S_KeepInstalled: show = keep->selected();
break;
98 case S_NoInst: show = dontinstall->selected();
break;
99 case S_Protected: show = protect->selected();
break;
100 case S_Taboo: show = taboo->selected();
break;
102 case S_AutoUpdate: show = update->selected();
break;
107 ZyppPkg pkg = tryCastToZyppPkg (opkg);
116 bool NCPkgFilterInstSummary::showInstSummaryPackages()
119 NCPkgTable * packageList = pkg->PackageList();
123 yuiError() <<
"No valid NCPkgTable widget" << endl;
131 for_( listIt, zyppPkgBegin(), zyppPkgEnd() )
133 ZyppSel selectable = *listIt;
134 ZyppObj obj = selectable->candidateObj();
140 ( selectable->installedObj() ) ? (obj = selectable->installedObj())
141 : ( obj = selectable->theObj() );
144 if( check( obj, selectable ) )
146 ZyppPkg pkg = tryCastToZyppPkg (obj);
153 packageList->setCurrentItem( 0 );
157 yuiMilestone() <<
"Fill package list" << endl;
163 NCursesEvent NCPkgFilterInstSummary::wHandleInput( wint_t ch )
165 NCursesEvent ret = NCursesEvent::none;
168 NCMultiSelectionBox::wHandleInput( ch ) ;
174 showInstSummaryPackages();
179 ret = NCursesEvent::handled;
bool createListEntry(ZyppPkg pkgPtr, ZyppSel slbPtr)
virtual void itemsCleared()