-rw-r--r-- | noncore/todayplugins/stockticker/stockticker/helpwindow.cpp | 1 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherpluginwidget.cpp | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp index 23e78f2..2274402 100644 --- a/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp +++ b/noncore/todayplugins/stockticker/stockticker/helpwindow.cpp | |||
@@ -1,66 +1,65 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | ||
3 | ** | 2 | ** |
4 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | 3 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. |
5 | ** | 4 | ** |
6 | ** This file is part of an example program for Qt. This example | 5 | ** This file is part of an example program for Qt. This example |
7 | ** program may be used, distributed and modified without limitation. | 6 | ** program may be used, distributed and modified without limitation. |
8 | ** | 7 | ** |
9 | *****************************************************************************/ | 8 | *****************************************************************************/ |
10 | 9 | ||
11 | #include "helpwindow.h" | 10 | #include "helpwindow.h" |
12 | #include <qstatusbar.h> | 11 | #include <qstatusbar.h> |
13 | 12 | ||
14 | #include <qmenubar.h> | 13 | #include <qmenubar.h> |
15 | #include <qtoolbar.h> | 14 | #include <qtoolbar.h> |
16 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
17 | #include <qcombobox.h> | 16 | #include <qcombobox.h> |
18 | 17 | ||
19 | #include <ctype.h> | 18 | #include <ctype.h> |
20 | 19 | ||
21 | HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) | 20 | HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) |
22 | : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() | 21 | : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() |
23 | { | 22 | { |
24 | readHistory(); | 23 | readHistory(); |
25 | readBookmarks(); | 24 | readBookmarks(); |
26 | 25 | ||
27 | browser = new QTextBrowser( this ); | 26 | browser = new QTextBrowser( this ); |
28 | QStringList Strlist; | 27 | QStringList Strlist; |
29 | Strlist.append( home_); | 28 | Strlist.append( home_); |
30 | 29 | ||
31 | browser->mimeSourceFactory()->setFilePath( Strlist ); | 30 | browser->mimeSourceFactory()->setFilePath( Strlist ); |
32 | 31 | ||
33 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 32 | browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
34 | 33 | ||
35 | connect( browser, SIGNAL( textChanged() ), | 34 | connect( browser, SIGNAL( textChanged() ), |
36 | 35 | ||
37 | this, SLOT( textChanged() ) ); | 36 | this, SLOT( textChanged() ) ); |
38 | 37 | ||
39 | setCentralWidget( browser ); | 38 | setCentralWidget( browser ); |
40 | 39 | ||
41 | if ( !home_.isEmpty() ) | 40 | if ( !home_.isEmpty() ) |
42 | 41 | ||
43 | //////////////////////////////// | 42 | //////////////////////////////// |
44 | browser->setSource( home_ ); | 43 | browser->setSource( home_ ); |
45 | 44 | ||
46 | //////////////////////////////// | 45 | //////////////////////////////// |
47 | connect( browser, SIGNAL( highlighted( const QString&) ), | 46 | connect( browser, SIGNAL( highlighted( const QString&) ), |
48 | statusBar(), SLOT( message( const QString&)) ); | 47 | statusBar(), SLOT( message( const QString&)) ); |
49 | 48 | ||
50 | setGeometry( 0,0,236,280); | 49 | setGeometry( 0,0,236,280); |
51 | 50 | ||
52 | QPopupMenu* file = new QPopupMenu( this ); | 51 | QPopupMenu* file = new QPopupMenu( this ); |
53 | // file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); | 52 | // file->insertItem( tr("&New Window"), this, SLOT( newWindow() ), ALT | Key_N ); |
54 | file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); | 53 | file->insertItem( tr("&Open File"), this, SLOT( openFile() ), ALT | Key_O ); |
55 | // file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); | 54 | // file->insertItem( tr("&Print"), this, SLOT( print() ), ALT | Key_P ); |
56 | file->insertSeparator(); | 55 | file->insertSeparator(); |
57 | file->insertItem( tr("&Close"), this, SLOT( close() ), ALT | Key_Q ); | 56 | file->insertItem( tr("&Close"), this, SLOT( close() ), ALT | Key_Q ); |
58 | // file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), ALT | Key_X ); | 57 | // file->insertItem( tr("E&xit"), qApp, SLOT( closeAllWindows() ), ALT | Key_X ); |
59 | 58 | ||
60 | // The same three icons are used twice each. | 59 | // The same three icons are used twice each. |
61 | ////F FIXME | 60 | ////F FIXME |
62 | QString pixs=(QDir::homeDirPath ()) +"/Applications/gutenbrowser/pix/"; | 61 | QString pixs=(QDir::homeDirPath ()) +"/Applications/gutenbrowser/pix/"; |
63 | QIconSet icon_back( QPixmap(pixs+"back.png") ); | 62 | QIconSet icon_back( QPixmap(pixs+"back.png") ); |
64 | QIconSet icon_forward( QPixmap(pixs+"forward.png") ); | 63 | QIconSet icon_forward( QPixmap(pixs+"forward.png") ); |
65 | QIconSet icon_home( QPixmap(pixs+"home.png") ); | 64 | QIconSet icon_home( QPixmap(pixs+"home.png") ); |
66 | 65 | ||
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp index 800fdcb..8440f20 100644 --- a/noncore/todayplugins/weather/weatherpluginwidget.cpp +++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp | |||
@@ -1,116 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. | 3 | =. |
4 | .=l. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | .=l. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qimage.h> | 30 | #include <qimage.h> |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | #include <qlayout.h> | 32 | #include <qlayout.h> |
33 | #include <qpixmap.h> | 33 | #include <qpixmap.h> |
34 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
35 | 35 | ||
36 | #include <opie/oprocess.h> | 36 | #include <opie/oprocess.h> |
37 | 37 | ||
38 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | 40 | ||
41 | #include "weatherpluginwidget.h" | 41 | #include "weatherpluginwidget.h" |
42 | 42 | ||
43 | WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name ) | 43 | WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name ) |
44 | : QWidget( parent, name ) | 44 | : QWidget( parent, name ) |
45 | { | 45 | { |
46 | QHBoxLayout *layout = new QHBoxLayout( this ); | 46 | QHBoxLayout *layout = new QHBoxLayout( this ); |
47 | layout->setAutoAdd( TRUE ); | 47 | layout->setAutoAdd( TRUE ); |
48 | layout->setSpacing( 2 ); | 48 | layout->setSpacing( 2 ); |
49 | 49 | ||
50 | weatherIcon = new QLabel( this ); | 50 | weatherIcon = new QLabel( this ); |
51 | weatherIcon->setMaximumWidth( 32 ); | 51 | weatherIcon->setMaximumWidth( 32 ); |
52 | QImage logo1 = Resource::loadImage( "todayweatherplugin/wait" ); | 52 | QImage logo1 = Resource::loadImage( "Clock" ); |
53 | QPixmap pic; | 53 | QPixmap pic; |
54 | pic.convertFromImage( logo1 ); | 54 | pic.convertFromImage( logo1 ); |
55 | weatherIcon->setPixmap( pic ); | 55 | weatherIcon->setPixmap( pic ); |
56 | 56 | ||
57 | weatherLabel = new QLabel( tr( "Retreiving current weather information." ), this ); | 57 | weatherLabel = new QLabel( tr( "Retreiving current weather information." ), this ); |
58 | weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); | 58 | weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); |
59 | 59 | ||
60 | startTimer(1000); | 60 | startTimer(1000); |
61 | } | 61 | } |
62 | 62 | ||
63 | WeatherPluginWidget::~WeatherPluginWidget() | 63 | WeatherPluginWidget::~WeatherPluginWidget() |
64 | { | 64 | { |
65 | QFile file( localFile ); | 65 | QFile file( localFile ); |
66 | if ( file.exists() ) | 66 | if ( file.exists() ) |
67 | { | 67 | { |
68 | file.remove(); | 68 | file.remove(); |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | void WeatherPluginWidget::timerEvent( QTimerEvent *e ) | 72 | void WeatherPluginWidget::timerEvent( QTimerEvent *e ) |
73 | { | 73 | { |
74 | killTimer( e->timerId() ); | 74 | killTimer( e->timerId() ); |
75 | retreiveData(); | 75 | retreiveData(); |
76 | } | 76 | } |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | void WeatherPluginWidget::retreiveData() | 80 | void WeatherPluginWidget::retreiveData() |
81 | { | 81 | { |
82 | Config config( "todayweatherplugin"); | 82 | Config config( "todayweatherplugin"); |
83 | config.setGroup( "Config" ); | 83 | config.setGroup( "Config" ); |
84 | 84 | ||
85 | location = config.readEntry( "Location", "" ); | 85 | location = config.readEntry( "Location", "" ); |
86 | useMetric = config.readBoolEntry( "Metric", TRUE ); | 86 | useMetric = config.readBoolEntry( "Metric", TRUE ); |
87 | frequency = config.readNumEntry( "Frequency", 5 ); | 87 | frequency = config.readNumEntry( "Frequency", 5 ); |
88 | 88 | ||
89 | startTimer( frequency * 60000 ); | 89 | startTimer( frequency * 60000 ); |
90 | 90 | ||
91 | localFile = "/tmp/"; | 91 | localFile = "/tmp/"; |
92 | localFile.append( location ); | 92 | localFile.append( location ); |
93 | localFile.append( ".TXT" ); | 93 | localFile.append( ".TXT" ); |
94 | 94 | ||
95 | remoteFile = "http://weather.noaa.gov/pub/data/observations/metar/stations/"; | 95 | remoteFile = "http://weather.noaa.gov/pub/data/observations/metar/stations/"; |
96 | remoteFile.append( location ); | 96 | remoteFile.append( location ); |
97 | remoteFile.append( ".TXT" ); | 97 | remoteFile.append( ".TXT" ); |
98 | 98 | ||
99 | QFile file( localFile ); | 99 | QFile file( localFile ); |
100 | if ( file.exists() ) | 100 | if ( file.exists() ) |
101 | { | 101 | { |
102 | file.remove(); | 102 | file.remove(); |
103 | } | 103 | } |
104 | 104 | ||
105 | OProcess *proc = new OProcess; | 105 | OProcess *proc = new OProcess; |
106 | 106 | ||
107 | *proc << "wget" << "-q" << remoteFile << "-O" << localFile; | 107 | *proc << "wget" << "-q" << remoteFile << "-O" << localFile; |
108 | connect( proc, SIGNAL( processExited( OProcess * ) ), this, SLOT( dataRetrieved( OProcess * ) ) ); | 108 | connect( proc, SIGNAL( processExited( OProcess * ) ), this, SLOT( dataRetrieved( OProcess * ) ) ); |
109 | proc->start(); | 109 | proc->start(); |
110 | } | 110 | } |
111 | 111 | ||
112 | void WeatherPluginWidget::displayWeather() | 112 | void WeatherPluginWidget::displayWeather() |
113 | { | 113 | { |
114 | weatherData = QString::null; | 114 | weatherData = QString::null; |
115 | 115 | ||
116 | QFile file( localFile ); | 116 | QFile file( localFile ); |