[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kbatterymonitor/kbatterymonitor
From:       Chris Howells <howells () kde ! org>
Date:       2004-11-01 0:59:15
Message-ID: 20041101005915.0E71416C04 () office ! kde ! org
[Download RAW message or body]

CVS commit by howells: 

Fix strings


  M +22 -9     kbatterymonitor.cpp   1.8


--- kdenonbeta/kbatterymonitor/kbatterymonitor/kbatterymonitor.cpp  #1.7:1.8
@@ -35,5 +35,5 @@ KBatteryMonitor::KBatteryMonitor(QWidget
 {
         KGlobal::locale()->insertCatalogue("kbatterymonitor");
-        setPixmap(KSystemTray::loadIcon("laptop_battery"));
+        setPixmap(loadIcon("laptop_battery"));
 
         rightPopup = contextMenu();
@@ -76,19 +76,34 @@ void KBatteryMonitor::update()
 {
         QString tooltip;
+        int hours = mTimeRemaining / 60;
+        int minutes = mTimeRemaining % 60;
         if (mACOnline)
         {
                 if (mTimeRemaining == -1) // the battery is fully charged
                 {
-                        tooltip = i18n("Battery fully charged");
+                        tooltip = i18n("Battery is fully charged");
                 }
                 else
                 {
-                        //FIXME plural
-                        tooltip = i18n("Charging: %1 hours %2 minutes remaining \
(%3%)").arg(mTimeRemaining/60).arg(mTimeRemaining % \
60).arg(mPercentageRemaining).arg(mTimeRemaining); +                        if (hours \
> 0) +                        {
+                                tooltip = i18n("Charging battery: %1 hour %2 minutes \
remaining (%3%)", "Charging battery: %1 hours %2 minutes remaining \
(%3%)").arg(hours).arg(minutes).arg(mPercentageRemaining); +                        }
+                        else
+                        {
+                                tooltip = i18n("Charging battery: %1 minute \
remaining (%2%)", "Charging battery: %1 minutes remaining \
(%2%)").arg(minutes).arg(mPercentageRemaining); +                        }
                 }
         }
         else
         {
-                tooltip = i18n("On battery power: %1 hours %2 minutes remaining \
(%3%)").arg(mTimeRemaining/60).arg(mTimeRemaining % 60).arg(mPercentageRemaining); +  \
if (hours > 0) +                {
+                        tooltip = i18n("On battery power: %1 hour %2 minutes \
remaining (%3%)", "On battery power: %1 hours %2 minutes remaining \
(%3%)").arg(hours).arg(minutes).arg(mPercentageRemaining); +                }
+                else
+                {
+                        tooltip = i18n("On battery power: %1 minute remaining \
(%2%)", "On battery power: %1 minutes remaining \
(%2%)").arg(minutes).arg(mPercentageRemaining); +                }
         }
 
@@ -117,8 +132,7 @@ void KBatteryMonitor::update()
                 updateIcon(mACOnline, mPercentageRemaining);
         
-                if (!mACOnline)
+                if (!mACOnline) // we only want to show the warning if we are on \
battery power, not charging  {
                         QString title = i18n("Battery Warning");
-                        QString body;
                         if (mPercentageRemaining <= 4)
                         {
@@ -151,6 +165,5 @@ void KBatteryMonitor::updateToolTip(cons
 void KBatteryMonitor::passivePopup(const QString &title, const QString &message)
 {
-        QPixmap icon = SmallIcon("laptop_battery");
-        KPassivePopup::message(title, message, icon, this);
+        KPassivePopup::message(title, message, SmallIcon("laptop_battery"), this);
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic