Author: gs
Date: Wed Aug 29 15:09:27 2007
New Revision: 40582
URL: http://svn.opensuse.org/viewcvs/yast?rev=40582&view=rev
Log:
remove YCPTerm, add preferredW/H
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.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=40582&r1=40581&r2=40582&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Wed Aug 29 15:09:27 2007
@@ -22,7 +22,7 @@
#include "NCAskForDirectory.h"
-#include
+#include "YWidgetID.h"
#include "YDialog.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -42,11 +42,11 @@
namespace
{
- const YCPTerm idOk( "ok" );
- const YCPTerm idCancel( "cancel" );
- const YCPTerm idDirList( "dirlist" );
- const YCPTerm idDirName( "dirname" );
- const YCPTerm idDetails( "details" );
+ const string idOk( "ok" );
+ const string idCancel( "cancel" );
+ const string idDirList( "dirlist" );
+ const string idDirName( "dirname" );
+ const string idDetails( "details" );
}
///////////////////////////////////////////////////////////////////
@@ -122,7 +122,7 @@
dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false
dirName->setNotify( true );
- YStringWidgetID * dirID = new YStringWidgetID( idDirName->name() );
+ YStringWidgetID * dirID = new YStringWidgetID( idDirName );
dirName->setId( dirID );
//new NCSpacing( vSplit, YD_VERT, false, 0.6 );
@@ -132,7 +132,7 @@
// label for checkbox
detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false );
- YStringWidgetID * detailsID = new YStringWidgetID( idDetails->name() );
+ YStringWidgetID * detailsID = new YStringWidgetID( idDetails );
detailed->setId( detailsID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.1, true, false ) );
@@ -141,7 +141,7 @@
// add the list of directories
dirList = new NCDirectoryTable( split, opt, NCFileTable::T_Overview, iniDir );
- YStringWidgetID * dirListID = new YStringWidgetID( idDirList->name() );
+ YStringWidgetID * dirListID = new YStringWidgetID( idDirList );
dirList->setId( dirListID );
//split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
@@ -158,7 +158,7 @@
opt.key_Fxx.setValue( 10 );
// the label of an OK button
okButton = new NCPushButton( hSplit1, _( "&OK" ) );
- YStringWidgetID * okID = new YStringWidgetID (idOk->name() );
+ YStringWidgetID * okID = new YStringWidgetID ( idOk );
okButton->setId( okID );
//hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.4, true, false ) );
@@ -168,7 +168,7 @@
opt.key_Fxx.setValue( 9 );
// the label of the Cancel button
cancelButton = new NCPushButton( hSplit1, _( "&Cancel" ) );
- YStringWidgetID * cancelID = new YStringWidgetID (idCancel->name() );
+ YStringWidgetID * cancelID = new YStringWidgetID (idCancel );
cancelButton->setId( cancelID );
//hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) );
@@ -205,21 +205,17 @@
return postevent;
}
-///////////////////////////////////////////////////////////////////
-//
-//
-// METHOD NAME : NCAskForExistingDirectory::niceSize
-// METHOD TYPE : void
-//
-// DESCRIPTION :
-//
-
+int NCAskForExistingDirectory::preferredWidth()
+{
+ return NCurses::cols()-10;
+}
-long NCAskForExistingDirectory::nicesize(YUIDimension dim)
+int NCAskForExistingDirectory::preferredHeight()
{
- return ( dim == YD_HORIZ ? NCurses::cols()-10 : NCurses::lines()-4 );
+ return NCurses::lines()-4;
}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -256,13 +252,13 @@
if ( currentId )
{
- if ( currentId->toString() == idOk->name() )
+ if ( currentId->toString() == idOk )
{
postevent.result = YCPString( dirList->getCurrentDir() );
// return false means: close the popup
return false;
}
- else if ( currentId->toString() == idDirList->name() )
+ else if ( currentId->toString() == idDirList )
{
unsigned int i = dirName->getListSize();
@@ -285,12 +281,12 @@
dirList->fillList();
}
}
- else if ( currentId->toString() == idDirName->name() )
+ else if ( currentId->toString() == idDirName )
{
dirList->setStartDir( dirName->value() );
dirList->fillList();
}
- else if ( currentId->toString() == idDetails->name() )
+ else if ( currentId->toString() == idDetails )
{
bool details = getCheckBoxValue( detailed );
if ( details )
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.h?rev=40582&r1=40581&r2=40582&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.h Wed Aug 29 15:09:27 2007
@@ -70,7 +70,9 @@
/**
* Set the default size
*/
- virtual long nicesize(YUIDimension dim);
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
/**
* Create layout of file directory selection popup
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org