Author: gs
Date: Tue Jun 26 13:13:12 2007
New Revision: 39031
URL: http://svn.opensuse.org/viewcvs/yast?rev=39031&view=rev
Log:
use YStringWidgetID to set IDs manually,
use YCPDialogParser to parse the layout files and
YCPDialogParser::findWidgetWithId to find Ids from layout
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc Tue Jun 26 13:13:12 2007
@@ -31,6 +31,7 @@
#include
#include
+#include "YCPDialogParser.h"
///////////////////////////////////////////////////////////////////
//
@@ -77,14 +78,17 @@
YWidgetOpt childrenOpt( opt );
widgetRoot = (YContainerWidget *)ui->createWidgetTree( dynamic_cast(parent),
childrenOpt, 0, pkgLayout );
+ YCPDialogParser::parseWidgetTreeTerm(dynamic_cast(parent), childrenOpt, pkgLayout );
}
// create the PackageSelector (creation with 'new' is required because initialization
// in the list of member variables causes problems with untranslated messages)
- packager = new NCPackageSelector( ui, opt );
+ // packager = new NCPackageSelector( ui, opt );
if ( widgetRoot )
{
+ packager = new NCPackageSelector( ui, widgetRoot, opt );
+
this->addChild( widgetRoot );
widgetRoot->setParent( this );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc Tue Jun 26 13:13:12 2007
@@ -221,6 +221,40 @@
///////////////////////////////////////////////////////////////////
//
//
+// METHOD NAME : NCTextEntry::setValue
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCTextEntry::setValue( const std::string & ntext )
+{
+ buffer = NCstring( ntext ).str();
+ if ( maxInputLength && buffer.length() > maxInputLength ) {
+ buffer = buffer.erase( maxInputLength );
+ }
+ fldstart = 0;
+ curpos = buffer.length();
+ tUpdate();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCTextEntry::value
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+string NCTextEntry::value( )
+{
+ NCstring text ( buffer );
+
+ return text.Str();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
// METHOD NAME : NCTextEntry::getText
// METHOD TYPE : YCPString
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h Tue Jun 26 13:13:12 2007
@@ -108,6 +108,9 @@
virtual void setText( const YCPString & ntext );
virtual YCPString getText();
+ virtual void setValue( const std::string & ntext ); // new for setText()
+ virtual string value(); // new for getText()
+
virtual void setValidChars( const YCPString & validchars );
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCurses.h?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCurses.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCurses.h Tue Jun 26 13:13:12 2007
@@ -27,6 +27,7 @@
#include
#include "YEvent.h"
+#include "YWidget.h"
#include /* curses.h: #define NCURSES_CH_T cchar_t */
#include
@@ -87,7 +88,8 @@
Type type;
NCWidget * widget;
- YCPValue selection; // used for MenuEvent (the menu selection)
+ YWidgetID * selection; // used for MenuEvent (the menu selection)
+ //YCPValue selection;
YCPValue result; // can be used for any result
@@ -100,7 +102,7 @@
NCursesEvent( Type t = none, YEvent::EventReason r = YEvent::UnknownReason )
: type ( t )
, widget ( 0 )
- , selection( YCPNull() )
+ , selection( 0 )
, result ( YCPNull() )
, detail ( NODETAIL )
, reason ( r )
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Tue Jun 26 13:13:12 2007
@@ -137,7 +137,7 @@
/**
* Creates a radio button group.
*/
- virtual YContainerWidget * createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt );
+ // virtual YContainerWidget * createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt );
/**
* Creates a frame widget
@@ -222,7 +222,7 @@
* @param rbg the radio button group the new button will belong to
*/
virtual YWidget * createRadioButton( YWidget * parent, YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
+ //YRadioButtonGroup * rbg,
const YCPString & label,
bool checked );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Tue Jun 26 13:13:12 2007
@@ -48,6 +48,9 @@
#include
#include
+#include "YWidgetID.h"
+#include "YCPDialogParser.h"
+
typedef zypp::ui::PatchContents ZyppPatchContents;
typedef zypp::ui::PatchContents::const_iterator ZyppPatchContentsIterator;
typedef zypp::syscontent::Reader::Entry ZyppReaderEntry;
@@ -96,9 +99,10 @@
//
// Constructor
//
-NCPackageSelector::NCPackageSelector( YNCursesUI * ui, const YWidgetOpt & opt )
+NCPackageSelector::NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, const YWidgetOpt & opt )
: y2ui( ui )
- , visibleInfo( YCPNull() )
+ , widgetRoot ( wRoot )
+ , visibleInfo( 0 )
, filterPopup( 0 )
, depsPopup( 0 )
, selectionPopup( 0 )
@@ -437,7 +441,8 @@
bool NCPackageSelector::handleEvent ( const NCursesEvent& event )
{
bool retVal = false;
- YCPValue currentId = YCPNull();
+ YWidgetID * currentId = 0;
+ //YCPValue currentId = YCPNull();
if ( event == NCursesEvent::handled )
return false;
@@ -453,14 +458,16 @@
}
// Find the handler-function for the given widget-nameId
- if ( ! currentId.isNull() )
+ if ( currentId )
{
UIMIL << "Selected widget id: " << currentId->toString() << endl;
// hyperlink
- if ( currentId->isString()
- && currentId->asString()->value().substr(0, 4) == "pkg:" )
+ //if ( currentId->isString()
+ // && currentId->asString()->value().substr(0, 4) == "pkg:" )
+ if ( currentId->toString().substr(0,4) == "pkg:" )
{
- LinkHandler( currentId->asString()->value() );
+ //LinkHandler( currentId->asString()->value() );
+ LinkHandler( currentId->toString() );
return true;
}
@@ -494,7 +501,7 @@
//
// currently displayed package information
//
-void NCPackageSelector::setVisibleInfo( const YCPValue & info )
+void NCPackageSelector::setVisibleInfo( YWidgetID * info )
{
visibleInfo = info;
}
@@ -624,7 +631,8 @@
NCDBG << "Filter: " << label->toString() << endl;
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( label );
@@ -719,7 +727,8 @@
packageList->drawList();
// set filter label to 'Search'
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
@@ -769,7 +778,9 @@
packageList->drawList();
// set filter label to 'Search'
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ //YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
+
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
@@ -824,7 +835,8 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
+
if ( filterLabel )
{
if ( filter == "installable" )
@@ -890,7 +902,7 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( YCPString(NCPkgNames::UpdateProblem()) );
@@ -935,7 +947,7 @@
if ( sel )
{
- if ( contains( patchSelectables, sel ) )
+ if ( inContainer( patchSelectables, sel ) )
{
NCMIL << "Suppressing duplicate selectable: " << (*it)->name().c_str() << "-" <<
(*it)->edition().asString().c_str() << " " <<
@@ -1071,7 +1083,7 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( NCPkgNames::InstSummary() );
@@ -1141,7 +1153,7 @@
if ( !label.isNull() )
{
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast(filterLabel)->setLabel( label );
@@ -1442,14 +1454,14 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull()
- || visibleInfo.isNull() )
+ || !event.selection
+ || !visibleInfo )
{
NCERR << "*** InformationHandler RETURN false ***" << endl;
return false;
}
- if ( visibleInfo->compare( event.selection ) == YO_EQUAL )
+ if ( visibleInfo->isEqual( event.selection ) )
{
// information selection has not changed
return true;
@@ -1458,7 +1470,8 @@
// set visibleInfo
visibleInfo = event.selection;
- if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ //if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "versions" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"availpkgs\"), `opt(`notify), \"pkgTable\" )";
@@ -1470,7 +1483,7 @@
if (!layout.isNull() )
y2ui->evaluateReplaceWidget( YCPSymbol("replaceinfo"), layout->asTerm() );
- NCPkgTable * pkgAvail = dynamic_cast(y2ui->widgetWithId(NCPkgNames::AvailPkgs(), true));
+ NCPkgTable * pkgAvail = dynamic_cast(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::AvailPkgs()));
if ( pkgAvail )
{
@@ -1485,7 +1498,8 @@
}
}
// patches
- else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ //else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"patchpkgs\"), `opt(`notify), \"pkgTable\" )";
@@ -1497,7 +1511,7 @@
if (!layout.isNull())
y2ui->evaluateReplaceWidget( YCPSymbol ("replaceinfo"), layout->asTerm() );
- NCPkgTable * patchPkgs = dynamic_cast(y2ui->widgetWithId(NCPkgNames::PatchPkgs(), true));
+ NCPkgTable * patchPkgs = dynamic_cast(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgs() ));
if ( patchPkgs )
{
@@ -1511,7 +1525,8 @@
fillPatchPackages( patchPkgs, packageList->getDataPointer( packageList->getCurrentItem() ) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"pkgsversions\"), `opt(`notify), \"pkgTable\" )";
@@ -1523,7 +1538,7 @@
if (!layout.isNull())
y2ui->evaluateReplaceWidget( YCPSymbol ("replaceinfo"), layout->asTerm() );
- NCPkgTable * patchPkgsVersions = dynamic_cast(y2ui->widgetWithId(NCPkgNames::PatchPkgsVersions(), true));
+ NCPkgTable * patchPkgsVersions = dynamic_cast(YCPDialogParser::findWidgetWithId(widgetRoot, NCPkgNames::PatchPkgsVersions()) );
if ( patchPkgsVersions )
{
@@ -1565,7 +1580,7 @@
//
bool NCPackageSelector::DependencyHandler( const NCursesEvent& event )
{
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
@@ -1575,7 +1590,8 @@
NCPkgNames::OKLabel() );
info.setNiceSize( 35, 5 );
- if ( event.selection->compare( NCPkgNames::ShowDeps() ) == YO_EQUAL )
+ // ( event.selection->compare( NCPkgNames::ShowDeps() ) == YO_EQUAL )
+ if ( event.selection->toString() == "showdeps" )
{
bool ok = false;
@@ -1592,13 +1608,15 @@
updatePackageList();
showDiskSpace();
}
- else if ( event.selection->compare( NCPkgNames::VerifySystem() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::VerifySystem() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "verifysystem" )
{
verifyPackageDependencies();
updatePackageList();
showDiskSpace();
}
- else if ( event.selection->compare( NCPkgNames::AutoDeps() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::AutoDeps() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "autodeps" )
{
char menu[2000];
@@ -1695,12 +1713,13 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull() )
+ || !event.selection )
{
return false;
}
- if ( event.selection->compare( NCPkgNames::RpmGroups() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::RpmGroups() ) == YO_EQUAL )
+ if ( event.selection->toString() == "groups" )
{
if ( filterPopup )
{
@@ -1708,7 +1727,8 @@
retEvent = filterPopup->showFilterPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Selections() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Selections() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "selections" )
{
if ( selectionPopup )
{
@@ -1716,7 +1736,8 @@
retEvent = selectionPopup->showSelectionPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Patterns() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Patterns() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "patterns" )
{
if ( patternPopup )
{
@@ -1724,7 +1745,8 @@
retEvent = patternPopup->showSelectionPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Languages() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Languages() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "languages" )
{
if ( languagePopup )
{
@@ -1733,47 +1755,58 @@
}
}
// patches
- else if ( event.selection->compare( NCPkgNames::Recommended() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Recommended() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "recommended" )
{
fillPatchList( "recommended" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::Security() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Security() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "security" )
{
fillPatchList( "security" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::Optional() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Optional() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "optional" )
{
fillPatchList( "optional" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::YaST2Patches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::YaST2Patches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "yast2" )
{
fillPatchList( "YaST2" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::AllPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::AllPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "allpatches" )
{
fillPatchList( "all" ); // show all patches
}
- else if ( event.selection->compare( NCPkgNames::InstalledPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstalledPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "instpatches" )
{
fillPatchList( "installed" ); // show installed patches
}
- else if ( event.selection->compare( NCPkgNames::InstallablePatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstallablePatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "installablepatches" )
{
fillPatchList( "installable" ); // show installed patches
}
- else if ( event.selection->compare( NCPkgNames::NewPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::NewPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "newpatches" )
{
fillPatchList( "new" ); // show new patches
}
- else if ( event.selection->compare( NCPkgNames::UpdateList() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateList() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "updatelist" )
{
fillUpdateList();
}
- else if ( event.selection->compare( NCPkgNames::Whatif() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Whatif() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "whatif" )
{
fillSummaryList( NCPkgTable::L_Changes );
}
- else if ( event.selection->compare( NCPkgNames::Installed() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Installed() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "installed" )
{
fillSummaryList( NCPkgTable::L_Installed );
}
@@ -1796,7 +1829,7 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull() )
+ || !event.selection )
{
return false;
}
@@ -1808,76 +1841,91 @@
}
// call the corresponding method of NCPkgTable
- if ( event.selection->compare( NCPkgNames::Toggle() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::Toggle() ) == YO_EQUAL )
+ if ( event.selection->toString() == "toggle" )
{
packageList->toggleObjStatus( );
}
- else if ( event.selection->compare( NCPkgNames::Select() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Select() ) == YO_EQUAL )
+ else if ( event.selection->toString() =="select" )
{
if ( testMode )
diskspacePopup->setDiskSpace( '+' );
else
packageList->changeObjStatus( '+' );
}
- else if ( event.selection->compare( NCPkgNames::Delete() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Delete() ) == YO_EQUAL )
+ else if (event.selection->toString() == "delete" )
{
if ( testMode )
diskspacePopup->setDiskSpace( '-' );
else
packageList->changeObjStatus( '-' );
}
- else if ( event.selection->compare( NCPkgNames::Update() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Update() ) == YO_EQUAL )
+ else if (event.selection->toString() == "update" )
{
if ( testMode )
diskspacePopup->checkDiskSpaceRange();
else
packageList->changeObjStatus( '>' );
}
- else if ( event.selection->compare( NCPkgNames::TabooOn() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::TabooOn() ) == YO_EQUAL )
+ else if (event.selection->toString() == "tabooOn" )
{
packageList->changeObjStatus( '!' );
}
- else if ( event.selection->compare( NCPkgNames::TabooOff() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::TabooOff() ) == YO_EQUAL )
+ else if (event.selection->toString() == "tabooOff" )
{
packageList->changeObjStatus( '%' );
}
- else if ( event.selection->compare( NCPkgNames::SourceYes() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SourceYes() ) == YO_EQUAL )
+ else if (event.selection->toString() == "sourceYes" )
{
#ifdef FIXME
packageList->SourceInstall( true );
#endif
}
- else if ( event.selection->compare( NCPkgNames::SourceNo() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SourceNo() ) == YO_EQUAL )
+ else if (event.selection->toString() == "sourceNo" )
{
#ifdef FIXME
packageList->SourceInstall( false );
#endif
}
- else if ( event.selection->compare( NCPkgNames::InstallAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstallAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "selall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Install );
}
- else if ( event.selection->compare( NCPkgNames::DontInstall() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontInstall() ) == YO_EQUAL )
+ else if (event.selection->toString() == "deselall" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontInstall );
}
- else if ( event.selection->compare( NCPkgNames::DeleteAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DeleteAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "delall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Delete );
}
- else if ( event.selection->compare( NCPkgNames::DontDelete() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontDelete() ) == YO_EQUAL )
+ else if (event.selection->toString() == "dontdel" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontDelete );
}
- else if ( event.selection->compare( NCPkgNames::UpdateNewer() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateNewer() ) == YO_EQUAL )
+ else if (event.selection->toString() == "updnewer" )
{
packageList->changeListObjStatus( NCPkgTable::A_UpdateNewer );
}
- else if ( event.selection->compare( NCPkgNames::UpdateAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "updall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Update );
}
- else if ( event.selection->compare( NCPkgNames::DontUpdate() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontUpdate() ) == YO_EQUAL )
+ else if (event.selection->toString() == "dontupd" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontUpdate );
}
@@ -1991,13 +2039,14 @@
//
bool NCPackageSelector::FileHandler( const NCursesEvent& event )
{
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
//Export package list into file
- if ( event.selection->compare( NCPkgNames::ExportToFile() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::ExportToFile() ) == YO_EQUAL )
+ if ( event.selection->toString() =="export" )
{
//Ask for file to save into
YCPValue filename = YNCursesUI::ui()->askForSaveFileName( YCPString(DEFAULT_EXPORT_FILE_NAME),
@@ -2048,7 +2097,8 @@
}
//Import package list from file
- else if ( event.selection->compare( NCPkgNames::ImportFromFile() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::ImportFromFile() ) == YO_EQUAL )
+ else if ( event.selection->toString() =="import" )
{
//ask for file to open
YCPValue filename = YNCursesUI::ui()->askForExistingFile( YCPString(DEFAULT_EXPORT_FILE_NAME),
@@ -2141,12 +2191,13 @@
string text = "";
YCPString headline = YCPString(NCPkgNames::PackageHelp());
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
- if ( event.selection->compare( NCPkgNames::GeneralHelp() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::GeneralHelp() ) == YO_EQUAL )
+ if ( event.selection->toString() == "help_general" )
{
text += NCPkgNames::HelpPkgInst1();
text += NCPkgNames::HelpPkgInst12();
@@ -2157,7 +2208,8 @@
text += NCPkgNames::HelpPkgInst5();
text += NCPkgNames::HelpPkgInst6();
}
- else if ( event.selection->compare( NCPkgNames::StatusHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::StatusHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_status" )
{
text += NCPkgNames::HelpOnStatus1();
text += NCPkgNames::HelpOnStatus2();
@@ -2167,11 +2219,13 @@
text += NCPkgNames::HelpOnStatus6();
text += NCPkgNames::HelpOnStatus7();
}
- else if ( event.selection->compare( NCPkgNames::UpdateHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_update" )
{
text += NCPkgNames::HelpOnUpdate();
}
- else if ( event.selection->compare( NCPkgNames::SearchHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SearchHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_search" )
{
headline = YCPString(NCPkgNames::SearchHeadline());
text += NCPkgNames::HelpOnSearch();
@@ -2460,13 +2514,14 @@
return false;
}
- if ( visibleInfo.isNull() )
+ if ( !visibleInfo )
{
NCERR << "Visible package information NOT set" << endl;
return false;
}
- if ( visibleInfo->compare( NCPkgNames::PatchDescr() ) == YO_EQUAL )
+ // if ( visibleInfo->compare( NCPkgNames::PatchDescr() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "patchdescr" )
{
string descr;
@@ -2496,24 +2551,26 @@
descr += createDescrText( value );
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast(descrInfo)->setText( YCPString( descr ) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
- NCPkgTable *patchPkgList = dynamic_cast(y2ui->widgetWithId(NCPkgNames::PatchPkgs(), true));
+ NCPkgTable *patchPkgList = dynamic_cast(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgs()));
if ( patchPkgList )
{
fillPatchPackages ( patchPkgList, objPtr);
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "packagesversions" )
{
- NCPkgTable *patchPkgsVersions = dynamic_cast(y2ui->widgetWithId(NCPkgNames::PatchPkgsVersions(), true));
+ NCPkgTable *patchPkgsVersions = dynamic_cast(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgsVersions()));
if ( patchPkgsVersions )
{
fillPatchPackages ( patchPkgsVersions, objPtr, true);
@@ -2611,27 +2668,29 @@
return false;
}
- if ( visibleInfo.isNull() )
+ if ( !visibleInfo )
{
NCERR << "Visible package information NOT set" << endl;
return false;
}
- if ( visibleInfo->compare( NCPkgNames::LongDescr() ) == YO_EQUAL )
+ // if ( visibleInfo->compare( NCPkgNames::LongDescr() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "longdescr" )
{
// ask the package manager for the description of this package
zypp::Text value = pkgPtr->description();
string descr = createDescrText( value );
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast(descrInfo)->setText( YCPString(descr) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Files() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Files() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "files" )
{
string text = NCPkgNames::ListOfFiles();
// the file list is available only for installed packages
@@ -2645,13 +2704,14 @@
}
// get the widget id
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast(descrInfo)->setText( YCPString(text) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PkgInfo() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PkgInfo() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "pkginfo" )
{
string instVersion = "";
string version = "";
@@ -2734,22 +2794,24 @@
}
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast(descrInfo)->setText( YCPString(text) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "versions" )
{
- NCPkgTable * pkgAvail = dynamic_cast(y2ui->widgetWithId(NCPkgNames::AvailPkgs(), true));
+ NCPkgTable * pkgAvail = dynamic_cast(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::AvailPkgs()));
if ( pkgAvail )
{
fillAvailableList( pkgAvail, slbPtr );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Relations() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Relations() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "relations" )
{
string text = "";
text += slbPtr->name();
@@ -2784,7 +2846,7 @@
}
// show the package relations
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
@@ -2993,7 +3055,7 @@
YCPString label( diff.asString () );
// show the required diskspace
- YWidget * diskSpace = y2ui->widgetWithId( NCPkgNames::Diskspace(), true );
+ YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
static_cast(diskSpace)->setLabel( label );
@@ -3082,7 +3144,7 @@
YCPString label( totalSize.asString() );
// show the download size
- YWidget * diskSpace = y2ui->widgetWithId( NCPkgNames::Diskspace(), true );
+ YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
static_cast(diskSpace)->setLabel( label );
@@ -3096,7 +3158,7 @@
//
NCPkgTable * NCPackageSelector::getPackageList()
{
- YWidget * packages = y2ui->widgetWithId( NCPkgNames::Packages(), true );
+ YWidget * packages = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
return ( dynamic_cast(packages) );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h Tue Jun 26 13:13:12 2007
@@ -30,6 +30,7 @@
#include <utility> // for STL pair
#include
+#include "YWidgetID.h"
#include
#include
@@ -73,7 +74,9 @@
YNCursesUI * y2ui; // the UI
- YCPValue visibleInfo; // visible package info (description, file list, ...)
+ YWidget * widgetRoot; // the root of the widget tree of the layout
+
+ YWidgetID * visibleInfo; // visible package info (description, file list, ...)
NCPkgPopupTree * filterPopup; // the rpm group tags popup
@@ -119,7 +122,7 @@
* @param ui The NCurses UI
* @param opt The widget options
*/
- NCPackageSelector( YNCursesUI * ui, const YWidgetOpt & opt );
+ NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, const YWidgetOpt & opt );
/**
* Destructor
@@ -345,7 +348,7 @@
* Sets the member variable to the currently visible information
* @param info
*/
- void setVisibleInfo( const YCPValue & info );
+ void setVisibleInfo( YWidgetID * info );
/**
* Fills the package table
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc Tue Jun 26 13:13:12 2007
@@ -30,6 +30,8 @@
#include "NCPopupInfo.h"
#include "NCTextEntry.h"
+#include "YWidgetID.h"
+
#include "NCi18n.h"
/*
@@ -171,7 +173,9 @@
// add the solve button
opt.key_Fxx.setValue( 10 );
solveButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::SolveLabel()) );
- solveButton->setId( NCPkgNames::Solve () );
+ //solveButton->setId( NCPkgNames::Solve () );
+ YStringWidgetID * solveID = new YStringWidgetID("solve");
+ solveButton->setId( solveID );
hSplit->addChild( solveButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
@@ -179,7 +183,9 @@
// add the cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
- cancelButton->setId( NCPkgNames::Cancel () );
+ // cancelButton->setId( NCPkgNames::Cancel () );
+ YStringWidgetID * cancelID = new YStringWidgetID("cancel");
+ cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
}
@@ -386,17 +392,17 @@
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId.isNull() )
+ // YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
+ if ( !currentId )
return false;
- if ( currentId->compare( NCPkgNames::Cancel () ) == YO_EQUAL )
+ if ( currentId->toString() == "cancel" )
{
// close the dialog
postevent = NCursesEvent::cancel;
}
- else if ( currentId->compare( NCPkgNames::Solve () ) == YO_EQUAL )
+ else if ( currentId->toString() == "solve" )
{
// apply the solution here
zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc Tue Jun 26 13:13:12 2007
@@ -21,6 +21,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -115,7 +117,8 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton() );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
split->addChild( okButton );
@@ -217,16 +220,17 @@
// METHOD TYPE : bool
//
// DESCRIPTION :
-//
+//x
bool NCPkgPopupDescr::postAgain()
{
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ // YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( !currentId.isNull()
- && currentId->compare( NCPkgNames::Cancel() ) == YO_EQUAL )
+ if ( currentId
+ && currentId->toString() == "cancel" )
{
// close the dialog
postevent = NCursesEvent::cancel;
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Tue Jun 26 13:13:12 2007
@@ -21,6 +21,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -124,7 +126,8 @@
// add the ok button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton () );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
split->addChild( okButton );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc Tue Jun 26 13:13:12 2007
@@ -107,7 +107,8 @@
opt.isEditable.setValue( true );
searchExpr = new NCComboBox( frame0, opt, YCPString(NCPkgNames::SearchPhrase()) );
frame0->addChild( searchExpr );
- searchExpr->setId( NCPkgNames::SearchBox() );
+ YStringWidgetID * searchID = new YStringWidgetID ("search_box" );
+ searchExpr->setId( searchID );
searchExpr->itemAdded( YCPString( "" ), // set initial value
0, // index
false ); // not selected
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc Tue Jun 26 13:13:12 2007
@@ -20,6 +20,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -115,7 +117,8 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton() );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
hSplit->addChild( okButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
@@ -123,7 +126,8 @@
// add the Cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
- cancelButton->setId( NCPkgNames::Cancel() );
+ YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
+ cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
@@ -180,7 +184,7 @@
// show all packages which are automatically selected for installation
if ( slb->toModify() && slb->modifiedBy () != zypp::ResStatus::USER )
{
- if ( ! contains( ignoredNames, slb->name() ) )
+ if ( ! inContainer( ignoredNames, slb->name() ) )
{
ZyppPkg pkgPtr = tryCastToZyppPkg (slb->theObj());
if ( pkgPtr )
@@ -280,10 +284,10 @@
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast(postevent.widget)->id();
-
- if ( !currentId.isNull()
- && currentId->compare( NCPkgNames::Cancel() ) == YO_EQUAL )
+ // YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
+ if ( currentId
+ && currentId->toString() == "cancel" )
{
//user hit cancel - discard set of changes (if not empty)
packager->clearVerifiedPkgs();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h?rev=39031&r1=39030&r2=39031&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h Tue Jun 26 13:13:12 2007
@@ -110,7 +110,7 @@
}
-template<typename T> bool contains( const std::set<T> & container, T search )
+template<typename T> bool inContainer( const std::set<T> & container, T search )
{
return container.find( search ) != container.end();
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org