Author: dmacvicar Date: Mon Jul 14 23:47:50 2008 New Revision: 49079 URL: http://svn.opensuse.org/viewcvs/yast?rev=49079&view=rev Log: - feature #302003, show transactions in a better way. basically we not only show automatic changes, but all changes or only user requested ones. Modified: trunk/qt-pkg/package/yast2-qt-pkg.changes trunk/qt-pkg/src/YQPackageSelector.cc trunk/qt-pkg/src/YQPackageSelectorBase.cc trunk/qt-pkg/src/YQPkgChangesDialog.cc trunk/qt-pkg/src/YQPkgChangesDialog.h Modified: trunk/qt-pkg/package/yast2-qt-pkg.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/package/yast2-qt-pkg.changes?rev=49079&r1=49078&r2=49079&view=diff ============================================================================== --- trunk/qt-pkg/package/yast2-qt-pkg.changes (original) +++ trunk/qt-pkg/package/yast2-qt-pkg.changes Mon Jul 14 23:47:50 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jul 14 23:45:08 CEST 2008 - dmacvicar@suse.de + +- feature #302003, show transactions in a better way. + basically we not only show automatic changes, but + all changes or only user requested ones. + +------------------------------------------------------------------- Fri Jul 11 15:40:57 CEST 2008 - sh@suse.de - Fixed bnc #399674: Icons for Auto* actions missing in help Modified: trunk/qt-pkg/src/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelector.cc?rev=49079&r1=49078&r2=49079&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelector.cc (original) +++ trunk/qt-pkg/src/YQPackageSelector.cc Mon Jul 14 23:47:50 2008 @@ -750,7 +750,7 @@ action->setText(_( "&Extras" )); _extrasMenu->addAction( _( "Show &Products" ), this, SLOT( showProducts() ) ); - _extrasMenu->addAction( _( "Show &Automatic Package Changes" ), this, SLOT( showAutoPkgList() ), Qt::CTRL + Qt::Key_A ); + _extrasMenu->addAction( _( "Show P&ackage Changes" ), this, SLOT( showAutoPkgList() ), Qt::CTRL + Qt::Key_A ); _extrasMenu->addAction( _( "&Verify System" ), this, SLOT( verifySystem() ) ); _extrasMenu->addSeparator(); Modified: trunk/qt-pkg/src/YQPackageSelectorBase.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelectorBase.cc?rev=49079&r1=49078&r2=49079&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelectorBase.cc (original) +++ trunk/qt-pkg/src/YQPackageSelectorBase.cc Mon Jul 14 23:47:50 2008 @@ -173,16 +173,12 @@ { resolveDependencies(); - // Show which packages are installed/deleted automatically + // Show which packages are installed/deleted QString msg = - "<p><b>" - // Dialog header - + _( "Automatic Changes" ) - + "</b></p>" // Detailed explanation ( automatic word wrap! ) + "<p>" - + _( "In addition to your manual selections, the following packages" - " have been changed to resolve dependencies:" ) + + _( "The following items will be changed:" + " " ) + "<p>"; YQPkgChangesDialog::showChangesDialog( this, Modified: trunk/qt-pkg/src/YQPkgChangesDialog.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgChangesDialog.cc?rev=49079&r1=49078&r2=49079&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgChangesDialog.cc (original) +++ trunk/qt-pkg/src/YQPkgChangesDialog.cc Mon Jul 14 23:47:50 2008 @@ -26,6 +26,7 @@ #include <QLabel> #include <QLayout> #include <QPushButton> +#include <QComboBox> #include <QStyle> #include <QBoxLayout> @@ -42,11 +43,6 @@ using std::set; using std::string; - -#define SPACING 2 // between subwidgets -#define MARGIN 4 // around the widget - - YQPkgChangesDialog::YQPkgChangesDialog( QWidget * parent, const QString & message, const QString & acceptButtonLabel, @@ -66,12 +62,8 @@ QVBoxLayout * layout = new QVBoxLayout(); Q_CHECK_PTR( layout ); - layout->setMargin(MARGIN); - layout->setSpacing(SPACING); setLayout(layout); - // HBox for icon and message - QHBoxLayout * hbox = new QHBoxLayout(); Q_CHECK_PTR( hbox ); layout->addLayout( hbox ); @@ -79,7 +71,6 @@ // Icon - hbox->addSpacing(SPACING); QLabel * iconLabel = new QLabel( this ); Q_CHECK_PTR( iconLabel ); hbox->addWidget(iconLabel); @@ -87,16 +78,23 @@ iconLabel->setPixmap( QApplication::style().stylePixmap( QStyle::SP_MessageBoxInformation ) ); #endif iconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert - hbox->addSpacing(SPACING); // Label for the message - QLabel * label = new QLabel( message, this ); Q_CHECK_PTR( label ); hbox->addWidget(label); label->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert + QComboBox *filter = new QComboBox(this); + filter->addItems( QStringList() << _("All") + << _("Selected by the user") + << _("Automatic Changes") ); + + layout->addWidget(filter); + connect( filter, SIGNAL(currentIndexChanged(int)), + SLOT(slotFilterChanged(int))); + // Pkg list _pkgList = new YQPkgList( this ); @@ -110,8 +108,6 @@ hbox = new QHBoxLayout(); Q_CHECK_PTR( hbox ); - hbox->setSpacing( SPACING ); - hbox->setMargin ( MARGIN ); layout->addLayout( hbox ); hbox->addStretch(); @@ -150,6 +146,26 @@ filter( QRegExp( "" ), byAuto, byApp, byUser ); } +void +YQPkgChangesDialog::slotFilterChanged( int index ) +{ + switch(index) + { + case All: + filter( true, true, true ); + break; + case User: + filter( false, true, true ); + break; + case Automatic: + filter( true, false, false ); + break; + default: + break; + }; + +} + void YQPkgChangesDialog::filter( const QRegExp & regexp, bool byAuto, bool byApp, bool byUser ) @@ -170,18 +186,20 @@ if ( selectable->toModify() ) { - zypp::ResStatus::TransactByValue modifiedBy = selectable->modifiedBy(); - + zypp::ResStatus::TransactByValue modifiedBy = selectable->modifiedBy(); + if ( ( ( modifiedBy == zypp::ResStatus::SOLVER ) && byAuto ) || - ( ( modifiedBy == zypp::ResStatus::APPL_LOW || - modifiedBy == zypp::ResStatus::APPL_HIGH ) && byApp ) || - ( ( modifiedBy == zypp::ResStatus::USER ) && byUser ) ) + ( ( modifiedBy == zypp::ResStatus::APPL_LOW || + modifiedBy == zypp::ResStatus::APPL_HIGH ) && byApp ) || + ( ( modifiedBy == zypp::ResStatus::USER ) && byUser ) ) { - if ( regexp.isEmpty() || regexp.indexIn( selectable->name().c_str() ) >= 0 ) - { - if ( ! contains( ignoredNames, selectable->name() ) ) - _pkgList->addPkgItem( selectable, tryCastToZyppPkg( selectable->theObj() ) ); - } + if ( regexp.isEmpty() + || regexp.indexIn( selectable->name().c_str() ) >= 0 ) + { + if ( ! contains( ignoredNames, selectable->name() ) ) + _pkgList->addPkgItem( selectable, + tryCastToZyppPkg( selectable->theObj() ) ); + } } } } Modified: trunk/qt-pkg/src/YQPkgChangesDialog.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgChangesDialog.h?rev=49079&r1=49078&r2=49079&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgChangesDialog.h (original) +++ trunk/qt-pkg/src/YQPkgChangesDialog.h Mon Jul 14 23:47:50 2008 @@ -37,6 +37,16 @@ Q_OBJECT public: + /** + * Filters + */ + enum Filter + { + All, + User, + Automatic + }; + /** * Static convenience method: Post a changes dialog with text @@ -84,6 +94,12 @@ **/ virtual QSize sizeHint () const; +protected slots: + /** + * called when the filter is changed + */ + void slotFilterChanged( int index ); + protected: /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org