author | drw <drw> | 2005-05-24 20:53:08 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-24 20:53:08 (UTC) |
commit | 22cda9f7212641869c3abe210c66bf54a03f9579 (patch) (unidiff) | |
tree | 446175ae7d2d2790bf52732a66a930648f0a195c | |
parent | 2848aca68964a46fb2f786cc01a9b2583d599511 (diff) | |
download | opie-22cda9f7212641869c3abe210c66bf54a03f9579.zip opie-22cda9f7212641869c3abe210c66bf54a03f9579.tar.gz opie-22cda9f7212641869c3abe210c66bf54a03f9579.tar.bz2 |
Resource -> OResource and remove unnecessary include
-rw-r--r-- | noncore/todayplugins/weather/weatherconfig.cpp | 49 | ||||
-rw-r--r-- | noncore/todayplugins/weather/weatherpluginwidget.cpp | 13 |
2 files changed, 25 insertions, 37 deletions
diff --git a/noncore/todayplugins/weather/weatherconfig.cpp b/noncore/todayplugins/weather/weatherconfig.cpp index 4663549..d3ff3c9 100644 --- a/noncore/todayplugins/weather/weatherconfig.cpp +++ b/noncore/todayplugins/weather/weatherconfig.cpp | |||
@@ -1,45 +1,44 @@ | |||
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 "weatherconfig.h" | 29 | #include "weatherconfig.h" |
30 | 30 | ||
31 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/resource.h> | ||
34 | 33 | ||
35 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
36 | #include <qclipboard.h> | 35 | #include <qclipboard.h> |
37 | #include <qfontmetrics.h> | 36 | #include <qfontmetrics.h> |
38 | #include <qlabel.h> | 37 | #include <qlabel.h> |
39 | #include <qlayout.h> | 38 | #include <qlayout.h> |
40 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
41 | #include <qlayout.h> | 40 | #include <qlayout.h> |
42 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
43 | #include <qspinbox.h> | 42 | #include <qspinbox.h> |
44 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
45 | 44 | ||
@@ -64,30 +63,24 @@ WeatherPluginConfig::WeatherPluginConfig( QWidget *parent, const char* name) | |||
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." ) ); | 63 | 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." ) ); |
65 | 64 | ||
66 | locationEdit = new QLineEdit( config.readEntry( "Location", "" ), this ); | 65 | locationEdit = new QLineEdit( config.readEntry( "Location", "" ), this ); |
67 | locationEdit->setMaximumHeight( fh + 5 ); | 66 | locationEdit->setMaximumHeight( fh + 5 ); |
68 | locationEdit->setFocus(); | 67 | locationEdit->setFocus(); |
69 | layout->addMultiCellWidget( locationEdit, 1, 1, 0, 1 ); | 68 | layout->addMultiCellWidget( locationEdit, 1, 1, 0, 1 ); |
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." ) ); | 69 | 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." ) ); |
71 | 70 | ||
72 | label = new QLabel( tr( "Visit http://www.nws.noaa.gov/tg/siteloc.shtml to find the nearest location." ), this ); | 71 | label = new QLabel( tr( "Visit http://www.nws.noaa.gov/tg/siteloc.shtml to find the nearest location." ), this ); |
73 | label->setAlignment( AlignHCenter | WordBreak ); | 72 | label->setAlignment( AlignHCenter | WordBreak ); |
74 | label->setMaximumHeight( label->height() ); | 73 | label->setMaximumHeight( label->height() ); |
75 | layout->addMultiCellWidget( label, 2, 2, 0, 1 ); | 74 | layout->addMultiCellWidget( label, 2, 2, 0, 1 ); |
76 | //layout->addWidget( label, 2, 0 ); | ||
77 | |||
78 | //QPushButton *pb = new QPushButton( Resource::loadPixmap( "copy" ), | ||
79 | //tr( "Copy link" ), this ); | ||
80 | //connect( pb, SIGNAL( clicked() ), this, SLOT( slotCopyLink() ) ); | ||
81 | //layout->addWidget( pb, 2, 1 ); | ||
82 | 75 | ||
83 | metricCB = new QCheckBox( tr( "Use metric units" ), this ); | 76 | metricCB = new QCheckBox( tr( "Use metric units" ), this ); |
84 | metricCB->setMaximumHeight( fh + 5 ); | 77 | metricCB->setMaximumHeight( fh + 5 ); |
85 | metricCB->setChecked( config.readBoolEntry( "Metric", TRUE ) ); | 78 | metricCB->setChecked( config.readBoolEntry( "Metric", TRUE ) ); |
86 | layout->addMultiCellWidget( metricCB, 3, 3, 0, 1 ); | 79 | layout->addMultiCellWidget( metricCB, 3, 3, 0, 1 ); |
87 | QWhatsThis::add( metricCB, tr( "Click here to select type of units displayed." ) ); | 80 | QWhatsThis::add( metricCB, tr( "Click here to select type of units displayed." ) ); |
88 | 81 | ||
89 | label = new QLabel( tr( "Update frequency (in minutes):" ), this ); | 82 | label = new QLabel( tr( "Update frequency (in minutes):" ), this ); |
90 | label->setMaximumHeight( fh + 3 ); | 83 | label->setMaximumHeight( fh + 3 ); |
91 | layout->addWidget( label, 4, 0 ); | 84 | layout->addWidget( label, 4, 0 ); |
92 | QWhatsThis::add( label, tr( "Select how often (in minutes) you want the weather to be updated." ) ); | 85 | QWhatsThis::add( label, tr( "Select how often (in minutes) you want the weather to be updated." ) ); |
93 | 86 | ||
diff --git a/noncore/todayplugins/weather/weatherpluginwidget.cpp b/noncore/todayplugins/weather/weatherpluginwidget.cpp index 8c41189..fe54051 100644 --- a/noncore/todayplugins/weather/weatherpluginwidget.cpp +++ b/noncore/todayplugins/weather/weatherpluginwidget.cpp | |||
@@ -19,48 +19,45 @@ _;:, .> :=|. This file is free software; you can | |||
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 <opie2/oprocess.h> | 29 | #include <opie2/oprocess.h> |
30 | 30 | ||
31 | #include <qpe/applnk.h> | 31 | #include <opie2/oresource.h> |
32 | |||
32 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
33 | #include <qpe/resource.h> | ||
34 | 34 | ||
35 | #include <qfile.h> | 35 | #include <qfile.h> |
36 | #include <qimage.h> | ||
37 | #include <qlabel.h> | 36 | #include <qlabel.h> |
38 | #include <qlayout.h> | 37 | #include <qlayout.h> |
39 | #include <qpixmap.h> | 38 | #include <qpixmap.h> |
40 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
41 | 40 | ||
42 | #include "weatherpluginwidget.h" | 41 | #include "weatherpluginwidget.h" |
43 | 42 | ||
44 | using namespace Opie::Core; | 43 | using namespace Opie::Core; |
45 | WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name ) | 44 | WeatherPluginWidget::WeatherPluginWidget( QWidget *parent, const char* name ) |
46 | : QWidget( parent, name ) | 45 | : QWidget( parent, name ) |
47 | { | 46 | { |
48 | QHBoxLayout *layout = new QHBoxLayout( this, 1, 2 ); | 47 | QHBoxLayout *layout = new QHBoxLayout( this, 1, 2 ); |
49 | layout->setAutoAdd( true ); | 48 | layout->setAutoAdd( true ); |
50 | 49 | ||
51 | weatherIcon = new QLabel( this ); | 50 | weatherIcon = new QLabel( this ); |
52 | QPixmap pic; | 51 | weatherIcon->setPixmap( Opie::Core::OResource::loadPixmap( "Clock", Opie::Core::OResource::SmallIcon ) ); |
53 | pic.convertFromImage( Resource::loadImage( "Clock" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
54 | weatherIcon->setPixmap( pic ); | ||
55 | 52 | ||
56 | weatherLabel = new QLabel( tr( "Retreiving current weather information." ), this ); | 53 | weatherLabel = new QLabel( tr( "Retreiving current weather information." ), this ); |
57 | weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); | 54 | weatherLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); |
58 | 55 | ||
59 | weatherIcon->setFixedSize( weatherLabel->height(), weatherLabel->height() ); | 56 | weatherIcon->setFixedSize( weatherLabel->height(), weatherLabel->height() ); |
60 | 57 | ||
61 | startTimer(1000); | 58 | startTimer(1000); |
62 | } | 59 | } |
63 | 60 | ||
64 | WeatherPluginWidget::~WeatherPluginWidget() | 61 | WeatherPluginWidget::~WeatherPluginWidget() |
65 | { | 62 | { |
66 | QFile file( localFile ); | 63 | QFile file( localFile ); |
@@ -136,27 +133,25 @@ void WeatherPluginWidget::displayWeather() | |||
136 | getWind( weatherData ); | 133 | getWind( weatherData ); |
137 | tmpstr.append( dataStr ); | 134 | tmpstr.append( dataStr ); |
138 | 135 | ||
139 | tmpstr.append( tr( "\nPres: " ) ); | 136 | tmpstr.append( tr( "\nPres: " ) ); |
140 | getPressure( weatherData ); | 137 | getPressure( weatherData ); |
141 | tmpstr.append( dataStr ); | 138 | tmpstr.append( dataStr ); |
142 | 139 | ||
143 | weatherLabel->setText( tmpstr ); | 140 | weatherLabel->setText( tmpstr ); |
144 | 141 | ||
145 | tmpstr = "todayweatherplugin/"; | 142 | tmpstr = "todayweatherplugin/"; |
146 | getIcon( weatherData ); | 143 | getIcon( weatherData ); |
147 | tmpstr.append( dataStr ); | 144 | tmpstr.append( dataStr ); |
148 | QPixmap pic; | 145 | weatherIcon->setPixmap( Opie::Core::OResource::loadPixmap( tmpstr, Opie::Core::OResource::SmallIcon ) ); |
149 | pic.convertFromImage( Resource::loadImage( tmpstr ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
150 | weatherIcon->setPixmap( pic ); | ||
151 | } | 146 | } |
152 | else | 147 | else |
153 | { | 148 | { |
154 | weatherLabel->setText( tr( "Current weather data not available." ) ); | 149 | weatherLabel->setText( tr( "Current weather data not available." ) ); |
155 | } | 150 | } |
156 | } | 151 | } |
157 | 152 | ||
158 | void WeatherPluginWidget::getTemp( const QString &data ) | 153 | void WeatherPluginWidget::getTemp( const QString &data ) |
159 | { | 154 | { |
160 | int value; | 155 | int value; |
161 | bool ok; | 156 | bool ok; |
162 | 157 | ||