Author: sh-sh-sh
Date: Fri Feb 1 16:42:21 2008
New Revision: 44111
URL: http://svn.opensuse.org/viewcvs/yast?rev=44111&view=rev
Log:
use widget pointers, not artificially introduced IDs
Modified:
trunk/ncurses/src/pkg/NCPkgPopupDescr.cc
trunk/ncurses/src/pkg/NCPkgPopupDiskspace.cc
trunk/ncurses/src/pkg/NCPkgPopupRepo.cc
trunk/ncurses/src/pkg/NCPkgPopupSearch.cc
trunk/ncurses/src/pkg/NCPkgPopupSelection.cc
trunk/ncurses/src/pkg/NCPkgPopupTable.cc
Modified: trunk/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupDescr.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupDescr.cc Fri Feb 1 16:42:21 2008
@@ -21,7 +21,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -125,9 +124,6 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
- okButton->setId( okID );
-
}
///////////////////////////////////////////////////////////////////
@@ -232,16 +228,6 @@
if ( ! postevent.widget )
return false;
- // YCPValue currentId = dynamic_cast(postevent.widget)->id();
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "cancel" )
- {
- // close the dialog
- postevent = NCursesEvent::cancel;
- }
-
if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
{
// return false means: close the popup dialog
Modified: trunk/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupDiskspace.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupDiskspace.cc Fri Feb 1 16:42:21 2008
@@ -21,7 +21,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "YTypes.h"
#include "NCLayoutBox.h"
@@ -118,10 +117,7 @@
// add the ok button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
okButton->setFunctionKey( 10 );
- okButton->setId( okID );
-
}
///////////////////////////////////////////////////////////////////
Modified: trunk/ncurses/src/pkg/NCPkgPopupRepo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupRepo.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupRepo.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupRepo.cc Fri Feb 1 16:42:21 2008
@@ -220,9 +220,6 @@
//the cute button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
-
- okButton->setId( okID );
okButton->setFunctionKey(10);
new NCSpacing( split, YD_VERT, false, 0.4 );
@@ -379,10 +376,7 @@
postevent.detail = NCursesEvent::NODETAIL;
- YWidgetID *currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "ok" )
+ if ( postevent.widget == okButton )
{
postevent.detail = NCursesEvent::USERDEF ;
// return false means: close the popup
Modified: trunk/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupSearch.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupSearch.cc Fri Feb 1 16:42:21 2008
@@ -29,8 +29,6 @@
#include "NCPkgNames.h"
#include "NCPackageSelector.h"
-#include "YWidgetID.h"
-
#include "NCi18n.h"
/*
@@ -103,8 +101,6 @@
NCPkgNames::SearchPhrase(),
true ); // editable = true
- YStringWidgetID * searchID = new YStringWidgetID ("search_box" );
- searchExpr->setId( searchID );
searchExpr->setStretchable( YD_HORIZ, true );
searchExpr->addItem( new YTableItem() );
@@ -148,15 +144,11 @@
// add the cancel and the ok button
okButton = new NCPushButton( hSplit3, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
- okButton->setId( okID );
okButton->setFunctionKey( 10 );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 );
cancelButton = new NCPushButton( hSplit3, NCPkgNames::CancelLabel() );
- YStringWidgetID * cancelID = new YStringWidgetID("cancel");
- cancelButton->setId( cancelID );
cancelButton->setFunctionKey( 9 );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 );
@@ -275,10 +267,7 @@
postevent.result = "";
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId &&
- currentId->toString() == "cancel" )
+ if ( postevent.widget == cancelButton )
{
postevent = NCursesEvent::cancel;
}
Modified: trunk/ncurses/src/pkg/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupSelection.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupSelection.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupSelection.cc Fri Feb 1 16:42:21 2008
@@ -137,9 +137,6 @@
// add an OK button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
-
- okButton->setId( okID );
okButton->setFunctionKey(10);
new NCSpacing( split, YD_VERT, false, 0.4 );
@@ -312,10 +309,7 @@
postevent.detail = NCursesEvent::NODETAIL;
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "ok" )
+ if ( postevent.widget == okButton )
{
postevent.detail = NCursesEvent::USERDEF ;
// return false means: close the popup
Modified: trunk/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPkgPopupTable.cc?rev=44111&r1=44110&r2=44111&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ trunk/ncurses/src/pkg/NCPkgPopupTable.cc Fri Feb 1 16:42:21 2008
@@ -20,7 +20,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -125,8 +124,6 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( hSplit, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
- okButton->setId( okID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
@@ -134,8 +131,6 @@
// add the Cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
- YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
- cancelButton->setId( cancelID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.2 );
@@ -301,10 +296,7 @@
if ( ! postevent.widget )
return false;
- // YCPValue currentId = dynamic_cast(postevent.widget)->id();
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( currentId
- && currentId->toString() == "cancel" )
+ if ( postevent.widget == cancelButton )
{
//user hit cancel - discard set of changes (if not empty)
packager->clearVerifiedPkgs();
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org