summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-14 15:12:59 (UTC)
committer zecke <zecke>2004-03-14 15:12:59 (UTC)
commita104a921518d4427bf3dc9edd2c968133420607c (patch) (side-by-side diff)
tree005a054e766250891039f9adf4bacf3d6f0486f0
parent8a243adc61fc9c8a48fa9061f0eba12c7b345d70 (diff)
downloadopie-a104a921518d4427bf3dc9edd2c968133420607c.zip
opie-a104a921518d4427bf3dc9edd2c968133420607c.tar.gz
opie-a104a921518d4427bf3dc9edd2c968133420607c.tar.bz2
ODP changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/fortune/fortunepluginwidget.cpp6
-rw-r--r--noncore/todayplugins/fortune/fortunepluginwidget.h6
-rw-r--r--noncore/todayplugins/stockticker/stockticker/inputDialog.cpp4
-rw-r--r--noncore/todayplugins/stockticker/stockticker/inputDialog.h2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h4
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktimerpluginwidget.h4
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.cpp3
-rw-r--r--noncore/todayplugins/weather/weatherpluginwidget.h4
9 files changed, 21 insertions, 14 deletions
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.cpp b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
index 3aa978c..c3ee546 100644
--- a/noncore/todayplugins/fortune/fortunepluginwidget.cpp
+++ b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
@@ -5,77 +5,79 @@
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "fortunepluginwidget.h"
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qvaluelist.h>
#include <qtl.h>
#include <qstring.h>
#include <qscrollview.h>
#include <qobject.h>
#include <qlayout.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
FortunePluginWidget::FortunePluginWidget( QWidget *parent, const char* name )
: QWidget( parent, name )
{
fortune = NULL;
getFortune();
}
FortunePluginWidget::~FortunePluginWidget() {
if( fortuneProcess ){
delete fortuneProcess;
}
}
/**
* Get the fortunes
*/
void FortunePluginWidget::getFortune() {
QVBoxLayout* layoutFortune = new QVBoxLayout( this );
if ( fortune ) {
delete fortune;
}
fortune = new OTicker( this );
// fortune->setReadOnly( TRUE );
// fortune->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
fortune->setText( QString("Obtaining fortune...") );
layoutFortune->addWidget( fortune );
fortuneProcess = new OProcess();
*fortuneProcess << "fortune";
- connect(fortuneProcess, SIGNAL(receivedStdout(OProcess*,char*,int) ),
- this, SLOT(slotStdOut(OProcess*,char*,int) ) );
+ connect(fortuneProcess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
+ this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int) ) );
if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
qWarning("could not start :(");
fortune->setText( QString("Failed to obtain fortune.") );
delete fortuneProcess;
fortuneProcess = 0;
}
}
void FortunePluginWidget::slotStdOut( OProcess* /*proc*/, char* buf, int len )
{
QCString s( buf, len );
s.replace( QRegExp("\n"), "" );
fortune->setText( s );
}
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.h b/noncore/todayplugins/fortune/fortunepluginwidget.h
index abb7bed..1b71430 100644
--- a/noncore/todayplugins/fortune/fortunepluginwidget.h
+++ b/noncore/todayplugins/fortune/fortunepluginwidget.h
@@ -12,34 +12,34 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef FORTUNE_PLUGIN_WIDGET_H
#define FORTUNE_PLUGIN_WIDGET_H
#include <opie2/oprocess.h>
#include <opie2/oticker.h>
#include <qstring.h>
#include <qwidget.h>
class FortunePluginWidget : public QWidget
{
Q_OBJECT
public:
FortunePluginWidget( QWidget *parent, const char *name );
~FortunePluginWidget();
private:
- OTicker *fortune;
- OProcess *fortuneProcess;
+ Opie::Ui::OTicker *fortune;
+ Opie::Core::OProcess *fortuneProcess;
void getFortune();
private slots:
- void slotStdOut( OProcess*, char*, int );
+ void slotStdOut( Opie::Core::OProcess*, char*, int );
};
#endif
diff --git a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
index b3fa708..ce35256 100644
--- a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
+++ b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
@@ -1,37 +1,39 @@
#include "inputDialog.h"
#include <qapplication.h>
#include <qlayout.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qvariant.h>
#include <qpushbutton.h>
#include <qwhatsthis.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpe/config.h>
#include <qstringlist.h>
+using namespace Opie::Core;
+using namespace Opie::Core;
#include <qmainwindow.h>
#include "helpwindow.h"
#include <stdlib.h>
// #include <sys/stat.h>
// #include <unistd.h>
InputDialog::InputDialog( )
: QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) {
setCaption( tr("Symbol Lookup"));
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing(6);
layout->setMargin( 2);
LineEdit1 = new QLineEdit( this, "LineEdit1" );
LineEdit1->setFocus();
layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 3);
QLabel *label;
label = new QLabel(this);
label->setText( tr("Enter something to lookup / search."));
label->setMaximumHeight(60);
@@ -39,48 +41,48 @@ InputDialog::InputDialog( )
connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(doLookup()));
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
layout->addItem( spacer, 8, 0 );
}
InputDialog::~InputDialog() {
}
void InputDialog::doLookup() {
// http://finance.yahoo.com/l?m=&s=siemens&t=
QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\"";
QString tempHtml = "/tmp/stockticker.html";
QString cmd = "wget -O "+tempHtml+" "+url;
qDebug(cmd);
/*
OProcess proc;
proc << "/usr/bin/wget";
proc<<"-O"<< tempHtml<< url;
- connect( &proc, SIGNAL( processExited(OProcess*)),this, SLOT( showBrowser(OProcess*)));
+ connect( &proc, SIGNAL( processExited(Opie::Core::OProcess*)),this, SLOT( showBrowser(Opie::Core::OProcess*)));
proc.start( OProcess::NotifyOnExit);
*/
system(cmd.latin1());
HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
StockLookup->setCaption("Symbol");
StockLookup->showMaximized();
StockLookup->show();
LineEdit1->text();
}
void InputDialog::showBrowser(OProcess*) {
qDebug("BLAH");
QString tempHtml = "/tmp/stockticker.html";
HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
StockLookup->setCaption("Symbol");
StockLookup->showMaximized();
StockLookup->show();
LineEdit1->text();
}
diff --git a/noncore/todayplugins/stockticker/stockticker/inputDialog.h b/noncore/todayplugins/stockticker/stockticker/inputDialog.h
index a1c00bd..d7ff94c 100644
--- a/noncore/todayplugins/stockticker/stockticker/inputDialog.h
+++ b/noncore/todayplugins/stockticker/stockticker/inputDialog.h
@@ -1,30 +1,30 @@
#ifndef INPUTDIALOG_H
#define INPUTDIALOG_H
#include <opie2/oprocess.h>
#include <qvariant.h>
#include <qdialog.h>
#include <qmainwindow.h>
class QLineEdit;
class QCheckBox;
class InputDialog : public QMainWindow {
Q_OBJECT
public:
InputDialog( );
~InputDialog();
private:
QLineEdit* LineEdit1;
private slots:
void doLookup();
- void showBrowser(OProcess*);
+ void showBrowser(Opie::Core::OProcess*);
protected slots:
};
#endif // INPUTDIALOG_H
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index 51113ba..aaeb5ee 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -1,46 +1,48 @@
/*
* stocktickerpluginwidget.cpp
*
* copyright : (c) 2002 by L.J. Potter
* email : llornkcor@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <opie2/oticker.h>
#include <qpe/config.h>
#include <qlayout.h>
+using namespace Opie::Ui;
+using namespace Opie::Ui;
extern "C" {
#include "libstocks/stocks.h"
}
#include <pthread.h>
#include "stocktickerpluginwidget.h"
QString output;
OTicker *stocktickerTicker;
QCString stock_liste;
bool dotimeCheck, dodateCheck, dosymbolCheck, donameCheck;
bool docurrentPriceCheck, dolastPriceCheck, doopenPriceCheck;
bool dominPriceCheck, domaxPriceCheck, dovariationCheck, dovolumeCheck;
void getStocks(char *blah) {
// stocktickerTicker->setText( "Downloading stock data.");
stock *stocks_quotes=NULL;
stock *stocks_tmp;
stock_liste = blah;
::free ( blah );
// char *stock_liste = (char *)blah->latin1();
// qDebug("%s", stock_liste.data() );
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h
index 8a8fbf8..727e289 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.h
@@ -2,50 +2,50 @@
* stocktickerpluginwidget.h
*
* copyright : (c) 2002 by L.J. Potter
* email : lornkcor@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef STOCKTICKERL_PLUGIN_WIDGET_H
#define STOCKTICKERL_PLUGIN_WIDGET_H
#include <qsocket.h>
#include <qstring.h>
#include <qwidget.h>
#include <qlineedit.h>
-#include <opie/oclickablelabel.h>
-#include <opie/oticker.h>
+#include <opie2/oclickablelabel.h>
+#include <opie2/oticker.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
class QTimer;
class StockTickerPluginWidget : public QWidget {
Q_OBJECT
public:
StockTickerPluginWidget( QWidget *parent, const char *name );
~StockTickerPluginWidget();
protected slots:
void doStocks();
void isConnected();
void socketError(int);
void checkConnection();
private:
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktimerpluginwidget.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktimerpluginwidget.h
index d7b6047..667d9c9 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktimerpluginwidget.h
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktimerpluginwidget.h
@@ -1,44 +1,44 @@
/*
* mailpluginwidget.h
*
* copyright : (c) 2002 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MAIL_PLUGIN_WIDGET_H
#define MAIL_PLUGIN_WIDGET_H
#include <qstring.h>
#include <qwidget.h>
-#include <opie/oclickablelabel.h>
+#include <opie2/oclickablelabel.h>
class MailPluginWidget : public QWidget {
Q_OBJECT
public:
MailPluginWidget( QWidget *parent, const char *name );
~MailPluginWidget();
protected slots:
void startMail();
private:
- OClickableLabel *mailLabel;
+ Opie::Ui::OClickableLabel *mailLabel;
void readConfig();
void getInfo();
};
#endif
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp
index ad99a43..8e00c36 100644
--- a/noncore/todayplugins/weather/weatherpluginwidget.cpp
+++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp
@@ -19,48 +19,49 @@
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qfile.h>
#include <qimage.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qtextstream.h>
#include <opie2/oprocess.h>
#include <qpe/config.h>
#include <qpe/resource.h>
#include "weatherpluginwidget.h"
+using namespace Opie::Core;
WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name )
: QWidget( parent, name )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setAutoAdd( TRUE );
layout->setSpacing( 2 );
weatherIcon = new QLabel( this );
weatherIcon->setMaximumWidth( 32 );
QImage logo1 = Resource::loadImage( "Clock" );
QPixmap pic;
pic.convertFromImage( logo1 );
weatherIcon->setPixmap( pic );
weatherLabel = new QLabel( tr( "Retreiving current weather information." ), this );
weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
startTimer(1000);
}
WeatherPluginWidget::~WeatherPluginWidget()
{
QFile file( localFile );
if ( file.exists() )
@@ -84,49 +85,49 @@ void WeatherPluginWidget::retreiveData()
location = config.readEntry( "Location", "" );
useMetric = config.readBoolEntry( "Metric", TRUE );
frequency = config.readNumEntry( "Frequency", 5 );
startTimer( frequency * 60000 );
localFile = "/tmp/";
localFile.append( location );
localFile.append( ".TXT" );
remoteFile = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
remoteFile.append( location );
remoteFile.append( ".TXT" );
QFile file( localFile );
if ( file.exists() )
{
file.remove();
}
OProcess *proc = new OProcess;
*proc << "wget" << "-q" << remoteFile << "-O" << localFile;
- connect( proc, SIGNAL( processExited(OProcess*) ), this, SLOT( dataRetrieved(OProcess*) ) );
+ connect( proc, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( dataRetrieved(Opie::Core::OProcess*) ) );
proc->start();
}
void WeatherPluginWidget::displayWeather()
{
weatherData = QString::null;
QFile file( localFile );
if ( file.size() > 0 && file.open( IO_ReadOnly ) )
{
QTextStream data( &file );
while ( !data.eof() )
{
weatherData.append( data.readLine() );
}
file.close();
weatherData = weatherData.simplifyWhiteSpace();
QString tmpstr;
tmpstr.append( tr( "Temp: " ) );
getTemp( weatherData );
tmpstr.append( dataStr );
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.h b/noncore/todayplugins/weather/weatherpluginwidget.h
index d2bbd8b..93d0f59 100644
--- a/noncore/todayplugins/weather/weatherpluginwidget.h
+++ b/noncore/todayplugins/weather/weatherpluginwidget.h
@@ -11,61 +11,61 @@
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef WEATHER_PLUGIN_WIDGET_H
#define WEATHER_PLUGIN_WIDGET_H
#include <qstring.h>
#include <qwidget.h>
-class OProcess;
+namespace Opie {namespace Core {class Opie::Core::OProcess;}}
class QLabel;
class QTimer;
class WeatherPluginWidget : public QWidget {
Q_OBJECT
public:
WeatherPluginWidget( QWidget *parent, const char *name );
~WeatherPluginWidget();
private:
QString location;
QString remoteFile;
QString localFile;
QString weatherData;
QString dataStr;
bool useMetric;
int frequency;
QLabel *weatherLabel;
QLabel *weatherIcon;
void timerEvent( QTimerEvent * );
void retreiveData();
void displayWeather();
void getTemp( const QString & );
void getWind( const QString & );
void getPressure( const QString & );
void getIcon( const QString & );
private slots:
- void dataRetrieved( OProcess * );
+ void dataRetrieved( Opie::Core::OProcess * );
};
#endif