[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/kontact/plugins/newsticker
From:       Allen Winter <winter () kde ! org>
Date:       2006-03-15 4:07:35
Message-ID: 1142395655.780213.1329.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 518747 by winterz:

Don't use RichText to display the newsticker summary because too much
horizontal space is used between articles.

Included in this patch is a URL eventFilter that displays statusbar hint
on mouseover.  This is done to make the newsticker summary behavior
consistent with the other component summaries.

BUGS: 120229


 M  +16 -1     summarywidget.cpp  
 M  +2 -3      summarywidget.h  


--- branches/KDE/3.5/kdepim/kontact/plugins/newsticker/summarywidget.cpp #518746:518747
@@ -244,7 +244,9 @@
     int numArticles = 0;
     for ( artIt = articles.begin(); artIt != articles.end() && numArticles < mArticleCount; ++artIt ) {
       urlLabel = new KURLLabel( (*artIt).second.url(), (*artIt).first, mBaseWidget );
-      urlLabel->setTextFormat( RichText );
+      urlLabel->installEventFilter( this );
+      //TODO: RichText causes too much horizontal space between articles
+      //urlLabel->setTextFormat( RichText );
       mLabels.append( urlLabel );
       mLayout->addWidget( urlLabel );
 
@@ -299,4 +301,17 @@
     kapp->clipboard()->setText( url, QClipboard::Clipboard );
 }
 
+bool SummaryWidget::eventFilter( QObject *obj, QEvent* e )
+{
+  if ( obj->inherits( "KURLLabel" ) ) {
+    KURLLabel* label = static_cast<KURLLabel*>( obj );
+    if ( e->type() == QEvent::Enter )
+      emit message( i18n( "Open URL %1" ).arg( label->text() ) );
+    if ( e->type() == QEvent::Leave )
+      emit message( QString::null );
+  }
+
+  return Kontact::Summary::eventFilter( obj, e );
+}
+
 #include "summarywidget.moc"
--- branches/KDE/3.5/kdepim/kontact/plugins/newsticker/summarywidget.h #518746:518747
@@ -62,11 +62,8 @@
     SummaryWidget( QWidget *parent, const char *name = 0 );
 
     int summaryHeight() const;
-
     QStringList configModules() const;
 
-    void updateSummary( bool force = false );
-
   k_dcop:
     /**
      * Inform the newsticker summary widget that an RSSDocument has been updated.
@@ -88,6 +85,7 @@
     void documentUpdateError( DCOPRef ref, int errorCode );
 
   public slots:
+    void updateSummary( bool force = false );
     void configChanged();
 
   protected slots:
@@ -95,6 +93,7 @@
     void rmbMenu( const QString& );
 
   protected:
+    virtual bool eventFilter( QObject *obj, QEvent *e );
     void initDocuments();
     void updateView();
     void readConfig();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic