summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stockticker/helpwindow.cpp19
-rw-r--r--noncore/todayplugins/stockticker/stockticker/inputDialog.cpp2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp4
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp13
4 files changed, 0 insertions, 38 deletions
diff --git a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
index 33dcac0..23e78f2 100644
--- a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
+++ b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp
@@ -1,132 +1,113 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of an example program for Qt. This example 6** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 7** program may be used, distributed and modified without limitation.
8** 8**
9*****************************************************************************/ 9*****************************************************************************/
10 10
11#include "helpwindow.h" 11#include "helpwindow.h"
12#include <qstatusbar.h> 12#include <qstatusbar.h>
13#include <qstringlist.h>
14 13
15#include <qpixmap.h>
16#include <qpopupmenu.h>
17#include <qmenubar.h> 14#include <qmenubar.h>
18#include <qtoolbar.h> 15#include <qtoolbar.h>
19#include <qtoolbutton.h> 16#include <qtoolbutton.h>
20#include <qiconset.h>
21#include <qfile.h>
22#include <qtextstream.h>
23#include <qstylesheet.h>
24#include <qmessagebox.h>
25#include <qfiledialog.h>
26#include <qapplication.h>
27#include <qcombobox.h> 17#include <qcombobox.h>
28#include <qevent.h>
29#include <qlineedit.h>
30#include <qobjectlist.h>
31#include <qfileinfo.h>
32#include <qfile.h>
33#include <qdatastream.h>
34#include <qprinter.h>
35#include <qsimplerichtext.h>
36#include <qpaintdevicemetrics.h>
37 18
38#include <ctype.h> 19#include <ctype.h>
39 20
40HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) 21HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name )
41 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() 22 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL()
42{ 23{
43 readHistory(); 24 readHistory();
44 readBookmarks(); 25 readBookmarks();
45 26
46 browser = new QTextBrowser( this ); 27 browser = new QTextBrowser( this );
47 QStringList Strlist; 28 QStringList Strlist;
48 Strlist.append( home_); 29 Strlist.append( home_);
49 30
50 browser->mimeSourceFactory()->setFilePath( Strlist ); 31 browser->mimeSourceFactory()->setFilePath( Strlist );
51 32
52 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 33 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
53 34
54 connect( browser, SIGNAL( textChanged() ), 35 connect( browser, SIGNAL( textChanged() ),
55 36
56 this, SLOT( textChanged() ) ); 37 this, SLOT( textChanged() ) );
57 38
58 setCentralWidget( browser ); 39 setCentralWidget( browser );
59 40
60 if ( !home_.isEmpty() ) 41 if ( !home_.isEmpty() )
61 42
62//////////////////////////////// 43////////////////////////////////
63 browser->setSource( home_ ); 44 browser->setSource( home_ );
64 45
65//////////////////////////////// 46////////////////////////////////
66 connect( browser, SIGNAL( highlighted( const QString&) ), 47 connect( browser, SIGNAL( highlighted( const QString&) ),
67 statusBar(), SLOT( message( const QString&)) ); 48 statusBar(), SLOT( message( const QString&)) );
68 49
69 setGeometry( 0,0,236,280); 50 setGeometry( 0,0,236,280);
70 51
71 QPopupMenu* file = new QPopupMenu( this ); 52 QPopupMenu* file = new QPopupMenu( this );
72// file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); 53// file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N );
73 file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); 54 file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O );
74// file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); 55// file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P );
75 file->insertSeparator(); 56 file->insertSeparator();
76 file->insertItem( tr("&Close"), this, SLOT( close() ), ALT | Key_Q ); 57 file->insertItem( tr("&Close"), this, SLOT( close() ), ALT | Key_Q );
77// file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), ALT | Key_X ); 58// file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), ALT | Key_X );
78 59
79 // The same three icons are used twice each. 60 // The same three icons are used twice each.
80////F FIXME 61////F FIXME
81 QString pixs=(QDir::homeDirPath ()) +"/Applications/gutenbrowser/pix/"; 62 QString pixs=(QDir::homeDirPath ()) +"/Applications/gutenbrowser/pix/";
82 QIconSet icon_back( QPixmap(pixs+"back.png") ); 63 QIconSet icon_back( QPixmap(pixs+"back.png") );
83 QIconSet icon_forward( QPixmap(pixs+"forward.png") ); 64 QIconSet icon_forward( QPixmap(pixs+"forward.png") );
84 QIconSet icon_home( QPixmap(pixs+"home.png") ); 65 QIconSet icon_home( QPixmap(pixs+"home.png") );
85 66
86 QPopupMenu* go = new QPopupMenu( this ); 67 QPopupMenu* go = new QPopupMenu( this );
87 backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), ALT | Key_Left ); 68 backwardId = go->insertItem( icon_back, tr("&Backward"), browser, SLOT( backward() ), ALT | Key_Left );
88 forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), ALT | Key_Right ); 69 forwardId = go->insertItem( icon_forward, tr("&Forward"), browser, SLOT( forward() ), ALT | Key_Right );
89 go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) ); 70 go->insertItem( icon_home, tr("&Home"), browser, SLOT( home() ) );
90 71
91 72
92 hist = new QPopupMenu( this ); 73 hist = new QPopupMenu( this );
93 QStringList::Iterator it = history.begin(); 74 QStringList::Iterator it = history.begin();
94 for ( ; it != history.end(); ++it ) 75 for ( ; it != history.end(); ++it )
95 mHistory[ hist->insertItem( *it ) ] = *it; 76 mHistory[ hist->insertItem( *it ) ] = *it;
96 connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) ); 77 connect( hist, SIGNAL( activated( int ) ), this, SLOT( histChosen( int ) ) );
97 78
98 bookm = new QPopupMenu( this ); 79 bookm = new QPopupMenu( this );
99 bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) ); 80 bookm->insertItem( tr( "Add Bookmark" ), this, SLOT( addBookmark() ) );
100 bookm->insertSeparator(); 81 bookm->insertSeparator();
101 82
102 QStringList::Iterator it2 = bookmarks.begin(); 83 QStringList::Iterator it2 = bookmarks.begin();
103 for ( ; it2 != bookmarks.end(); ++it2 ) 84 for ( ; it2 != bookmarks.end(); ++it2 )
104 mBookmarks[ bookm->insertItem( *it2 ) ] = *it2; 85 mBookmarks[ bookm->insertItem( *it2 ) ] = *it2;
105 connect( bookm, SIGNAL( activated( int ) ), 86 connect( bookm, SIGNAL( activated( int ) ),
106 this, SLOT( bookmChosen( int ) ) ); 87 this, SLOT( bookmChosen( int ) ) );
107 88
108 menuBar()->insertItem( tr("&File"), file ); 89 menuBar()->insertItem( tr("&File"), file );
109 menuBar()->insertItem( tr("&Go"), go ); 90 menuBar()->insertItem( tr("&Go"), go );
110 menuBar()->insertItem( tr( "History" ), hist ); 91 menuBar()->insertItem( tr( "History" ), hist );
111 menuBar()->insertItem( tr( "Bookmarks" ), bookm ); 92 menuBar()->insertItem( tr( "Bookmarks" ), bookm );
112// menuBar()->insertSeparator(); 93// menuBar()->insertSeparator();
113// menuBar()->insertItem( tr("&Help"), help ); 94// menuBar()->insertItem( tr("&Help"), help );
114 95
115 menuBar()->setItemEnabled( forwardId, FALSE); 96 menuBar()->setItemEnabled( forwardId, FALSE);
116 menuBar()->setItemEnabled( backwardId, FALSE); 97 menuBar()->setItemEnabled( backwardId, FALSE);
117 connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) ); 98 connect( browser, SIGNAL( backwardAvailable( bool ) ), this, SLOT( setBackwardAvailable( bool ) ) );
118 connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) ); 99 connect( browser, SIGNAL( forwardAvailable( bool ) ), this, SLOT( setForwardAvailable( bool ) ) );
119 100
120 101
121 QToolBar* toolbar = new QToolBar( this ); 102 QToolBar* toolbar = new QToolBar( this );
122 addToolBar( toolbar, "Toolbar"); 103 addToolBar( toolbar, "Toolbar");
123 QToolButton* button; 104 QToolButton* button;
124 105
125 button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar ); 106 button = new QToolButton( icon_back, tr("Backward"), "", browser, SLOT(backward()), toolbar );
126 connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); 107 connect( browser, SIGNAL( backwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) );
127 button->setEnabled( FALSE ); 108 button->setEnabled( FALSE );
128 button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar ); 109 button = new QToolButton( icon_forward, tr("Forward"), "", browser, SLOT(forward()), toolbar );
129 connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) ); 110 connect( browser, SIGNAL( forwardAvailable(bool) ), button, SLOT( setEnabled(bool) ) );
130 button->setEnabled( FALSE ); 111 button->setEnabled( FALSE );
131 button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar ); 112 button = new QToolButton( icon_home, tr("Home"), "", browser, SLOT(home()), toolbar );
132 113
diff --git a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
index 18021c2..42a3885 100644
--- a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
+++ b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
@@ -1,89 +1,87 @@
1#include "inputDialog.h" 1#include "inputDialog.h"
2 2
3#include <qapplication.h> 3#include <qapplication.h>
4 4
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qlayout.h>
7#include <qlineedit.h> 6#include <qlineedit.h>
8#include <qlayout.h>
9#include <qvariant.h> 7#include <qvariant.h>
10#include <qpushbutton.h> 8#include <qpushbutton.h>
11#include <qwhatsthis.h> 9#include <qwhatsthis.h>
12#include <qlabel.h> 10#include <qlabel.h>
13#include <qpe/config.h> 11#include <qpe/config.h>
14#include <qstringlist.h> 12#include <qstringlist.h>
15#include <qmainwindow.h> 13#include <qmainwindow.h>
16#include "helpwindow.h" 14#include "helpwindow.h"
17 15
18#include <opie/oprocess.h> 16#include <opie/oprocess.h>
19 17
20#include <stdlib.h> 18#include <stdlib.h>
21// #include <sys/stat.h> 19// #include <sys/stat.h>
22// #include <unistd.h> 20// #include <unistd.h>
23 21
24InputDialog::InputDialog( ) 22InputDialog::InputDialog( )
25 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) { 23 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) {
26 setCaption( tr("Symbol Lookup")); 24 setCaption( tr("Symbol Lookup"));
27 25
28 QGridLayout *layout = new QGridLayout( this ); 26 QGridLayout *layout = new QGridLayout( this );
29 layout->setSpacing(6); 27 layout->setSpacing(6);
30 layout->setMargin( 2); 28 layout->setMargin( 2);
31 29
32 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 30 LineEdit1 = new QLineEdit( this, "LineEdit1" );
33 LineEdit1->setFocus(); 31 LineEdit1->setFocus();
34 32
35 layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 3); 33 layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 3);
36 34
37 QLabel *label; 35 QLabel *label;
38 label = new QLabel(this); 36 label = new QLabel(this);
39 label->setText( tr("Enter something to lookup / search.")); 37 label->setText( tr("Enter something to lookup / search."));
40 label->setMaximumHeight(60); 38 label->setMaximumHeight(60);
41 layout->addMultiCellWidget( label, 1, 1, 0, 3); 39 layout->addMultiCellWidget( label, 1, 1, 0, 3);
42 40
43 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(doLookup())); 41 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(doLookup()));
44 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); 42 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
45 layout->addItem( spacer, 8, 0 ); 43 layout->addItem( spacer, 8, 0 );
46 44
47} 45}
48 46
49InputDialog::~InputDialog() { 47InputDialog::~InputDialog() {
50} 48}
51 49
52void InputDialog::doLookup() { 50void InputDialog::doLookup() {
53// http://finance.yahoo.com/l?m=&s=siemens&t= 51// http://finance.yahoo.com/l?m=&s=siemens&t=
54 52
55 QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\""; 53 QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\"";
56 QString tempHtml = "/tmp/stockticker.html"; 54 QString tempHtml = "/tmp/stockticker.html";
57 QString cmd = "wget -O "+tempHtml+" "+url; 55 QString cmd = "wget -O "+tempHtml+" "+url;
58 qDebug(cmd); 56 qDebug(cmd);
59 57
60 58
61/* 59/*
62 OProcess proc; 60 OProcess proc;
63 proc << "/usr/bin/wget"; 61 proc << "/usr/bin/wget";
64 proc<<"-O"<< tempHtml<< url; 62 proc<<"-O"<< tempHtml<< url;
65 63
66 connect( &proc, SIGNAL( processExited( OProcess *)),this, SLOT( showBrowser(OProcess *))); 64 connect( &proc, SIGNAL( processExited( OProcess *)),this, SLOT( showBrowser(OProcess *)));
67 proc.start( OProcess::NotifyOnExit); 65 proc.start( OProcess::NotifyOnExit);
68*/ 66*/
69 system(cmd.latin1()); 67 system(cmd.latin1());
70 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); 68 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
71 StockLookup->setCaption("Symbol"); 69 StockLookup->setCaption("Symbol");
72 StockLookup->showMaximized(); 70 StockLookup->showMaximized();
73 StockLookup->show(); 71 StockLookup->show();
74 LineEdit1->text(); 72 LineEdit1->text();
75 73
76 74
77} 75}
78 76
79void InputDialog::showBrowser(OProcess*) { 77void InputDialog::showBrowser(OProcess*) {
80 qDebug("BLAH"); 78 qDebug("BLAH");
81 QString tempHtml = "/tmp/stockticker.html"; 79 QString tempHtml = "/tmp/stockticker.html";
82 80
83 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); 81 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
84 StockLookup->setCaption("Symbol"); 82 StockLookup->setCaption("Symbol");
85 StockLookup->showMaximized(); 83 StockLookup->showMaximized();
86 StockLookup->show(); 84 StockLookup->show();
87 LineEdit1->text(); 85 LineEdit1->text();
88 86
89} 87}
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp
index fdabd5c..e3d378b 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp
@@ -1,129 +1,125 @@
1/* 1/*
2 * stocktickeRconfig.cpp 2 * stocktickeRconfig.cpp
3 * 3 *
4 * copyright : (c) 2002 by ljp 4 * copyright : (c) 2002 by ljp
5 * email : llornkcor@handhelds.org 5 * email : llornkcor@handhelds.org
6 * 6 *
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 "stocktickerconfig.h" 17#include "stocktickerconfig.h"
18#include <opie/todayconfigwidget.h> 18#include <opie/todayconfigwidget.h>
19 19
20#include <qpe/config.h>
21 20
22#include <qapplication.h> 21#include <qapplication.h>
23 22
24#include <qspinbox.h> 23#include <qspinbox.h>
25#include <qcheckbox.h> 24#include <qcheckbox.h>
26#include <qlayout.h>
27#include <qlineedit.h> 25#include <qlineedit.h>
28#include <qlayout.h>
29#include <qvariant.h> 26#include <qvariant.h>
30#include <qpushbutton.h> 27#include <qpushbutton.h>
31#include <qwhatsthis.h> 28#include <qwhatsthis.h>
32#include <qlabel.h> 29#include <qlabel.h>
33#include <qpe/config.h>
34#include <qstringlist.h> 30#include <qstringlist.h>
35#include <qmainwindow.h> 31#include <qmainwindow.h>
36 32
37#include <stdlib.h> 33#include <stdlib.h>
38 34
39StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char* name) 35StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char* name)
40 : TodayConfigWidget(parent, name ) { 36 : TodayConfigWidget(parent, name ) {
41 37
42 QGridLayout *layout = new QGridLayout( this ); 38 QGridLayout *layout = new QGridLayout( this );
43 layout->setSpacing(2); 39 layout->setSpacing(2);
44 layout->setMargin( 2); 40 layout->setMargin( 2);
45 41
46 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 42 LineEdit1 = new QLineEdit( this, "LineEdit1" );
47 LineEdit1->setFocus(); 43 LineEdit1->setFocus();
48// QWhatsThis::add( LineEdit1, tr("Enter the stock symbols you want to be shown here.")); 44// QWhatsThis::add( LineEdit1, tr("Enter the stock symbols you want to be shown here."));
49 45
50 layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 4); 46 layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 4);
51 47
52 Config cfg( "stockticker"); 48 Config cfg( "stockticker");
53 cfg.setGroup( "Symbols" ); 49 cfg.setGroup( "Symbols" );
54 QString symbollist; 50 QString symbollist;
55 symbollist = cfg.readEntry("Symbols", ""); 51 symbollist = cfg.readEntry("Symbols", "");
56 LineEdit1->setText(symbollist); 52 LineEdit1->setText(symbollist);
57 53
58 QLabel *label; 54 QLabel *label;
59 label = new QLabel(this); 55 label = new QLabel(this);
60 label->setText( tr("Enter stock symbols seperated\nby a space.")); 56 label->setText( tr("Enter stock symbols seperated\nby a space."));
61 label->setMaximumHeight(60); 57 label->setMaximumHeight(60);
62 layout->addMultiCellWidget( label, 1, 1, 0, 4); 58 layout->addMultiCellWidget( label, 1, 1, 0, 4);
63 59
64 cfg.setGroup( "Fields" ); 60 cfg.setGroup( "Fields" );
65 61
66 timeCheck= new QCheckBox ( "Time",this ); 62 timeCheck= new QCheckBox ( "Time",this );
67 timeCheck->setChecked( cfg.readBoolEntry("timeCheck",1)); 63 timeCheck->setChecked( cfg.readBoolEntry("timeCheck",1));
68 layout->addMultiCellWidget(timeCheck, 2, 2, 0, 0 ); 64 layout->addMultiCellWidget(timeCheck, 2, 2, 0, 0 );
69 QWhatsThis::add( timeCheck, tr("Toggles Time of current price field")); 65 QWhatsThis::add( timeCheck, tr("Toggles Time of current price field"));
70 66
71 dateCheck= new QCheckBox ( "Date", this ); 67 dateCheck= new QCheckBox ( "Date", this );
72 dateCheck->setChecked( cfg.readBoolEntry("dateCheck",1)); 68 dateCheck->setChecked( cfg.readBoolEntry("dateCheck",1));
73 layout->addMultiCellWidget( dateCheck, 2, 2, 1, 1 ); 69 layout->addMultiCellWidget( dateCheck, 2, 2, 1, 1 );
74 QWhatsThis::add(dateCheck, tr("Toggles date field")); 70 QWhatsThis::add(dateCheck, tr("Toggles date field"));
75 71
76 symbolCheck= new QCheckBox ( "Symbol", this ); 72 symbolCheck= new QCheckBox ( "Symbol", this );
77 symbolCheck->setChecked( cfg.readBoolEntry("symbolCheck",1)); 73 symbolCheck->setChecked( cfg.readBoolEntry("symbolCheck",1));
78 layout->addMultiCellWidget( symbolCheck, 2, 2, 2, 2 ); 74 layout->addMultiCellWidget( symbolCheck, 2, 2, 2, 2 );
79 QWhatsThis::add(symbolCheck, tr("Toggles Symbol field")); 75 QWhatsThis::add(symbolCheck, tr("Toggles Symbol field"));
80 76
81 nameCheck= new QCheckBox ( "Name", this ); 77 nameCheck= new QCheckBox ( "Name", this );
82 nameCheck->setChecked( cfg.readBoolEntry("nameCheck",1)); 78 nameCheck->setChecked( cfg.readBoolEntry("nameCheck",1));
83 layout->addMultiCellWidget( nameCheck, 3, 3, 0, 0 ); 79 layout->addMultiCellWidget( nameCheck, 3, 3, 0, 0 );
84 QWhatsThis::add(nameCheck, tr("Toggles Name of symbols owner field")); 80 QWhatsThis::add(nameCheck, tr("Toggles Name of symbols owner field"));
85 81
86 currentPriceCheck= new QCheckBox ( "Price", this ); 82 currentPriceCheck= new QCheckBox ( "Price", this );
87 currentPriceCheck->setChecked( cfg.readBoolEntry("currentPriceCheck",1)); 83 currentPriceCheck->setChecked( cfg.readBoolEntry("currentPriceCheck",1));
88 layout->addMultiCellWidget( currentPriceCheck, 3, 3, 1, 1 ); 84 layout->addMultiCellWidget( currentPriceCheck, 3, 3, 1, 1 );
89 QWhatsThis::add(currentPriceCheck, tr("Toggles current Price field")); 85 QWhatsThis::add(currentPriceCheck, tr("Toggles current Price field"));
90 86
91 lastPriceCheck= new QCheckBox ( "Last Price", this ); 87 lastPriceCheck= new QCheckBox ( "Last Price", this );
92 lastPriceCheck->setChecked( cfg.readBoolEntry("lastPriceCheck",1)); 88 lastPriceCheck->setChecked( cfg.readBoolEntry("lastPriceCheck",1));
93 layout->addMultiCellWidget(lastPriceCheck, 3, 3, 2, 2); 89 layout->addMultiCellWidget(lastPriceCheck, 3, 3, 2, 2);
94 QWhatsThis::add(lastPriceCheck, tr("Toggles last price field")); 90 QWhatsThis::add(lastPriceCheck, tr("Toggles last price field"));
95 91
96 openPriceCheck= new QCheckBox ( "Open Price", this); 92 openPriceCheck= new QCheckBox ( "Open Price", this);
97 openPriceCheck->setChecked( cfg.readBoolEntry("openPriceCheck",1)); 93 openPriceCheck->setChecked( cfg.readBoolEntry("openPriceCheck",1));
98 layout->addMultiCellWidget( openPriceCheck, 4, 4, 0, 0 ); 94 layout->addMultiCellWidget( openPriceCheck, 4, 4, 0, 0 );
99 QWhatsThis::add(openPriceCheck, tr("Toggles opening price field")); 95 QWhatsThis::add(openPriceCheck, tr("Toggles opening price field"));
100 96
101 minPriceCheck= new QCheckBox ( "Min Price", this ); 97 minPriceCheck= new QCheckBox ( "Min Price", this );
102 minPriceCheck->setChecked( cfg.readBoolEntry("minPriceCheck",1)); 98 minPriceCheck->setChecked( cfg.readBoolEntry("minPriceCheck",1));
103 layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1); 99 layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1);
104 QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field")); 100 QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field"));
105 101
106 maxPriceCheck= new QCheckBox ( "Max Price", this); 102 maxPriceCheck= new QCheckBox ( "Max Price", this);
107 maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1)); 103 maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1));
108 layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 ); 104 layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 );
109 QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field")); 105 QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field"));
110 106
111 variationCheck= new QCheckBox ( "Variation", this ); 107 variationCheck= new QCheckBox ( "Variation", this );
112 variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1)); 108 variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1));
113 layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 ); 109 layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 );
114 QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field")); 110 QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field"));
115 111
116 volumeCheck= new QCheckBox ( "Volume", this ); 112 volumeCheck= new QCheckBox ( "Volume", this );
117 volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1)); 113 volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1));
118 layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1); 114 layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1);
119 QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field")); 115 QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field"));
120 116
121 timerDelaySpin = new QSpinBox( this, "timer spin" ); 117 timerDelaySpin = new QSpinBox( this, "timer spin" );
122 QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) ); 118 QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) );
123 timerDelaySpin->setMaxValue( 60); 119 timerDelaySpin->setMaxValue( 60);
124 120
125 cfg.setGroup("Timer"); 121 cfg.setGroup("Timer");
126 timerDelaySpin->setValue( cfg.readNumEntry("Delay",0)); 122 timerDelaySpin->setValue( cfg.readNumEntry("Delay",0));
127 layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0); 123 layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0);
128 124
129 QLabel *label2; 125 QLabel *label2;
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index a740b58..c3ca52d 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -1,128 +1,115 @@
1/* 1/*
2 * stocktickerpluginwidget.cpp 2 * stocktickerpluginwidget.cpp
3 * 3 *
4 * copyright : (c) 2002 by L.J. Potter 4 * copyright : (c) 2002 by L.J. Potter
5 * email : llornkcor@handhelds.org 5 * email : llornkcor@handhelds.org
6 * 6 *
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 <qsocket.h>
18#include <qvaluelist.h>
19#include <qtl.h>
20#include <qstring.h>
21#include <qstringlist.h>
22#include <qobject.h>
23#include <qlayout.h> 17#include <qlayout.h>
24#include <qlineedit.h>
25#include <qregexp.h>
26#include <qtimer.h>
27#include <qmessagebox.h>
28 18
29#include <qpe/config.h> 19#include <qpe/config.h>
30#include <qpe/timestring.h>
31#include <qpe/qcopenvelope_qws.h>
32#include <qpe/network.h>
33 20
34#include <opie/oticker.h> 21#include <opie/oticker.h>
35 22
36extern "C" { 23extern "C" {
37#include "libstocks/stocks.h" 24#include "libstocks/stocks.h"
38} 25}
39 26
40#include <pthread.h> 27#include <pthread.h>
41 28
42#include "stocktickerpluginwidget.h" 29#include "stocktickerpluginwidget.h"
43 30
44QString output; 31QString output;
45OTicker *stocktickerTicker; 32OTicker *stocktickerTicker;
46 33
47void getStocks(char *blah) { 34void getStocks(char *blah) {
48 35
49// stocktickerTicker->setText( "Downloading stock data."); 36// stocktickerTicker->setText( "Downloading stock data.");
50 stock *stocks_quotes=NULL; 37 stock *stocks_quotes=NULL;
51 stock *stocks_tmp; 38 stock *stocks_tmp;
52 QCString stock_liste = blah; 39 QCString stock_liste = blah;
53 ::free ( blah ); 40 ::free ( blah );
54 // char *stock_liste = (char *)blah->latin1(); 41 // char *stock_liste = (char *)blah->latin1();
55 qDebug("%s", stock_liste.data() ); 42 qDebug("%s", stock_liste.data() );
56 QString tempString; 43 QString tempString;
57 output = ""; 44 output = "";
58 45
59 libstocks_return_code error; 46 libstocks_return_code error;
60 47
61 Config cfg( "stockticker"); 48 Config cfg( "stockticker");
62 cfg.setGroup( "Fields" ); 49 cfg.setGroup( "Fields" );
63 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck; 50 bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
64 bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck; 51 bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck;
65 bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck; 52 bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck;
66 53
67 dotimeCheck=dodateCheck=dosymbolCheck=donameCheck= docurrentPriceCheck=dolastPriceCheck=doopenPriceCheck=dominPriceCheck=domaxPriceCheck=dovariationCheck=dovolumeCheck=false; 54 dotimeCheck=dodateCheck=dosymbolCheck=donameCheck= docurrentPriceCheck=dolastPriceCheck=doopenPriceCheck=dominPriceCheck=domaxPriceCheck=dovariationCheck=dovolumeCheck=false;
68 55
69 dotimeCheck=cfg.readBoolEntry("timeCheck",1); 56 dotimeCheck=cfg.readBoolEntry("timeCheck",1);
70 dodateCheck=cfg.readBoolEntry("dateCheck",1); 57 dodateCheck=cfg.readBoolEntry("dateCheck",1);
71 dosymbolCheck=cfg.readBoolEntry("symbolCheck",1); 58 dosymbolCheck=cfg.readBoolEntry("symbolCheck",1);
72 donameCheck=cfg.readBoolEntry("nameCheck",1); 59 donameCheck=cfg.readBoolEntry("nameCheck",1);
73 docurrentPriceCheck=cfg.readBoolEntry("currentPriceCheck",1); 60 docurrentPriceCheck=cfg.readBoolEntry("currentPriceCheck",1);
74 dolastPriceCheck=cfg.readBoolEntry("lastPriceCheck",1); 61 dolastPriceCheck=cfg.readBoolEntry("lastPriceCheck",1);
75 doopenPriceCheck=cfg.readBoolEntry("openPriceCheck",1); 62 doopenPriceCheck=cfg.readBoolEntry("openPriceCheck",1);
76 dominPriceCheck=cfg.readBoolEntry("minPriceCheck",1); 63 dominPriceCheck=cfg.readBoolEntry("minPriceCheck",1);
77 domaxPriceCheck=cfg.readBoolEntry("maxPriceCheck",1); 64 domaxPriceCheck=cfg.readBoolEntry("maxPriceCheck",1);
78 dovariationCheck=cfg.readBoolEntry("variationCheck",1); 65 dovariationCheck=cfg.readBoolEntry("variationCheck",1);
79 dovolumeCheck=cfg.readBoolEntry("volumeCheck",1); 66 dovolumeCheck=cfg.readBoolEntry("volumeCheck",1);
80 67
81// DefProxy(); 68// DefProxy();
82 { 69 {
83 char *proxy; 70 char *proxy;
84 libstocks_return_code error; 71 libstocks_return_code error;
85 72
86 /* Proxy support */ 73 /* Proxy support */
87 /* Checks for "http_proxy" environment variable */ 74 /* Checks for "http_proxy" environment variable */
88 proxy = getenv("http_proxy"); 75 proxy = getenv("http_proxy");
89 if(proxy) { 76 if(proxy) {
90 /* printf("proxy set\n"); */ 77 /* printf("proxy set\n"); */
91 error = set_proxy(proxy); 78 error = set_proxy(proxy);
92 if (error) { 79 if (error) {
93 printf("Proxy error (%d)\n", error); 80 printf("Proxy error (%d)\n", error);
94 QString tempString; 81 QString tempString;
95 tempString.sprintf("Proxy error (%d)\n", error); 82 tempString.sprintf("Proxy error (%d)\n", error);
96 output = tempString; 83 output = tempString;
97 return; 84 return;
98// exit(1); 85// exit(1);
99 } 86 }
100 } 87 }
101 } 88 }
102// char *stock_liste = (char *)blah; 89// char *stock_liste = (char *)blah;
103 /* Get the stocks and process errors */ 90 /* Get the stocks and process errors */
104 error = get_stocks( stock_liste.data(), &stocks_quotes); 91 error = get_stocks( stock_liste.data(), &stocks_quotes);
105 92
106 if (error) { 93 if (error) {
107 printf("Error in getting stocks (%d)\n", error); 94 printf("Error in getting stocks (%d)\n", error);
108 tempString.sprintf("Error in getting stocks (%d)\n", error); 95 tempString.sprintf("Error in getting stocks (%d)\n", error);
109 output =tempString; 96 output =tempString;
110 return; 97 return;
111// exit(1); 98// exit(1);
112 } 99 }
113 100
114 stocks_tmp = stocks_quotes; 101 stocks_tmp = stocks_quotes;
115 102
116 /* Displays the stocks */ 103 /* Displays the stocks */
117 while(stocks_tmp!=0){ 104 while(stocks_tmp!=0){
118 105
119 if (stocks_tmp->Time) { 106 if (stocks_tmp->Time) {
120// printf("%s ", stocks_tmp->Time); 107// printf("%s ", stocks_tmp->Time);
121 tempString.sprintf("| %s ", stocks_tmp->Time); 108 tempString.sprintf("| %s ", stocks_tmp->Time);
122 tempString.replace(QRegExp("\""),""); 109 tempString.replace(QRegExp("\""),"");
123 if( dotimeCheck) 110 if( dotimeCheck)
124 output +=tempString; 111 output +=tempString;
125 } 112 }
126 if (stocks_tmp->Date) { 113 if (stocks_tmp->Date) {
127// printf("%s ", stocks_tmp->Date); 114// printf("%s ", stocks_tmp->Date);
128 tempString.sprintf("| %s ", stocks_tmp->Date); 115 tempString.sprintf("| %s ", stocks_tmp->Date);