-rw-r--r-- | noncore/applets/brightnessapplet/brightnessapplet.cpp | 4 | ||||
-rw-r--r-- | noncore/applets/brightnessapplet/brightnessapplet.pro | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/noncore/applets/brightnessapplet/brightnessapplet.cpp b/noncore/applets/brightnessapplet/brightnessapplet.cpp index 5aaa27e..90fde05 100644 --- a/noncore/applets/brightnessapplet/brightnessapplet.cpp +++ b/noncore/applets/brightnessapplet/brightnessapplet.cpp | |||
@@ -131,80 +131,80 @@ BrightnessAppletControl::BrightnessAppletControl( OTaskbarApplet* parent, const | |||
131 | setFixedHeight( 100 ); | 131 | setFixedHeight( 100 ); |
132 | setFixedWidth( gl->sizeHint().width() ); | 132 | setFixedWidth( gl->sizeHint().width() ); |
133 | setFocusPolicy(QWidget::NoFocus); | 133 | setFocusPolicy(QWidget::NoFocus); |
134 | } | 134 | } |
135 | 135 | ||
136 | 136 | ||
137 | BrightnessAppletControl::~BrightnessAppletControl() | 137 | BrightnessAppletControl::~BrightnessAppletControl() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | ||
142 | void BrightnessAppletControl::hideEvent( QHideEvent* e ) | 142 | void BrightnessAppletControl::hideEvent( QHideEvent* e ) |
143 | { | 143 | { |
144 | BrightnessApplet* applet = static_cast<BrightnessApplet*>( parent() ); | 144 | BrightnessApplet* applet = static_cast<BrightnessApplet*>( parent() ); |
145 | applet->writeSystemBrightness( applet->calcBrightnessValue() ); | 145 | applet->writeSystemBrightness( applet->calcBrightnessValue() ); |
146 | QFrame::hideEvent( e ); | 146 | QFrame::hideEvent( e ); |
147 | } | 147 | } |
148 | 148 | ||
149 | BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name ) | 149 | BrightnessApplet::BrightnessApplet( QWidget *parent, const char *name ) |
150 | :OTaskbarApplet( parent, name ) | 150 | :OTaskbarApplet( parent, name ) |
151 | { | 151 | { |
152 | setFixedHeight( AppLnk::smallIconSize() ); | 152 | setFixedHeight( AppLnk::smallIconSize() ); |
153 | setFixedWidth( AppLnk::smallIconSize() ); | 153 | setFixedWidth( AppLnk::smallIconSize() ); |
154 | _pixmap.convertFromImage( Resource::loadImage( "brightnessapplet/icon" ).smoothScale( height(), width() ) ); | 154 | _pixmap.convertFromImage( Resource::loadImage( "brightnessapplet/icon" ).smoothScale( height(), width() ) ); |
155 | _control = new BrightnessAppletControl( this, "control" ); | 155 | _control = new BrightnessAppletControl( this, "control" ); |
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||
159 | void BrightnessApplet::writeSystemBrightness(int brightness) | 159 | void BrightnessApplet::writeSystemBrightness(int brightness) |
160 | { | 160 | { |
161 | PowerStatus ps = PowerStatusManager::readStatus(); | 161 | PowerStatus ps = PowerStatusManager::readStatus(); |
162 | 162 | ||
163 | Config cfg("qpe"); | 163 | Config cfg( "apm" ); |
164 | if (ps.acStatus() == PowerStatus::Online) { | 164 | if (ps.acStatus() == PowerStatus::Online) { |
165 | cfg.setGroup("AC"); | 165 | cfg.setGroup("AC"); |
166 | } else { | 166 | } else { |
167 | cfg.setGroup("Battery"); | 167 | cfg.setGroup("Battery"); |
168 | } | 168 | } |
169 | cfg.writeEntry("Brightness", brightness); | 169 | cfg.writeEntry("Brightness", brightness); |
170 | odebug << "writing brightness " << brightness << oendl; | 170 | odebug << "writing brightness " << brightness << oendl; |
171 | cfg.write(); | 171 | cfg.write(); |
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | int BrightnessApplet::readSystemBrightness(void) | 175 | int BrightnessApplet::readSystemBrightness(void) |
176 | { | 176 | { |
177 | PowerStatus ps = PowerStatusManager::readStatus(); | 177 | PowerStatus ps = PowerStatusManager::readStatus(); |
178 | Config cfg("qpe"); | 178 | Config cfg( "apm" ); |
179 | 179 | ||
180 | if (ps.acStatus() == PowerStatus::Online) { | 180 | if (ps.acStatus() == PowerStatus::Online) { |
181 | cfg.setGroup("AC"); | 181 | cfg.setGroup("AC"); |
182 | } else { | 182 | } else { |
183 | cfg.setGroup("Battery"); | 183 | cfg.setGroup("Battery"); |
184 | } | 184 | } |
185 | 185 | ||
186 | odebug << "reading brightness " << cfg.readNumEntry("Brightness", 128) << oendl; | 186 | odebug << "reading brightness " << cfg.readNumEntry("Brightness", 128) << oendl; |
187 | 187 | ||
188 | return cfg.readNumEntry("Brightness", 128); | 188 | return cfg.readNumEntry("Brightness", 128); |
189 | } | 189 | } |
190 | 190 | ||
191 | 191 | ||
192 | BrightnessApplet::~BrightnessApplet() | 192 | BrightnessApplet::~BrightnessApplet() |
193 | { | 193 | { |
194 | } | 194 | } |
195 | 195 | ||
196 | 196 | ||
197 | int BrightnessApplet::position() | 197 | int BrightnessApplet::position() |
198 | { | 198 | { |
199 | return 7; | 199 | return 7; |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | void BrightnessApplet::paintEvent( QPaintEvent* ) | 203 | void BrightnessApplet::paintEvent( QPaintEvent* ) |
204 | { | 204 | { |
205 | QPainter p(this); | 205 | QPainter p(this); |
206 | p.drawPixmap(0, 0, _pixmap ); | 206 | p.drawPixmap(0, 0, _pixmap ); |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | int BrightnessApplet::calcBrightnessValue() | 210 | int BrightnessApplet::calcBrightnessValue() |
diff --git a/noncore/applets/brightnessapplet/brightnessapplet.pro b/noncore/applets/brightnessapplet/brightnessapplet.pro index 8c65120..79a44d3 100644 --- a/noncore/applets/brightnessapplet/brightnessapplet.pro +++ b/noncore/applets/brightnessapplet/brightnessapplet.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on | 2 | CONFIG += qt plugin warn_on |
3 | HEADERS = brightnessapplet.h | 3 | HEADERS = brightnessapplet.h |
4 | SOURCES = brightnessapplet.cpp | 4 | SOURCES = brightnessapplet.cpp |
5 | TARGET = brightnessapplet | 5 | TARGET = brightnessapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopiecore2 -lopieui2 | 9 | LIBS += -lqpe -lopiecore2 -lopieui2 |
10 | VERSION = 0.1.1 | 10 | VERSION = 0.1.2 |
11 | 11 | ||
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | include ( $(OPIEDIR)/include.pro ) |