Author: gs Date: Thu Aug 2 11:38:57 2007 New Revision: 39887 URL: http://svn.opensuse.org/viewcvs/yast?rev=39887&view=rev Log: remove addChild() Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.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=39887&r1=39886&r2=39887&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Thu Aug 2 11:38:57 2007 @@ -95,67 +95,64 @@ void NCAskForExistingDirectory::createLayout( const YCPString & iniDir, const YCPString & headline ) { - + // FIXME - check all options settings! YWidgetOpt opt; // the vertical split is the (only) child of the dialog NCLayoutBox * split = new NCLayoutBox( this, YD_VERT ); - addChild( split ); + + // addChild() is obsolete (handled by new libyui) opt.notifyMode.setValue( false ); // the headline - NCLabel * head = new NCLabel( split, headline->toString(), true, false ); // isHeading = true - split->addChild( head ); + new NCLabel( split, headline->toString(), true, false ); // isHeading = true - split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) ); + new NCSpacing( split, YD_VERT, false, 0.4 ); - opt.isHStretchable.setValue( true ); + opt.isHStretchable.setValue( true ); // see hSplit NCFrame * frame = new NCFrame( split, "" ); - NCLayoutBox * vSplit = new NCLayoutBox( frame, YD_VERT ); + //NCLayoutBox * vSplit = new NCLayoutBox( frame, YD_VERT ); - opt.isEditable.setValue( false ); - opt.notifyMode.setValue( true ); + opt.isEditable.setValue( false ); // see dirName + opt.notifyMode.setValue( true ); // see dirName + // label for text field showing the selected dir dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false dirName->setNotify( true ); - frame->addChild( dirName ); + YStringWidgetID * dirID = new YStringWidgetID( idDirName->name() ); dirName->setId( dirID ); - vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) ); - - split->addChild( frame ); + //new NCSpacing( vSplit, YD_VERT, false, 0.6 ); // add the checkBox detailed NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ ); - split->addChild( hSplit ); + // label for checkbox detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false ); YStringWidgetID * detailsID = new YStringWidgetID( idDetails->name() ); detailed->setId( detailsID ); //hSplit->addChild( new NCSpacing( hSplit, opt, 0.1, true, false ) ); - hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ) ); // stretchable = true - hSplit->addChild( detailed ); + new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ); // stretchable = true // add the list of directories dirList = new NCDirectoryTable( split, opt, NCFileTable::T_Overview, iniDir ); YStringWidgetID * dirListID = new YStringWidgetID( idDirList->name() ); dirList->setId( dirListID ); - split->addChild( dirList ); //split->addChild( new NCSpacing( split, opt, 0.4, false, true ) ); - split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) ); + new NCSpacing( split, YD_VERT, false, 0.4 ); // HBox for the buttons NCLayoutBox * hSplit1 = new NCLayoutBox( split, YD_HORIZ ); - split->addChild( hSplit1 ); + opt.isHStretchable.setValue( true ); //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) ); - hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ) ); // stretchable = true + new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ); // stretchable = true // add the OK button opt.key_Fxx.setValue( 10 ); @@ -164,10 +161,8 @@ YStringWidgetID * okID = new YStringWidgetID (idOk->name() ); okButton->setId( okID ); - hSplit1->addChild( okButton ); - //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.4, true, false ) ); - hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.4 ) ); + new NCSpacing( hSplit1, YD_HORIZ, true, 0.4 ); // add the Cancel button opt.key_Fxx.setValue( 9 ); @@ -176,9 +171,8 @@ YStringWidgetID * cancelID = new YStringWidgetID (idCancel->name() ); cancelButton->setId( cancelID ); - hSplit1->addChild( cancelButton ); //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) ); - hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ) ); + new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ); } @@ -275,7 +269,7 @@ if (postevent.result.isNull ()) return true; - // FIXME ??? + // FIXME ??? - what about 'i' #if 0 dirName->itemAdded( postevent.result->asString(), i, 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=39887&r1=39886&r2=39887&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc Thu Aug 2 11:38:57 2007 @@ -133,6 +133,8 @@ const string & headline, bool edit ) { + // FIXME - check all option settings + YWidgetOpt opt; string startDir; @@ -140,45 +142,42 @@ // the vertical split is the (only) child of the dialog NCLayoutBox * split = new NCLayoutBox( this, YD_VERT ); - addChild( split ); + + // addChild() id obsolete (handled by new libyui) opt.notifyMode.setValue( false ); //the headline //opt.isHeading.setValue( true ); - NCLabel * head = new NCLabel( split, headline, true, false ); // isHeading = true - split->addChild( head ); + new NCLabel( split, headline, true, false ); // isHeading = true - split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) ); + new NCSpacing( split, YD_VERT, false, 0.4 ); opt.isHStretchable.setValue( true ); NCFrame * frame = new NCFrame( split, "" ); - NCLayoutBox * vSplit = new NCLayoutBox( frame, YD_VERT ); + //NCLayoutBox * vSplit = new NCLayoutBox( frame, YD_VERT ); opt.isEditable.setValue( false ); opt.notifyMode.setValue( true ); // label for text field showing the selected dir dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false; dirName->setNotify( true ); - frame->addChild( dirName ); + YStringWidgetID * dirID = new YStringWidgetID( idDirName->name() ); dirName->setId( dirID ); - vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) ); - - split->addChild( frame ); + //new NCSpacing( vSplit, YD_VERT, false, 0.6 ); // add the checkBox detailed NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ ); - split->addChild( hSplit ); + // label for checkbox 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 - hSplit->addChild( detailed ); + new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ); // stretchable = true // HBox for the lists NCLayoutBox * hSplit1 = new NCLayoutBox( split, YD_HORIZ ); @@ -188,15 +187,12 @@ dirList = new NCDirectoryTable( hSplit1, opt, NCFileSelection::T_Overview, YCPString(startDir) ); YStringWidgetID * dirListID = new YStringWidgetID( idDirList->name() ); dirList->setId( dirListID ); - hSplit1->addChild( dirList ); // add the list of files fileList = new NCFileTable( hSplit1, opt, NCFileSelection::T_Overview, filter, YCPString(startDir) ); YStringWidgetID * dirFileID = new YStringWidgetID( idFileList->name() ); fileList->setId( dirFileID ); - hSplit1->addChild( fileList ); - split->addChild( hSplit1 ); opt.notifyMode.setValue( false ); opt.keyEvents.setValue( false ); @@ -213,44 +209,39 @@ // FIXME // fileName->setMaxFld( 50); - hSplit2->addChild( fileName ); // label for text field showing the filter (e.g. *.bak) NCComboBox * extension = new NCComboBox( hSplit2, _( "Filter:" ), edit ); // editable as set in edit - hSplit2->addChild( extension ); + extension->addItem( filter, true ); // selected - split->addChild( hSplit2 ); //split->addChild( new NCSpacing( split, opt, 0.8, false, true ) ); - split->addChild( new NCSpacing( split, YD_VERT, false, 0.8 ) ); + new NCSpacing( split, YD_VERT, false, 0.8 ); // HBox for the buttons NCLayoutBox * hSplit3 = new NCLayoutBox( split, YD_HORIZ ); - split->addChild( hSplit3 ); + opt.isHStretchable.setValue( true ); //hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) ); - hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ) ); + new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ); // add the OK button - opt.key_Fxx.setValue( 10 ); + opt.key_Fxx.setValue( 10 ); // FIXME // the label of the OK button okButton = new NCPushButton( hSplit3, _( "&OK" ) ); YStringWidgetID * okID = new YStringWidgetID(idOk->name() ); okButton->setId( okID ); - hSplit3->addChild( okButton ); - - hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 ) ); + new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 ); // add the Cancel button - opt.key_Fxx.setValue( 9 ); + opt.key_Fxx.setValue( 9 ); // FIXME // the label of the Cancel button cancelButton = new NCPushButton( hSplit3, _( "&Cancel" ) ); - YStringWidgetID * cancelID = new YStringWidgetID( idCancel->name() ); + YStringWidgetID * cancelID = new YStringWidgetID( idCancel->name() ); cancelButton->setId( cancelID ); - hSplit3->addChild( cancelButton ); - hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ) ); + new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ); } @@ -377,7 +368,7 @@ i, true ); #endif - //FIXME ??? + //FIXME ??? - what about 'i' // show the currently selected directory dirName->addItem( postevent.result->asString()->toString(), true ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org