Author: gs Date: Thu Jul 19 15:19:22 2007 New Revision: 39540 URL: http://svn.opensuse.org/viewcvs/yast?rev=39540&view=rev Log: adapt NCRichText to new YRichText Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc 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/NCWidgetFactory.cc 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/NCPkgPopupDescr.cc 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc Thu Jul 19 15:19:22 2007 @@ -86,18 +86,15 @@ // DESCRIPTION : creates special widgets used for the package selection // dialog (which do not have a corresponding widget in qt-ui) // -YWidget * NCPackageSelectorPlugin::createPkgSpecial( YWidget *parent, - YWidgetOpt &opt, - const YCPString &subwidget ) +YWidget * NCPackageSelectorPlugin::createPkgSpecial( YWidget *parent, const string &subwidget ) { - YCPString pkgTable( "pkgTable" ); - YWidget * w = 0; - if ( subwidget->compare( pkgTable ) == YO_EQUAL ) + if ( subwidget == "pkgTable" ) { NCDBG << "Creating a NCPkgTable" << endl; try { + YWidgetOpt opt = new YWidgetOpt(); w = new NCPkgTable( parent, opt ); } catch (const std::exception & e) 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc Thu Jul 19 15:19:22 2007 @@ -168,12 +168,12 @@ // // DESCRIPTION : // -NCRichText::NCRichText( YWidget * parent, const YWidgetOpt & opt, - const YCPString & ntext ) - : YRichText( opt, ntext ) +NCRichText::NCRichText( YWidget * parent, const string & ntext, + bool plainTextMode ) + : YRichText( parent, ntext, plainTextMode ) , NCPadWidget( parent ) , text( ntext ) - , plainText( opt.plainTextMode.value() ) + , plainText( plainTextMode ) , preTag( false ) , Tattr( 0 ) { @@ -195,19 +195,6 @@ WIDDBG << endl; } -/////////////////////////////////////////////////////////////////// -// -// -// METHOD NAME : NCRichText::nicesize -// METHOD TYPE : long -// -// DESCRIPTION : -// -long NCRichText::nicesize( YUIDimension dim ) -{ - return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H; -} - int NCRichText::preferredWidth() { return wGetDefsze().W; 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h Thu Jul 19 15:19:22 2007 @@ -199,12 +199,10 @@ public: - NCRichText( YWidget * parent, const YWidgetOpt & opt, - const YCPString & text ); + NCRichText( YWidget * parent, const string & text, + bool plainTextMode = false ); virtual ~NCRichText(); - virtual long nicesize( YUIDimension dim ); - virtual int preferredWidth(); virtual int preferredHeight(); @@ -221,7 +219,6 @@ virtual void setText( const YCPString & ntext ); - //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.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc?rev=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Thu Jul 19 15:19:22 2007 @@ -166,16 +166,6 @@ } - -NCRichText * -NCWidgetFactory::createRichText( YWidget * parent ) -{ - return 0; // FIXME: TO DO -} - - - - // // Less Common Leaf Widgets // @@ -226,24 +216,6 @@ return 0; // FIXME: TO DO } - - - -YPackageSelector * -NCWidgetFactory::createPackageSelector( YWidget * parent ) -{ - return 0; // FIXME: TO DO -} - - - -YPkgSpecial * -NCWidgetFactory::createPkgSpecial( YWidget * parent ) -{ - return 0; // FIXME: TO DO -} - - // // Layout Helpers // @@ -342,5 +314,57 @@ return replacePoint; } +NCRichText * +NCWidgetFactory::createRichText( YWidget * parent, const string & text, bool plainTextMode ) +{ + NCRichText * richText = new NCRichText( parent, text, plainTextMode ); + YUI_CHECK_NEW( richText ); + + return richText; +} + +NCImage * +NCWidgetFactory::createImage( YWidget * parent, const string & imageFileName, bool animated ) +{ + NCImage * image = new NCImage( parent, imageFileName, animated ); + YUI_CHECK_NEW( image ); + + return image; +} + +NCPackageSelector * +NCWidgetFactory::createPackageSelector( YWidget * parent, long modeFlags ) +{ + NCUI::ui()->setAutoActivateDialogs( false ); + + NCPackageSelectorPlugin * plugin = NCUI::ui()->packageSelectorPlugin(); + if ( plugin ) + return plugin->createPackageSelector( parent, modeFlags ); + else + return 0; +} +YWidget * +NCWidgetFactory::createPkgSpecial( YWidget * parent, const string & subwidget ) +{ + YWidget * w = 0; + + NCPackageSelectorPlugin * plugin = packageSelectorPlugin(); + + if ( plugin ) + { + w = plugin->createPkgSpecial( parent, subwidget ); + } + + return w; +} + +NCMultiLineEdit * +NCWidgetFactory::createMultiLineEdit( YWidget * parent, const string & label ) +{ + NCMultiLineEdit * multiLineEdit = new NCMultiLineEdit( parent, label ); + YUI_CHECK_NEW( multiLineEdit ); + + return multiLineEdit; +} 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h Thu Jul 19 15:19:22 2007 @@ -93,7 +93,7 @@ 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 ); + virtual NCRichText * createRichText ( YWidget * parent, const string & text, bool plainTextMode = false ); // // Less Common Leaf Widgets @@ -104,10 +104,10 @@ virtual NCMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label ); virtual NCImage * createImage ( YWidget * parent, const string & imagePath ); virtual NCLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 ); - virtual NCSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ); + virtual NCMultiSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ); - virtual YPackageSelector * createPackageSelector ( YWidget * parent ); - virtual YPkgSpecial * createPkgSpecial ( YWidget * parent ); // NCurses only, will throw exception in the Qt UI + virtual YPackageSelector * createPackageSelector ( YWidget * parent ); + virtual YWidget * createPkgSpecial ( YWidget * parent ); // NCurses only, will throw exception in the Qt UI // // Layout Helpers 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original) +++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Thu Jul 19 15:19:22 2007 @@ -414,13 +414,6 @@ return new NCLabel( parent, text, isHeading, isOutputField ); } -YWidget * YNCursesUI::createRichText( YWidget * parent, YWidgetOpt & opt, - const YCPString & text ) -{ - ONCREATE; - return new NCRichText( parent, opt, text ); -} - YWidget * YNCursesUI::createLogView( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, 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=39540&r1=39539&r2=39540&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original) +++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Thu Jul 19 15:19:22 2007 @@ -205,13 +205,6 @@ bool isHeading, bool isOutputField ); /** - * Creates a rich text widget - * @param text Initial text of the label - */ - virtual YWidget * createRichText( YWidget * parent, YWidgetOpt & opt, - const YCPString & text ); - - /** * Creates a log view widget * @param label label above the log view * @param visibleLines default number of vislible lines 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=39540&r1=39539&r2=39540&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 19 15:19:22 2007 @@ -95,7 +95,7 @@ // add the rich text widget for the package description opt.isVStretchable.setValue( true ); - descrText = new NCRichText( split, opt, YCPString( "" ) ); + descrText = new NCRichText( split, "" ); //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) ); new NCSpacing( split, YD_VERT, true, 0.6 ); // stretchable = true -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org