author | llornkcor <llornkcor> | 2002-10-31 13:57:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-31 13:57:32 (UTC) |
commit | b0687f08f561a879311e934b1d297e2e8c53689f (patch) (side-by-side diff) | |
tree | 6617025864f43dfcf9427a9483df2d8f56e81d09 | |
parent | 74db7535e17fd87d98fc3b82be3a09d5dfbfe292 (diff) | |
download | opie-b0687f08f561a879311e934b1d297e2e8c53689f.zip opie-b0687f08f561a879311e934b1d297e2e8c53689f.tar.gz opie-b0687f08f561a879311e934b1d297e2e8c53689f.tar.bz2 |
no refresh, and Ticker back is users background preference
3 files changed, 10 insertions, 4 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp index 82dfb13..baf8198 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp @@ -8,49 +8,51 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "stocktickerplugin.h" #include "stocktickerpluginwidget.h" StockTickerPlugin::StockTickerPlugin() { } StockTickerPlugin::~StockTickerPlugin() { } QString StockTickerPlugin::pluginName() const { return QObject::tr( "StockTicker plugin" ); } double StockTickerPlugin::versionNumber() const { return 0.6; } QString StockTickerPlugin::pixmapNameWidget() const { return "pass"; } QWidget* StockTickerPlugin::widget( QWidget * wid ) { return new StockTickerPluginWidget( wid, "StockTicker " ); } QString StockTickerPlugin::pixmapNameConfig() const { return 0l; } TodayConfigWidget* StockTickerPlugin::configWidget( QWidget* wid ) { return 0l; } QString StockTickerPlugin::appName() const { return "stockticker"; } - +bool StockTickerPlugin::excludeFromRefresh() const { +return true; +} diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h index 9f174bf..7e7698f 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h @@ -1,47 +1,47 @@ /* * stocktickerplugin.h * * copyright : (c) 2002 by L.J. Potter * email : llornkcor@handhelds.org * */ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef STOCKTICKER_PLUGIN_H #define STOCKTICKER_PLUGIN_H #include <qstring.h> #include <qwidget.h> #include <opie/tododb.h> #include <opie/oclickablelabel.h> #include <opie/todayplugininterface.h> #include <opie/todayconfigwidget.h> class StockTickerPlugin : public TodayPluginObject { public: StockTickerPlugin(); ~StockTickerPlugin(); QString pluginName() const; double versionNumber() const; QString pixmapNameWidget() const; QWidget* widget(QWidget *); QString pixmapNameConfig() const; TodayConfigWidget* configWidget(QWidget *); QString appName() const; - + bool excludeFromRefresh() const; }; #endif diff --git a/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp b/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp index 6e6273b..3bdc820 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp @@ -10,84 +10,88 @@ _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qwidget.h> #include <qpixmap.h> #include <qbutton.h> #include <qpainter.h> #include <qframe.h> #include <qlayout.h> #include <qdir.h> #include <stdlib.h> #include <stdio.h> #include "ticker.h" Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { setFrameStyle( NoFrame/*WinPanel | Sunken */); } Ticker::~Ticker() { } void Ticker::setText( const QString& text ) { - + Config cfg("qpe"); + cfg.setGroup("Appearance"); + pos = 0; // reset it everytime the text is changed scrollText = text; int pixelLen = fontMetrics().width( text ); QPixmap pm( pixelLen, contentsRect().height() ); - pm.fill( QColor( 167, 212, 167 ) ); +// pm.fill( QColor( 167, 212, 167 )); + + pm.fill( QColor( cfg.readEntry( "Background", "#E5E1D5" ) )); QPainter pmp( &pm ); pmp.setPen( Qt::black ); pmp.drawText( 0, 0, pixelLen, contentsRect().height(), AlignVCenter, scrollText ); pmp.end(); scrollTextPixmap = pm; killTimers(); if ( pixelLen > contentsRect().width() ) startTimer( 50 ); update(); } void Ticker::timerEvent( QTimerEvent * ) { pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - 1; repaint( FALSE ); } void Ticker::drawContents( QPainter *p ) { int pixelLen = scrollTextPixmap.width(); p->drawPixmap( pos, contentsRect().y(), scrollTextPixmap ); if ( pixelLen > contentsRect().width() ) // Scrolling p->drawPixmap( pos - pixelLen, contentsRect().y(), scrollTextPixmap ); } void Ticker::mouseReleaseEvent( QMouseEvent * e) { qDebug("<<<<<<<>>>>>>>>>"); emit mousePressed(); } |