summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
Unidiff
Diffstat (limited to 'noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index a7f98be..8830472 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -7,86 +7,80 @@
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include <qvaluelist.h> 17#include <qvaluelist.h>
18#include <qtl.h> 18#include <qtl.h>
19#include <qstring.h> 19#include <qstring.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21#include <qobject.h> 21#include <qobject.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qlineedit.h> 23#include <qlineedit.h>
24#include <qregexp.h> 24#include <qregexp.h>
25#include <qtimer.h> 25#include <qtimer.h>
26 26
27#include <qpe/config.h> 27#include <qpe/config.h>
28#include <qpe/timestring.h> 28#include <qpe/timestring.h>
29#include <qpe/qcopenvelope_qws.h> 29#include <qpe/qcopenvelope_qws.h>
30 30
31#include "ticker.h" 31#include <opie/oticker.h>
32//#include "ticker.h"
32 33
33extern "C" { 34extern "C" {
34#include "libstocks/stocks.h" 35#include "libstocks/stocks.h"
35} 36}
36 37
37#include "stocktickerpluginwidget.h" 38#include "stocktickerpluginwidget.h"
38 39
39StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name) 40StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name)
40 : QWidget(parent, name ) { 41 : QWidget(parent, name ) {
41 init(); 42 init();
42 startTimer(1000); 43 startTimer(1000);
43} 44}
44 45
45StockTickerPluginWidget::~StockTickerPluginWidget() { 46StockTickerPluginWidget::~StockTickerPluginWidget() {
46} 47}
47 48
48void StockTickerPluginWidget::init() { 49void StockTickerPluginWidget::init() {
49 50
50 QHBoxLayout* layout = new QHBoxLayout( this ); 51 QHBoxLayout* layout = new QHBoxLayout( this );
51 52
52 stocktickerTicker = new Ticker(this); 53 stocktickerTicker = new OTicker(this);
53 stocktickerTicker->setMinimumHeight(15); 54 stocktickerTicker->setMinimumHeight(15);
54 connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( doStocks() )); 55 connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( doStocks() ));
55 56
56 layout->addWidget( stocktickerTicker); 57 layout->addWidget( stocktickerTicker);
57// Config cfg( "stockticker");
58// cfg.setGroup("Timer");
59// timerDelay= cfg.readNumEntry("Delay",0);
60// if(timerDelay > 0 )
61// startTimer(timerDelay*60000);
62// qDebug("timer ^ set for %d",(timerDelay*60000)/60000);
63 58
64} 59}
65 60
66void StockTickerPluginWidget::doStocks() { 61void StockTickerPluginWidget::doStocks() {
67 Config cfg( "stockticker"); 62 Config cfg( "stockticker");
68
69 cfg.setGroup( "Symbols" ); 63 cfg.setGroup( "Symbols" );
70 QString symbollist; 64 QString symbollist;
71 symbollist = cfg.readEntry("Symbols", ""); 65 symbollist = cfg.readEntry("Symbols", "");
72 symbollist.replace(QRegExp(" "),"+");//seperated by + 66 symbollist.replace(QRegExp(" "),"+");//seperated by +
73// qDebug(symbollist); 67// qDebug(symbollist);
74 68
75 getStocks( symbollist.latin1()); 69 getStocks( symbollist.latin1());
76 70
77 stocktickerTicker->setText( output ); 71 stocktickerTicker->setText( output );
78} 72}
79 73
80void StockTickerPluginWidget::getStocks( const char *blah) { 74void StockTickerPluginWidget::getStocks( const char *blah) {
81 75
82 stock *stocks_quotes=NULL; 76 stock *stocks_quotes=NULL;
83 stock *stocks_tmp; 77 stock *stocks_tmp;
84 78
85 QString tempString; 79 QString tempString;
86 output = ""; 80 output = "";
87 81
88 libstocks_return_code error; 82 libstocks_return_code error;
89 83
90 Config cfg( "stockticker"); 84 Config cfg( "stockticker");
91 cfg.setGroup( "Fields" ); 85 cfg.setGroup( "Fields" );
92 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck; 86 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;