[yast-commit] r55472 - in /trunk/ncurses-pkg/src: NCPkgMenuConfig.cc NCPkgMenuConfig.h
Author: kmachalkova Date: Thu Feb 12 16:21:10 2009 New Revision: 55472 URL: http://svn.opensuse.org/viewcvs/yast?rev=55472&view=rev Log: new menu Added: trunk/ncurses-pkg/src/NCPkgMenuConfig.cc trunk/ncurses-pkg/src/NCPkgMenuConfig.h Added: trunk/ncurses-pkg/src/NCPkgMenuConfig.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgMenuConfig.cc?rev=55472&view=auto ============================================================================== --- trunk/ncurses-pkg/src/NCPkgMenuConfig.cc (added) +++ trunk/ncurses-pkg/src/NCPkgMenuConfig.cc Thu Feb 12 16:21:10 2009 @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: NCPkgMenuConfig.cc + + Author: Hedgehog Painter <kmachalkova@suse.cz> + +/-*/ +#define YUILogComponent "ncurses-pkg" +#include <YUILog.h> + +#include "NCPkgMenuConfig.h" +#include "NCPackageSelector.h" + +/* + Textdomain "ncurses-pkg" +*/ + +NCPkgMenuConfig::NCPkgMenuConfig (YWidget *parent, string label, NCPackageSelector *pkger) + : NCMenuButton( parent, label) + ,pkg( pkger ) +{ + createLayout(); +} + +NCPkgMenuConfig::~NCPkgMenuConfig() +{ + +} + +void NCPkgMenuConfig::createLayout() +{ + repoManager = new YMenuItem( _( "Launch Repository Manager") ); + onlineUpdate = new YMenuItem( _( "Launch Online Update Configuration" ) ); + actionOnExit = new YMenuItem( _( "Action on Exit" ) ); + + items.push_back( repoManager ); + items.push_back( onlineUpdate ); + items.push_back( actionOnExit ); + + restart = new YMenuItem( actionOnExit, _( "[x] Close Package Manager" ) ); + close = new YMenuItem( actionOnExit, _( "[ ] Restart Package Manager" ) ); + showSummary = new YMenuItem( actionOnExit, _( "[ ] Show Summary" ) ); + + addItems( items ); + +} + +bool NCPkgMenuConfig::handleEvent( const NCursesEvent & event) +{ + if (!event.selection) + return false; + + if ( event.selection == repoManager ) + { + //return `repo_mgr symbol to YCP module (FaTE #302517) + const_cast<NCursesEvent &>(event).result = "repo_mgr"; + yuiMilestone() << "Launching repository manager " << endl; + + //and close the main loop + return false; + } + else if ( event.selection == onlineUpdate ) + { + //the same as above, return `online_update_config + const_cast<NCursesEvent &>(event).result = "online_update_configuration"; + yuiMilestone() << "Launching YOU configuration " << endl; + + return false; + + } + + return true; +} + Added: trunk/ncurses-pkg/src/NCPkgMenuConfig.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgMenuConfig.h?rev=55472&view=auto ============================================================================== --- trunk/ncurses-pkg/src/NCPkgMenuConfig.h (added) +++ trunk/ncurses-pkg/src/NCPkgMenuConfig.h Thu Feb 12 16:21:10 2009 @@ -0,0 +1,62 @@ +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: NCPkgMenuConfig.cc + + Author: Hedgehog Painter <kmachalkova@suse.cz> + +/-*/ +#ifndef NCPkgMenuConfig_h +#define NCPkgMenuConfig_h + +#include <string> + +#include "NCurses.h" +#include "NCi18n.h" +#include "NCMenuButton.h" +//#include "NCPackageSelector.h" +#include "NCPkgStrings.h" +#include "NCPkgPopupDiskspace.h" + + +class NCPackageSelector; + + +class NCPkgMenuConfig : public NCMenuButton { + + NCPkgMenuConfig & operator=( const NCPkgMenuConfig & ); + NCPkgMenuConfig ( const NCPkgMenuConfig & ); + +public: + + YItemCollection items; + + YMenuItem *repoManager; + YMenuItem *onlineUpdate; + YMenuItem *actionOnExit; + + YMenuItem *restart; + YMenuItem *close; + YMenuItem *showSummary; + + NCPackageSelector *pkg; + + NCPkgMenuConfig (YWidget *parent, string label, NCPackageSelector *pkger); + virtual ~NCPkgMenuConfig(); + + void createLayout(); + + bool handleEvent (const NCursesEvent & event); + +}; + +#endif -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org