Author: gs
Date: Thu Jul 26 13:22:49 2007
New Revision: 39703
URL: http://svn.opensuse.org/viewcvs/yast?rev=39703&view=rev
Log:
adapt NCTree, addItem calls ...
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.h
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h
branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.h
branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h
branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTree.h
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
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/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Thu Jul 26 13:22:49 2007
@@ -118,7 +118,8 @@
opt.isEditable.setValue( false );
opt.notifyMode.setValue( true );
// label for text field showing the selected dir
- dirName = new NCComboBox( frame, opt, YCPString(_( "Selected Directory:" )) );
+ dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false
+ dirName->setNotify( true );
frame->addChild( dirName );
YStringWidgetID * dirID = new YStringWidgetID( idDirName->name() );
dirName->setId( dirID );
@@ -131,7 +132,7 @@
NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
split->addChild( hSplit );
// label for checkbox
- detailed = new NCCheckBox( hSplit, opt, YCPString(_( "&Detailed View" )), false );
+ detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false );
YStringWidgetID * detailsID = new YStringWidgetID( idDetails->name() );
detailed->setId( detailsID );
@@ -196,9 +197,8 @@
dirList->fillList( );
dirList->setKeyboardFocus();
- dirName->itemAdded( YCPString( dirList->getCurrentDir() ),
- 0, // index
- true ); // selected
+ dirName->addItem( dirList->getCurrentDir(),
+ true ); // selected
// event loop
do {
@@ -275,11 +275,16 @@
if (postevent.result.isNull ())
return true;
- // show the currently selected directory
+ // FIXME ???
+#if 0
dirName->itemAdded( postevent.result->asString(),
i,
true );
-
+#endif
+ // show the currently selected directory
+ dirName->addItem( postevent.result->asString()->toString(),
+ true );
+
if ( postevent.reason == YEvent::Activated )
{
// fill the directory list
@@ -288,7 +293,7 @@
}
else if ( currentId->toString() == idDirName->name() )
{
- dirList->setStartDir( dirName->getValue() );
+ dirList->setStartDir( dirName->value() );
dirList->fillList();
}
else if ( currentId->toString() == idDetails->name() )
@@ -324,17 +329,10 @@
bool NCAskForExistingDirectory::getCheckBoxValue( NCCheckBox * checkBox )
{
- YCPValue value = YCPNull();
-
if ( checkBox )
{
- value = checkBox->getValue();
-
// return whether the option is selected or not
- if ( !value.isNull() )
- {
- return ( value->asBoolean()->toString() == "true" ? true : false );
- }
+ return ( checkBox->isChecked() );
}
return false;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc Thu Jul 26 13:22:49 2007
@@ -128,15 +128,15 @@
//
// DESCRIPTION :
//
-void NCAskForFile::createLayout( const YCPString & iniDir,
- const YCPString & filter,
- const YCPString & headline,
+void NCAskForFile::createLayout( const string & iniDir,
+ const string & filter,
+ const string & headline,
bool edit )
{
YWidgetOpt opt;
string startDir;
- startDir = checkIniDir( iniDir->value() );
+ startDir = checkIniDir( iniDir );
// the vertical split is the (only) child of the dialog
NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
@@ -147,7 +147,7 @@
//the headline
//opt.isHeading.setValue( true );
- NCLabel * head = new NCLabel( split, headline->toString(), true, false ); // isHeading = true
+ NCLabel * head = new NCLabel( split, headline, true, false ); // isHeading = true
split->addChild( head );
split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) );
@@ -160,7 +160,8 @@
opt.isEditable.setValue( false );
opt.notifyMode.setValue( true );
// label for text field showing the selected dir
- dirName = new NCComboBox( frame, opt, YCPString(_( "Selected Directory:" )) );
+ dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false;
+ dirName->setNotify( true );
frame->addChild( dirName );
YStringWidgetID * dirID = new YStringWidgetID( idDirName->name() );
dirName->setId( dirID );
@@ -173,7 +174,7 @@
NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
split->addChild( hSplit );
// label for checkbox
- detailed = new NCCheckBox( hSplit, opt, YCPString( _( "&Detailed View" ) ), false );
+ detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false );
YStringWidgetID * detailsID = new YStringWidgetID( idDetails->name() );
detailed->setId( detailsID );
hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ) ); // stretchable = true
@@ -214,11 +215,10 @@
hSplit2->addChild( fileName );
// label for text field showing the filter (e.g. *.bak)
- NCComboBox * extension = new NCComboBox( hSplit2, opt, YCPString(_( "Filter:" )) );
+ NCComboBox * extension = new NCComboBox( hSplit2, _( "Filter:" ), edit ); // editable as set in edit
hSplit2->addChild( extension );
- extension->itemAdded( filter,
- 0, // index
- true ); // selected
+ extension->addItem( filter,
+ true ); // selected
split->addChild( hSplit2 );
//split->addChild( new NCSpacing( split, opt, 0.8, false, true ) );
@@ -270,8 +270,7 @@
fileList->fillList();
dirList->setKeyboardFocus();
- dirName->itemAdded( YCPString( dirList->getCurrentDir() ),
- 0, // index
+ dirName->addItem( dirList->getCurrentDir(),
true ); // selected
// event loop
@@ -373,10 +372,15 @@
&& !postevent.result.isNull() )
{
unsigned int i = dirName->getListSize();
- // show the currently selected directory
+#if 0
dirName->itemAdded( postevent.result->asString(),
i,
true );
+#endif
+ //FIXME ???
+ // show the currently selected directory
+ dirName->addItem( postevent.result->asString()->toString(),
+ true );
updateFileList();
if ( postevent.reason == YEvent::Activated )
@@ -388,7 +392,7 @@
}
else if ( currentId->toString() == idDirName->name() )
{
- dirList->setStartDir( dirName->getValue() );
+ dirList->setStartDir( dirName->text() );
dirList->fillList();
updateFileList();
@@ -442,17 +446,10 @@
//
bool NCAskForFile::getCheckBoxValue( NCCheckBox * checkBox )
{
- YCPValue value = YCPNull();
-
if ( checkBox )
{
- value = checkBox->getValue();
-
// return whether the option is selected or not
- if ( !value.isNull() )
- {
- return ( value->asBoolean()->toString() == "true" ? true : false );
- }
+ return ( checkBox->isChecked() );
}
return false;
@@ -472,9 +469,9 @@
const YCPString & headline )
: NCAskForFile( at, iniDir, filter, headline )
{
- createLayout( iniDir,
- filter,
- headline,
+ createLayout( iniDir->toString(),
+ filter->toString(),
+ headline->toString(),
false ); // file name is not editable
}
@@ -508,9 +505,9 @@
const YCPString & headline )
: NCAskForFile( at, iniDir, filter, headline )
{
- createLayout( iniDir,
- filter,
- headline,
+ createLayout( iniDir->toString(),
+ filter->toString(),
+ headline->toString(),
true ); // file name is editable
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.h Thu Jul 26 13:22:49 2007
@@ -91,9 +91,9 @@
* @param bool File name field editable?
* @return void
*/
- void createLayout( const YCPString & iniDir,
- const YCPString & filter,
- const YCPString & headline,
+ void createLayout( const string & iniDir,
+ const string & filter,
+ const string & headline,
bool editable );
/**
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc Thu Jul 26 13:22:49 2007
@@ -36,7 +36,8 @@
// DESCRIPTION :
//
NCCheckBox::NCCheckBox( YWidget * parent,
- const string & nlabel )
+ const string & nlabel,
+ bool checked )
: YCheckBox( parent, nlabel )
, NCWidget( parent )
, tristate( false )
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h Thu Jul 26 13:22:49 2007
@@ -64,7 +64,8 @@
public:
NCCheckBox( YWidget * parent,
- const string & label );
+ const string & label,
+ bool checked = false );
virtual ~NCCheckBox();
virtual long nicesize( YUIDimension dim );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc Thu Jul 26 13:22:49 2007
@@ -200,6 +200,27 @@
///////////////////////////////////////////////////////////////////
//
//
+// METHOD NAME : NCComboBox::addItem
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCComboBox::addItem( const string & label, bool selected )
+{
+ YComboBox::addItem( label, selected );
+ YItem * item = findItem( label );
+
+ deflist.push_back( label );
+ if ( selected || index == -1 )
+ {
+ setValue( label );
+ index = item->index();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
// METHOD NAME : NCComboBox::setLabel
// METHOD TYPE : void
//
@@ -342,9 +363,9 @@
//
// DESCRIPTION :
//
-void NCComboBox::setValidChars( const YCPString & validchars )
+void NCComboBox::setValidChars( const string & validchars )
{
- validChars = validchars;
+ validChars = NCstring( validchars );
YComboBox::setValidChars( validchars );
}
@@ -638,7 +659,7 @@
{
if (!deflist.empty()) {
wpos at( ScreenPos() + wpos( win->height(), -1 ) );
- NCPopupList dialog( at, YCPString(""), deflist, index );
+ NCPopupList dialog( at, "", deflist, index );
int idx = dialog.post();
if ( idx != -1 )
setCurrentItem( idx );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h Thu Jul 26 13:22:49 2007
@@ -95,6 +95,7 @@
bool selected );
#endif
virtual void addItem ( YItem * item );
+ void addItem( const string & label, bool selected );
virtual int preferredWidth();
virtual int preferredHeight();
@@ -108,16 +109,16 @@
virtual void setLabel( const string & nlabel );
-#if 0
- // FIXME - obsolete? same as setText() ?
+ // FIXME - internally used? move to private? or obsolete? same as setText() ?
virtual void setValue( const string & ntext );
+#if 0
virtual YCPString getValue() const;
#endif
virtual void setText( const string & ntext );
virtual string text();
- virtual void setValidChars( const YCPString & validchars );
+ virtual void setValidChars( const string & validchars );
virtual int getCurrentItem() const;
virtual void setCurrentItem( int index );
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc Thu Jul 26 13:22:49 2007
@@ -118,9 +118,8 @@
//
void NCMultiLineEdit::setValue( const string & ntext )
{
- YMultiLineEdit::setValue( ntext );
DelPad();
- ctext = ntext;
+ ctext = NCstring( ntext );
Redraw();
}
@@ -155,7 +154,7 @@
if ( myPad() ) {
ctext = NCstring( myPad()->getText() );
}
- return ctext;
+ return ctext.Str();
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc Thu Jul 26 13:22:49 2007
@@ -125,7 +125,7 @@
NCMIL << "Index of current Item: " << index << endl;
- return findItem( index );
+ return itemAt( index );
}
///////////////////////////////////////////////////////////////////
@@ -141,6 +141,7 @@
myPad()->ScrlLine( item->index() );
}
+#if 0
///////////////////////////////////////////////////////////////////
//
//
@@ -157,6 +158,7 @@
myPad()->Append( Items );
DrawPad();
}
+#endif
void NCMultiSelectionBox::addItem( YItem * item )
{
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc Thu Jul 26 13:22:49 2007
@@ -76,6 +76,7 @@
NCWidget * firstChild = dynamic_cast(YDialog::currentDialog()->firstChild());
if ( firstChild )
NCMIL << "FIRST child: " << firstChild << endl;
+ // FIXME ???
return (YPackageSelector *)(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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc Thu Jul 26 13:22:49 2007
@@ -54,7 +54,7 @@
, vDim( 20 )
, visible ( false )
{
- createLayout( headline, text, okButtonLabel, cancelButtonLabel );
+ createLayout( headline->toString(), text->toString(), okButtonLabel, cancelButtonLabel );
}
///////////////////////////////////////////////////////////////////
@@ -77,8 +77,8 @@
//
// DESCRIPTION :
//
-void NCPopupInfo::createLayout( const YCPString & headline,
- const YCPString & text,
+void NCPopupInfo::createLayout( const string & headline,
+ const string & text,
string okButtonLabel,
string cancelButtonLabel )
{
@@ -92,11 +92,11 @@
// add the headline
// opt.isHeading.setValue( true );
//NCLabel * head = new NCLabel( split, opt, headline );
- NCLabel * head = new NCLabel( split, headline->toString(), true, false ); // isHeading = true
+ NCLabel * head = new NCLabel( split, headline, true, false ); // isHeading = true
split->addChild( head );
// add the rich text widget
- helpText = new NCRichText( split, opt, text );
+ helpText = new NCRichText( split, text );
split->addChild( helpText );
NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.h Thu Jul 26 13:22:49 2007
@@ -79,8 +79,8 @@
virtual long nicesize(YUIDimension dim);
- void createLayout( const YCPString & headline,
- const YCPString & text,
+ void createLayout( const string & headline,
+ const string & text,
string okButtonLabel,
string cancelButtonLabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.cc Thu Jul 26 13:22:49 2007
@@ -30,16 +30,16 @@
// DESCRIPTION :
//
NCPopupList::NCPopupList( const wpos at,
- const YCPString & label,
- const list<YCPString> & deflist,
+ const string & label,
+ const list<string> & deflist,
int index )
: NCPopupTable( at )
{
vector<string> row( 1 );
createList( row );
- for ( list<YCPString>::const_iterator entry = deflist.begin();
+ for ( list<string>::const_iterator entry = deflist.begin();
entry != deflist.end(); ++entry ) {
- row[0] = (*entry)->value();
+ row[0] = (*entry);
addItem( YCPNull(), row );
}
setCurrentItem( index );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupList.h Thu Jul 26 13:22:49 2007
@@ -26,7 +26,6 @@
#include "NCPopupTable.h"
-class YCPString;
///////////////////////////////////////////////////////////////////
//
@@ -46,8 +45,8 @@
public:
NCPopupList( const wpos at,
- const YCPString & label,
- const list<YCPString> & deflist,
+ const string & label,
+ const list<string> & deflist,
int index = 0 );
virtual ~NCPopupList();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc Thu Jul 26 13:22:49 2007
@@ -246,10 +246,10 @@
//
// DESCRIPTION :
//
-void NCRichText::setText( const YCPString & ntext )
+void NCRichText::setText( const string & ntext )
{
DelPad();
- text = ntext;
+ text = NCstring( ntext );
YRichText::setText( ntext );
Redraw();
}
@@ -273,7 +273,7 @@
arm( armed );
NCPadWidget::wRedraw();
- if ( initial && autoScrollDown ) {
+ if ( initial && autoScrollDown () ) {
myPad()->ScrlTo( wpos( myPad()->maxy(), 0 ) );
}
return;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h Thu Jul 26 13:22:49 2007
@@ -217,7 +217,7 @@
virtual NCursesEvent wHandleInput( wint_t key );
- virtual void setText( const YCPString & ntext );
+ virtual void setText( const string & ntext );
virtual void setEnabled( bool do_bv );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc Thu Jul 26 13:22:49 2007
@@ -31,11 +31,12 @@
: YSelectionBox( parent, nlabel )
, NCPadWidget( parent )
, biglist( false )
- , immediate( opt.immediateMode.value() )
+ , immediate( false )
{
WIDDBG << endl;
InitPad();
setLabel( nlabel );
+ immediate = immediateMode();
}
///////////////////////////////////////////////////////////////////
@@ -185,7 +186,7 @@
//
// DESCRIPTION :
//
-void NCSelectionBox::setLabel( const YCPString & nlabel )
+void NCSelectionBox::setLabel( const string & nlabel )
{
YSelectionBox::setLabel( nlabel );
NCPadWidget::setLabel( NCstring( nlabel ) );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h Thu Jul 26 13:22:49 2007
@@ -79,7 +79,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual int getCurrentItem();
virtual void setCurrentItem( int index );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc Thu Jul 26 13:22:49 2007
@@ -19,6 +19,10 @@
#include "Y2Log.h"
#include "NCTree.h"
+#include "YItem.h"
+#include "YSelectionWidget.h"
+
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : NCTableLine
@@ -60,13 +64,14 @@
} else {
parent->fchild = this;
}
- if ( !parent->yitem.isOpenByDefault() ) {
+ // FIXME ??? was yitem.isOpenByDefault()
+ if ( !parent->yitem.isOpen() ) {
SetState( S_HIDDEN );
}
}
Append( new NCTableCol( YCPString( string( prefixLen(), ' ' )
- + yitem.getText()->value() ) ) );
+ + yitem.label() ) ) ); // FIXME ??? was yitem.getText()->value()
}
virtual ~NCTreeLine() { delete [] prefix; }
@@ -181,9 +186,8 @@
//
// DESCRIPTION :
//
-NCTree::NCTree( YWidget * parent, const YWidgetOpt & opt,
- const YCPString & nlabel )
- : YTree( opt, nlabel )
+NCTree::NCTree( YWidget * parent, const string & nlabel )
+ : YTree( parent, nlabel )
, NCPadWidget( parent )
{
WIDDBG << endl;
@@ -298,7 +302,7 @@
yitem = &cline->Yitem();
}
}
- DDBG << "-> " << (yitem?yitem->getText()->value().c_str():"noitem") << endl;
+ DDBG << "-> " << (yitem?yitem->label().c_str():"noitem") << endl;
return yitem;
}
@@ -317,7 +321,7 @@
for ( unsigned i = 0; i < myPad()->Lines(); ++i ) {
const NCTreeLine * cline = getTreeLine( i );
if ( &cline->Yitem() == it ) {
- DDBG << "got " << it->getText()->value() << " at " << i << endl;
+ DDBG << "got " << it->label() << " at " << i << endl;
myPad()->ShowItem( cline );
break;
}
@@ -332,7 +336,7 @@
//
// DESCRIPTION :
//
-void NCTree::setLabel( const YCPString & nlabel )
+void NCTree::setLabel( const string & nlabel )
{
YTree::setLabel( nlabel );
NCPadWidget::setLabel( NCstring( nlabel ) );
@@ -376,21 +380,39 @@
//
// DESCRIPTION :
//
-static void Dit( NCTreeLine * p, NCTreePad * pad, const YTreeItem * item )
+//
+// FOXME - was static Dit()
+//
+void NCTree::Dit( NCTreeLine * p, NCTreePad * pad, YTreeItem * item )
{
NCTreeLine * c = new NCTreeLine( p, *item );
pad->Append( c );
+ // FIXME ???
+#if 0
for ( YTreeItemListConstIterator it = item->itemList().begin();
it < item->itemList().end(); ++it ) {
Dit( c, pad, *it );
}
+#endif
+ for ( YItemIterator it = itemsBegin(); it < itemsEnd(); ++it )
+ {
+ Dit( c, pad, (YTreeItem *)(*it) ); // FIXME ???
+ }
}
void NCTree::DrawPad()
{
+#if 0
for ( YTreeItemListIterator it = items.begin(); it < items.end(); ++it ) {
Dit( 0, myPad(), *it );
}
+#endif
+ // FIXME ???
+ for ( YItemIterator it = itemsBegin(); it < itemsEnd(); ++it )
+ {
+ Dit( 0, myPad(), (YTreeItem *)(*it) ); // FIXME ???
+ }
+
NCPadWidget::DrawPad();
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCTree.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTree.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTree.h Thu Jul 26 13:22:49 2007
@@ -54,7 +54,8 @@
virtual NCPad * CreatePad();
virtual void DrawPad();
-
+ void Dit( NCTreeLine * p, NCTreePad * pad, YTreeItem * item );
+
protected:
virtual void startMultipleChanges() { startMultidraw(); }
@@ -62,8 +63,7 @@
public:
- NCTree( YWidget * parent, const YWidgetOpt & opt,
- const YCPString & label );
+ NCTree( YWidget * parent, const string & label );
virtual ~NCTree();
virtual long nicesize( YUIDimension dim );
@@ -78,7 +78,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual void rebuildTree();
virtual const YTreeItem * getCurrentItem() const;
@@ -86,7 +86,6 @@
virtual NCursesEvent wHandleInput( wint_t key );
- //virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
virtual void setEnabled( bool do_bv );
virtual bool setKeyboardFocus() {
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h Thu Jul 26 13:22:49 2007
@@ -102,16 +102,35 @@
const string & label,
bool isChecked = false );
- virtual NCRadioButton * createRadioButton ( YWidget * parent, const string & label, bool isChecked = false );
- virtual NCComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false );
- virtual NCSelectionBox * createSelectionBox ( YWidget * parent, const string & label );
- virtual NCTree * createTree ( YWidget * parent, const string & label );
+ virtual NCRadioButton * createRadioButton ( YWidget * parent, const string & label,
+ bool isChecked = false );
+
+ virtual NCComboBox * createComboBox ( YWidget * parent, const string & label,
+ bool editable = false );
+
+ virtual NCSelectionBox * createSelectionBox ( YWidget * parent,
+ const string & label );
+
+ virtual NCTree * createTree ( YWidget * parent,
+ const string & label );
+
virtual NCTable * createTable ( YWidget * parent );
- virtual NCProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 );
- virtual NCRichText * createRichText ( YWidget * parent, const string & text, bool plainTextMode = false );
+
+ virtual NCProgressBar * createProgressBar ( YWidget * parent,
+ const string & label,
+ int maxValue = 100 );
+
+ virtual NCRichText * createRichText ( YWidget * parent,
+ const string & text,
+ bool plainTextMode = false );
- virtual NCIntField * createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal );
- virtual NCMenuButton * createMenuButton ( YWidget * parent, const string & label );
+ virtual NCIntField * createIntField ( YWidget * parent,
+ const string & label,
+ int minVal, int maxVal,
+ int initialVal );
+
+ virtual NCMenuButton * createMenuButton ( YWidget * parent,
+ const string & label );
/**
* Creates a MultiLineEdit widget
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Thu Jul 26 13:22:49 2007
@@ -433,6 +433,7 @@
ONCREATE;
return new NCPushButton( parent, label );
}
+#endif
YWidget * YNCursesUI::createMenuButton( YWidget * parent, YWidgetOpt & opt,
const YCPString & label )
@@ -441,6 +442,7 @@
return new NCMenuButton( parent, opt, label );
}
+#if 0
YWidget * YNCursesUI::createRadioButton( YWidget * parent,
const string & label )
{
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Thu Jul 26 13:22:49 2007
@@ -225,7 +225,6 @@
*/
virtual YWidget * createPushButton( YWidget * parent,
const string & label );
-
#endif
/**
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Thu Jul 26 13:22:49 2007
@@ -2557,7 +2557,7 @@
if ( descrInfo )
{
- static_cast(descrInfo)->setText( YCPString( descr ) );
+ static_cast(descrInfo)->setText( descr );
}
}
// else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
@@ -2688,7 +2688,7 @@
if ( descrInfo )
{
- static_cast(descrInfo)->setText( YCPString(descr) );
+ static_cast(descrInfo)->setText( descr );
}
}
// else if ( visibleInfo->compare( NCPkgNames::Files() ) == YO_EQUAL )
@@ -2709,7 +2709,7 @@
YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
- static_cast(descrInfo)->setText( YCPString(text) );
+ static_cast(descrInfo)->setText( text );
}
}
// else if ( visibleInfo->compare( NCPkgNames::PkgInfo() ) == YO_EQUAL )
@@ -2800,7 +2800,7 @@
if ( descrInfo )
{
- static_cast(descrInfo)->setText( YCPString(text) );
+ static_cast(descrInfo)->setText( text );
}
}
// else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
@@ -2852,7 +2852,7 @@
if ( descrInfo )
{
- static_cast(descrInfo)->setText( YCPString( text ) );
+ static_cast(descrInfo)->setText( text );
}
}
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=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc Thu Jul 26 13:22:49 2007
@@ -145,7 +145,7 @@
headline->setLabel( pkgPtr->summary() );
- descrText->setText( YCPString(packager->createDescrText(pkgPtr->description())) );
+ descrText->setText( packager->createDescrText(pkgPtr->description()) );
return true;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc Thu Jul 26 13:22:49 2007
@@ -42,7 +42,7 @@
, packager ( pkg )
{
// create the layout (the NCTree)
- createLayout( YCPString(NCPkgNames::RpmTreeLabel()) );
+ createLayout( NCPkgNames::RpmTreeLabel() );
// clone the tree (fill the NCTree)
cloneTree( pkg->rpmGroupsTree()->root(), 0 );
@@ -68,7 +68,7 @@
//
// DESCRIPTION :
//
-void NCPkgPopupTree::createLayout( const YCPString & label )
+void NCPkgPopupTree::createLayout( const string & label )
{
YWidgetOpt opt;
@@ -82,7 +82,7 @@
// addChild() is obsolete
// create the tree
- filterTree = new NCTree( split, opt, label );
+ filterTree = new NCTree( split, label );
}
@@ -165,18 +165,17 @@
//
// DESCRIPTION :
//
-YTreeItem * NCPkgPopupTree::addItem( YTreeItem * parentItem,
- const YCPString & text,
- void * data,
- bool open )
+void NCPkgPopupTree::addItem( YTreeItem * newItem )
{
if ( !filterTree )
- return 0;
+ {
+ NCERR << "ERROR: rpm groups tree not available" << endl;
+ return;
+ }
- return ( filterTree->addItem( parentItem, text, YCPString( "" ), data, open ) );
-}
+ filterTree->addItem( newItem );
-
+}
///////////////////////////////////////////////////////////////////
@@ -252,11 +251,10 @@
while ( child )
{
NCDBG << "TRANSLATION: " << child->value().translation() << endl;
- clone = addItem( parentClone,
- YCPString( child->value().translation() ),
- child,
- false );
+ addItem( parentClone );
+
+ clone = parentClone;
cloneTree( child, clone );
child = child->next();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h?rev=39703&r1=39702&r2=39703&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h Thu Jul 26 13:22:49 2007
@@ -53,7 +53,7 @@
NCPackageSelector * packager; // connection to the PackageSelector
- // internal use (copies tree items got from YPkgRpmGroupTagsFilterView)
+ // internal use (copies tree items)
void cloneTree( YStringTreeItem * parentOrig, YTreeItem * parentClone );
protected:
@@ -73,12 +73,9 @@
virtual long nicesize(YUIDimension dim);
- void createLayout( const YCPString & label );
+ void createLayout( const string & label );
- YTreeItem * addItem( YTreeItem * parentItem,
- const YCPString & text,
- void * data,
- bool open );
+ void addItem( YTreeItem * newItem );
NCursesEvent showFilterPopup( );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org