author | drw <drw> | 2004-03-02 16:05:29 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-02 16:05:29 (UTC) |
commit | 49bee7ab52b819a07e9b6de4576eda467d632a66 (patch) (unidiff) | |
tree | 47ecafeed72340c945e88010aaff0d21a6a34964 | |
parent | 31f776618b8615074b56dd2d3cdda3002fde671d (diff) | |
download | opie-49bee7ab52b819a07e9b6de4576eda467d632a66.zip opie-49bee7ab52b819a07e9b6de4576eda467d632a66.tar.gz opie-49bee7ab52b819a07e9b6de4576eda467d632a66.tar.bz2 |
Today weather plugin: libopie -> libopie2
-rw-r--r-- | noncore/todayplugins/weather/config.in | 2 | ||||
-rw-r--r-- | noncore/todayplugins/weather/opie-today-weatherplugin.control | 2 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weather.pro | 2 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherconfig.cpp | 13 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherconfig.h | 2 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherplugin.h | 6 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherpluginimpl.h | 2 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherpluginwidget.cpp | 6 |
8 files changed, 17 insertions, 18 deletions
diff --git a/noncore/todayplugins/weather/config.in b/noncore/todayplugins/weather/config.in index 7202983..ae35a59 100644 --- a/noncore/todayplugins/weather/config.in +++ b/noncore/todayplugins/weather/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config TODAY_WEATHER | 1 | config TODAY_WEATHER |
2 | boolean "opie-today-weatherplugin (current weather report)" | 2 | boolean "opie-today-weatherplugin (current weather report)" |
3 | default "y" | 3 | default "y" |
4 | depends (LIBQPE || LIBQPE-X11) && LIBOPIE | 4 | depends (LIBQPE || LIBQPE-X11) && LIBOPIE2CORE && LIBOPIE2PIM |
diff --git a/noncore/todayplugins/weather/opie-today-weatherplugin.control b/noncore/todayplugins/weather/opie-today-weatherplugin.control index 80b7d2b..7dbd315 100644 --- a/noncore/todayplugins/weather/opie-today-weatherplugin.control +++ b/noncore/todayplugins/weather/opie-today-weatherplugin.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-today-weatherplugin | 1 | Package: opie-today-weatherplugin |
2 | Files: plugins/today/libtodayweatherplugin.so* pics/todayweatherplugin | 2 | Files: plugins/today/libtodayweatherplugin.so* pics/todayweatherplugin |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Dan Williams <drw@handhelds.org> | 5 | Maintainer: Dan Williams <drw@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: libqte2, opie-today | 7 | Depends: libqte2, libopiecore2, libopiepim2, opie-today |
8 | Description: Weather plugin for Today | 8 | Description: Weather plugin for Today |
9 | Displays current weather conditions. | 9 | Displays current weather conditions. |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/todayplugins/weather/weather.pro b/noncore/todayplugins/weather/weather.pro index 5ad14e1..d1f8edd 100644 --- a/noncore/todayplugins/weather/weather.pro +++ b/noncore/todayplugins/weather/weather.pro | |||
@@ -1,25 +1,25 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | #CONFIG -= moc | 2 | #CONFIG -= moc |
3 | CONFIG += qt plugin release | 3 | CONFIG += qt plugin release |
4 | 4 | ||
5 | HEADERS = weatherplugin.h \ | 5 | HEADERS = weatherplugin.h \ |
6 | weatherpluginimpl.h \ | 6 | weatherpluginimpl.h \ |
7 | weatherpluginwidget.h \ | 7 | weatherpluginwidget.h \ |
8 | weatherconfig.h | 8 | weatherconfig.h |
9 | 9 | ||
10 | SOURCES = weatherplugin.cpp \ | 10 | SOURCES = weatherplugin.cpp \ |
11 | weatherpluginimpl.cpp \ | 11 | weatherpluginimpl.cpp \ |
12 | weatherpluginwidget.cpp \ | 12 | weatherpluginwidget.cpp \ |
13 | weatherconfig.cpp | 13 | weatherconfig.cpp |
14 | 14 | ||
15 | INCLUDEPATH += $(OPIEDIR)/include \ | 15 | INCLUDEPATH += $(OPIEDIR)/include \ |
16 | ../ ../library | 16 | ../ ../library |
17 | DEPENDPATH += $(OPIEDIR)/include \ | 17 | DEPENDPATH += $(OPIEDIR)/include \ |
18 | ../ ../library | 18 | ../ ../library |
19 | 19 | ||
20 | LIBS+= -lqpe -lopie | 20 | LIBS+= -lqpe -lopiecore2 -lopiepim2 |
21 | 21 | ||
22 | DESTDIR = $(OPIEDIR)/plugins/today | 22 | DESTDIR = $(OPIEDIR)/plugins/today |
23 | TARGET = todayweatherplugin | 23 | TARGET = todayweatherplugin |
24 | 24 | ||
25 | include ( $(OPIEDIR)/include.pro ) | 25 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/todayplugins/weather/weatherconfig.cpp b/noncore/todayplugins/weather/weatherconfig.cpp index 99ee2a0..4663549 100644 --- a/noncore/todayplugins/weather/weatherconfig.cpp +++ b/noncore/todayplugins/weather/weatherconfig.cpp | |||
@@ -1,95 +1,94 @@ | |||
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 <stdlib.h> | 29 | #include "weatherconfig.h" |
30 | |||
31 | #include <qpe/config.h> | ||
32 | #include <qpe/qpeapplication.h> | ||
33 | #include <qpe/resource.h> | ||
30 | 34 | ||
31 | #include <qcheckbox.h> | 35 | #include <qcheckbox.h> |
32 | #include <qclipboard.h> | 36 | #include <qclipboard.h> |
33 | #include <qfontmetrics.h> | 37 | #include <qfontmetrics.h> |
34 | #include <qlabel.h> | 38 | #include <qlabel.h> |
35 | #include <qlayout.h> | 39 | #include <qlayout.h> |
36 | #include <qlineedit.h> | 40 | #include <qlineedit.h> |
37 | #include <qlayout.h> | 41 | #include <qlayout.h> |
38 | #include <qpushbutton.h> | 42 | #include <qpushbutton.h> |
39 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
40 | #include <qwhatsthis.h> | 44 | #include <qwhatsthis.h> |
41 | 45 | ||
42 | #include <qpe/config.h> | 46 | #include <stdlib.h> |
43 | #include <qpe/qpeapplication.h> | ||
44 | #include <qpe/resource.h> | ||
45 | #include <opie/todayconfigwidget.h> | ||
46 | |||
47 | #include "weatherconfig.h" | ||
48 | 47 | ||
49 | WeatherPluginConfig::WeatherPluginConfig( QWidget *parent, const char* name) | 48 | WeatherPluginConfig::WeatherPluginConfig( QWidget *parent, const char* name) |
50 | : TodayConfigWidget(parent, name ) | 49 | : TodayConfigWidget(parent, name ) |
51 | { | 50 | { |
52 | Config config( "todayweatherplugin"); | 51 | Config config( "todayweatherplugin"); |
53 | config.setGroup( "Config" ); | 52 | config.setGroup( "Config" ); |
54 | 53 | ||
55 | QFontMetrics fm = fontMetrics(); | 54 | QFontMetrics fm = fontMetrics(); |
56 | int fh = fm.height(); | 55 | int fh = fm.height(); |
57 | 56 | ||
58 | QGridLayout *layout = new QGridLayout( this ); | 57 | QGridLayout *layout = new QGridLayout( this ); |
59 | layout->setSpacing( 4 ); | 58 | layout->setSpacing( 4 ); |
60 | layout->setMargin( 4 ); | 59 | layout->setMargin( 4 ); |
61 | 60 | ||
62 | QLabel *label = new QLabel( tr( "Enter ICAO location identifier:" ), this ); | 61 | QLabel *label = new QLabel( tr( "Enter ICAO location identifier:" ), this ); |
63 | label->setMaximumHeight( fh + 3 ); | 62 | label->setMaximumHeight( fh + 3 ); |
64 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); | 63 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); |
65 | QWhatsThis::add( label, tr( "Enter the 4 letter code for the desired location here. See http://www.nws.noaa.gov/tg/siteloc.shtml to find a location near you." ) ); | 64 | QWhatsThis::add( label, tr( "Enter the 4 letter code for the desired location here. See http://www.nws.noaa.gov/tg/siteloc.shtml to find a location near you." ) ); |
66 | 65 | ||
67 | locationEdit = new QLineEdit( config.readEntry( "Location", "" ), this ); | 66 | locationEdit = new QLineEdit( config.readEntry( "Location", "" ), this ); |
68 | locationEdit->setMaximumHeight( fh + 5 ); | 67 | locationEdit->setMaximumHeight( fh + 5 ); |
69 | locationEdit->setFocus(); | 68 | locationEdit->setFocus(); |
70 | layout->addMultiCellWidget( locationEdit, 1, 1, 0, 1 ); | 69 | layout->addMultiCellWidget( locationEdit, 1, 1, 0, 1 ); |
71 | QWhatsThis::add( locationEdit, tr( "Enter the 4 letter code for the desired location here. See http://www.nws.noaa.gov/tg/siteloc.shtml to find a location near you." ) ); | 70 | QWhatsThis::add( locationEdit, tr( "Enter the 4 letter code for the desired location here. See http://www.nws.noaa.gov/tg/siteloc.shtml to find a location near you." ) ); |
72 | 71 | ||
73 | label = new QLabel( tr( "Visit http://www.nws.noaa.gov/tg/siteloc.shtml to find the nearest location." ), this ); | 72 | label = new QLabel( tr( "Visit http://www.nws.noaa.gov/tg/siteloc.shtml to find the nearest location." ), this ); |
74 | label->setAlignment( AlignHCenter | WordBreak ); | 73 | label->setAlignment( AlignHCenter | WordBreak ); |
75 | label->setMaximumHeight( label->height() ); | 74 | label->setMaximumHeight( label->height() ); |
76 | layout->addMultiCellWidget( label, 2, 2, 0, 1 ); | 75 | layout->addMultiCellWidget( label, 2, 2, 0, 1 ); |
77 | //layout->addWidget( label, 2, 0 ); | 76 | //layout->addWidget( label, 2, 0 ); |
78 | 77 | ||
79 | //QPushButton *pb = new QPushButton( Resource::loadPixmap( "copy" ), | 78 | //QPushButton *pb = new QPushButton( Resource::loadPixmap( "copy" ), |
80 | //tr( "Copy link" ), this ); | 79 | //tr( "Copy link" ), this ); |
81 | //connect( pb, SIGNAL( clicked() ), this, SLOT( slotCopyLink() ) ); | 80 | //connect( pb, SIGNAL( clicked() ), this, SLOT( slotCopyLink() ) ); |
82 | //layout->addWidget( pb, 2, 1 ); | 81 | //layout->addWidget( pb, 2, 1 ); |
83 | 82 | ||
84 | metricCB = new QCheckBox( tr( "Use metric units" ), this ); | 83 | metricCB = new QCheckBox( tr( "Use metric units" ), this ); |
85 | metricCB->setMaximumHeight( fh + 5 ); | 84 | metricCB->setMaximumHeight( fh + 5 ); |
86 | metricCB->setChecked( config.readBoolEntry( "Metric", TRUE ) ); | 85 | metricCB->setChecked( config.readBoolEntry( "Metric", TRUE ) ); |
87 | layout->addMultiCellWidget( metricCB, 3, 3, 0, 1 ); | 86 | layout->addMultiCellWidget( metricCB, 3, 3, 0, 1 ); |
88 | QWhatsThis::add( metricCB, tr( "Click here to select type of units displayed." ) ); | 87 | QWhatsThis::add( metricCB, tr( "Click here to select type of units displayed." ) ); |
89 | 88 | ||
90 | label = new QLabel( tr( "Update frequency (in minutes):" ), this ); | 89 | label = new QLabel( tr( "Update frequency (in minutes):" ), this ); |
91 | label->setMaximumHeight( fh + 3 ); | 90 | label->setMaximumHeight( fh + 3 ); |
92 | layout->addWidget( label, 4, 0 ); | 91 | layout->addWidget( label, 4, 0 ); |
93 | QWhatsThis::add( label, tr( "Select how often (in minutes) you want the weather to be updated." ) ); | 92 | QWhatsThis::add( label, tr( "Select how often (in minutes) you want the weather to be updated." ) ); |
94 | 93 | ||
95 | timerDelaySB = new QSpinBox( 1, 60, 1, this ); | 94 | timerDelaySB = new QSpinBox( 1, 60, 1, this ); |
diff --git a/noncore/todayplugins/weather/weatherconfig.h b/noncore/todayplugins/weather/weatherconfig.h index d9ffec2..1780c7f 100644 --- a/noncore/todayplugins/weather/weatherconfig.h +++ b/noncore/todayplugins/weather/weatherconfig.h | |||
@@ -1,60 +1,60 @@ | |||
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 | #ifndef WEATHER_PLUGIN_CONFIG_H | 29 | #ifndef WEATHER_PLUGIN_CONFIG_H |
30 | #define WEATHER_PLUGIN_CONFIG_H | 30 | #define WEATHER_PLUGIN_CONFIG_H |
31 | 31 | ||
32 | #include <qstring.h> | 32 | #include <qstring.h> |
33 | #include <qwidget.h> | 33 | #include <qwidget.h> |
34 | 34 | ||
35 | #include <opie/todayconfigwidget.h> | 35 | #include <opie2/todayconfigwidget.h> |
36 | 36 | ||
37 | class QCheckBox; | 37 | class QCheckBox; |
38 | class QLineEdit; | 38 | class QLineEdit; |
39 | class QPushButton; | 39 | class QPushButton; |
40 | class QSpinBox; | 40 | class QSpinBox; |
41 | 41 | ||
42 | class WeatherPluginConfig : public TodayConfigWidget | 42 | class WeatherPluginConfig : public TodayConfigWidget |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | public: | 45 | public: |
46 | WeatherPluginConfig( QWidget *parent, const char *name ); | 46 | WeatherPluginConfig( QWidget *parent, const char *name ); |
47 | ~WeatherPluginConfig(); | 47 | ~WeatherPluginConfig(); |
48 | void writeConfig(); | 48 | void writeConfig(); |
49 | 49 | ||
50 | private: | 50 | private: |
51 | QLineEdit *locationEdit; | 51 | QLineEdit *locationEdit; |
52 | QCheckBox *metricCB; | 52 | QCheckBox *metricCB; |
53 | QSpinBox *timerDelaySB; | 53 | QSpinBox *timerDelaySB; |
54 | 54 | ||
55 | private slots: | 55 | private slots: |
56 | void doLookup(); | 56 | void doLookup(); |
57 | //void slotCopyLink(); | 57 | //void slotCopyLink(); |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #endif | 60 | #endif |
diff --git a/noncore/todayplugins/weather/weatherplugin.h b/noncore/todayplugins/weather/weatherplugin.h index 480d220..73e7104 100644 --- a/noncore/todayplugins/weather/weatherplugin.h +++ b/noncore/todayplugins/weather/weatherplugin.h | |||
@@ -1,54 +1,54 @@ | |||
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 | #ifndef WEATHER_PLUGIN_H | 29 | #ifndef WEATHER_PLUGIN_H |
30 | #define WEATHER_PLUGIN_H | 30 | #define WEATHER_PLUGIN_H |
31 | 31 | ||
32 | #include <opie2/todayplugininterface.h> | ||
33 | #include <opie2/todayconfigwidget.h> | ||
34 | |||
32 | #include <qstring.h> | 35 | #include <qstring.h> |
33 | #include <qwidget.h> | 36 | #include <qwidget.h> |
34 | 37 | ||
35 | #include <opie/todayplugininterface.h> | ||
36 | #include <opie/todayconfigwidget.h> | ||
37 | |||
38 | class WeatherPlugin : public TodayPluginObject | 38 | class WeatherPlugin : public TodayPluginObject |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | WeatherPlugin(); | 41 | WeatherPlugin(); |
42 | ~WeatherPlugin(); | 42 | ~WeatherPlugin(); |
43 | 43 | ||
44 | QString pluginName() const; | 44 | QString pluginName() const; |
45 | double versionNumber() const; | 45 | double versionNumber() const; |
46 | QString pixmapNameWidget() const; | 46 | QString pixmapNameWidget() const; |
47 | QWidget *widget(QWidget *); | 47 | QWidget *widget(QWidget *); |
48 | QString pixmapNameConfig() const; | 48 | QString pixmapNameConfig() const; |
49 | QString appName() const; | 49 | QString appName() const; |
50 | bool excludeFromRefresh() const; | 50 | bool excludeFromRefresh() const; |
51 | TodayConfigWidget *configWidget(QWidget *); | 51 | TodayConfigWidget *configWidget(QWidget *); |
52 | }; | 52 | }; |
53 | 53 | ||
54 | #endif | 54 | #endif |
diff --git a/noncore/todayplugins/weather/weatherpluginimpl.h b/noncore/todayplugins/weather/weatherpluginimpl.h index eaaae1d..d1a7400 100644 --- a/noncore/todayplugins/weather/weatherpluginimpl.h +++ b/noncore/todayplugins/weather/weatherpluginimpl.h | |||
@@ -1,51 +1,51 @@ | |||
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 | #ifndef WEATHER_PLUGIN_IMPL_H | 29 | #ifndef WEATHER_PLUGIN_IMPL_H |
30 | #define WEATHER_PLUGIN_IMPL_H | 30 | #define WEATHER_PLUGIN_IMPL_H |
31 | 31 | ||
32 | #include <opie/todayplugininterface.h> | 32 | #include <opie2/todayplugininterface.h> |
33 | 33 | ||
34 | class WeatherPlugin; | 34 | class WeatherPlugin; |
35 | 35 | ||
36 | class WeatherPluginImpl : public TodayPluginInterface | 36 | class WeatherPluginImpl : public TodayPluginInterface |
37 | { | 37 | { |
38 | public: | 38 | public: |
39 | WeatherPluginImpl(); | 39 | WeatherPluginImpl(); |
40 | virtual ~WeatherPluginImpl(); | 40 | virtual ~WeatherPluginImpl(); |
41 | 41 | ||
42 | QRESULT queryInterface( const QUuid &, QUnknownInterface ** ); | 42 | QRESULT queryInterface( const QUuid &, QUnknownInterface ** ); |
43 | Q_REFCOUNT | 43 | Q_REFCOUNT |
44 | 44 | ||
45 | virtual TodayPluginObject *guiPart(); | 45 | virtual TodayPluginObject *guiPart(); |
46 | 46 | ||
47 | private: | 47 | private: |
48 | WeatherPlugin *weatherPlugin; | 48 | WeatherPlugin *weatherPlugin; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #endif | 51 | #endif |
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp index 15d1c6e..ad99a43 100644 --- a/noncore/todayplugins/weather/weatherpluginwidget.cpp +++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp | |||
@@ -1,165 +1,165 @@ | |||
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 <opie2/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( "Clock" ); | 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 ); |
117 | 117 | ||
118 | if ( file.size() > 0 && file.open( IO_ReadOnly ) ) | 118 | if ( file.size() > 0 && file.open( IO_ReadOnly ) ) |
119 | { | 119 | { |
120 | QTextStream data( &file ); | 120 | QTextStream data( &file ); |
121 | while ( !data.eof() ) | 121 | while ( !data.eof() ) |
122 | { | 122 | { |
123 | weatherData.append( data.readLine() ); | 123 | weatherData.append( data.readLine() ); |
124 | } | 124 | } |
125 | file.close(); | 125 | file.close(); |
126 | weatherData = weatherData.simplifyWhiteSpace(); | 126 | weatherData = weatherData.simplifyWhiteSpace(); |
127 | 127 | ||
128 | QString tmpstr; | 128 | QString tmpstr; |
129 | 129 | ||
130 | tmpstr.append( tr( "Temp: " ) ); | 130 | tmpstr.append( tr( "Temp: " ) ); |
131 | getTemp( weatherData ); | 131 | getTemp( weatherData ); |
132 | tmpstr.append( dataStr ); | 132 | tmpstr.append( dataStr ); |
133 | 133 | ||
134 | tmpstr.append( tr( " Wind: " ) ); | 134 | tmpstr.append( tr( " Wind: " ) ); |
135 | getWind( weatherData ); | 135 | getWind( weatherData ); |
136 | tmpstr.append( dataStr ); | 136 | tmpstr.append( dataStr ); |
137 | 137 | ||
138 | tmpstr.append( tr( "\nPres: " ) ); | 138 | tmpstr.append( tr( "\nPres: " ) ); |
139 | getPressure( weatherData ); | 139 | getPressure( weatherData ); |
140 | tmpstr.append( dataStr ); | 140 | tmpstr.append( dataStr ); |
141 | 141 | ||
142 | weatherLabel->setText( tmpstr ); | 142 | weatherLabel->setText( tmpstr ); |
143 | 143 | ||
144 | tmpstr = "todayweatherplugin/"; | 144 | tmpstr = "todayweatherplugin/"; |
145 | getIcon( weatherData ); | 145 | getIcon( weatherData ); |
146 | tmpstr.append( dataStr ); | 146 | tmpstr.append( dataStr ); |
147 | QImage logo1 = Resource::loadImage( tmpstr ); | 147 | QImage logo1 = Resource::loadImage( tmpstr ); |
148 | QPixmap pic; | 148 | QPixmap pic; |
149 | pic.convertFromImage( logo1 ); | 149 | pic.convertFromImage( logo1 ); |
150 | weatherIcon->setPixmap( pic ); | 150 | weatherIcon->setPixmap( pic ); |
151 | } | 151 | } |
152 | else | 152 | else |
153 | { | 153 | { |
154 | weatherLabel->setText( tr( "Current weather data not available." ) ); | 154 | weatherLabel->setText( tr( "Current weather data not available." ) ); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | void WeatherPluginWidget::getTemp( const QString &data ) | 158 | void WeatherPluginWidget::getTemp( const QString &data ) |
159 | { | 159 | { |
160 | int value; | 160 | int value; |
161 | bool ok; | 161 | bool ok; |
162 | 162 | ||
163 | int pos = data.find( QRegExp( "M?[0-9]+/M?[0-9]+" ), 20 ); | 163 | int pos = data.find( QRegExp( "M?[0-9]+/M?[0-9]+" ), 20 ); |
164 | if ( pos > -1 ) | 164 | if ( pos > -1 ) |
165 | { | 165 | { |