author | llornkcor <llornkcor> | 2002-11-10 23:49:18 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 23:49:18 (UTC) |
commit | 38b632ddbe065403b84bf29949941c88f8916d41 (patch) (unidiff) | |
tree | 143f923544f1d33a4c0a4cab820cf20890b0fadd | |
parent | 41c15dff26825ba13233d84583080e6bceee470f (diff) | |
download | opie-38b632ddbe065403b84bf29949941c88f8916d41.zip opie-38b632ddbe065403b84bf29949941c88f8916d41.tar.gz opie-38b632ddbe065403b84bf29949941c88f8916d41.tar.bz2 |
added scroll speed options
4 files changed, 40 insertions, 6 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp index 11b615b..fdabd5c 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp | |||
@@ -103,79 +103,109 @@ StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char* | |||
103 | layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1); | 103 | layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1); |
104 | QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field")); | 104 | QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field")); |
105 | 105 | ||
106 | maxPriceCheck= new QCheckBox ( "Max Price", this); | 106 | maxPriceCheck= new QCheckBox ( "Max Price", this); |
107 | maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1)); | 107 | maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1)); |
108 | layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 ); | 108 | layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 ); |
109 | QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field")); | 109 | QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field")); |
110 | 110 | ||
111 | variationCheck= new QCheckBox ( "Variation", this ); | 111 | variationCheck= new QCheckBox ( "Variation", this ); |
112 | variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1)); | 112 | variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1)); |
113 | layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 ); | 113 | layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 ); |
114 | QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field")); | 114 | QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field")); |
115 | 115 | ||
116 | volumeCheck= new QCheckBox ( "Volume", this ); | 116 | volumeCheck= new QCheckBox ( "Volume", this ); |
117 | volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1)); | 117 | volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1)); |
118 | layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1); | 118 | layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1); |
119 | QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field")); | 119 | QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field")); |
120 | 120 | ||
121 | timerDelaySpin = new QSpinBox( this, "timer spin" ); | 121 | timerDelaySpin = new QSpinBox( this, "timer spin" ); |
122 | QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) ); | 122 | QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) ); |
123 | timerDelaySpin->setMaxValue( 60); | 123 | timerDelaySpin->setMaxValue( 60); |
124 | 124 | ||
125 | cfg.setGroup("Timer"); | 125 | cfg.setGroup("Timer"); |
126 | timerDelaySpin->setValue( cfg.readNumEntry("Delay",0)); | 126 | timerDelaySpin->setValue( cfg.readNumEntry("Delay",0)); |
127 | layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0); | 127 | layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0); |
128 | 128 | ||
129 | QLabel *label2; | 129 | QLabel *label2; |
130 | label2 = new QLabel(this); | 130 | label2 = new QLabel(this); |
131 | label2->setText( tr("Minutes between lookups.")); | 131 | label2->setText( tr("Minutes between lookups.")); |
132 | label2->setMaximumHeight(60); | 132 | label2->setMaximumHeight(60); |
133 | layout->addMultiCellWidget( label2, 6, 6, 1, 2); | 133 | layout->addMultiCellWidget( label2, 6, 6, 1, 2); |
134 | 134 | ||
135 | scrollSpeed = new QSpinBox( this, "Scrollspin" ); | ||
136 | QWhatsThis::add( timerDelaySpin , tr( "Speed of scrolling action, in milliseconds" ) ); | ||
137 | scrollSpeed->setMaxValue( 1000); | ||
138 | scrollSpeed->setSteps(50,50); | ||
139 | cfg.setGroup("Timer"); | ||
140 | scrollSpeed->setValue( cfg.readNumEntry("ScrollSpeed",50)); | ||
141 | layout->addMultiCellWidget( scrollSpeed , 7, 7, 0, 0); | ||
142 | |||
143 | QLabel *label3; | ||
144 | label3 = new QLabel(this); | ||
145 | label3->setText( tr("Scroll Speed, in milliseconds")); | ||
146 | label3->setMaximumHeight(60); | ||
147 | layout->addMultiCellWidget( label3, 7, 7, 1, 2); | ||
148 | |||
149 | scrollLength = new QSpinBox( this, "ScrollLength" ); | ||
150 | QWhatsThis::add( timerDelaySpin , tr( "Length of scrolling" ) ); | ||
151 | scrollLength->setMaxValue( 10); | ||
152 | // scrollLength->setSteps(5,5); | ||
153 | cfg.setGroup("Timer"); | ||
154 | scrollLength->setValue( cfg.readNumEntry("ScrollLength",1)); | ||
155 | layout->addMultiCellWidget( scrollLength , 8, 8, 0, 0); | ||
156 | |||
157 | QLabel *label4; | ||
158 | label4 = new QLabel(this); | ||
159 | label4->setText( tr("Scroll Length")); | ||
160 | label4->setMaximumHeight(60); | ||
161 | layout->addMultiCellWidget( label4, 8, 8, 1, 2); | ||
162 | |||
135 | // lookupButton = new QPushButton(this, "LookupButton"); | 163 | // lookupButton = new QPushButton(this, "LookupButton"); |
136 | // lookupButton->setText(tr("Symbol Lookup")); | 164 | // lookupButton->setText(tr("Symbol Lookup")); |
137 | // connect(lookupButton,SIGNAL(clicked()),SLOT( doLookup())); | 165 | // connect(lookupButton,SIGNAL(clicked()),SLOT( doLookup())); |
138 | // layout->addMultiCellWidget( lookupButton , 9, 9, 0, 0); | 166 | // layout->addMultiCellWidget( lookupButton , 9, 9, 0, 0); |
139 | 167 | ||
140 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | 168 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); |
141 | layout->addItem( spacer, 8, 0 ); | 169 | layout->addItem( spacer, 9, 0 ); |
142 | 170 | ||
143 | } | 171 | } |
144 | 172 | ||
145 | 173 | ||
146 | void StocktickerPluginConfig::writeConfig() { | 174 | void StocktickerPluginConfig::writeConfig() { |
147 | Config cfg( "stockticker"); | 175 | Config cfg( "stockticker"); |
148 | cfg.setGroup( "Symbols" ); | 176 | cfg.setGroup( "Symbols" ); |
149 | QString outText = text().upper(); | 177 | QString outText = text().upper(); |
150 | outText.stripWhiteSpace(); | 178 | outText.stripWhiteSpace(); |
151 | cfg.writeEntry("Symbols", outText ); | 179 | cfg.writeEntry("Symbols", outText ); |
152 | cfg.setGroup( "Fields" ); | 180 | cfg.setGroup( "Fields" ); |
153 | cfg.writeEntry("timeCheck",timeCheck->isChecked()); | 181 | cfg.writeEntry("timeCheck",timeCheck->isChecked()); |
154 | cfg.writeEntry("dateCheck",dateCheck->isChecked()); | 182 | cfg.writeEntry("dateCheck",dateCheck->isChecked()); |
155 | cfg.writeEntry("symbolCheck",symbolCheck->isChecked()); | 183 | cfg.writeEntry("symbolCheck",symbolCheck->isChecked()); |
156 | cfg.writeEntry("nameCheck",nameCheck->isChecked()); | 184 | cfg.writeEntry("nameCheck",nameCheck->isChecked()); |
157 | cfg.writeEntry("currentPriceCheck",currentPriceCheck->isChecked()); | 185 | cfg.writeEntry("currentPriceCheck",currentPriceCheck->isChecked()); |
158 | cfg.writeEntry("lastPriceCheck",lastPriceCheck->isChecked()); | 186 | cfg.writeEntry("lastPriceCheck",lastPriceCheck->isChecked()); |
159 | cfg.writeEntry("openPriceCheck",openPriceCheck->isChecked()); | 187 | cfg.writeEntry("openPriceCheck",openPriceCheck->isChecked()); |
160 | cfg.writeEntry("minPriceCheck",minPriceCheck->isChecked()); | 188 | cfg.writeEntry("minPriceCheck",minPriceCheck->isChecked()); |
161 | cfg.writeEntry("maxPriceCheck",maxPriceCheck->isChecked()); | 189 | cfg.writeEntry("maxPriceCheck",maxPriceCheck->isChecked()); |
162 | cfg.writeEntry("variationCheck",variationCheck->isChecked()); | 190 | cfg.writeEntry("variationCheck",variationCheck->isChecked()); |
163 | cfg.writeEntry("volumeCheck",volumeCheck->isChecked()); | 191 | cfg.writeEntry("volumeCheck",volumeCheck->isChecked()); |
164 | 192 | ||
165 | cfg.setGroup("Timer"); | 193 | cfg.setGroup("Timer"); |
166 | cfg.writeEntry("Delay",timerDelaySpin->value()); | 194 | cfg.writeEntry("Delay",timerDelaySpin->value()); |
195 | cfg.writeEntry("ScrollLength",scrollLength->value()); | ||
196 | cfg.writeEntry("ScrollSpeed",scrollSpeed->value()); | ||
167 | 197 | ||
168 | cfg.write(); | 198 | cfg.write(); |
169 | } | 199 | } |
170 | 200 | ||
171 | StocktickerPluginConfig::~StocktickerPluginConfig() { | 201 | StocktickerPluginConfig::~StocktickerPluginConfig() { |
172 | } | 202 | } |
173 | 203 | ||
174 | QString StocktickerPluginConfig::text() const { | 204 | QString StocktickerPluginConfig::text() const { |
175 | return LineEdit1->text(); | 205 | return LineEdit1->text(); |
176 | } | 206 | } |
177 | 207 | ||
178 | void StocktickerPluginConfig::doLookup() { | 208 | void StocktickerPluginConfig::doLookup() { |
179 | 209 | ||
180 | system("stockticker"); | 210 | system("stockticker"); |
181 | } | 211 | } |
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.h index 33aed86..2b67a8b 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.h +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.h | |||
@@ -9,38 +9,38 @@ | |||
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 | #ifndef STOCKTICKER_PLUGIN_CONFIG_H | 17 | #ifndef STOCKTICKER_PLUGIN_CONFIG_H |
18 | #define STOCKTICKER_PLUGIN_CONFIG_H | 18 | #define STOCKTICKER_PLUGIN_CONFIG_H |
19 | 19 | ||
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | #include <opie/todayconfigwidget.h> | 21 | #include <opie/todayconfigwidget.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | 23 | ||
24 | class QLineEdit; | 24 | class QLineEdit; |
25 | class QCheckBox; | 25 | class QCheckBox; |
26 | class QPushButton; | 26 | class QPushButton; |
27 | class QCheckBox; | 27 | class QCheckBox; |
28 | class QSpinBox; | 28 | class QSpinBox; |
29 | 29 | ||
30 | class StocktickerPluginConfig : public TodayConfigWidget { | 30 | class StocktickerPluginConfig : public TodayConfigWidget { |
31 | //Q_OBJECT | 31 | //Q_OBJECT |
32 | public: | 32 | public: |
33 | StocktickerPluginConfig( QWidget *parent, const char *name ); | 33 | StocktickerPluginConfig( QWidget *parent, const char *name ); |
34 | ~StocktickerPluginConfig(); | 34 | ~StocktickerPluginConfig(); |
35 | QString text() const; | 35 | QString text() const; |
36 | void writeConfig(); | 36 | void writeConfig(); |
37 | private: | 37 | private: |
38 | QLineEdit* LineEdit1; | 38 | QLineEdit* LineEdit1; |
39 | QCheckBox *timeCheck, *dateCheck, *symbolCheck, *nameCheck, *currentPriceCheck, *lastPriceCheck, *openPriceCheck, *minPriceCheck, *maxPriceCheck, *variationCheck, *volumeCheck; | 39 | QCheckBox *timeCheck, *dateCheck, *symbolCheck, *nameCheck, *currentPriceCheck, *lastPriceCheck, *openPriceCheck, *minPriceCheck, *maxPriceCheck, *variationCheck, *volumeCheck; |
40 | QPushButton *lookupButton; | 40 | QPushButton *lookupButton; |
41 | QSpinBox *timerDelaySpin; | 41 | QSpinBox *timerDelaySpin, *scrollSpeed, *scrollLength; |
42 | private slots: | 42 | private slots: |
43 | void doLookup(); | 43 | void doLookup(); |
44 | 44 | ||
45 | }; | 45 | }; |
46 | #endif | 46 | #endif |
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp index 18c9e51..0d90d0f 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp | |||
@@ -183,102 +183,105 @@ void getStocks( const QString *blah) { | |||
183 | output +=tempString; | 183 | output +=tempString; |
184 | 184 | ||
185 | // printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice); | 185 | // printf("| Min | %-7.2f |\n", stocks_tmp->MinPrice); |
186 | tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice); | 186 | tempString.sprintf("| Min %-7.2f ", stocks_tmp->MinPrice); |
187 | if(dominPriceCheck) | 187 | if(dominPriceCheck) |
188 | output +=tempString; | 188 | output +=tempString; |
189 | 189 | ||
190 | // printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice); | 190 | // printf("| Max | %-7.2f |\n",stocks_tmp->MaxPrice); |
191 | tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice); | 191 | tempString.sprintf("| Max %-7.2f ",stocks_tmp->MaxPrice); |
192 | if(domaxPriceCheck) | 192 | if(domaxPriceCheck) |
193 | output +=tempString; | 193 | output +=tempString; |
194 | 194 | ||
195 | // printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage); | 195 | // printf("| Var | %-6.2f (%5.2f %%) |\n", stocks_tmp->Variation, stocks_tmp->Pourcentage); |
196 | tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage); | 196 | tempString.sprintf("| Var %-6.2f (%5.2f %%) ", stocks_tmp->Variation, stocks_tmp->Pourcentage); |
197 | if(dovariationCheck) | 197 | if(dovariationCheck) |
198 | output +=tempString; | 198 | output +=tempString; |
199 | 199 | ||
200 | // printf("| Volume | %-9d |\n", stocks_tmp->Volume); | 200 | // printf("| Volume | %-9d |\n", stocks_tmp->Volume); |
201 | tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume); | 201 | tempString.sprintf("| Volume %-9d ", stocks_tmp->Volume); |
202 | if(dovolumeCheck) | 202 | if(dovolumeCheck) |
203 | output +=tempString; | 203 | output +=tempString; |
204 | 204 | ||
205 | // printf("----------------------------------------\n\n"); | 205 | // printf("----------------------------------------\n\n"); |
206 | tempString.sprintf("||==++==|"); | 206 | tempString.sprintf("||==++==|"); |
207 | output +=tempString; | 207 | output +=tempString; |
208 | 208 | ||
209 | /* Simple function which help to browse in the stocks list */ | 209 | /* Simple function which help to browse in the stocks list */ |
210 | stocks_tmp = next_stock(stocks_tmp); | 210 | stocks_tmp = next_stock(stocks_tmp); |
211 | } | 211 | } |
212 | 212 | ||
213 | /* frees stocks */ | 213 | /* frees stocks */ |
214 | free_stocks(stocks_quotes); | 214 | free_stocks(stocks_quotes); |
215 | stocktickerTicker->setText( output ); | 215 | stocktickerTicker->setText( output.latin1() ); |
216 | 216 | ||
217 | } | 217 | } |
218 | 218 | ||
219 | StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name) | 219 | StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char* name) |
220 | : QWidget(parent, name ) { | 220 | : QWidget(parent, name ) { |
221 | init(); | 221 | init(); |
222 | startTimer(1000); | 222 | startTimer(1000); |
223 | |||
224 | stocktickerTicker->setTextFormat(Qt::RichText); | ||
223 | // checkConnection(); | 225 | // checkConnection(); |
224 | } | 226 | } |
225 | 227 | ||
226 | StockTickerPluginWidget::~StockTickerPluginWidget() { | 228 | StockTickerPluginWidget::~StockTickerPluginWidget() { |
227 | } | 229 | } |
228 | 230 | ||
229 | void StockTickerPluginWidget::init() { | 231 | void StockTickerPluginWidget::init() { |
230 | 232 | ||
231 | QHBoxLayout* layout = new QHBoxLayout( this ); | 233 | QHBoxLayout* layout = new QHBoxLayout( this ); |
232 | stocktickerTicker = new OTicker(this); | 234 | stocktickerTicker = new OTicker(this); |
233 | // stocktickerTicker->setMinimumHeight(15); | 235 | // stocktickerTicker->setMinimumHeight(15); |
234 | connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( checkConnection() )); | 236 | connect( stocktickerTicker, SIGNAL( mousePressed()), this, SLOT( checkConnection() )); |
235 | layout->addWidget( stocktickerTicker); | 237 | layout->addWidget( stocktickerTicker); |
236 | wasError = true; | 238 | wasError = true; |
237 | } | 239 | } |
238 | 240 | ||
239 | void StockTickerPluginWidget::doStocks() { | 241 | void StockTickerPluginWidget::doStocks() { |
240 | Config cfg( "stockticker"); | 242 | Config cfg( "stockticker"); |
241 | cfg.setGroup( "Symbols" ); | 243 | cfg.setGroup( "Symbols" ); |
242 | symbollist=""; | 244 | symbollist=""; |
243 | symbollist = cfg.readEntry("Symbols", ""); | 245 | symbollist = cfg.readEntry("Symbols", ""); |
244 | symbollist.replace(QRegExp(" "),"+");//seperated by + | 246 | symbollist.replace(QRegExp(" "),"+");//seperated by + |
245 | 247 | ||
246 | // qDebug(symbollist); | 248 | cfg.setGroup("Timer"); |
249 | stocktickerTicker->setUpdateTime( cfg.readNumEntry("ScrollSpeed",50)); | ||
250 | stocktickerTicker->setScrollLength( cfg.readNumEntry("ScrollLength",10)); | ||
251 | |||
247 | if (!symbollist.isEmpty()) { | 252 | if (!symbollist.isEmpty()) { |
248 | pthread_t thread1; | 253 | pthread_t thread1; |
249 | pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist); | 254 | pthread_create(&thread1,NULL, (void * (*)(void *))getStocks, &symbollist); |
250 | } | 255 | } |
251 | // pthread_join(thread1,NULL); | ||
252 | // getStocks( symbollist.latin1() ); | ||
253 | } | 256 | } |
254 | 257 | ||
255 | void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { | 258 | void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { |
256 | killTimer(e->timerId()); | 259 | killTimer(e->timerId()); |
257 | checkConnection(); | 260 | checkConnection(); |
258 | } | 261 | } |
259 | 262 | ||
260 | void StockTickerPluginWidget::checkConnection() { | 263 | void StockTickerPluginWidget::checkConnection() { |
261 | // qDebug("checking connection"); | 264 | // qDebug("checking connection"); |
262 | // Sock = new QSocket( this ); | 265 | // Sock = new QSocket( this ); |
263 | 266 | ||
264 | // if( wasError) | 267 | // if( wasError) |
265 | // stocktickerTicker->setText("Checking connection"); | 268 | // stocktickerTicker->setText("Checking connection"); |
266 | 269 | ||
267 | // if(Sock->state() == QSocket::Idle) { | 270 | // if(Sock->state() == QSocket::Idle) { |
268 | // Sock->connectToHost("finance.yahoo.com", 80); | 271 | // Sock->connectToHost("finance.yahoo.com", 80); |
269 | // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); | 272 | // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); |
270 | // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); | 273 | // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); |
271 | // } else { | 274 | // } else { |
272 | // qDebug("State is not Idle"); | 275 | // qDebug("State is not Idle"); |
273 | isConnected(); | 276 | isConnected(); |
274 | // } | 277 | // } |
275 | } | 278 | } |
276 | 279 | ||
277 | void StockTickerPluginWidget::isConnected() { | 280 | void StockTickerPluginWidget::isConnected() { |
278 | // qDebug("We connect, so ok to grab stocks"); | 281 | // qDebug("We connect, so ok to grab stocks"); |
279 | doStocks(); | 282 | doStocks(); |
280 | 283 | ||
281 | Config cfg( "stockticker"); | 284 | Config cfg( "stockticker"); |
282 | cfg.setGroup("Timer"); | 285 | cfg.setGroup("Timer"); |
283 | timerDelay= cfg.readNumEntry("Delay",0); | 286 | timerDelay= cfg.readNumEntry("Delay",0); |
284 | if(timerDelay > 0) | 287 | if(timerDelay > 0) |
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h index 8776bff..1189bf5 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h | |||
@@ -21,42 +21,43 @@ | |||
21 | #include <qsocket.h> | 21 | #include <qsocket.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | 25 | ||
26 | #include <opie/tododb.h> | 26 | #include <opie/tododb.h> |
27 | #include <opie/oclickablelabel.h> | 27 | #include <opie/oclickablelabel.h> |
28 | #include <opie/oticker.h> | 28 | #include <opie/oticker.h> |
29 | 29 | ||
30 | #include <sys/types.h> | 30 | #include <sys/types.h> |
31 | #include <sys/uio.h> | 31 | #include <sys/uio.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | #include <string.h> | 35 | #include <string.h> |
36 | 36 | ||
37 | class QTimer; | 37 | class QTimer; |
38 | 38 | ||
39 | class StockTickerPluginWidget : public QWidget { | 39 | class StockTickerPluginWidget : public QWidget { |
40 | 40 | ||
41 | Q_OBJECT | 41 | Q_OBJECT |
42 | 42 | ||
43 | public: | 43 | public: |
44 | StockTickerPluginWidget( QWidget *parent, const char *name ); | 44 | StockTickerPluginWidget( QWidget *parent, const char *name ); |
45 | ~StockTickerPluginWidget(); | 45 | ~StockTickerPluginWidget(); |
46 | 46 | ||
47 | protected slots: | 47 | protected slots: |
48 | void doStocks(); | 48 | void doStocks(); |
49 | void isConnected(); | 49 | void isConnected(); |
50 | void socketError(int); | 50 | void socketError(int); |
51 | void checkConnection(); | 51 | void checkConnection(); |
52 | private: | 52 | private: |
53 | int updateSpeed; | ||
53 | QString symbollist; | 54 | QString symbollist; |
54 | bool wasError; | 55 | bool wasError; |
55 | QSocket *Sock; | 56 | QSocket *Sock; |
56 | void timerEvent( QTimerEvent * ); | 57 | void timerEvent( QTimerEvent * ); |
57 | void init(); | 58 | void init(); |
58 | // void DefProxy(void); | 59 | // void DefProxy(void); |
59 | int timerDelay; | 60 | int timerDelay; |
60 | }; | 61 | }; |
61 | 62 | ||
62 | #endif | 63 | #endif |