Author: gs
Date: Thu Jun 28 10:51:04 2007
New Revision: 39066
URL: http://svn.opensuse.org/viewcvs/yast?rev=39066&view=rev
Log:
replace NCTextEntry by NCInputField
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h
branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupTextEntry.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Thu Jun 28 10:51:04 2007
@@ -256,17 +256,18 @@
postevent.detail = NCursesEvent::NODETAIL;
- YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ //YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( !currentId.isNull() )
+ if ( currentId )
{
- if ( currentId->compare( YCPString(idOk->name()) ) == YO_EQUAL )
+ if ( currentId->toString() == idOk->name() )
{
postevent.result = YCPString( dirList->getCurrentDir() );
// return false means: close the popup
return false;
}
- else if ( currentId->compare( YCPString(idDirList->name()) ) == YO_EQUAL )
+ else if ( currentId->toString() == idDirList->name() )
{
unsigned int i = dirName->getListSize();
@@ -284,12 +285,12 @@
dirList->fillList();
}
}
- else if ( currentId->compare( YCPString(idDirName->name()) ) == YO_EQUAL )
+ else if ( currentId->toString() == idDirName->name() )
{
dirList->setStartDir( dirName->getValue() );
dirList->fillList();
}
- else if ( currentId->compare( YCPString(idDetails->name()) ) == YO_EQUAL )
+ else if ( currentId->toString() == idDetails->name() )
{
bool details = getCheckBoxValue( detailed );
if ( details )
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCInputField.h Thu Jun 28 10:51:04 2007
@@ -132,7 +132,7 @@
// limits the input to numberOfChars characters and truncates the text
// if appropriate
- void setInputMaxLength( const YCPInteger & numberOfChars);
+ void setInputMaxLength( int numberOfChars );
void setCurPos( unsigned pos ) { curpos = pos; }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc Thu Jun 28 10:51:04 2007
@@ -410,7 +410,7 @@
string text( 1, (char )first);
NCPopupTextEntry dialog( at, label, text, vlen, 0,
- NCTextEntry::NUMBER );
+ NCInputField::NUMBER );
while ( dialog.post() != -1 ) {
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc Thu Jun 28 10:51:04 2007
@@ -68,7 +68,7 @@
int NCMultiLineEdit::preferredWidth()
{
- defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2
+ defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2;
return wGetDefsze().W;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc Thu Jun 28 10:51:04 2007
@@ -25,6 +25,8 @@
#include "NCSplit.h"
#include "NCSpacing.h"
+#include "YWidgetID.h"
+
namespace
{
const YCPTerm idOk( "ok" );
@@ -88,8 +90,9 @@
addChild( split );
// add the headline
- opt.isHeading.setValue( true );
- NCLabel * head = new NCLabel( split, opt, headline );
+ // opt.isHeading.setValue( true );
+ //NCLabel * head = new NCLabel( split, opt, headline );
+ NCLabel * head = new NCLabel( split, headline->toString(), true, false ); // isHeading = true
split->addChild( head );
// add the rich text widget
@@ -101,30 +104,35 @@
if ( okButtonLabel != "" && cancelButtonLabel != "" )
{
opt.isHStretchable.setValue( true );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.4 ) ); // stretchable = true
}
if ( okButtonLabel != "" )
{
opt.key_Fxx.setValue( 10 );
// add the OK button
- okButton = new NCPushButton( hSplit, opt, YCPString(okButtonLabel) );
- okButton->setId( YCPString(idOk->name()) );
+ okButton = new NCPushButton( hSplit, okButtonLabel );
+ YStringWidgetID * okID = new YStringWidgetID (idOk->name() );
+ okButton->setId( okID );
hSplit->addChild( okButton );
}
if ( cancelButtonLabel != "" )
{
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.4 ) );
opt.key_Fxx.setValue( 9 );
// add the Cancel button
- cancelButton = new NCPushButton( hSplit, opt, YCPString(cancelButtonLabel) );
- cancelButton->setId( YCPString(idCancel->name()) );
+ cancelButton = new NCPushButton( hSplit, cancelButtonLabel );
+ YStringWidgetID * cancelID = new YStringWidgetID( cancelButtonLabel );
+ cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.4 ) );
}
}
@@ -219,10 +227,10 @@
if ( okButton && cancelButton )
{
- YCPValue currentId = dynamic_cast(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( !currentId.isNull()
- && currentId->compare( YCPString(idCancel->name()) ) == YO_EQUAL )
+ if ( currentId
+ && currentId->toString() == idCancel->name() )
{
// close the dialog
postevent = NCursesEvent::cancel;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupTextEntry.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupTextEntry.cc Thu Jun 28 10:51:04 2007
@@ -38,9 +38,10 @@
{
YWidgetOpt opt;
//opt.notifyMode.setValue( true );
- wtext = new NCTextEntry( this, opt,
- label, text,
- maxInput, maxFld );
+ wtext = new NCTextEntry( this,
+ label->toString(),
+ false // passwordMode = false
+ );
wtext->setFldtype( t );
wtext->setReturnOnReturn( true );
addChild( wtext );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Thu Jun 28 10:51:04 2007
@@ -53,7 +53,7 @@
#include "NCSplit.h"
#include "NCSquash.h"
#include "NCTable.h"
-#include "NCTextEntry.h"
+#include "NCInputField.h"
#include "NCIntField.h"
#include "NCComboBox.h"
#include "NCTree.h"
@@ -215,13 +215,13 @@
label, checked );
}
-YWidget * YNCursesUI::createTextEntry( YWidget * parent,
+YWidget * YNCursesUI::createInputField( YWidget * parent,
const string & label,
bool passwordMode )
{
ONCREATE;
- return new NCTextEntry( dynamic_cast( parent ),
- label, passwordMode );
+ return new NCInputField( dynamic_cast( parent ),
+ label, passwordMode );
}
YWidget *YNCursesUI::createMultiLineEdit( YWidget * parent, YWidgetOpt & opt,
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc?rev=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Thu Jun 28 10:51:04 2007
@@ -54,7 +54,7 @@
#include "NCSplit.h"
#include "NCSquash.h"
#include "NCTable.h"
-#include "NCTextEntry.h"
+#include "NCInputField.h"
#include "NCIntField.h"
#include "NCComboBox.h"
#include "NCTree.h"
@@ -474,13 +474,13 @@
label, checked );
}
-YWidget * YNCursesUI::createTextEntry( YWidget * parent,
+YWidget * YNCursesUI::createInputField( YWidget * parent,
const string & label,
bool passwordMode )
{
ONCREATE;
- return new NCTextEntry( dynamic_cast( parent ),
- label, passwordMode );
+ return new NCInputField( dynamic_cast( parent ),
+ label, passwordMode );
}
YWidget *YNCursesUI::createMultiLineEdit( YWidget * parent, YWidgetOpt & opt,
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=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Thu Jun 28 10:51:04 2007
@@ -238,9 +238,9 @@
/**
* Creates a text entry or password entry field.
*/
- virtual YWidget * createTextEntry( YWidget * parent,
- const string & label,
- bool passwordMode );
+ virtual YWidget * createInputField( YWidget * parent,
+ const string & label,
+ bool passwordMode );
/**
* Creates a selection box
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=39066&r1=39065&r2=39066&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc Thu Jun 28 10:51:04 2007
@@ -151,10 +151,12 @@
//vSplit->addChild( new NCSpacing( vSplit, opt, 0.2, false, true ) );
vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.2 ) ); // stretchable = true
- details = new NCTextEntry( vSplit, opt,
- YCPString( "" ), YCPString( "" ),
- 200, 200 );
-
+ details = new NCTextEntry( vSplit,
+ "", false );
+ details->setInputMaxLength( 200 );
+ // FIXME
+ //details->setMaxFld( 200 );
+
vSplit->addChild( details );
//vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.8 ) ); // stretchable = true
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org