Author: gs
Date: Mon Nov 12 12:15:32 2007
New Revision: 41964
URL: http://svn.opensuse.org/viewcvs/yast?rev=41964&view=rev
Log:
replace YCPString by string in NCPopupInfo constructor
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.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/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc?rev=41964&r1=41963&r2=41964&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc Mon Nov 12 12:15:32 2007
@@ -1214,10 +1214,8 @@
helpPopup = new NCPopupInfo( wpos( NCurses::lines()/3, NCurses::cols()/3 ),
// headline of the text mode help
_( "Text Mode Navigation" ),
- YCPString( helpIntro +
- _( "<p>Function key bindings:</p>" ) +
- helpText
- ),
+ helpIntro + _( "<p>Function key bindings:</p>" )
+ + helpText,
"" );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc?rev=41964&r1=41963&r2=41964&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc Mon Nov 12 12:15:32 2007
@@ -219,7 +219,7 @@
zypp::License license;
bool license_confirmed = true;
ZyppPkg pkgPtr = NULL;
- YCPString header( "" );
+ string header;
bool ok = true;
int cols = NCurses::cols();
int lines = NCurses::lines();
@@ -233,7 +233,7 @@
{
notify = objPtr->delnotify();
NCDBG << "DELETE message: " << notify << endl;
- header = YCPString(NCPkgNames::WarningLabel());
+ header = NCPkgNames::WarningLabel();
}
break;
case S_Install:
@@ -242,7 +242,7 @@
{
notify = objPtr->insnotify();
NCDBG << "NOTIFY message: " << notify << endl;
- header = YCPString(NCPkgNames::NotifyLabel());
+ header = NCPkgNames::NotifyLabel();
}
case S_AutoInstall:
case S_AutoUpdate:
@@ -263,14 +263,17 @@
{
if (!license_confirmed)
{
- NCPopupInfo info( wpos( (lines * 10)/100, (cols * 10) /100),
- NCPkgNames::NotifyLabel(),
- //YCPString(_("End User License Agreement") ),
- YCPString( "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( license ) ),
- NCPkgNames::AcceptLabel(),
- NCPkgNames::CancelLabel() );
- info.setNiceSize( (NCurses::cols() * 80)/100, (NCurses::lines()*80)/100);
- license_confirmed = info.showInfoPopup( ) != NCursesEvent::cancel;
+ NCPopupInfo * info = new NCPopupInfo( wpos( (lines * 10)/100, (cols * 10) /100),
+ NCPkgNames::NotifyLabel(),
+ //_("End User License Agreement") ),
+ "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( license ),
+ NCPkgNames::AcceptLabel(),
+ NCPkgNames::CancelLabel()
+ );
+ info->setNiceSize( (NCurses::cols() * 80)/100, (NCurses::lines()*80)/100);
+ license_confirmed = info->showInfoPopup( ) != NCursesEvent::cancel;
+
+ YDialog::deleteTopmostDialog();
}
if ( !license_confirmed )
@@ -301,11 +304,14 @@
if ( ok && !notify.empty() )
{
- NCPopupInfo info( wpos( (lines * 35)/100, (cols * 25)/100),
- header,
- YCPString( "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( notify ) ) );
- info.setNiceSize( (NCurses::cols() * 50)/100, (NCurses::lines() * 30)/100);
- info.showInfoPopup( );
+ NCPopupInfo * info = new NCPopupInfo( wpos( (lines * 35)/100, (cols * 25)/100),
+ header,
+ "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( notify )
+ );
+ info->setNiceSize( (NCurses::cols() * 50)/100, (NCurses::lines() * 30)/100);
+ info->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
}
// inform the package manager
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=41964&r1=41963&r2=41964&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupInfo.cc Mon Nov 12 12:15:32 2007
@@ -29,8 +29,8 @@
namespace
{
- const YCPTerm idOk( "ok" );
- const YCPTerm idCancel( "cancel" );
+ const string idOk( "ok" );
+ const string idCancel( "cancel" );
}
///////////////////////////////////////////////////////////////////
@@ -42,8 +42,8 @@
// DESCRIPTION :
//
NCPopupInfo::NCPopupInfo( const wpos at,
- const YCPString & headline,
- const YCPString & text,
+ const string & headline,
+ const string & text,
string okButtonLabel,
string cancelButtonLabel )
: NCPopup( at, false )
@@ -54,7 +54,7 @@
, vDim( 20 )
, visible ( false )
{
- createLayout( headline->value(), text->value(), okButtonLabel, cancelButtonLabel );
+ createLayout( headline, text, okButtonLabel, cancelButtonLabel );
}
///////////////////////////////////////////////////////////////////
@@ -82,17 +82,12 @@
string okButtonLabel,
string cancelButtonLabel )
{
- // FIXME - check all options
- YWidgetOpt opt;
-
// the vertical split is the (only) child of the dialog
NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
// addChild() is obsolete (handled by new libyui)
// add the headline
- // opt.isHeading.setValue( true );
- //NCLabel * head = new NCLabel( split, opt, headline );
new NCLabel( split, headline, true, false ); // isHeading = true
// add the rich text widget
@@ -102,32 +97,30 @@
if ( okButtonLabel != "" && cancelButtonLabel != "" )
{
- opt.isHStretchable.setValue( true );
- //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 ); // stretchable = true
}
if ( okButtonLabel != "" )
{
- opt.key_Fxx.setValue( 10 ); // FIXME
// add the OK button
okButton = new NCPushButton( hSplit, okButtonLabel );
- YStringWidgetID * okID = new YStringWidgetID (idOk->name() );
+ okButton->setFunctionKey( 10 );
+
+ YStringWidgetID * okID = new YStringWidgetID (idOk );
okButton->setId( okID );
}
if ( cancelButtonLabel != "" )
{
- //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
- opt.key_Fxx.setValue( 9 ); // FIXME
// add the Cancel button
cancelButton = new NCPushButton( hSplit, cancelButtonLabel );
- YStringWidgetID * cancelID = new YStringWidgetID( cancelButtonLabel );
+ cancelButton->setFunctionKey( 9 );
+
+ YStringWidgetID * cancelID = new YStringWidgetID( idCancel );
cancelButton->setId( cancelID );
- //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
}
@@ -252,8 +245,9 @@
YWidgetID * currentId = dynamic_cast