[yast-commit] r59972 - in /branches/SuSE-Code-11-SP1-Branch/qt-pkg: package/ src/
Author: tgoettlicher Date: Fri Dec 4 17:39:18 2009 New Revision: 59972 URL: http://svn.opensuse.org/viewcvs/yast?rev=59972&view=rev Log: applied latest version Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/package/yast2-qt-pkg.changes branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPackageSelector.cc branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgGenericDetailsView.h branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.cc branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.h branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.cc branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.h branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQZypp.h Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/package/yast2-qt-pkg.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/package/yast2-qt-pkg.changes?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/package/yast2-qt-pkg.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/package/yast2-qt-pkg.changes Fri Dec 4 17:39:18 2009 @@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Fri Dec 4 16:59:59 CET 2009 - tgoettlicher@suse.de + +- Enabled multiple packages (fate# 305311) +- V 2.18.19 + +------------------------------------------------------------------- +Tue Dec 1 10:13:02 CET 2009 - tgoettlicher@suse.de + +- fixed bnc #549868: Mnemonic clash in Software Management +- fixed bnc #554473: UTF-8 Problem +- fixed bnc #558881: Broken accented chars in YaST Qt packager versions tab + +------------------------------------------------------------------- +Thu Nov 19 14:15:03 CET 2009 - tgoettlicher@suse.de + +- fixed orphaned packages View (bnc #551771) + +------------------------------------------------------------------- Fri Oct 23 15:56:47 UTC 2009 - dmacvicar@suse.de - allow repository upgrades from the user interface @@ -204,7 +222,7 @@ ------------------------------------------------------------------- Fri Jan 9 18:52:44 CET 2009 - sh@suse.de -- Fixed accumulated margins in "Versions" view for installed +- Fixed accmulated margins in "Versions" view for installed ------------------------------------------------------------------- Fri Jan 9 17:59:43 CET 2009 - sh@suse.de Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPackageSelector.cc?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPackageSelector.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPackageSelector.cc Fri Dec 4 17:39:18 2009 @@ -524,6 +524,9 @@ connect( _pkgList, SIGNAL( currentItemChanged ( ZyppSel ) ), _pkgVersionsView, SLOT ( showDetailsIfVisible( ZyppSel ) ) ); + connect( _pkgList, SIGNAL( statusChanged() ), + _pkgVersionsView, SLOT ( slotRefreshDetails() ) ); + // // File List @@ -733,7 +736,7 @@ _configMenu = new QMenu( _menuBar ); YUI_CHECK_NEW( _configMenu ); action = _menuBar->addMenu( _configMenu ); - action->setText(_( "&Configuration" )); + action->setText(_( "Confi&guration" )); _configMenu->addAction( _( "&Repositories..." ), this, SLOT( repoManager() ), Qt::CTRL + Qt::Key_R ); _configMenu->addAction( _( "&Online Update..." ), this, SLOT( onlineUpdateConfiguration() ), Qt::CTRL + Qt::Key_O ); _configMenu->addAction( _( "Search Packages on &Web..." ), this, SLOT( webpinSearch() ), Qt::CTRL + Qt::Key_W ); @@ -980,6 +983,9 @@ { connect( _pkgVersionsView, SIGNAL( candidateChanged( ZyppObj ) ), _pkgList, SLOT ( updateItemData() ) ); + + connect( _pkgVersionsView, SIGNAL( multiversionSelectionChanged( ) ), + _pkgList, SLOT ( updateItemData() ) ); } @@ -1390,7 +1396,10 @@ // repository if there is a job for it if ( zypp::getZYpp()->resolver()->upgradingRepo(repo) ) { - _repoUpgradingLabel->setText(_repoUpgradingLabel->text() + _("<p><small><a href=\"repoupgraderemove:///%1\">Cancel switching</a> system packages to versions in repository %2</small></p>").arg(repo.alias().c_str()).arg(repo.name().c_str())); + _repoUpgradingLabel->setText(_repoUpgradingLabel->text() + _("<p><small><a href=\"repoupgraderemove:///%1\">Cancel switching</a> system packages to versions in repository %2</small></p>") + .arg(fromUTF8(repo.alias().c_str())) + .arg(fromUTF8(repo.name().c_str())) + ); } } @@ -1406,7 +1415,10 @@ ! repo.isSystemRepo() && _repoFilterView->selectedRepo() == repo ) { - _repoUpgradeLabel->setText(_repoUpgradeLabel->text() + _("<p><a href=\"repoupgradeadd:///%1\">Switch system packages</a> to the versions in this repository (%2)</p>").arg(repo.alias().c_str()).arg(repo.name().c_str())); + _repoUpgradeLabel->setText(_repoUpgradeLabel->text() + _("<p><a href=\"repoupgradeadd:///%1\">Switch system packages</a> to the versions in this repository (%2)</p>") + .arg(fromUTF8(repo.alias().c_str())) + .arg(fromUTF8(repo.name().c_str())) + ); } } _repoUpgradeLabel->setVisible(!_repoUpgradeLabel->text().isEmpty() && Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgGenericDetailsView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgGenericDetailsView.h?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgGenericDetailsView.h (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgGenericDetailsView.h Fri Dec 4 17:39:18 2009 @@ -124,6 +124,7 @@ **/ virtual void showDetails( ZyppSel selectable ) = 0; + protected slots: Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.cc?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.cc Fri Dec 4 17:39:18 2009 @@ -72,6 +72,7 @@ case YPKG_GROUP_SUGGESTED: return _( "Suggested Packages" ); case YPKG_GROUP_RECOMMENDED: return _( "Recommended Packages"); case YPKG_GROUP_ORPHANED: return _( "Orphaned Packages" ); + case YPKG_GROUP_MULTIVERSION: return _( "Multiversion Packages" ); // Intentionally omitting 'default' case so gcc can catch unhandled enums } @@ -118,6 +119,7 @@ case YPKG_GROUP_SUGGESTED: return( "package_edutainment_languages" ); case YPKG_GROUP_RECOMMENDED: return( "package_edutainment_languages" ); case YPKG_GROUP_ORPHANED: return( "package_edutainment_languages" ); + case YPKG_GROUP_MULTIVERSION: return( "package_edutainment_languages" ); case YPKG_GROUP_ALL: return( "package_main" ); // Intentionally omitting 'default' case so gcc can catch unhandled enums @@ -219,6 +221,8 @@ _groupsMap[ YPKG_GROUP_RECOMMENDED ] = new YQPkgPackageKitGroup( this, YPKG_GROUP_RECOMMENDED ); _groupsMap[ YPKG_GROUP_SUGGESTED ] = new YQPkgPackageKitGroup( this, YPKG_GROUP_SUGGESTED ); _groupsMap[ YPKG_GROUP_ORPHANED ] = new YQPkgPackageKitGroup( this, YPKG_GROUP_ORPHANED ); + if ( ! zypp::sat::Pool::instance().multiversionEmpty() ) + _groupsMap[ YPKG_GROUP_MULTIVERSION] = new YQPkgPackageKitGroup( this, YPKG_GROUP_MULTIVERSION ); } } @@ -334,28 +338,31 @@ return true; } - if ( selectable->candidateObj() ) + if ( selectedGroup() == YPKG_GROUP_RECOMMENDED && + zypp::PoolItem(pkg).status().isRecommended() ) { - if ( selectedGroup() == YPKG_GROUP_RECOMMENDED && - zypp::PoolItem(pkg).status().isRecommended() ) - { - emit filterMatch( selectable, pkg ); - return true; - } - if ( selectedGroup() == YPKG_GROUP_SUGGESTED && - zypp::PoolItem(pkg).status().isSuggested() ) - { - emit filterMatch( selectable, pkg ); - return true; - } - if ( selectedGroup() == YPKG_GROUP_ORPHANED && - zypp::PoolItem(pkg).status().isOrphaned() ) - { - emit filterMatch( selectable, pkg ); - return true; - } - + emit filterMatch( selectable, pkg ); + return true; } + if ( selectedGroup() == YPKG_GROUP_SUGGESTED && + zypp::PoolItem(pkg).status().isSuggested() ) + { + emit filterMatch( selectable, pkg ); + return true; + } + if ( selectedGroup() == YPKG_GROUP_ORPHANED && + zypp::PoolItem(pkg).status().isOrphaned() ) + { + emit filterMatch( selectable, pkg ); + return true; + } + if ( selectedGroup() == YPKG_GROUP_MULTIVERSION && + selectable->multiversionInstall() ) + { + emit filterMatch( selectable, pkg ); + return true; + } + return false; } Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.h?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.h (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgPackageKitGroupsFilterView.h Fri Dec 4 17:39:18 2009 @@ -71,6 +71,7 @@ YPKG_GROUP_SUGGESTED, YPKG_GROUP_RECOMMENDED, YPKG_GROUP_ORPHANED, + YPKG_GROUP_MULTIVERSION, YPKG_GROUP_ALL, } YPkgGroupEnum; Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.cc?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.cc Fri Dec 4 17:39:18 2009 @@ -26,6 +26,9 @@ #include <QTabWidget> #include <QRegExp> #include <QHeaderView> +#include <QStylePainter> +#include <QStyleOptionButton> + #include "YQPkgVersionsView.h" #include "YQPkgRepoList.h" @@ -33,6 +36,7 @@ #include "YQi18n.h" #include "utf8.h" +#define ICONOFFSET 3 // the status icons have an asymmetrical transparent border YQPkgVersionsView::YQPkgVersionsView( QWidget * parent, bool userCanSwitch ) @@ -69,10 +73,19 @@ void +YQPkgVersionsView::slotRefreshDetails( ) +{ + emit multiversionSelectionChanged( ); +} + + +void YQPkgVersionsView::showDetailsIfVisible( ZyppSel selectable ) { _selectable = selectable; + yuiMilestone() << "showDetailsIfVis" << endl; + if ( _parentTab ) // Is this view embedded into a tab widget? { if ( _parentTab->currentWidget() == this ) // Is this page the topmost? @@ -88,6 +101,8 @@ void YQPkgVersionsView::showDetails( ZyppSel selectable ) { + yuiMilestone() << "showDetails" << endl; + _selectable = selectable; if ( ! selectable ) @@ -128,7 +143,7 @@ font.setPixelSize( (int) ( fm.height() * 1.1 ) ); pkgNameLabel->setFont( font ); - pkgNameLabel->setText( selectable->theObj()->name().c_str() ); + pkgNameLabel->setText( fromUTF8(selectable->theObj()->name().c_str()) ); // New scope { @@ -144,64 +159,89 @@ qDeleteAll( _installed ); _installed.clear(); - - // - // Fill installed objects - // + if ( selectable->multiversionInstall() ) { - zypp::ui::Selectable::installed_iterator it = selectable->installedBegin(); + // + // Find installed and available objects ( for multiversion view ) + // + { + zypp::ui::Selectable::picklist_iterator it = selectable->picklistBegin(); + - while ( it != selectable->installedEnd() ) + while ( it != selectable->picklistEnd() ) + { + YQPkgMultiVersion * version = new YQPkgMultiVersion( this, selectable, *it, _userCanSwitch ); + + _installed.push_back( version ); + _layout->addWidget( version ); + + connect (version, SIGNAL(statusChanged()), this, SLOT(slotRefreshDetails())); + connect (this, SIGNAL(multiversionSelectionChanged()), version, SLOT(update())); + + ++it; + } + } + } + else + { + // + // Fill installed objects + // { - QString text = _( "%1-%2 from vendor %3 (installed)" ) - .arg( (*it)->edition().asString().c_str() ) - .arg( (*it)->arch().asString().c_str() ) - .arg( (*it)->vendor().c_str() ) ; - - QWidget * installedVersion = new QWidget( this ); - QHBoxLayout * instLayout = new QHBoxLayout( installedVersion ); - instLayout->setContentsMargins( 0, 0, 0, 0 ); - - QLabel * icon = new QLabel( installedVersion ); - icon->setPixmap( YQIconPool::pkgSatisfied() ); - instLayout->addWidget( icon ); + zypp::ui::Selectable::installed_iterator it = selectable->installedBegin(); + + while ( it != selectable->installedEnd() ) + { + QString text = _( "%1-%2 from vendor %3 (installed)" ) + .arg( fromUTF8( (*it)->edition().asString().c_str() ) ) + .arg( fromUTF8( (*it)->arch().asString().c_str() ) ) + .arg( fromUTF8( (*it)->vendor().c_str() ) ) ; + + QWidget * installedVersion = new QWidget( this ); + QHBoxLayout * instLayout = new QHBoxLayout( installedVersion ); + instLayout->setContentsMargins( 0, 0, 0, 0 ); + + QLabel * icon = new QLabel( installedVersion ); + icon->setPixmap( YQIconPool::pkgSatisfied() ); + instLayout->addWidget( icon ); - QLabel * textLabel = new QLabel( text, installedVersion ); - instLayout->addWidget( textLabel ); - instLayout->addStretch(); + QLabel * textLabel = new QLabel( text, installedVersion ); + instLayout->addWidget( textLabel ); + instLayout->addStretch(); - _installed.push_back( installedVersion ); - _layout->addWidget( installedVersion ); + _installed.push_back( installedVersion ); + _layout->addWidget( installedVersion ); - ++it; + ++it; + } } - } - // - // Fill available objects - // + // + // Fill available objects + // - { - zypp::ui::Selectable::available_iterator it = selectable->availableBegin(); - - while ( it != selectable->availableEnd() ) { - QRadioButton *radioButton = new YQPkgVersion( this, selectable, *it, _userCanSwitch ); - connect( radioButton, SIGNAL( clicked( bool ) ), SLOT( checkForChangedCandidate() ) ); + zypp::ui::Selectable::available_iterator it = selectable->availableBegin(); + + while ( it != selectable->availableEnd() ) + { + QRadioButton *radioButton = new YQPkgVersion( this, selectable, *it, _userCanSwitch ); + connect( radioButton, SIGNAL( clicked( bool ) ), SLOT( checkForChangedCandidate() ) ); - _buttons->addButton( radioButton ); - _layout->addWidget( radioButton ); + _buttons->addButton( radioButton ); + _layout->addWidget( radioButton ); - if ( selectable->hasCandidateObj() && - selectable->candidateObj()->edition() == (*it)->edition() && - selectable->candidateObj()->arch() == (*it)->arch() ) - { - radioButton->setChecked(true); - } + if ( selectable->hasCandidateObj() && + selectable->candidateObj()->edition() == (*it)->edition() && + selectable->candidateObj()->arch() == (*it)->arch() ) + { + radioButton->setChecked(true); + } - ++it; + ++it; + } } } @@ -307,11 +347,11 @@ // ^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^ // %1 %2 %3 %4 %5 setText( _( "%1-%2 from %3 with priority %4 and vendor %5" ) - .arg( zyppObj->edition().asString().c_str() ) - .arg( zyppObj->arch().asString().c_str() ) - .arg( zyppObj->repository().info().name().c_str() ) + .arg( fromUTF8( zyppObj->edition().asString().c_str() ) ) + .arg( fromUTF8( zyppObj->arch().asString().c_str() ) ) + .arg( fromUTF8( zyppObj->repository().info().name().c_str() ) ) .arg( zyppObj->repository().info().priority() ) - .arg( zyppObj->vendor().c_str() ) ); + .arg( fromUTF8( zyppObj->vendor().c_str() ) ) ); } @@ -334,4 +374,163 @@ + +YQPkgMultiVersion::YQPkgMultiVersion( QWidget * parent, + ZyppSel selectable, + ZyppPoolItem zyppPoolItem, + bool enabled ) + : QCheckBox( parent ) + , _selectable( selectable ) + , _zyppPoolItem( zyppPoolItem ) +{ + setText (_( "%1-%2 from %3 with priority %4 and vendor %5" ) + .arg( fromUTF8( zyppPoolItem->edition().asString().c_str() ) ) + .arg( fromUTF8( zyppPoolItem->arch().asString().c_str() ) ) + .arg( fromUTF8( zyppPoolItem->repository().info().name().c_str() ) ) + .arg( zyppPoolItem->repository().info().priority() ) + .arg( fromUTF8( zyppPoolItem->vendor().c_str() ) )); + + + connect( this, SIGNAL (toggled(bool)), this, SLOT( slotIconClicked())); +} + + +YQPkgMultiVersion::~YQPkgMultiVersion() +{ + // NOP +} + + +void YQPkgMultiVersion::slotIconClicked() +{ + // prevent checkmark, we draw the status icons ourselves + bool oldBlock = blockSignals( true ); + setChecked( false ); + blockSignals( oldBlock ); + cycleStatus(); +} + + +void YQPkgMultiVersion::cycleStatus() +{ + + ZyppStatus oldStatus = _selectable->pickStatus( _zyppPoolItem ); + ZyppStatus newStatus = oldStatus; + + switch ( oldStatus ) + { + case S_Install: + newStatus = S_NoInst; + break; + + case S_Protected: + newStatus = _selectable->identicalAvailable( _zyppPoolItem ) ? + S_KeepInstalled: S_NoInst; + break; + + case S_Taboo: + newStatus = _selectable->identicalInstalled( _zyppPoolItem ) ? + S_KeepInstalled : S_NoInst; + break; + + case S_KeepInstalled: + newStatus = _selectable->identicalAvailable( _zyppPoolItem ) ? + S_Update : S_Del; + break; + + case S_Update: + newStatus = S_Del; + break; + + case S_AutoUpdate: + newStatus = S_KeepInstalled; + break; + + case S_Del: + case S_AutoDel: + newStatus = S_KeepInstalled; + break; + + case S_NoInst: + if ( _selectable->identicalAvailable( _zyppPoolItem ) ) + { + newStatus = S_Install; + } + else + { + yuiWarning() << "No candidate for " << _selectable->theObj()->name() << endl; + newStatus = S_NoInst; + } + break; + + case S_AutoInstall: + // this used to be taboo before, but now ZYpp supports + // saving weak locks (unselected packages) + newStatus = S_NoInst; + break; + } + + + setStatus( newStatus ); + yuiMilestone() << "oldStatus:" << oldStatus << endl; + yuiMilestone() << "newStatus:" << newStatus << endl; + +} + + +void YQPkgMultiVersion::setStatus( ZyppStatus newStatus ) +{ + _selectable->setPickStatus( _zyppPoolItem, newStatus ); + + emit statusChanged(); + update(); +} + + +void YQPkgMultiVersion::paintEvent(QPaintEvent *) +{ + // draw the usual checkbox + QStylePainter p(this); + QStyleOptionButton opt; + initStyleOption(&opt); + p.drawControl(QStyle::CE_CheckBox, opt); + + + // calculate position and draw the status icon + QRect elementRect = style()->subElementRect ( QStyle::SE_CheckBoxIndicator, &opt); + QPixmap icon = statusIcon( _selectable->pickStatus(_zyppPoolItem) ); + + QPoint start = elementRect.center() - icon.rect().center(); + QRect rect = QRect(start.x() - ICONOFFSET, start.y(), icon.width(), icon.height()); + + p.drawItemPixmap( rect, 0, icon ); +} + + +QPixmap YQPkgMultiVersion::statusIcon( ZyppStatus status ) +{ + QPixmap icon = YQIconPool::pkgNoInst(); + + switch ( status ) + { + case S_Del: icon = YQIconPool::pkgDel(); break; + case S_Install: icon = YQIconPool::pkgInstall(); break; + case S_KeepInstalled: icon = YQIconPool::pkgKeepInstalled(); break; + case S_NoInst: icon = QPixmap(); break; + case S_Protected: icon = YQIconPool::pkgProtected(); break; + case S_Taboo: icon = YQIconPool::pkgTaboo(); break; + case S_Update: icon = YQIconPool::pkgUpdate(); break; + + case S_AutoDel: icon = YQIconPool::pkgAutoDel(); break; + case S_AutoInstall: icon = YQIconPool::pkgAutoInstall(); break; + case S_AutoUpdate: icon = YQIconPool::pkgAutoUpdate(); break; + + // Intentionally omitting 'default' branch so the compiler can + // catch unhandled enum states + } + return icon; +} + + + #include "YQPkgVersionsView.moc" Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.h?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.h (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQPkgVersionsView.h Fri Dec 4 17:39:18 2009 @@ -22,6 +22,7 @@ #include <QScrollArea> #include <QRadioButton> +#include <QCheckBox> #include <QButtonGroup> #include <QBoxLayout> #include <QLabel> @@ -29,6 +30,7 @@ #include "YQZypp.h" + class QTabWidget; @@ -80,6 +82,7 @@ **/ void reload( QWidget * newCurrent ); + void slotRefreshDetails(); signals: @@ -87,6 +90,8 @@ * Emitted when the user changes the **/ void candidateChanged( ZyppObj newCandidate ); + void multiversionSelectionChanged( ); + protected slots: @@ -117,7 +122,7 @@ }; -class YQPkgVersion: public QRadioButton +class YQPkgVersion : public QRadioButton { public: @@ -163,4 +168,65 @@ }; + +class YQPkgMultiVersion: public QCheckBox +{ + Q_OBJECT + +public: + + /** + * Constructor. Creates a YQPkgVersion item that corresponds to the package + * manager object that 'pkg' refers to. + **/ + YQPkgMultiVersion( QWidget * parent, + ZyppSel selectable, + ZyppPoolItem zyppPoolItem, + bool enabled = true ); + + /** + * Destructor + **/ + virtual ~YQPkgMultiVersion(); + + /** + * Returns the original ZYPP selectable + **/ + ZyppSel selectable() const { return _selectable; } + + /** + * Paints checkboxes with status icons instead of a checkmark + **/ + void paintEvent(QPaintEvent *); + + +protected: + + /** + * Cycle the package status to the next valid value. + **/ + void cycleStatus(); + + void setStatus( ZyppStatus newStatus ); + QPixmap statusIcon( ZyppStatus status ); + + // Data members + + ZyppSel _selectable; + ZyppPoolItem _zyppPoolItem; + + +protected slots: + void slotIconClicked(); + + +signals: + void statusChanged(); + + +}; + + + + #endif // ifndef YQPkgVersionsView_h Modified: branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQZypp.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQZypp.h?rev=59972&r1=59971&r2=59972&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQZypp.h (original) +++ branches/SuSE-Code-11-SP1-Branch/qt-pkg/src/YQZypp.h Fri Dec 4 17:39:18 2009 @@ -55,6 +55,7 @@ typedef zypp::Pattern::constPtr ZyppPattern; typedef zypp::Patch::constPtr ZyppPatch; typedef zypp::Product::constPtr ZyppProduct; +typedef zypp::PoolItem ZyppPoolItem; typedef zypp::ResPoolProxy ZyppPool; typedef zypp::ResPoolProxy::const_iterator ZyppPoolIterator; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
tgoettlicher@svn.opensuse.org