Diffstat (limited to 'noncore/todayplugins/stockticker/stockticker/inputDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/todayplugins/stockticker/stockticker/inputDialog.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp index ce35256..ae219d7 100644 --- a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp +++ b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp | |||
@@ -1,33 +1,35 @@ | |||
1 | #include "inputDialog.h" | 1 | #include "inputDialog.h" |
2 | #include "helpwindow.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | #include <qpe/config.h> | ||
7 | using namespace Opie::Core; | ||
2 | 8 | ||
9 | /* QT */ | ||
3 | #include <qapplication.h> | 10 | #include <qapplication.h> |
4 | #include <qlayout.h> | 11 | #include <qlayout.h> |
5 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
6 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
7 | #include <qvariant.h> | 14 | #include <qvariant.h> |
8 | #include <qpushbutton.h> | 15 | #include <qpushbutton.h> |
9 | #include <qwhatsthis.h> | 16 | #include <qwhatsthis.h> |
10 | #include <qlabel.h> | 17 | #include <qlabel.h> |
11 | #include <qlayout.h> | 18 | #include <qlayout.h> |
12 | #include <qpe/config.h> | ||
13 | #include <qstringlist.h> | 19 | #include <qstringlist.h> |
14 | using namespace Opie::Core; | ||
15 | using namespace Opie::Core; | ||
16 | #include <qmainwindow.h> | 20 | #include <qmainwindow.h> |
17 | #include "helpwindow.h" | ||
18 | 21 | ||
22 | /* STD */ | ||
19 | #include <stdlib.h> | 23 | #include <stdlib.h> |
20 | // #include <sys/stat.h> | ||
21 | // #include <unistd.h> | ||
22 | 24 | ||
23 | InputDialog::InputDialog( ) | 25 | InputDialog::InputDialog( ) |
24 | : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) { | 26 | : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) { |
25 | setCaption( tr("Symbol Lookup")); | 27 | setCaption( tr("Symbol Lookup")); |
26 | 28 | ||
27 | QGridLayout *layout = new QGridLayout( this ); | 29 | QGridLayout *layout = new QGridLayout( this ); |
28 | layout->setSpacing(6); | 30 | layout->setSpacing(6); |
29 | layout->setMargin( 2); | 31 | layout->setMargin( 2); |
30 | 32 | ||
31 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 33 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
32 | LineEdit1->setFocus(); | 34 | LineEdit1->setFocus(); |
33 | 35 | ||
@@ -45,44 +47,44 @@ InputDialog::InputDialog( ) | |||
45 | 47 | ||
46 | } | 48 | } |
47 | 49 | ||
48 | InputDialog::~InputDialog() { | 50 | InputDialog::~InputDialog() { |
49 | } | 51 | } |
50 | 52 | ||
51 | void InputDialog::doLookup() { | 53 | void InputDialog::doLookup() { |
52 | // http://finance.yahoo.com/l?m=&s=siemens&t= | 54 | // http://finance.yahoo.com/l?m=&s=siemens&t= |
53 | 55 | ||
54 | QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\""; | 56 | QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\""; |
55 | QString tempHtml = "/tmp/stockticker.html"; | 57 | QString tempHtml = "/tmp/stockticker.html"; |
56 | QString cmd = "wget -O "+tempHtml+" "+url; | 58 | QString cmd = "wget -O "+tempHtml+" "+url; |
57 | qDebug(cmd); | 59 | odebug << cmd << oendl; |
58 | 60 | ||
59 | 61 | ||
60 | /* | 62 | /* |
61 | OProcess proc; | 63 | OProcess proc; |
62 | proc << "/usr/bin/wget"; | 64 | proc << "/usr/bin/wget"; |
63 | proc<<"-O"<< tempHtml<< url; | 65 | proc<<"-O"<< tempHtml<< url; |
64 | 66 | ||
65 | connect( &proc, SIGNAL( processExited(Opie::Core::OProcess*)),this, SLOT( showBrowser(Opie::Core::OProcess*))); | 67 | connect( &proc, SIGNAL( processExited(Opie::Core::OProcess*)),this, SLOT( showBrowser(Opie::Core::OProcess*))); |
66 | proc.start( OProcess::NotifyOnExit); | 68 | proc.start( OProcess::NotifyOnExit); |
67 | */ | 69 | */ |
68 | system(cmd.latin1()); | 70 | system(cmd.latin1()); |
69 | HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); | 71 | HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); |
70 | StockLookup->setCaption("Symbol"); | 72 | StockLookup->setCaption("Symbol"); |
71 | StockLookup->showMaximized(); | 73 | StockLookup->showMaximized(); |
72 | StockLookup->show(); | 74 | StockLookup->show(); |
73 | LineEdit1->text(); | 75 | LineEdit1->text(); |
74 | 76 | ||
75 | 77 | ||
76 | } | 78 | } |
77 | 79 | ||
78 | void InputDialog::showBrowser(OProcess*) { | 80 | void InputDialog::showBrowser(OProcess*) { |
79 | qDebug("BLAH"); | 81 | odebug << "BLAH" << oendl; |
80 | QString tempHtml = "/tmp/stockticker.html"; | 82 | QString tempHtml = "/tmp/stockticker.html"; |
81 | 83 | ||
82 | HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); | 84 | HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); |
83 | StockLookup->setCaption("Symbol"); | 85 | StockLookup->setCaption("Symbol"); |
84 | StockLookup->showMaximized(); | 86 | StockLookup->showMaximized(); |
85 | StockLookup->show(); | 87 | StockLookup->show(); |
86 | LineEdit1->text(); | 88 | LineEdit1->text(); |
87 | 89 | ||
88 | } | 90 | } |