42 #define YUILogComponent "qt-pkg" 45 #include <QHeaderView> 54 #include "YQPkgObjList.h" 55 #include "YQPkgTextDialog.h" 57 #include "YQIconPool.h" 60 #include "zypp/ZYppFactory.h" 67 #define VERBOSE_EXCLUDE_RULES 0 68 #define EXTRA_SOLVE_COLLECTIONS 0 72 : QY2ListView( parent )
74 , _installedContextMenu(0)
75 , _notInstalledContextMenu(0)
76 , actionSetCurrentInstall(0)
77 , actionSetCurrentDontInstall(0)
78 , actionSetCurrentKeepInstalled(0)
79 , actionSetCurrentDelete(0)
80 , actionSetCurrentUpdate(0)
81 , actionSetCurrentUpdateForce(0)
82 , actionSetCurrentTaboo(0)
83 , actionSetCurrentProtected(0)
84 , actionSetListInstall(0)
85 , actionSetListDontInstall(0)
86 , actionSetListKeepInstalled(0)
87 , actionSetListDelete(0)
88 , actionSetListUpdate(0)
89 , actionSetListUpdateForce(0)
90 , actionSetListTaboo(0)
91 , actionSetListProtected(0)
101 _instVersionCol = -42;
104 _brokenIconCol = -42;
105 _satisfiedIconCol = -42;
112 connect(
this, SIGNAL( columnClicked (
int, QTreeWidgetItem *,
int,
const QPoint & ) ),
113 this, SLOT (
pkgObjClicked (
int, QTreeWidgetItem *,
int,
const QPoint & ) ) );
115 connect(
this, SIGNAL( columnDoubleClicked (
int, QTreeWidgetItem *,
int,
const QPoint & ) ),
116 this, SLOT (
pkgObjClicked (
int, QTreeWidgetItem *,
int,
const QPoint & ) ) );
121 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
124 setIconSize( QSize( 22, 16 ) );
126 setContextMenuPolicy(Qt::CustomContextMenu);
135 if ( _excludedItems )
136 delete _excludedItems;
145 yuiError() <<
"Null zypp::ui::Selectable!" << endl;
156 const QString & summary,
159 QY2ListViewItem * item =
new QY2ListViewItem(
this, QString::null );
163 if ( nameCol() >= 0 && ! name.isEmpty() ) item->setText( nameCol(), name );
164 if ( summaryCol() >= 0 && ! summary.isEmpty() ) item->setText( summaryCol(), summary );
165 if ( sizeCol() >= 0 && size > 0L )
167 QString sizeStr = size.form().c_str();
168 item->setText( sizeCol(), sizeStr );
176 QTreeWidgetItem * listViewItem,
185 if ( button == Qt::LeftButton )
187 if ( col == statusCol() )
213 _excludedItems->
clear();
214 QY2ListView::clear();
221 QPixmap icon = YQIconPool::pkgNoInst();
227 case S_Del: icon = YQIconPool::pkgDel();
break;
228 case S_Install: icon = YQIconPool::pkgInstall();
break;
229 case S_KeepInstalled: icon = YQIconPool::pkgKeepInstalled();
break;
230 case S_NoInst: icon = YQIconPool::pkgNoInst();
break;
231 case S_Protected: icon = YQIconPool::pkgProtected();
break;
232 case S_Taboo: icon = YQIconPool::pkgTaboo();
break;
233 case S_Update: icon = YQIconPool::pkgUpdate();
break;
235 case S_AutoDel: icon = YQIconPool::pkgAutoDel();
break;
236 case S_AutoInstall: icon = YQIconPool::pkgAutoInstall();
break;
237 case S_AutoUpdate: icon = YQIconPool::pkgAutoUpdate();
break;
247 case S_Del: icon = YQIconPool::disabledPkgDel();
break;
248 case S_Install: icon = YQIconPool::disabledPkgInstall();
break;
249 case S_KeepInstalled: icon = YQIconPool::disabledPkgKeepInstalled();
break;
250 case S_NoInst: icon = YQIconPool::disabledPkgNoInst();
break;
251 case S_Protected: icon = YQIconPool::disabledPkgProtected();
break;
252 case S_Taboo: icon = YQIconPool::disabledPkgTaboo();
break;
253 case S_Update: icon = YQIconPool::disabledPkgUpdate();
break;
255 case S_AutoDel: icon = YQIconPool::disabledPkgAutoDel();
break;
256 case S_AutoInstall: icon = YQIconPool::disabledPkgAutoInstall();
break;
257 case S_AutoUpdate: icon = YQIconPool::disabledPkgAutoUpdate();
break;
273 case S_AutoDel:
return _(
"Autodelete" );
274 case S_AutoInstall:
return _(
"Autoinstall" );
275 case S_AutoUpdate:
return _(
"Autoupdate" );
276 case S_Del:
return _(
"Delete" );
277 case S_Install:
return _(
"Install" );
278 case S_KeepInstalled:
return _(
"Keep" );
279 case S_NoInst:
return _(
"Do Not Install" );
280 case S_Protected:
return _(
"Protected -- Do Not Modify" );
281 case S_Taboo:
return _(
"Taboo -- Never Install" );
282 case S_Update:
return _(
"Update" );
285 return QString::null;
292 QTreeWidgetItem * listViewItem = currentItem();
294 if ( ! listViewItem )
301 if ( newStatus != item->
status() )
319 if ( doSelectNextItem )
330 YQUI::ui()->busyCursor();
331 QTreeWidgetItemIterator it(
this );
339 if ( newStatus == S_Update )
364 emit updateItemStates();
367 YQUI::ui()->normalCursor();
375 QTreeWidgetItemIterator it(
this);
376 QTreeWidgetItem * item;
378 while ( (item = *it) != NULL )
383 setCurrentItem( *it );
392 actionSetCurrentInstall =
createAction( S_Install,
"[+]" );
393 actionSetCurrentDontInstall =
createAction( S_NoInst,
"[-]" );
394 actionSetCurrentKeepInstalled =
createAction( S_KeepInstalled,
"[<], [-]" );
396 actionSetCurrentUpdate =
createAction( S_Update,
"[>], [+]" );
402 actionSetCurrentProtected =
createAction( S_Protected,
"[*]" );
404 actionSetListInstall =
createAction( S_Install,
"",
true );
405 actionSetListDontInstall =
createAction( S_NoInst,
"",
true );
406 actionSetListKeepInstalled =
createAction( S_KeepInstalled,
"",
true );
408 actionSetListProtected =
createAction( S_Protected,
"",
true );
410 actionSetListUpdate =
createAction( _(
"Update if newer version available" ),
416 actionSetListUpdateForce =
createAction( _(
"Update unconditionally" ),
424 connect( actionSetCurrentInstall, &QAction::triggered,
this, &YQPkgObjList::setCurrentInstall );
425 connect( actionSetCurrentDontInstall, &QAction::triggered,
this, &YQPkgObjList::setCurrentDontInstall );
426 connect( actionSetCurrentKeepInstalled, &QAction::triggered,
this, &YQPkgObjList::setCurrentKeepInstalled );
427 connect( actionSetCurrentDelete, &QAction::triggered,
this, &YQPkgObjList::setCurrentDelete );
428 connect( actionSetCurrentUpdate, &QAction::triggered,
this, &YQPkgObjList::setCurrentUpdate );
429 connect( actionSetCurrentUpdateForce, &QAction::triggered,
this, &YQPkgObjList::setCurrentUpdateForce );
430 connect( actionSetCurrentTaboo, &QAction::triggered,
this, &YQPkgObjList::setCurrentTaboo );
431 connect( actionSetCurrentProtected, &QAction::triggered,
this, &YQPkgObjList::setCurrentProtected );
432 connect( actionSetListInstall, &QAction::triggered,
this, &YQPkgObjList::setListInstall );
433 connect( actionSetListDontInstall, &QAction::triggered,
this, &YQPkgObjList::setListDontInstall );
434 connect( actionSetListKeepInstalled, &QAction::triggered,
this, &YQPkgObjList::setListKeepInstalled );
435 connect( actionSetListDelete, &QAction::triggered,
this, &YQPkgObjList::setListDelete );
436 connect( actionSetListUpdate, &QAction::triggered,
this, &YQPkgObjList::setListUpdate );
437 connect( actionSetListUpdateForce, &QAction::triggered,
this, &YQPkgObjList::setListUpdateForce );
438 connect( actionSetListTaboo, &QAction::triggered,
this, &YQPkgObjList::setListTaboo );
439 connect( actionSetListProtected, &QAction::triggered,
this, &YQPkgObjList::setListProtected );
457 const QPixmap & icon,
458 const QPixmap & insensitiveIcon,
462 QString label = text;
464 if ( ! key.isEmpty() )
468 QIcon iconSet ( icon );
470 if ( ! insensitiveIcon.isNull() )
472 iconSet.addPixmap( insensitiveIcon,
476 QAction * action =
new QAction( label,
478 Q_CHECK_PTR( action );
479 action->setEnabled( enabled );
480 action->setIcon( iconSet );
489 _notInstalledContextMenu =
new QMenu(
this );
490 Q_CHECK_PTR( _notInstalledContextMenu );
492 _notInstalledContextMenu->addAction( actionSetCurrentInstall );
493 _notInstalledContextMenu->addAction( actionSetCurrentDontInstall );
494 _notInstalledContextMenu->addAction( actionSetCurrentTaboo );
503 _installedContextMenu =
new QMenu(
this );
504 Q_CHECK_PTR( _installedContextMenu );
506 _installedContextMenu->addAction( actionSetCurrentKeepInstalled );
507 _installedContextMenu->addAction( actionSetCurrentDelete );
508 _installedContextMenu->addAction( actionSetCurrentUpdate );
509 _installedContextMenu->addAction( actionSetCurrentUpdateForce );
518 QMenu * submenu =
new QMenu( menu );
519 Q_CHECK_PTR( submenu );
521 submenu->addAction( actionSetListInstall );
522 submenu->addAction( actionSetListDontInstall );
523 submenu->addAction( actionSetListKeepInstalled );
524 submenu->addAction( actionSetListDelete );
525 submenu->addAction( actionSetListUpdate );
526 submenu->addAction( actionSetListUpdateForce );
527 submenu->addAction( actionSetListTaboo );
529 QAction *action = menu->addMenu( submenu );
530 action->setText( _(
"&All in This List" ) );
539 if ( ! _notInstalledContextMenu )
542 return _notInstalledContextMenu;
549 if ( ! _installedContextMenu )
552 return _installedContextMenu;
566 if ( selectable->hasInstalledObj() )
568 actionSetCurrentInstall->setEnabled(
false );
569 actionSetCurrentDontInstall->setEnabled(
false );
570 actionSetCurrentTaboo->setEnabled(
false );
571 actionSetCurrentProtected->setEnabled(
true );
573 actionSetCurrentKeepInstalled->setEnabled(
true );
574 actionSetCurrentDelete->setEnabled(
true );
575 actionSetCurrentUpdate->setEnabled( selectable->hasCandidateObj() );
576 actionSetCurrentUpdateForce->setEnabled( selectable->hasCandidateObj() );
580 actionSetCurrentInstall->setEnabled( selectable->hasCandidateObj() );
581 actionSetCurrentDontInstall->setEnabled(
true );
582 actionSetCurrentTaboo->setEnabled(
true );
583 actionSetCurrentProtected->setEnabled(
false );
585 actionSetCurrentKeepInstalled->setEnabled(
false );
586 actionSetCurrentDelete->setEnabled(
false );
587 actionSetCurrentUpdate->setEnabled(
false );
588 actionSetCurrentUpdateForce->setEnabled(
false );
593 actionSetCurrentInstall->setEnabled(
false );
594 actionSetCurrentDontInstall->setEnabled(
false );
595 actionSetCurrentTaboo->setEnabled(
false );
597 actionSetCurrentKeepInstalled->setEnabled(
false );
598 actionSetCurrentDelete->setEnabled(
false );
599 actionSetCurrentUpdate->setEnabled(
false );
600 actionSetCurrentUpdateForce->setEnabled(
false );
601 actionSetCurrentProtected->setEnabled(
false );
612 Qt::KeyboardModifiers special_combo = ( Qt::ControlModifier | Qt::ShiftModifier | Qt::AltModifier );
614 if ( ( event->modifiers() & special_combo ) == special_combo )
616 if ( event->key() == Qt::Key_Q )
619 yuiMilestone() <<
"Debug mode: " << _debug << endl;
623 QTreeWidgetItem * selectedListViewItem = currentItem();
625 if ( selectedListViewItem )
634 installed = item->
selectable()->hasInstalledObj();
638 ZyppStatus status = item->
status();
640 switch( event->key() )
651 ZyppStatus newStatus = S_KeepInstalled;
654 newStatus = S_Update;
675 case Qt::Key_Asterisk:
682 case Qt::Key_Greater:
691 if ( status == S_Update ||
692 status == S_AutoUpdate )
703 item->toggleDebugIsBroken();
713 item->toggleDebugIsSatisfied();
722 QY2ListView::keyPressEvent( event );
729 QY2ListViewItem * item =
new QY2ListViewItem(
this );
732 item->setText( nameCol() >= 0 ? nameCol() : 0, text );
739 _excludeRules.push_back( rule );
747 QTreeWidgetItemIterator listView_it(
this );
749 while ( *listView_it )
751 QTreeWidgetItem * current_item = *listView_it;
761 ExcludedItems::iterator excluded_it = _excludedItems->
begin();
763 while ( excluded_it != _excludedItems->
end() )
765 QTreeWidgetItem * current_item = (*excluded_it).first;
782 if ( _excludedItems->
size() > 0 )
784 yuiMilestone() << _excludedItems->
size() <<
" packages excluded" << endl;
786 for ( ExcludeRuleList::iterator rule_it = _excludeRules.begin();
787 rule_it != _excludeRules.end();
794 yuiMilestone() <<
"Active exclude rule: \"" 795 << rule->
regexp().pattern() <<
"\"" 810 #if VERBOSE_EXCLUDE_RULES 814 for ( ExcludeRuleList::iterator rule_it = _excludeRules.begin();
815 rule_it != _excludeRules.end() && !
exclude;
820 if ( rule->
match( item ) )
823 #if VERBOSE_EXCLUDE_RULES 831 this->
exclude( item, exclude );
833 #if VERBOSE_EXCLUDE_RULES 836 yuiDebug() <<
"Rule \"" << matchingRule->
regexp().pattern()
837 <<
"\" matches: Excluding " << item->
zyppObj()->name()
842 yuiDebug() <<
"Un-excluding " << item->
zyppObj()->name() << endl;
858 QTreeWidgetItem * parentItem = item->parent();
861 parentItem->setHidden(exclude);
863 item->setHidden(exclude);
865 _excludedItems->
add( item, parentItem );
874 : QY2ListViewItem( pkgObjList )
875 , _pkgObjList( pkgObjList )
876 , _selectable( selectable )
877 , _zyppObj( zyppObj )
886 QY2ListViewItem * parent,
889 : QY2ListViewItem( parent )
890 , _pkgObjList( pkgObjList )
891 , _selectable( selectable )
892 , _zyppObj( zyppObj )
901 : QY2ListViewItem( pkgObjList )
902 , _pkgObjList( pkgObjList )
920 if ( _zyppObj == 0 && _selectable )
921 _zyppObj = _selectable->theObj();
923 _debugIsBroken =
false;
924 _debugIsSatisfied =
false;
925 _candidateIsNewer =
false;
926 _installedIsNewer =
false;
928 const ZyppObj candidate =
selectable()->candidateObj();
929 const ZyppObj installed =
selectable()->installedObj();
931 if ( candidate && installed )
933 if ( candidate->edition() < installed->edition() )
934 _installedIsNewer =
true;
935 else if ( installed->edition() < candidate->edition() )
936 _candidateIsNewer =
true;
939 if ( installed && ! candidate )
940 _installedIsNewer =
true;
943 if ( summaryCol() >= 0 )
setText( summaryCol(),
zyppObj()->summary() );
945 if ( sizeCol() >= 0 )
947 zypp::ByteCount size =
zyppObj()->installSize();
950 setText( sizeCol(), size.asString() );
953 if ( versionCol() == instVersionCol() )
955 if ( versionCol() >= 0 )
962 setText( versionCol(), QString().sprintf(
"%s",
zyppObj()->edition().c_str() ) );
966 if ( candidate && installed->edition() != candidate->edition() )
969 QString().sprintf(
"%s (%s)",
970 installed->edition().c_str(),
971 candidate->edition().c_str() ) );
976 QString().sprintf(
"%s", installed->edition().c_str() ) );
983 setText( versionCol(), QString().sprintf(
"(%s)", candidate->edition().c_str() ) );
988 if ( _installedIsNewer )
989 setTextColor( versionCol(), Qt::red);
990 else if ( _candidateIsNewer )
991 setTextColor( versionCol(), Qt::blue);
996 if ( instVersionCol() >= 0 )
1000 setText( instVersionCol(), installed->edition() );
1002 if ( _installedIsNewer )
1003 setTextColor( instVersionCol(), Qt::red);
1004 else if ( _candidateIsNewer )
1005 setTextColor( instVersionCol(), Qt::blue);
1009 if ( versionCol() >= 0 )
1011 if (
zyppObj() != installed &&
1016 else if ( candidate )
1018 setText( versionCol(), candidate->edition() );
1020 if ( _installedIsNewer )
1021 setTextColor( versionCol(), Qt::red);
1022 else if ( _candidateIsNewer )
1023 setTextColor( versionCol(), Qt::blue);
1042 QTreeWidgetItem::setText( column, fromUTF8( text.c_str() ) );
1049 setText( column, edition.asString() );
1058 yuiError() <<
"No selectable" << endl;
1069 zypp::ResStatus::TransactByValue modifiedBy =
selectable()->modifiedBy();
1071 return ( modifiedBy == zypp::ResStatus::APPL_LOW ||
1072 modifiedBy == zypp::ResStatus::APPL_HIGH );
1080 ZyppStatus oldStatus =
selectable()->status();
1089 _pkgObjList->updateItemStates();
1101 zypp::getZYpp()->resolver()->resolvePool();
1116 if ( statusCol() >= 0 )
1123 if ( brokenIconCol() >= 0 )
1126 setIcon( brokenIconCol(), QPixmap() );
1129 if ( satisfiedIconCol() >= 0 )
1135 setIcon( satisfiedIconCol(),
isSatisfied() ? YQIconPool::pkgSatisfied() : QPixmap() );
1138 if ( brokenIconCol() >= 0 )
1145 setIcon( brokenIconCol(), YQIconPool::warningSign() );
1147 yuiWarning() <<
"Broken object: " << _selectable->theObj()->name()
1148 <<
" - " << _selectable->theObj()->summary()
1158 if ( _debugIsSatisfied )
1161 if ( _selectable->hasInstalledObj() )
1164 return _selectable->candidateObj().isSatisfied();
1170 if ( _debugIsBroken )
1173 if ( ! _selectable->hasInstalledObj() )
1178 case S_KeepInstalled:
1181 return _selectable->installedObj().isBroken();
1195 yuiError() <<
"Expected uninstalled zyppObj" << endl;
1199 yuiError() <<
"Should never get here" << endl;
1207 if ( ! _editable || ! _pkgObjList->
editable() )
1210 ZyppStatus oldStatus =
status();
1211 ZyppStatus newStatus = oldStatus;
1213 switch ( oldStatus )
1216 newStatus = S_NoInst;
1220 newStatus =
selectable()->hasCandidateObj() ?
1221 S_KeepInstalled: S_NoInst;
1225 newStatus =
selectable()->hasInstalledObj() ?
1226 S_KeepInstalled : S_NoInst;
1229 case S_KeepInstalled:
1230 newStatus =
selectable()->hasCandidateObj() ?
1239 newStatus = S_KeepInstalled;
1244 newStatus = S_KeepInstalled;
1250 newStatus = S_Install;
1254 yuiWarning() <<
"No candidate for " <<
selectable()->theObj()->name() << endl;
1255 newStatus = S_NoInst;
1262 newStatus = S_NoInst;
1266 if ( oldStatus != newStatus )
1298 text =
selectable()->candidateObj()->insnotify();
1305 text =
selectable()->candidateObj()->delnotify();
1311 if ( ! text.empty() )
1313 yuiDebug() <<
"Showing notify text" << endl;
1337 switch ( sel->status() )
1344 if ( sel->hasLicenceConfirmed() )
1347 if ( sel->candidateObj() )
1348 licenseText = sel->candidateObj()->licenseToConfirm();
1351 default:
return true;
1354 if ( licenseText.empty() )
1357 yuiDebug() <<
"Showing license agreement for " << sel->name() << endl;
1364 yuiMilestone() <<
"User confirmed license agreement for " << sel->name() << endl;
1365 sel->setLicenceConfirmed(
true );
1372 switch ( sel->status() )
1377 yuiWarning() <<
"User rejected license agreement for " << sel->name()
1378 <<
" - setting to TABOO" 1381 sel->setStatus( S_Taboo );
1388 yuiWarning() <<
"User rejected license agreement for " << sel->name()
1389 <<
" - setting to PROTECTED" 1392 sel->setStatus( S_Protected );
1408 if ( col == statusCol() )
1420 tip +=
"\n" + _(
"(by a software selection)" );
1422 tip +=
"\n" + _(
"(by dependencies)" );
1433 if ( col == brokenIconCol() )
1438 return _(
"Dependencies broken" );
1443 if ( col == satisfiedIconCol() )
1448 return _(
"All dependencies satisfied" );
1451 return QString::null;
1459 int col = treeWidget()->sortColumn();
1463 if ( col == nameCol() )
1465 return ( strcasecmp( this->
zyppObj()->name().c_str(), other->
zyppObj()->name().c_str() ) < 0 );
1467 if ( col == summaryCol() )
1470 return ( strcoll( this->
zyppObj()->summary().c_str(), other->
zyppObj()->summary().c_str() ) < 0 );
1472 if ( col == sizeCol() )
1476 return ( this->
zyppObj()->installSize() < other->
zyppObj()->installSize() );
1478 else if ( col == statusCol() )
1491 else if ( col == instVersionCol() ||
1492 col == versionCol() )
1507 if (thisPoints == otherPoints )
1508 return ( QString (this->
zyppObj()->edition().c_str() ) <
1509 QString (other->
zyppObj()->edition().c_str() ) );
1511 return ( thisPoints < otherPoints );
1516 return QY2ListViewItem::operator<( otherListViewItem );
1527 if (
selectable()->hasInstalledObj() ) points += 10;
1528 if (
selectable()->hasCandidateObj() ) points += 1;
1541 const QRegExp & regexp,
1557 #if VERBOSE_EXCLUDE_RULES 1558 yuiDebug() << ( enable ?
"Enabling" :
"Disabling" )
1559 <<
" exclude rule " << _regexp.pattern()
1585 QString text = item->text( _column );
1587 if ( text.isEmpty() )
1590 return _regexp.exactMatch( text );
1599 : _pkgObjList( parent )
1612 _excludeMap.insert( ItemPair( item, oldParent ) );
1618 ItemMap::iterator it = _excludeMap.find( item );
1620 if ( it != _excludeMap.end() )
1622 _excludeMap.erase( it );
1629 for ( ItemMap::iterator it = _excludeMap.begin();
1630 it != _excludeMap.end();
1636 _excludeMap.clear();
1642 return ( _excludeMap.find( item ) != _excludeMap.end() );
1651 updateActions( item );
1656 QMenu * contextMenu =
1661 contextMenu->popup( viewport()->mapToGlobal( pos ) );
1668 ItemMap::iterator it = _excludeMap.find( item );
1670 if ( it == _excludeMap.end() )
1678 #include "YQPkgObjList.moc" ZyppSel selectable() const
Returns the original selectable within the package manager backend.
int size() const
Returns the number of items.
ZyppObj zyppObj() const
Returns the original object within the package manager backend.
Abstract base class to display a list of zypp::ResObjects.
void statusChanged()
Emitted when the status of a zypp::ResObject is changed.
void setText(int column, const string text)
Set a column text via STL string.
void setExcluded(bool exclude=true)
Set this item's exclude flag.
virtual QPixmap statusIcon(ZyppStatus status, bool enabled=true, bool bySelection=false)
Returns the suitable icon for a zypp::ResObject status - the regular icon if 'enabled' is 'true' or t...
void addPkgObjItem(ZyppSel selectable, ZyppObj zyppObj=0)
Add a zypp::ResObject to the list.
YQPkgObjListItem(YQPkgObjList *pkgObjList, ZyppSel selectable, ZyppObj zyppObj=0)
Constructor for root items: Creates a YQPkgObjList item that corresponds to the ZYPP selectable that ...
void addExcludeRule(YQPkgObjList::ExcludeRule *rule)
Add an exclude rule to this list.
virtual void createInstalledContextMenu()
Create the context menu for installed items.
void setAllItemStatus(ZyppStatus newStatus, bool force=false)
Sets the status of all (toplevel) list items to 'newStatus', if possible.
bool candidateIsNewer() const
Check if the candidate is newer than the installed version.
virtual QMenu * notInstalledContextMenu()
Returns the context menu for items that are installed.
bool showLicenseAgreement()
Display this item's license agreement (if there is any) that corresponds to its current status (S_Ins...
iterator begin()
Returns an iterator that points to the first excluded item.
virtual void updateData()
Update this item's data completely.
virtual void clear()
Reimplemented from QY2ListView: Emit currentItemChanged() signal after clearing the list...
void setColumn(int column=0)
Change the column number to check against after creation.
virtual void message(const QString &text)
Display a one-line message in the list.
static bool confirmText(QWidget *parent, const QString &text, const QString &acceptButtonLabel, const QString &rejectButtonLabel)
Let the user confirm a text.
virtual void updateStatus()
Update this item's status.
void addPassiveItem(const QString &name, const QString &summary=QString::null, FSize size=-1)
Add a purely passive list item that has a name and optional summary and size.
ExcludeRule(YQPkgObjList *parent, const QRegExp ®exp, int column=0)
Constructor: Creates a new exclude rule with a regular expression to check against the text of the sp...
void createActions()
Create the actions for the context menus.
virtual void setStatus(ZyppStatus newStatus, bool sendSignals=true)
Set the (binary RPM) package status.
QAction * createAction(ZyppStatus status, const QString &key=QString::null, bool enabled=false)
Create an action based on a zypp::ResObject status - automatically retrieve the corresponding status ...
virtual void pkgObjClicked(int button, QTreeWidgetItem *item, int col, const QPoint &pos)
Dispatcher slot for mouse click: cycle status depending on column.
void enable(bool enable=true)
Enable or disable this exclude rule.
void logExcludeStatistics()
Write statistics about excluded items to the log, if there are any.
virtual void currentItemChangedInternal(QTreeWidgetItem *item)
Dispatcher slot for selection change - internal only.
virtual void updateActions(YQPkgObjListItem *item=0)
Update the internal actions for the currently selected item ( if any ).
void sendStatusChanged()
Emit a statusChanged() signal for the specified zypp::ResObject.
void exclude(YQPkgObjListItem *item, bool exclude)
Exclude or include an item, i.e.
bool editable() const
Return whether or not items in this list are generally editable, i.e.
int versionPoints() const
Calculate a numerical value to compare versions, based on version relations:
void selectNextItem()
Select the next item, i.e.
bool isExcluded() const
Returns 'true' if this item is excluded.
void updatePackages()
Emitted when it's time to update displayed package information, e.g., package states.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
iterator end()
Returns an iterator that points after the last excluded item.
bool match(QTreeWidgetItem *item)
Check a list item against this exclude rule.
static void showText(QWidget *parent, const QString &text)
Show a text and wait until the user confirmed with 'OK'.
void clear()
Clear the excluded items.
ExcludedItems(YQPkgObjList *parent)
Constructor.
virtual bool bySelection() const
Returns 'true' if this selectable's status is set by a selection (rather than by the user or by the d...
virtual void applyChanges()
Apply changes hook.
QRegExp regexp() const
Returns the regexp.
void applyExcludeRules()
Apply all exclude rules of this list to all items, including those that are currently excluded...
bool contains(QTreeWidgetItem *item)
Returns 'true' if the specified item is in the excluded items.
void setRegexp(const QRegExp ®exp)
Change the regular expression after creation.
QTreeWidgetItem * oldParentItem(QTreeWidgetItem *item)
Returns the old parent of this item so it can be reparented or 0 if it was a root item...
virtual QMenu * addAllInListSubMenu(QMenu *menu)
Add a submenu "All in this list..." to 'menu'.
bool isBroken() const
Check if this item is "broken": If it is installed, but any of its dependencies are no longer satisfi...
virtual QString statusText(ZyppStatus status) const
Returns a short (one line) descriptive text for a zypp::ResObject status.
void currentItemChanged(ZyppSel selectable)
Emitted when a zypp::ui::Selectable is selected.
void slotCustomContextMenu(const QPoint &pos)
slot that shows context menu when requested
void setCurrentStatus(ZyppStatus newStatus, bool selectNextItem=false, bool ifNewerOnly=false)
Sets the currently selected item's status.
void sendUpdatePackages()
Emit an updatePackages() signal.
YQPkgObjList * parent() const
Returns this exclude rule's parent YQPkgObjList.
virtual void createNotInstalledContextMenu()
Create the context menu for items that are not installed.
bool isSatisfied() const
Check if this item is satisfied, even though it is not installed.
virtual QMenu * installedContextMenu()
Returns the context menu for items that are not installed.
bool installedIsNewer() const
Check if the installed version is newer than the candidate.
int column() const
Returns the column number.
virtual QString toolTip(int column)
Returns a tool tip text for a specific column of this item.
void solveResolvableCollections()
Do a "small" solver run for all "resolvable collections", i.e., for selections, patterns, languages, patches.
virtual ~YQPkgObjList()
Destructor.
void showNotifyTexts(ZyppStatus status)
Display this item's notify text (if there is any) that corresponds to the specified status (S_Install...
virtual void keyPressEvent(QKeyEvent *ev)
Event handler for keyboard input.
YQPkgObjList(QWidget *parent)
Constructor.
virtual ~ExcludedItems()
Destructor.
virtual ZyppStatus status() const
Returns the (binary RPM) package status.
bool isEnabled() const
Returns 'true' if this exclude rule is enabled, 'false' otherwise.
static bool showLicenseAgreement(ZyppSel sel)
Display a selectable's license agreement (if there is any) that corresponds to its current status (S_...
void add(QTreeWidgetItem *item, QTreeWidgetItem *oldParent)
Add a list item to the excluded items and transfer ownership to this class.
virtual ~YQPkgObjListItem()
Destructor.
virtual void setStatusIcon()
Set a status icon according to the package's status.
virtual void cycleStatus()
Cycle the package status to the next valid value.
void init()
Initialize internal data and set fields accordingly.
void remove(QTreeWidgetItem *item)
Remove a list item from the excluded items and transfer ownership back to the caller.
bool editable() const
Return whether or not this items is editable, i.e.