summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp32
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.h2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp11
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h1
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
@@ -132,13 +132,41 @@ StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char*
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
@@ -164,6 +192,8 @@ void StocktickerPluginConfig::writeConfig() {
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}
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
@@ -38,7 +38,7 @@ 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;
42private slots: 42private slots:
43 void doLookup(); 43 void doLookup();
44 44
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
@@ -212,7 +212,7 @@ void getStocks( const QString *blah) {
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
@@ -220,6 +220,8 @@ StockTickerPluginWidget::StockTickerPluginWidget( QWidget *parent, const char*
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
@@ -243,13 +245,14 @@ void StockTickerPluginWidget::doStocks() {
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
255void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 258void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
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
@@ -50,6 +50,7 @@ protected slots:
50 void socketError(int); 50 void socketError(int);
51 void checkConnection(); 51 void checkConnection();
52private: 52private:
53 int updateSpeed;
53 QString symbollist; 54 QString symbollist;
54 bool wasError; 55 bool wasError;
55 QSocket *Sock; 56 QSocket *Sock;