[yast-commit] r48540 - in /trunk/qt-pkg: ./ package/ src/
Author: schubi2 Date: Thu Jun 26 09:49:25 2008 New Revision: 48540 URL: http://svn.opensuse.org/viewcvs/yast?rev=48540&view=rev Log: Added plugin mechanism for displaying grafic solver results. Added: trunk/qt-pkg/src/YQZyppSolverDialogPluginIf.h trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.cc trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.h Modified: trunk/qt-pkg/package/yast2-qt-pkg.changes trunk/qt-pkg/src/CMakeLists.txt trunk/qt-pkg/src/YQPackageSelector.cc trunk/qt-pkg/src/YQPkgList.cc trunk/qt-pkg/src/YQPkgObjList.cc trunk/qt-pkg/src/YQPkgObjList.h trunk/qt-pkg/yast2-qt-pkg.spec.in 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=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/package/yast2-qt-pkg.changes (original) +++ trunk/qt-pkg/package/yast2-qt-pkg.changes Thu Jun 26 09:49:25 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Jun 26 09:47:18 CEST 2008 - schubi@suse.de + +- Added plugin mechanism for displaying grafic solver results. + +------------------------------------------------------------------- Wed Jun 4 11:46:58 CEST 2008 - sh@suse.de - Added translation marker for "File" menu (bnc #396419) Modified: trunk/qt-pkg/src/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/CMakeLists.txt?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/src/CMakeLists.txt (original) +++ trunk/qt-pkg/src/CMakeLists.txt Thu Jun 26 09:49:25 2008 @@ -53,6 +53,7 @@ YQPkgUpdateProblemFilterView.cc YQPkgVersionsView.cc YQPackageSelectorPluginImpl.cc + YQZyppSolverDialogPluginStub.cc ) QT4_AUTOMOC(${qt_yast_pkg_plugin_SRCS}) @@ -64,7 +65,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_INSTALL_PREFIX}/include/YaST2/yast2-qt ) INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} ) -ADD_LIBRARY( py2qt_pkg SHARED ${qt_yast_pkg_plugin_SRCS}) +ADD_LIBRARY( py2qt_pkg SHARED ${qt_yast_pkg_plugin_SRCS} ) TARGET_LINK_LIBRARIES( py2qt_pkg ${UI_PLUGIN_DIR}/libpy2qt.so ) TARGET_LINK_LIBRARIES( py2qt_pkg ${LIBYUI_LIBRARY} ) TARGET_LINK_LIBRARIES( py2qt_pkg ${ZYPP_LIBRARY} ) Modified: trunk/qt-pkg/src/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelector.cc?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelector.cc (original) +++ trunk/qt-pkg/src/YQPackageSelector.cc Thu Jun 26 09:49:25 2008 @@ -662,6 +662,7 @@ _pkgMenu->addAction(_pkgList->actionSetCurrentDelete); _pkgMenu->addAction(_pkgList->actionSetCurrentUpdate); _pkgMenu->addAction(_pkgList->actionSetCurrentTaboo); + _pkgMenu->addAction(_pkgList->actionShowCurrentSolverInfo); #if ENABLE_SOURCE_RPMS _pkgMenu->addSeparator(); Modified: trunk/qt-pkg/src/YQPkgList.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgList.cc?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgList.cc (original) +++ trunk/qt-pkg/src/YQPkgList.cc Thu Jun 26 09:49:25 2008 @@ -277,10 +277,10 @@ _notInstalledContextMenu->addAction(actionSetCurrentInstall); _notInstalledContextMenu->addAction(actionSetCurrentDontInstall); _notInstalledContextMenu->addAction(actionSetCurrentTaboo); + _notInstalledContextMenu->addAction(actionShowCurrentSolverInfo); addAllInListSubMenu( _notInstalledContextMenu ); - _notInstalledContextMenu->addSeparator(); _notInstalledContextMenu->addAction( _( "Export This List to &Text File..." ), this, SLOT( askExportList() ) ); @@ -297,6 +297,7 @@ _installedContextMenu->addAction(actionSetCurrentDelete); _installedContextMenu->addAction(actionSetCurrentUpdate); _installedContextMenu->addAction(actionSetCurrentProtected); + _installedContextMenu->addAction(actionShowCurrentSolverInfo); addAllInListSubMenu( _installedContextMenu ); Modified: trunk/qt-pkg/src/YQPkgObjList.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgObjList.cc?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgObjList.cc (original) +++ trunk/qt-pkg/src/YQPkgObjList.cc Thu Jun 26 09:49:25 2008 @@ -35,6 +35,7 @@ #include "YQi18n.h" #include "YQIconPool.h" #include "YQUI.h" +#include "YQZyppSolverDialogPluginStub.h" using std::list; using std::string; @@ -56,6 +57,7 @@ actionSetCurrentUpdate(0L), actionSetCurrentTaboo(0L), actionSetCurrentProtected(0L), + actionShowCurrentSolverInfo(0L), actionSetListInstall(0L), actionSetListDontInstall(0L), actionSetListKeepInstalled(0L), @@ -310,6 +312,24 @@ void +YQPkgObjList::showSolverInfo() +{ + QTreeWidgetItem * listViewItem = currentItem(); + + if ( ! listViewItem ) + return; + + YQPkgObjListItem * item = dynamic_cast<YQPkgObjListItem *> (listViewItem); + + if ( item ) + { + YQZyppSolverDialogPluginStub plugin; + plugin.createZyppSolverDialog(item->zyppObj()->poolItem()); + } +} + + +void YQPkgObjList::setAllItemStatus( ZyppStatus newStatus, bool force ) { if ( ! _editable ) @@ -376,6 +396,8 @@ actionSetCurrentTaboo = createAction( S_Taboo, "[!]" ); actionSetCurrentProtected = createAction( S_Protected, "[*]" ); + actionShowCurrentSolverInfo = createAction( _( "Show solver information" )); + actionSetListInstall = createAction( S_Install, "", true ); actionSetListDontInstall = createAction( S_NoInst, "", true ); actionSetListKeepInstalled = createAction( S_KeepInstalled, "", true ); @@ -404,6 +426,8 @@ connect( actionSetCurrentTaboo, SIGNAL( activated() ), this, SLOT( setCurrentTaboo() ) ); connect( actionSetCurrentProtected, SIGNAL( activated() ), this, SLOT( setCurrentProtected() ) ); + connect( actionShowCurrentSolverInfo, SIGNAL( activated() ), this, SLOT( showCurrentSolverInfo() ) ); + connect( actionSetListInstall, SIGNAL( activated() ), this, SLOT( setListInstall() ) ); connect( actionSetListDontInstall, SIGNAL( activated() ), this, SLOT( setListDontInstall() ) ); connect( actionSetListKeepInstalled, SIGNAL( activated() ), this, SLOT( setListKeepInstalled() ) ); @@ -468,6 +492,8 @@ _notInstalledContextMenu->addAction(actionSetCurrentDontInstall); _notInstalledContextMenu->addAction(actionSetCurrentTaboo); + _notInstalledContextMenu->addAction(actionShowCurrentSolverInfo); + addAllInListSubMenu( _notInstalledContextMenu ); } @@ -482,6 +508,8 @@ _installedContextMenu->addAction(actionSetCurrentDelete); _installedContextMenu->addAction(actionSetCurrentUpdate); + _installedContextMenu->addAction(actionShowCurrentSolverInfo); + addAllInListSubMenu( _installedContextMenu ); } @@ -559,6 +587,7 @@ actionSetCurrentDelete->setEnabled( false ); actionSetCurrentUpdate->setEnabled( false ); } + actionShowCurrentSolverInfo->setEnabled( true ); } else // ! item { @@ -570,6 +599,9 @@ actionSetCurrentDelete->setEnabled( false ); actionSetCurrentUpdate->setEnabled( false ); actionSetCurrentProtected->setEnabled( false ); + + actionShowCurrentSolverInfo->setEnabled( false ); + } } Modified: trunk/qt-pkg/src/YQPkgObjList.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPkgObjList.h?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPkgObjList.h (original) +++ trunk/qt-pkg/src/YQPkgObjList.h Thu Jun 26 09:49:25 2008 @@ -100,6 +100,11 @@ bool selectNextItem = false ); /** + * Show solver information about the current selected item + **/ + void showSolverInfo(); + + /** * Sets the status of all (toplevel) list items to 'newStatus', if possible. * Only one single statusChanged() signal is emitted. * @@ -239,6 +244,8 @@ void setCurrentTaboo() { setCurrentStatus( S_Taboo ); } void setCurrentProtected() { setCurrentStatus( S_Protected ); } + void showCurrentSolverInfo() { showSolverInfo (); } + void setListInstall() { setAllItemStatus( S_Install ); } void setListDontInstall() { setAllItemStatus( S_NoInst ); } void setListKeepInstalled() { setAllItemStatus( S_KeepInstalled ); } @@ -369,6 +376,7 @@ QAction * actionSetCurrentUpdate; QAction * actionSetCurrentTaboo; QAction * actionSetCurrentProtected; + QAction * actionShowCurrentSolverInfo; QAction * actionSetListInstall; QAction * actionSetListDontInstall; Added: trunk/qt-pkg/src/YQZyppSolverDialogPluginIf.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQZyppSolverDialogPluginIf.h?rev=48540&view=auto ============================================================================== --- trunk/qt-pkg/src/YQZyppSolverDialogPluginIf.h (added) +++ trunk/qt-pkg/src/YQZyppSolverDialogPluginIf.h Thu Jun 26 09:49:25 2008 @@ -0,0 +1,34 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (c) SuSE Linux AG | +\----------------------------------------------------------------------/ + + File: YQZyppSolverDialogPluginIf.h + + Author: Stefan Schubert <schubi@suse.de> + + +/-*/ + +#ifndef YQZyppSolverDialogPluginIf_h +#define YQZyppSolverDialogPluginIf_h + +#include <zypp/PoolItem.h> + +class YQZyppSolverDialogPluginIf +{ + + public: + + virtual ~YQZyppSolverDialogPluginIf() {} + + virtual bool createZyppSolverDialog(const zypp::PoolItem item) = 0 ; +}; +#endif Added: trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.cc?rev=48540&view=auto ============================================================================== --- trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.cc (added) +++ trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.cc Thu Jun 26 09:49:25 2008 @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (c) SuSE Linux AG | +\----------------------------------------------------------------------/ + + File: YQZyppSolverDialogPluginStub.cc + + Authors: Stefan Schubert <schubi@suse.de> + + +/-*/ +#include <qmessagebox.h> +#include "YQZyppSolverDialogPluginStub.h" + +#define YUILogComponent "qt-ui" +#include "YUILog.h" +#include "YQi18n.h" + +#define PLUGIN_BASE_NAME "qt_zypp_solver_dialog" + +YQZyppSolverDialogPluginStub::YQZyppSolverDialogPluginStub() + : YUIPlugin( PLUGIN_BASE_NAME ) +{ + if ( success() ) + { + yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME + << " plugin successfully from " << pluginLibFullPath() + << endl; + } + + + impl = (YQZyppSolverDialogPluginIf*) locateSymbol("ZYPPDIALOGP"); + + if ( ! impl ) + { + yuiError() << "Plugin " << PLUGIN_BASE_NAME << " does not provide ZYPPP symbol" << endl; + } +} + + +YQZyppSolverDialogPluginStub::~YQZyppSolverDialogPluginStub() +{ + // NOP +} + + +bool +YQZyppSolverDialogPluginStub::createZyppSolverDialog( const zypp::PoolItem item ) +{ + if ( ! impl ) + { + QMessageBox::information( 0, + _("Missing package") , + _("Package libqdialogsolver is rquired for this feature.")); + return false; + } + + return impl->createZyppSolverDialog( item ); +} + + Added: trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.h?rev=48540&view=auto ============================================================================== --- trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.h (added) +++ trunk/qt-pkg/src/YQZyppSolverDialogPluginStub.h Thu Jun 26 09:49:25 2008 @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (c) SuSE Linux AG | +\----------------------------------------------------------------------/ + + File: YQZyppSolverDialogPluginStub.h + + Authors: Stefan Schubert <schubi@suse.de> + +/-*/ + +// -*- c++ -*- + +#ifndef YQZyppSolverDialogPluginStub_h +#define YQZyppSolverDialogPluginStub_h + + +#include "YUIPlugin.h" + +#include "YQZyppSolverDialogPluginIf.h" +#include <zypp/PoolItem.h> + +class YWidget; + +/** + * Simplified access to the QZyppSolverDialog plugin. + **/ +class YQZyppSolverDialogPluginIf; + + +class YQZyppSolverDialogPluginStub: public YUIPlugin +{ +public: + /** + * Constructor: Load the plugin library for the QZyppDialog widget + **/ + YQZyppSolverDialogPluginStub(); + + /** + * Destructor. + **/ + virtual ~YQZyppSolverDialogPluginStub(); + + /** + * Create and show a QZyppDialog widget + * + * This might return 0 if the plugin lib could not be loaded or if the + * appropriate symbol could not be located in the plugin lib. + **/ + virtual bool createZyppSolverDialog( const zypp::PoolItem item ); + + + YQZyppSolverDialogPluginIf * impl ; +}; + + +#endif // YQZyppSolverDialogPluginStub_h Modified: trunk/qt-pkg/yast2-qt-pkg.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/yast2-qt-pkg.spec.in?rev=48540&r1=48539&r2=48540&view=diff ============================================================================== --- trunk/qt-pkg/yast2-qt-pkg.spec.in (original) +++ trunk/qt-pkg/yast2-qt-pkg.spec.in Thu Jun 26 09:49:25 2008 @@ -16,6 +16,7 @@ Requires: yast2_theme >= 2.16.1 Provides: yast2-qt:/usr/lib/YaST2/plugin/libpy2qt_pkg.so.2 Provides: yast2_ui_pkg +Recommends: libqdialogsolver1 %description - -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
schubi2@svn.opensuse.org