Author: gs Date: Wed Apr 25 14:12:39 2012 New Revision: 68024 URL: http://svn.opensuse.org/viewcvs/yast?rev=68024&view=rev Log: first step to show package classification (e.g. recommended packages), new entry 'Package Classification' added to filter Added: trunk/ncurses-pkg/src/NCPkgFilterClassification.cc trunk/ncurses-pkg/src/NCPkgFilterClassification.h Modified: trunk/ncurses-pkg/src/Makefile.am trunk/ncurses-pkg/src/NCPackageSelector.cc trunk/ncurses-pkg/src/NCPackageSelector.h trunk/ncurses-pkg/src/NCPkgFilterMain.cc trunk/ncurses-pkg/src/NCPkgFilterMain.h Modified: trunk/ncurses-pkg/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/Makefile.am?rev=6... ============================================================================== --- trunk/ncurses-pkg/src/Makefile.am (original) +++ trunk/ncurses-pkg/src/Makefile.am Wed Apr 25 14:12:39 2012 @@ -41,6 +41,7 @@ NCPkgFilterLocale.h \ NCPkgFilterRPMGroups.h \ NCPkgFilterInstSummary.h \ + NCPkgFilterClassification.h \ NCPkgStrings.h \ NCZypp.h @@ -72,6 +73,7 @@ NCPkgFilterLocale.cc \ NCPkgFilterRPMGroups.cc \ NCPkgFilterInstSummary.cc \ + NCPkgFilterClassification.cc \ NCPkgStrings.cc Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector... ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.cc (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.cc Wed Apr 25 14:12:39 2012 @@ -53,6 +53,7 @@ #include "NCPkgFilterPattern.h" #include "NCPkgFilterLocale.h" #include "NCPkgFilterRepo.h" +#include "NCPkgFilterClassification.h" #include "NCPkgPopupDeps.h" #include "NCPkgPopupDiskspace.h" #include "NCPkgMenuDeps.h" @@ -980,6 +981,15 @@ pkgList->fillSummaryList(NCPkgTable::L_Changes); break; } + case PkgClassification: + { + pkgClass = new NCPkgFilterClassification( replPoint, this ); + pkgClass->setSize( oldSize.Sze.W, oldSize.Sze.H ); + pkgClass->Redraw(); + pkgClass->setKeyboardFocus(); + break; + } + default: yuiError() << "zatim nic" << endl; } Modified: trunk/ncurses-pkg/src/NCPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector... ============================================================================== --- trunk/ncurses-pkg/src/NCPackageSelector.h (original) +++ trunk/ncurses-pkg/src/NCPackageSelector.h Wed Apr 25 14:12:39 2012 @@ -82,6 +82,7 @@ class NCPkgFilterRPMGroups; class NCPkgFilterSearch; class NCPkgFilterInstSummary; +class NCPkgFilterClassification; class NCPkgPopupFile; class NCPkgMenuExtras; class NCPkgMenuDeps; @@ -141,6 +142,8 @@ NCPkgFilterSearch * searchPopup; // the package search popup NCPkgFilterInstSummary *inst_summary; + NCPkgFilterClassification * pkgClass; // classification of packages + bool youMode; // YOU bool updateMode; // Update bool testMode; // testing @@ -204,7 +207,8 @@ Repositories, RPMGroups, Search, - Summary + Summary, + PkgClassification }; /** Added: trunk/ncurses-pkg/src/NCPkgFilterClassification.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterClassi... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterClassification.cc (added) +++ trunk/ncurses-pkg/src/NCPkgFilterClassification.cc Wed Apr 25 14:12:39 2012 @@ -0,0 +1,138 @@ +/**************************************************************************** +| +| Copyright (c) [2002-2011] Novell, Inc. +| All Rights Reserved. +| +| This program is free software; you can redistribute it and/or +| modify it under the terms of version 2 of the GNU General Public License as +| published by the Free Software Foundation. +| +| This program is distributed in the hope that it will be useful, +| but WITHOUT ANY WARRANTY; without even the implied warranty of +| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +| GNU General Public License for more details. +| +| You should have received a copy of the GNU General Public License +| along with this program; if not, contact Novell, Inc. +| +| To contact Novell about this file by physical or electronic mail, +| you may find current contact information at www.novell.com +| +|***************************************************************************/ + + +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` ___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +----------------------------------------------------------------------/ + + File: NCPkgFilterRepo.cc + + Author: Gabriele Mohr <gs@suse.com> + +/-*/ +#define YUILogComponent "ncurses-pkg" +#include <YUILog.h> + +#include "NCPkgFilterClassification.h" + +#include "YDialog.h" +#include "NCLayoutBox.h" +#include "NCSpacing.h" +#include "NCPackageSelector.h" + +#include "NCZypp.h" + +/* + Textdomain "ncurses-pkg" +*/ + + +/////////////////////////////////////////////////////////////////// +// +// +// METHOD NAME : NCPkgFilterClassification::NCPkgFilterClassification +// METHOD TYPE : Constructor +// +// DESCRIPTION : +// + +NCPkgFilterClassification::NCPkgFilterClassification( YWidget *parent, NCPackageSelector *pkg ) + :NCSelectionBox( parent, "" ) + ,packager(pkg) +{ + // fill seclection box + recommended = new YItem( _("Recommended") ); + addItem( recommended ); + + suggested = new YItem( _("Suggested") ); + addItem( suggested ); + + unneeded = new YItem( _("Unneeded" ) ); + addItem( unneeded ); + + showPackages(); +} + +bool NCPkgFilterClassification::showPackages( ) +{ + int index = getCurrentItem(); + YItem * group = itemAt( index ); + + if ( group == recommended ) + { + yuiMilestone() << "recommended is selected" << endl; + } + else if ( group == suggested ) + { + yuiMilestone() << "suggested is selected" << endl; + } + else if ( group == unneeded ) + { + yuiMilestone() << "unneeded is selected" << endl; + } + + return true; +} + +/////////////////////////////////////////////////////////////////// +// +// +// METHOD NAME : NCPkgFilterRepo::wHandleInput +// METHOD TYPE : NCursesEvent +// +// DESCRIPTION : default boring handle-input +// + +NCursesEvent NCPkgFilterClassification::wHandleInput( wint_t ch ) +{ + NCursesEvent ret = NCursesEvent::none; + handleInput( ch ); + + switch ( ch ) + { + case KEY_UP: + case KEY_DOWN: + case KEY_NPAGE: + case KEY_PPAGE: + case KEY_END: + case KEY_HOME: { + ret = NCursesEvent::handled; + showPackages(); + break; + } + + default: + ret = NCSelectionBox::wHandleInput( ch ) ; + } + + return ret; +} + Added: trunk/ncurses-pkg/src/NCPkgFilterClassification.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterClassi... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterClassification.h (added) +++ trunk/ncurses-pkg/src/NCPkgFilterClassification.h Wed Apr 25 14:12:39 2012 @@ -0,0 +1,105 @@ +/**************************************************************************** +| +| Copyright (c) [2002-2011] Novell, Inc. +| All Rights Reserved. +| +| This program is free software; you can redistribute it and/or +| modify it under the terms of version 2 of the GNU General Public License as +| published by the Free Software Foundation. +| +| This program is distributed in the hope that it will be useful, +| but WITHOUT ANY WARRANTY; without even the implied warranty of +| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +| GNU General Public License for more details. +| +| You should have received a copy of the GNU General Public License +| along with this program; if not, contact Novell, Inc. +| +| To contact Novell about this file by physical or electronic mail, +| you may find current contact information at www.novell.com +| +|***************************************************************************/ + + +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` ___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +----------------------------------------------------------------------/ + + File: NCPkgPopupRepo.h + + Author: Bubli <kmachalkova@suse.cz> + +/-*/ + +#ifndef NCPkgFilterClassification_h +#define NCPkgFilterClassification_h + +#include <iosfwd> + +#include <vector> +#include <string> +#include <algorithm> + +#include "NCPadWidget.h" +#include "NCPopup.h" +#include "NCPushButton.h" +#include "NCSelectionBox.h" + +#include "NCZypp.h" + +class NCTable; +class NCPushButton; +class NCPackageSelector; + +class NCPkgFilterClassification: public NCSelectionBox +{ +private: + + NCPkgFilterClassification & operator=( const NCPkgFilterClassification & ); + NCPkgFilterClassification ( const NCPkgFilterClassification & ); + + NCPackageSelector *packager; + + YItem *recommended; + YItem *suggested; + YItem *unneeded; + +public: + + /** + * A helper class to hold repository data in a neat table + * widget + * @param parent A parent widget + * @param opt Widget options + */ + + NCPkgFilterClassification ( YWidget *parent, NCPackageSelector *pkg); + + virtual ~NCPkgFilterClassification() {}; + + /** + * Add one line to the selection box + * @param YItem item The package classification, e.g. recommeded, suggested + * @param bool selected Line selected + */ + //virtual void addLine( YItem * item, bool selected ); + + + virtual NCursesEvent wHandleInput ( wint_t ch ); + + /** + * Fill package list + * + */ + bool showPackages( ); + +}; +#endif Modified: trunk/ncurses-pkg/src/NCPkgFilterMain.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterMain.c... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterMain.cc (original) +++ trunk/ncurses-pkg/src/NCPkgFilterMain.cc Wed Apr 25 14:12:39 2012 @@ -82,6 +82,9 @@ inst_summary = new YItem( _( "Installation Summary" ) ); items.push_back( inst_summary ); + pkg_class = new YItem( _( "Package Classification" ) ); + items.push_back( pkg_class ); + addItems( items ); } @@ -103,6 +106,8 @@ pkg->replaceFilter ( NCPackageSelector::Search ); else if ( currentItem == inst_summary ) pkg->replaceFilter ( NCPackageSelector::Summary ); + else if ( currentItem == pkg_class ) + pkg->replaceFilter ( NCPackageSelector::PkgClassification ); else yuiError() << "zatim nic" << endl; return true; Modified: trunk/ncurses-pkg/src/NCPkgFilterMain.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgFilterMain.h... ============================================================================== --- trunk/ncurses-pkg/src/NCPkgFilterMain.h (original) +++ trunk/ncurses-pkg/src/NCPkgFilterMain.h Wed Apr 25 14:12:39 2012 @@ -66,7 +66,8 @@ YItem *repositories; YItem *search; YItem *inst_summary; - + YItem *pkg_class; + NCPkgFilterMain (YWidget *parent, string label, NCPackageSelector *pkger ); virtual ~NCPkgFilterMain(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org