Author: sh-sh-sh Date: Tue Jul 31 16:25:04 2007 New Revision: 39843 URL: http://svn.opensuse.org/viewcvs/yast?rev=39843&view=rev Log: fixed hyperlinks Modified: branches/tmp/sh/qt4-port/qt/src/YQRichText.cc branches/tmp/sh/qt4-port/qt/src/YQRichText.h Modified: branches/tmp/sh/qt4-port/qt/src/YQRichText.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/qt4-port/qt/src/YQRichText.cc?rev=39843&r1=39842&r2=39843&view=diff ============================================================================== --- branches/tmp/sh/qt4-port/qt/src/YQRichText.cc (original) +++ branches/tmp/sh/qt4-port/qt/src/YQRichText.cc Tue Jul 31 16:25:04 2007 @@ -34,9 +34,9 @@ YQRichText::YQRichText( QWidget * parent, const YWidgetOpt & opt, - const YCPString & ycpText ) + const YCPString & text ) : Q3VBox( parent ) - , YRichText( opt, ycpText ) + , YRichText( opt, text ) { setWidgetRep( this ); @@ -44,20 +44,14 @@ _textBrowser = new QTextBrowser( this ); _textBrowser->setFont( YQUI::ui()->currentFont() ); + _textBrowser->setOpenLinks( false ); _textBrowser->installEventFilter( this ); _plainTextMode = opt.plainTextMode.value(); - QString text = fromUTF8( ycpText->value() ); if ( _plainTextMode ) - { _textBrowser->setLineWrapMode( QTextEdit::NoWrap ); - _textBrowser->setText( text ); - } - else - { - _textBrowser->setHtml( text ); - } + setText( text ); // Set the text foreground color to black, regardless of its current // settings - it might be changed if this widget resides in a @@ -84,8 +78,8 @@ // Propagate clicks on hyperlinks - connect( _textBrowser, SIGNAL( linkClicked( const QString & ) ), - this, SLOT ( linkClicked( const QString & ) ) ); + connect( _textBrowser, SIGNAL( anchorClicked( const QUrl & ) ), + this, SLOT ( linkClicked ( const QUrl & ) ) ); } @@ -141,10 +135,10 @@ } -void YQRichText::linkClicked( const QString & url ) +void YQRichText::linkClicked( const QUrl & url ) { - // y2debug( "Selected hyperlink \"%s\"", (const char *) url ); - YQUI::ui()->sendEvent( new YMenuEvent( YCPString( (const char *) url ) ) ); + // y2debug( "Selected hyperlink \"%s\"", (const char *) url.toString() ); + YQUI::ui()->sendEvent( new YMenuEvent( YCPString( (const char *) url.toString() ) ) ); } Modified: branches/tmp/sh/qt4-port/qt/src/YQRichText.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/qt4-port/qt/src/YQRichText.h?rev=39843&r1=39842&r2=39843&view=diff ============================================================================== --- branches/tmp/sh/qt4-port/qt/src/YQRichText.h (original) +++ branches/tmp/sh/qt4-port/qt/src/YQRichText.h Tue Jul 31 16:25:04 2007 @@ -22,6 +22,7 @@ #define YQRichText_h #include <q3vbox.h> +#include <qurl.h> #include <ycp/YCPString.h> #include "YRichText.h" @@ -88,7 +89,7 @@ /** * Notification that a hyperlink is clicked. **/ - void linkClicked( const QString & url ); + void linkClicked( const QUrl & url ); protected: @@ -103,5 +104,4 @@ }; - #endif // YQRichText_h -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org