Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

inputDialog.cpp

Go to the documentation of this file.
00001 #include "inputDialog.h"
00002 #include "helpwindow.h"
00003 
00004 /* OPIE */
00005 #include <opie2/odebug.h>
00006 #include <qpe/config.h>
00007 using namespace Opie::Core;
00008 
00009 /* QT */
00010 #include <qapplication.h>
00011 #include <qlayout.h>
00012 #include <qcheckbox.h>
00013 #include <qlineedit.h>
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qwhatsthis.h>
00017 #include <qlabel.h>
00018 #include <qlayout.h>
00019 #include <qstringlist.h>
00020 #include <qmainwindow.h>
00021 
00022 /* STD */
00023 #include <stdlib.h>
00024 
00025 InputDialog::InputDialog( )
00026  : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) {
00027     setCaption( tr("Symbol Lookup"));
00028 
00029     QGridLayout *layout = new QGridLayout( this );
00030     layout->setSpacing(6);
00031     layout->setMargin( 2);
00032 
00033     LineEdit1 = new QLineEdit( this, "LineEdit1" );
00034     LineEdit1->setFocus();
00035 
00036     layout->addMultiCellWidget(  LineEdit1, 0, 0, 0, 3);
00037 
00038     QLabel *label;
00039     label = new QLabel(this);
00040     label->setText( tr("Enter something to lookup / search."));
00041     label->setMaximumHeight(60);
00042     layout->addMultiCellWidget( label, 1, 1, 0, 3);
00043 
00044     connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(doLookup()));
00045     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
00046     layout->addItem( spacer, 8, 0 );
00047 
00048 }
00049 
00050 InputDialog::~InputDialog() {
00051 }
00052 
00053 void InputDialog::doLookup() {
00054 // http://finance.yahoo.com/l?m=&s=siemens&t=
00055 
00056     QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\"";
00057     QString tempHtml = "/tmp/stockticker.html";
00058      QString cmd = "wget -O "+tempHtml+" "+url;
00059      odebug << cmd << oendl; 
00060 
00061 
00062 /*
00063       OProcess proc;
00064       proc << "/usr/bin/wget";
00065       proc<<"-O"<< tempHtml<< url;
00066 
00067       connect( &proc, SIGNAL( processExited(Opie::Core::OProcess*)),this, SLOT( showBrowser(Opie::Core::OProcess*)));
00068       proc.start( OProcess::NotifyOnExit);
00069 */
00070      system(cmd.latin1());
00071      HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
00072      StockLookup->setCaption("Symbol");
00073      StockLookup->showMaximized();
00074      StockLookup->show();
00075      LineEdit1->text();
00076 
00077 
00078 }
00079 
00080 void InputDialog::showBrowser(OProcess*) {
00081     odebug << "BLAH" << oendl; 
00082     QString tempHtml = "/tmp/stockticker.html";
00083 
00084     HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
00085     StockLookup->setCaption("Symbol");
00086     StockLookup->showMaximized();
00087     StockLookup->show();
00088     LineEdit1->text();
00089 
00090 }

Generated on Sat Nov 5 16:15:34 2005 for OPIE by  doxygen 1.4.2