summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp
index 860db64..f27543c 100644
--- a/core/applets/batteryapplet/batterystatus.cpp
+++ b/core/applets/batteryapplet/batterystatus.cpp
@@ -118,87 +118,87 @@ void BatteryStatus::drawSegment( QPainter *p, const QRect &r, const QColor &topg
118 v1 + ((v2-v1)*j)/(ng-1), QColor::Hsv ) ); 118 v1 + ((v2-v1)*j)/(ng-1), QColor::Hsv ) );
119 p->drawLine( r.x(), r.top()+hy-2-j, r.x()+r.width(), r.top()+hy-2-j ); 119 p->drawLine( r.x(), r.top()+hy-2-j, r.x()+r.width(), r.top()+hy-2-j );
120 } 120 }
121 for ( int j = 0; j < hh; j++ ) { 121 for ( int j = 0; j < hh; j++ ) {
122 p->setPen( highlight ); 122 p->setPen( highlight );
123 p->drawLine( r.x(), r.top()+hy-2+j, r.x()+r.width(), r.top()+hy-2+j ); 123 p->drawLine( r.x(), r.top()+hy-2+j, r.x()+r.width(), r.top()+hy-2+j );
124 } 124 }
125 for ( int j = 0; j < ng-hy-hh; j++ ) { 125 for ( int j = 0; j < ng-hy-hh; j++ ) {
126 p->setPen( QColor( h1 + ((h2-h1)*j)/(ng-1), s1 + ((s2-s1)*j)/(ng-1), 126 p->setPen( QColor( h1 + ((h2-h1)*j)/(ng-1), s1 + ((s2-s1)*j)/(ng-1),
127 v1 + ((v2-v1)*j)/(ng-1), QColor::Hsv ) ); 127 v1 + ((v2-v1)*j)/(ng-1), QColor::Hsv ) );
128 p->drawLine( r.x(), r.top()+hy+hh-2+j, r.x()+r.width(), r.top()+hy+hh-2+j ); 128 p->drawLine( r.x(), r.top()+hy+hh-2+j, r.x()+r.width(), r.top()+hy+hh-2+j );
129 } 129 }
130} 130}
131 131
132QString BatteryStatus::statusText() const { 132QString BatteryStatus::statusText() const {
133 QString text; 133 QString text;
134 134
135 if ( ps->batteryStatus() == PowerStatus::Charging ) { 135 if ( ps->batteryStatus() == PowerStatus::Charging ) {
136 if (bat2) { 136 if (bat2) {
137 text = tr("Charging both devices"); 137 text = tr("Charging both devices");
138 } else { 138 } else {
139 text = tr("Charging"); 139 text = tr("Charging");
140 } 140 }
141 } else if ( ps->batteryPercentAccurate() ) { 141 } else if ( ps->batteryPercentAccurate() ) {
142 text.sprintf( tr("Percentage battery remaining") + ": %i%%", percent ); 142 text.sprintf( tr("Remaining Power") + ": %i%%", percent );
143 } else { 143 } else {
144 text = tr("Battery status: "); 144 text = tr("Battery status: ");
145 switch ( ps->batteryStatus() ) { 145 switch ( ps->batteryStatus() ) {
146 case PowerStatus::High: 146 case PowerStatus::High:
147 text += tr("Good"); 147 text += tr("Good");
148 break; 148 break;
149 case PowerStatus::Low: 149 case PowerStatus::Low:
150 text += tr("Low"); 150 text += tr("Low");
151 break; 151 break;
152 case PowerStatus::VeryLow: 152 case PowerStatus::VeryLow:
153 text += tr("Very Low"); 153 text += tr("Very Low");
154 break; 154 break;
155 case PowerStatus::Critical: 155 case PowerStatus::Critical:
156 text += tr("Critical"); 156 text += tr("Critical");
157 break; 157 break;
158 default: // NotPresent, etc. 158 default: // NotPresent, etc.
159 text += tr("Unknown"); 159 text += tr("Unknown");
160 } 160 }
161 } 161 }
162 162
163 if ( ps->acStatus() == PowerStatus::Backup ) 163 if ( ps->acStatus() == PowerStatus::Backup )
164 text += "\n" + tr("On backup power"); 164 text += "\n" + tr("On backup power");
165 else if ( ps->acStatus() == PowerStatus::Online ) 165 else if ( ps->acStatus() == PowerStatus::Online )
166 text += "\n" + tr("Power on-line"); 166 text += "\n" + tr("Power on-line");
167 else if ( ps->acStatus() == PowerStatus::Offline ) 167 else if ( ps->acStatus() == PowerStatus::Offline )
168 text += "\n" + tr("External power disconnected"); 168 text += "\n" + tr("External power disconnected");
169 169
170 if ( ps->batteryTimeRemaining() >= 0 ) { 170 if ( ps->batteryTimeRemaining() >= 0 ) {
171 text += "\n" + QString().sprintf( tr("Battery time remaining") + ": %im %02is", 171 text += "\n" + QString().sprintf( tr("Remaining Time") + ": %im %02is",
172 ps->batteryTimeRemaining() / 60, ps->batteryTimeRemaining() % 60 ); 172 ps->batteryTimeRemaining() / 60, ps->batteryTimeRemaining() % 60 );
173 } 173 }
174 return text; 174 return text;
175} 175}
176 176
177QString BatteryStatus::statusTextIpaq() const { 177QString BatteryStatus::statusTextIpaq() const {
178 QString text; 178 QString text;
179 text += tr("Percentage battery remaining: ") + perc2 + " " + jackStatus; 179 text += tr("Remaining Power: ") + perc2 + " " + jackStatus;
180 text += "\n" + tr("Battery time remaining: ") + sec2; 180 text += "\n" + tr("Remaining Time: ") + sec2;
181 return text; 181 return text;
182} 182}
183 183
184void BatteryStatus::paintEvent( QPaintEvent * ev ) { 184void BatteryStatus::paintEvent( QPaintEvent * ev ) {
185 185
186 QPainter p( this ); 186 QPainter p( this );
187 187
188 QString text = statusText(); 188 QString text = statusText();
189 p.drawText( 10, 50, width() - 20, 40 , AlignVCenter, text ); 189 p.drawText( 10, 50, width() - 20, 40 , AlignVCenter, text );
190 190
191 QColor c; 191 QColor c;
192 QColor darkc; 192 QColor darkc;
193 QColor lightc; 193 QColor lightc;
194 if ( ps->acStatus() == PowerStatus::Offline ) { 194 if ( ps->acStatus() == PowerStatus::Offline ) {
195 c = blue.light(120); 195 c = blue.light(120);
196 darkc = c.dark(280); 196 darkc = c.dark(280);
197 lightc = c.light(145); 197 lightc = c.light(145);
198 } else if ( ps->acStatus() == PowerStatus::Online ) { 198 } else if ( ps->acStatus() == PowerStatus::Online ) {
199 c = green.dark(130); 199 c = green.dark(130);
200 darkc = c.dark(200); 200 darkc = c.dark(200);
201 lightc = c.light(220); 201 lightc = c.light(220);
202 } else { 202 } else {
203 c = red; 203 c = red;
204 darkc = c.dark(280); 204 darkc = c.dark(280);