summaryrefslogtreecommitdiff
path: root/core/applets
authorkergoth <kergoth>2003-08-09 17:29:36 (UTC)
committer kergoth <kergoth>2003-08-09 17:29:36 (UTC)
commita0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (patch) (unidiff)
tree5ce78e1a5dedd31b7851d53bf9f072bd44edd1b0 /core/applets
parenta7e015198a8c5ad3b6e144a9032b059086253e00 (diff)
downloadopie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.zip
opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.gz
opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'core/applets') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp14
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp2
-rw-r--r--core/applets/cardmon/cardmon.cpp4
-rw-r--r--core/applets/homeapplet/home.h4
-rw-r--r--core/applets/restartapplet2/.cvsignore1
-rw-r--r--core/applets/suspendapplet/suspend.h4
6 files changed, 11 insertions, 18 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index 480d261..078ce8d 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -113,36 +113,26 @@ void BatteryMeter::chargeTimeout()
113 if ( batteryView ) 113 if ( batteryView )
114 batteryView->updatePercent( percent ); 114 batteryView->updatePercent( percent );
115} 115}
116 116
117void BatteryMeter::paintEvent( QPaintEvent* ) 117void BatteryMeter::paintEvent( QPaintEvent* )
118{ 118{
119 if ( style == 1 ) 119 if ( style == 1 )
120 { 120 {
121 QPainter p(this); 121 QPainter p(this);
122 QFont f( "Fixed", AppLnk::smallIconSize()/2 ); 122 QFont f( "Fixed", AppLnk::smallIconSize()/2 );
123 QFontMetrics fm( f ); 123 QFontMetrics fm( f );
124 p.setFont( f ); 124 p.setFont( f );
125 if ( percent > 98 ) { 125 p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
126 p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); 126 p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
127 }
128 else if ( percent < 5 )
129 {
130 p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) );
131 }
132 else
133 {
134 p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
135 p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
136 }
137 return; 127 return;
138 } 128 }
139 129
140 QPainter p(this); 130 QPainter p(this);
141 QColor color; 131 QColor color;
142 QColor g = gray.light( 160 ); 132 QColor g = gray.light( 160 );
143 switch ( ps->acStatus() ) 133 switch ( ps->acStatus() )
144 { 134 {
145 case PowerStatus::Offline: color = blue.light( 150 ); break; 135 case PowerStatus::Offline: color = blue.light( 150 ); break;
146 case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; 136 case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break;
147 default: color = red.light( 160 ); 137 default: color = red.light( 160 );
148 } 138 }
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp
index 092a48d..5936b5d 100644
--- a/core/applets/batteryapplet/batterystatus.cpp
+++ b/core/applets/batteryapplet/batterystatus.cpp
@@ -231,25 +231,25 @@ void BatteryStatus::paintEvent( QPaintEvent * ) {
231 231
232 QString jacketMsg; 232 QString jacketMsg;
233 if (bat2) { 233 if (bat2) {
234 p.setPen(black); 234 p.setPen(black);
235 p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus); 235 p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus);
236 p.drawText(10,240, tr("Battery time remaining: ") + sec2); 236 p.drawText(10,240, tr("Battery time remaining: ") + sec2);
237 jacketMsg = tr("Jacket " + jackChem); 237 jacketMsg = tr("Jacket " + jackChem);
238 } else { 238 } else {
239 jackPercent = 0; 239 jackPercent = 0;
240 jacketMsg = tr("No jacket with battery inserted"); 240 jacketMsg = tr("No jacket with battery inserted");
241 } 241 }
242 242
243 int jackPerc = ( jackPercent / 100.0 ) * screenWidth - 47; 243 int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ;
244 244
245 qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL); 245 qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL);
246 qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL); 246 qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL);
247 drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 ); 247 drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 );
248 drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 ); 248 drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 );
249 drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 ); 249 drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 );
250 p.setPen( black ); 250 p.setPen( black );
251 p.drawText(15, 180, jacketMsg); 251 p.drawText(15, 180, jacketMsg);
252 } 252 }
253 253
254} 254}
255 255
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index b8c4553..4ed09b8 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -263,25 +263,27 @@ bool CardMonitor::getStatusPcmcia(int showPopUp)
263 263
264 if (cardWas1 != cardInPcmcia1) { 264 if (cardWas1 != cardInPcmcia1) {
265 if (cardInPcmcia1) { 265 if (cardInPcmcia1) {
266 text += tr("New card: "); 266 text += tr("New card: ");
267 what = "on"; 267 what = "on";
268 } else { 268 } else {
269 text += tr("Ejected: "); 269 text += tr("Ejected: ");
270 what = "off"; 270 what = "off";
271 } 271 }
272 text += cardInPcmcia1Name; 272 text += cardInPcmcia1Name;
273 popUp(text, "cardmon/" + cardInPcmcia1Type); 273 popUp(text, "cardmon/" + cardInPcmcia1Type);
274 } 274 }
275#ifndef QT_NO_SOUND
275 QSound::play(Resource::findSound("cardmon/card" + what)); 276 QSound::play(Resource::findSound("cardmon/card" + what));
277#endif
276 } 278 }
277 } else { 279 } else {
278 // no file found 280 // no file found
279 qDebug("no file found"); 281 qDebug("no file found");
280 cardInPcmcia0 = FALSE; 282 cardInPcmcia0 = FALSE;
281 cardInPcmcia1 = FALSE; 283 cardInPcmcia1 = FALSE;
282 } 284 }
283 repaint( FALSE ); 285 repaint( FALSE );
284 return ((cardWas0 == cardInPcmcia0 286 return ((cardWas0 == cardInPcmcia0
285 && cardWas1 == cardInPcmcia1) ? FALSE : TRUE); 287 && cardWas1 == cardInPcmcia1) ? FALSE : TRUE);
286 288
287} 289}
@@ -315,25 +317,27 @@ bool CardMonitor::getStatusSd(int showPopUp)
315 317
316 if (!showPopUp && cardWas != cardInSd) { 318 if (!showPopUp && cardWas != cardInSd) {
317 QString text = QString::null; 319 QString text = QString::null;
318 QString what = QString::null; 320 QString what = QString::null;
319 if (cardInSd) { 321 if (cardInSd) {
320 text += "New card: SD/MMC"; 322 text += "New card: SD/MMC";
321 what = "on"; 323 what = "on";
322 } else { 324 } else {
323 text += "Ejected: SD/MMC"; 325 text += "Ejected: SD/MMC";
324 what = "off"; 326 what = "off";
325 } 327 }
326 //qDebug("TEXT: " + text ); 328 //qDebug("TEXT: " + text );
329#ifndef QT_NO_SOUND
327 QSound::play(Resource::findSound("cardmon/card" + what)); 330 QSound::play(Resource::findSound("cardmon/card" + what));
331#endif
328 popUp(text, "cardmon/ide");// XX add SD pic 332 popUp(text, "cardmon/ide");// XX add SD pic
329 } 333 }
330#else 334#else
331#error "Not on Linux" 335#error "Not on Linux"
332#endif 336#endif
333 repaint( FALSE ); 337 repaint( FALSE );
334 return ((cardWas == cardInSd) ? FALSE : TRUE); 338 return ((cardWas == cardInSd) ? FALSE : TRUE);
335} 339}
336 340
337void CardMonitor::paintEvent(QPaintEvent *) 341void CardMonitor::paintEvent(QPaintEvent *)
338{ 342{
339 343
diff --git a/core/applets/homeapplet/home.h b/core/applets/homeapplet/home.h
index 64af97d..1186caf 100644
--- a/core/applets/homeapplet/home.h
+++ b/core/applets/homeapplet/home.h
@@ -23,27 +23,27 @@
23#include <qpe/menuappletinterface.h> 23#include <qpe/menuappletinterface.h>
24 24
25class HomeApplet : public QObject, public MenuAppletInterface 25class HomeApplet : public QObject, public MenuAppletInterface
26{ 26{
27public: 27public:
28 HomeApplet ( ); 28 HomeApplet ( );
29 virtual ~HomeApplet ( ); 29 virtual ~HomeApplet ( );
30 30
31 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 31 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
32 Q_REFCOUNT 32 Q_REFCOUNT
33 33
34 virtual int position() const; 34 virtual int position() const;
35 35
36 virtual QString name ( ) const; 36 virtual QString name ( ) const;
37 virtual QIconSet icon ( ) const; 37 virtual QIconSet icon ( ) const;
38 virtual QString text ( ) const; 38 virtual QString text ( ) const;
39 virtual QString tr( const char* ) const; 39 virtual QString tr( const char* ) const;
40 virtual QString tr( const char*, const char* ) const; 40 virtual QString tr( const char*, const char* ) const;
41 virtual QPopupMenu *popup ( QWidget *parent ) const; 41 virtual QPopupMenu *popup ( QWidget *parent ) const;
42 42
43 virtual void activated ( ); 43 virtual void activated ( );
44 44
45private: 45private:
46 ulong ref; 46 ulong ref;
47}; 47};
48 48
49#endif 49#endif
diff --git a/core/applets/restartapplet2/.cvsignore b/core/applets/restartapplet2/.cvsignore
index a403d26..4943911 100644
--- a/core/applets/restartapplet2/.cvsignore
+++ b/core/applets/restartapplet2/.cvsignore
@@ -1,7 +1,6 @@
1*.moc 1*.moc
2*.~ 2*.~
3Makefile* 3Makefile*
4config.in 4config.in
5moc_* 5moc_*
6opieobjconfig.in 6opieobjconfig.in
7opieobj
diff --git a/core/applets/suspendapplet/suspend.h b/core/applets/suspendapplet/suspend.h
index 0c92bcb..75467c1 100644
--- a/core/applets/suspendapplet/suspend.h
+++ b/core/applets/suspendapplet/suspend.h
@@ -23,27 +23,27 @@
23#include <qpe/menuappletinterface.h> 23#include <qpe/menuappletinterface.h>
24 24
25class SuspendApplet : public QObject, public MenuAppletInterface 25class SuspendApplet : public QObject, public MenuAppletInterface
26{ 26{
27public: 27public:
28 SuspendApplet ( ); 28 SuspendApplet ( );
29 virtual ~SuspendApplet ( ); 29 virtual ~SuspendApplet ( );
30 30
31 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 31 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
32 Q_REFCOUNT 32 Q_REFCOUNT
33 33
34 virtual int position() const; 34 virtual int position() const;
35 35
36 virtual QString name ( ) const; 36 virtual QString name ( ) const;
37 virtual QIconSet icon ( ) const; 37 virtual QIconSet icon ( ) const;
38 virtual QString text ( ) const; 38 virtual QString text ( ) const;
39 virtual QString tr( const char* ) const; 39 virtual QString tr( const char* ) const;
40 virtual QString tr( const char*, const char* ) const; 40 virtual QString tr( const char*, const char* ) const;
41 virtual QPopupMenu *popup ( QWidget *parent ) const; 41 virtual QPopupMenu *popup ( QWidget *parent ) const;
42 42
43 virtual void activated ( ); 43 virtual void activated ( );
44 44
45private: 45private:
46 ulong ref; 46 ulong ref;
47}; 47};
48 48
49#endif 49#endif