summaryrefslogtreecommitdiff
path: root/core/applets
Side-by-side diff
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()
if ( batteryView )
batteryView->updatePercent( percent );
}
void BatteryMeter::paintEvent( QPaintEvent* )
{
if ( style == 1 )
{
QPainter p(this);
QFont f( "Fixed", AppLnk::smallIconSize()/2 );
QFontMetrics fm( f );
p.setFont( f );
- if ( percent > 98 ) {
- p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) );
- }
- else if ( percent < 5 )
- {
- p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) );
- }
- else
- {
- p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
- p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
- }
+ p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) );
+ p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" );
return;
}
QPainter p(this);
QColor color;
QColor g = gray.light( 160 );
switch ( ps->acStatus() )
{
case PowerStatus::Offline: color = blue.light( 150 ); break;
case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break;
default: color = red.light( 160 );
}
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 * ) {
QString jacketMsg;
if (bat2) {
p.setPen(black);
p.drawText(10,220, tr("Percentage battery remaining: ") + perc2 + " " + jackStatus);
p.drawText(10,240, tr("Battery time remaining: ") + sec2);
jacketMsg = tr("Jacket " + jackChem);
} else {
jackPercent = 0;
jacketMsg = tr("No jacket with battery inserted");
}
- int jackPerc = ( jackPercent / 100.0 ) * screenWidth - 47;
+ int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ;
qDrawShadePanel( &p, 9, 160, rightEnd1, 39, colorGroup(), TRUE, 1, NULL);
qDrawShadePanel( &p, rightEnd2, 167, 12, 24, colorGroup(), TRUE, 1, NULL);
drawSegment( &p, QRect( 10, 160, jackPerc, 40 ), lightc, darkc, lightc.light(115), 6 );
drawSegment( &p, QRect( 11 + jackPerc, 160, rightEnd1 - jackPerc, 40 ), white.light(80), black, white.light(90), 6 );
drawSegment( &p, QRect( rightEnd2, 167, 10, 25 ), white.light(80), black, white.light(90), 2 );
p.setPen( black );
p.drawText(15, 180, jacketMsg);
}
}
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)
if (cardWas1 != cardInPcmcia1) {
if (cardInPcmcia1) {
text += tr("New card: ");
what = "on";
} else {
text += tr("Ejected: ");
what = "off";
}
text += cardInPcmcia1Name;
popUp(text, "cardmon/" + cardInPcmcia1Type);
}
+#ifndef QT_NO_SOUND
QSound::play(Resource::findSound("cardmon/card" + what));
+#endif
}
} else {
// no file found
qDebug("no file found");
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
}
repaint( FALSE );
return ((cardWas0 == cardInPcmcia0
&& cardWas1 == cardInPcmcia1) ? FALSE : TRUE);
}
@@ -315,25 +317,27 @@ bool CardMonitor::getStatusSd(int showPopUp)
if (!showPopUp && cardWas != cardInSd) {
QString text = QString::null;
QString what = QString::null;
if (cardInSd) {
text += "New card: SD/MMC";
what = "on";
} else {
text += "Ejected: SD/MMC";
what = "off";
}
//qDebug("TEXT: " + text );
+#ifndef QT_NO_SOUND
QSound::play(Resource::findSound("cardmon/card" + what));
+#endif
popUp(text, "cardmon/ide"); // XX add SD pic
}
#else
#error "Not on Linux"
#endif
repaint( FALSE );
return ((cardWas == cardInSd) ? FALSE : TRUE);
}
void CardMonitor::paintEvent(QPaintEvent *)
{
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 @@
#include <qpe/menuappletinterface.h>
class HomeApplet : public QObject, public MenuAppletInterface
{
public:
HomeApplet ( );
virtual ~HomeApplet ( );
QRESULT queryInterface( const QUuid&, QUnknownInterface** );
Q_REFCOUNT
virtual int position() const;
-
+
virtual QString name ( ) const;
virtual QIconSet icon ( ) const;
virtual QString text ( ) const;
virtual QString tr( const char* ) const;
virtual QString tr( const char*, const char* ) const;
virtual QPopupMenu *popup ( QWidget *parent ) const;
-
+
virtual void activated ( );
private:
ulong ref;
};
#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 @@
*.moc
*.~
Makefile*
config.in
moc_*
opieobjconfig.in
-opieobj
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 @@
#include <qpe/menuappletinterface.h>
class SuspendApplet : public QObject, public MenuAppletInterface
{
public:
SuspendApplet ( );
virtual ~SuspendApplet ( );
QRESULT queryInterface( const QUuid&, QUnknownInterface** );
Q_REFCOUNT
virtual int position() const;
-
+
virtual QString name ( ) const;
virtual QIconSet icon ( ) const;
virtual QString text ( ) const;
virtual QString tr( const char* ) const;
virtual QString tr( const char*, const char* ) const;
virtual QPopupMenu *popup ( QWidget *parent ) const;
-
+
virtual void activated ( );
private:
ulong ref;
};
#endif