Author: dmacvicar Date: Mon Dec 8 22:55:04 2008 New Revision: 53981 URL: http://svn.opensuse.org/viewcvs/yast?rev=53981&view=rev Log: package selector shows libzypp unsupported packages incorrectly (bnc #457214) Modified: trunk/qt-pkg/src/YQPackageSelectorBase.cc trunk/qt-pkg/src/YQPkgChangesDialog.cc trunk/qt-pkg/src/YQPkgChangesDialog.h Modified: trunk/qt-pkg/src/YQPackageSelectorBase.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelectorBase.cc?rev=53981&r1=53980&r2=53981&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelectorBase.cc (original) +++ trunk/qt-pkg/src/YQPackageSelectorBase.cc Mon Dec 8 22:55:04 2008 @@ -297,7 +297,7 @@ " requires an additional customer contract for support." ) + "<p>"; - if ( YQPkgUnsupportedPackagesDialog::showChangesDialog( this, msg, _( "C&ontinue" ), _( "&Cancel" ), YQPkgChangesDialog::FilterUser, YQPkgChangesDialog::OptionAutoAcceptIfEmpty ) + if ( YQPkgUnsupportedPackagesDialog::showUnsupportedPackagesDialog( this, msg, _( "C&ontinue" ), _( "&Cancel" ), YQPkgChangesDialog::FilterUser, YQPkgChangesDialog::OptionAutoAcceptIfEmpty ) == QDialog::Rejected ) return; } Modified: trunk/qt-pkg/src/YQPkgChangesDialog.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgChangesDialog.cc?rev=53981&r1=53980&r2=53981&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgChangesDialog.cc (original) +++ trunk/qt-pkg/src/YQPkgChangesDialog.cc Mon Dec 8 22:55:04 2008 @@ -313,7 +313,7 @@ if ( dialog.isEmpty() && o.testFlag(OptionAutoAcceptIfEmpty) ) { - yuiMilestone() << "No items to show in dialog, accepting it automatically" << endl; + yuiMilestone() << "No items to show in changes dialog, accepting it automatically" << endl; return true; } @@ -350,14 +350,48 @@ return dialog.result() == QDialog::Accepted; } +YQPkgUnsupportedPackagesDialog::YQPkgUnsupportedPackagesDialog( QWidget *parent, + const QString & message, + const QString & acceptButtonLabel, + const QString & rejectButtonLabel ) + : YQPkgChangesDialog( parent, message, acceptButtonLabel, rejectButtonLabel ) +{ +} + bool YQPkgUnsupportedPackagesDialog::extraFilter( ZyppSel sel, ZyppPkg pkg ) { - yuiMilestone() << "***: " << pkg << sel << endl; if (!pkg || !sel) return false; - yuiMilestone() << "PKG: " << pkg << endl; + yuiDebug() << "UNSUPPORTED PKG: " << pkg << endl; return pkg->maybeUnsupported(); } +bool +YQPkgUnsupportedPackagesDialog::showUnsupportedPackagesDialog( QWidget * parent, + const QString & message, + const QString & acceptButtonLabel, + const QString & rejectButtonLabel, + Filters f, + Options o ) +{ + YQPkgUnsupportedPackagesDialog dialog( parent, + message, + acceptButtonLabel, + rejectButtonLabel ); + + dialog.setFilter(f); + + if ( dialog.isEmpty() && o.testFlag(OptionAutoAcceptIfEmpty) ) + { + yuiMilestone() << "No items to show in unsupported packages dialog, accepting it automatically" << endl; + return true; + } + + dialog.exec(); + + return dialog.result() == QDialog::Accepted; +} + + #include "YQPkgChangesDialog.moc" Modified: trunk/qt-pkg/src/YQPkgChangesDialog.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgChangesDialog.h?rev=53981&r1=53980&r2=53981&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgChangesDialog.h (original) +++ trunk/qt-pkg/src/YQPkgChangesDialog.h Mon Dec 8 22:55:04 2008 @@ -193,7 +193,42 @@ class YQPkgUnsupportedPackagesDialog : public YQPkgChangesDialog { - protected: +public: + /** + * Constructor: Creates a changes dialog with text 'message' on + * top, a list packages with an "auto" status that is not set via selections + * and one ( default ) or two buttons. + * + * Not meant for public use. Applications should use the static + * 'showChangesDialog' method instead. + * + * This constructor does not call filter() yet - this is the caller's + * responsibility. + **/ + YQPkgUnsupportedPackagesDialog( QWidget * parent, + const QString &message, + const QString &acceptButtonLabel, + const QString &rejectButtonLabel = QString::null ); + + /** + * Static convenience method: Post a changes dialog with text + * 'message', a list of changed packages and one ( default ) or two buttons. + * + * Returns 'true' if the user accepted ( i.e. clicked the 'accept' button ) + * and 'false' if the user rejected ( i.e. clicked the 'reject' button or + * the window manager close button ). + * + * If the list is empty ( i.e., there are no packages with an "auto" + * status ), the dialog is not shown at all ( and returns 'true' ) - unless + *'showIfListEmpty' is 'true'. + **/ + static bool showUnsupportedPackagesDialog( QWidget * parent, + const QString & message, + const QString & acceptButtonLabel, + const QString & rejectButtonLabel = QString::null, + Filters f = FilterAutomatic, + Options o = OptionAutoAcceptIfEmpty ); +protected: /** * leave supported packages out. */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org