Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49654 - in /trunk/ncurses-pkg/src: NCPackageSelector.cc NCPackageSelector.h NCPkgMenuHelp.cc NCPkgMenuHelp.h NCPkgStrings.cc
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Mon, 04 Aug 2008 15:53:55 -0000
  • Message-id: <20080804155355.9895B34577@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Mon Aug 4 17:53:55 2008
New Revision: 49654

URL: http://svn.opensuse.org/viewcvs/yast?rev=49654&view=rev
Log:
code cleanup: YOU help is treated just like any other
help (via NCPkgMenuHelp class), no need for extra
handler

Modified:
trunk/ncurses-pkg/src/NCPackageSelector.cc
trunk/ncurses-pkg/src/NCPackageSelector.h
trunk/ncurses-pkg/src/NCPkgMenuHelp.cc
trunk/ncurses-pkg/src/NCPkgMenuHelp.h
trunk/ncurses-pkg/src/NCPkgStrings.cc

Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.cc?rev=49654&r1=49653&r2=49654&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPackageSelector.cc (original)
+++ trunk/ncurses-pkg/src/NCPackageSelector.cc Mon Aug 4 17:53:55 2008
@@ -95,7 +95,6 @@
, viewMenu( 0 )
, extrasMenu( 0 )
, helpMenu( 0 )
- , youHelpButton( 0 )
, filterMain( 0 )
, actionMenu( 0 )
, filterMenu( 0 )
@@ -233,8 +232,6 @@
retVal = OkButtonHandler( event );
else if ( event.widget == cancelButton )
retVal = CancelHandler( event );
- else if ( event.widget == youHelpButton )
- retVal = YouHelpHandler( event );
else if ( event.widget == filterPopup )
{
retVal = filterPopup->handleEvent();
@@ -977,39 +974,6 @@

///////////////////////////////////////////////////////////////////
//
-// YOUHelpHandler
-//
-// Show the Online Update Help
-//
-bool NCPackageSelector::YouHelpHandler( const NCursesEvent& event )
-{
- NCPkgTable * packageList = PackageList();
- string text = "";
-
- text += NCPkgStrings::YouHelp1();
- text += NCPkgStrings::YouHelp2();
- text += NCPkgStrings::YouHelp3();
-
- // open the popup with the help text
- NCPopupInfo * youHelp = new NCPopupInfo( wpos( (NCurses::lines()*8)/100,
(NCurses::cols())*18/100 ),
- NCPkgStrings::YouHelp(),
- text
- );
- youHelp->setPreferredSize( (NCurses::cols()*65)/100,
(NCurses::lines()*85)/100 );
- youHelp->showInfoPopup( );
-
- YDialog::deleteTopmostDialog();
-
- if ( packageList )
- {
- packageList->setKeyboardFocus();
- }
-
- return true;
-}
-
-///////////////////////////////////////////////////////////////////
-//
// CancelHandler
//
// Cancel button handler.
@@ -1567,9 +1531,7 @@
YLayoutBox * bottom_bar = YUI::widgetFactory()->createHBox( vSplit );
YAlignment *ll = YUI::widgetFactory()->createLeft( bottom_bar );

- youHelpButton = new NCPushButton ( ll, _("&Help"));
- YUI_CHECK_NEW( youHelpButton );
- youHelpButton->setFunctionKey( 1 );
+ helpMenu = new NCPkgMenuHelp (ll, _("&Help"), this);

YAlignment *r = YUI::widgetFactory()->createRight( bottom_bar );
YLayoutBox * hSplit5 = YUI::widgetFactory()->createHBox( r );
@@ -1667,7 +1629,7 @@

//Bottom button bar
YAlignment *ll = YUI::widgetFactory()->createLeft( bottom_bar );
- helpMenu = new NCPkgMenuHelp (ll, _("&Help"));
+ helpMenu = new NCPkgMenuHelp (ll, _("&Help"), this);
YUI_CHECK_NEW( helpMenu );

//right-alignment for OK-Cancel

Modified: trunk/ncurses-pkg/src/NCPackageSelector.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.h?rev=49654&r1=49653&r2=49654&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPackageSelector.h (original)
+++ trunk/ncurses-pkg/src/NCPackageSelector.h Mon Aug 4 17:53:55 2008
@@ -128,7 +128,6 @@
NCPkgMenuView *viewMenu;
NCPkgMenuExtras *extrasMenu;
NCPkgMenuHelp *helpMenu;
- NCPushButton *youHelpButton;
NCPkgFilterMain *filterMain;
NCPkgMenuAction *actionMenu;
NCPkgMenuFilter *filterMenu;
@@ -327,13 +326,6 @@
*/
bool CancelHandler ( const NCursesEvent& event );

- /**
- * Handler function for the "Help" button in YOU
- * @param event The Ncurses event
- * @return bool
- */
- bool YouHelpHandler( const NCursesEvent& event );
-
/**
* Handles hyperlinks in package description
* @param link The link

Modified: trunk/ncurses-pkg/src/NCPkgMenuHelp.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgMenuHelp.cc?rev=49654&r1=49653&r2=49654&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgMenuHelp.cc (original)
+++ trunk/ncurses-pkg/src/NCPkgMenuHelp.cc Mon Aug 4 17:53:55 2008
@@ -20,14 +20,16 @@

#include "NCPkgMenuHelp.h"
#include "NCPkgStrings.h"
+#include "NCPackageSelector.h"


/*
Textdomain "ncurses-pkg"
*/

-NCPkgMenuHelp::NCPkgMenuHelp (YWidget *parent, string label)
+NCPkgMenuHelp::NCPkgMenuHelp (YWidget *parent, string label, NCPackageSelector
*pkger)
: NCMenuButton( parent, label)
+ , pkg( pkger)
{
createLayout();
setFunctionKey( 1 );
@@ -40,17 +42,24 @@

void NCPkgMenuHelp::createLayout()
{
- generalHelp = new YMenuItem( _("&General Help") );
- items.push_back( generalHelp );
+ if ( !pkg->isYouMode())
+ {
+ generalHelp = new YMenuItem( _("&General Help") );
+ items.push_back( generalHelp );

- statusHelp = new YMenuItem( _("&Package Status and Symbols") );
- items.push_back( statusHelp );
+ statusHelp = new YMenuItem( _("&Package Status and Symbols") );
+ items.push_back( statusHelp );

- filterHelp = new YMenuItem( _("&How To Use the Filters") );
- items.push_back( filterHelp );
+ filterHelp = new YMenuItem( _("&How To Use the Filters") );
+ items.push_back( filterHelp );

- menuHelp = new YMenuItem( _("&Useful Functions in Menu") );
- items.push_back( menuHelp );
+ menuHelp = new YMenuItem( _("&Useful Functions in Menu") );
+ items.push_back( menuHelp );
+ }
+ else {
+ patchHelp = new YMenuItem( _("&Patch Status and Patch Installation"));
+ items.push_back ( patchHelp );
+ }

addItems( items);
}
@@ -100,6 +109,13 @@
text += NCPkgStrings::HelpOnFilters4();
text += NCPkgStrings::HelpOnFilters5();
}
+ else if ( event.selection == patchHelp )
+ {
+ headline = NCPkgStrings::YouHelp();
+ text += NCPkgStrings::YouHelp1();
+ text += NCPkgStrings::YouHelp2();
+ text += NCPkgStrings::YouHelp3();
+ }
else
yuiError() << "zatim nic" << endl;


Modified: trunk/ncurses-pkg/src/NCPkgMenuHelp.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgMenuHelp.h?rev=49654&r1=49653&r2=49654&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgMenuHelp.h (original)
+++ trunk/ncurses-pkg/src/NCPkgMenuHelp.h Mon Aug 4 17:53:55 2008
@@ -26,12 +26,15 @@
#include "NCPopupInfo.h"
#include "NCZypp.h"

+class NCPackageSelector;
+
class NCPkgMenuHelp : public NCMenuButton {

NCPkgMenuHelp & operator=( const NCPkgMenuHelp & );
NCPkgMenuHelp ( const NCPkgMenuHelp & );

public:
+ NCPackageSelector *pkg;

YItemCollection items;

@@ -39,8 +42,9 @@
YMenuItem *statusHelp;
YMenuItem *filterHelp;
YMenuItem *menuHelp;
+ YMenuItem *patchHelp;

- NCPkgMenuHelp (YWidget *parent, string label);
+ NCPkgMenuHelp (YWidget *parent, string label, NCPackageSelector *pkger);
virtual ~NCPkgMenuHelp();

void createLayout();

Modified: trunk/ncurses-pkg/src/NCPkgStrings.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgStrings.cc?rev=49654&r1=49653&r2=49654&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgStrings.cc (original)
+++ trunk/ncurses-pkg/src/NCPkgStrings.cc Mon Aug 4 17:53:55 2008
@@ -564,7 +564,7 @@
const string NCPkgStrings::YouHelp()
{
// the headline of the help popup
- static const string value = _( "Online Update Help" );
+ static const string value = _( "Patch Status and Patch Installation" );
return value;
}


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages