fix:Task bar power plugin, get charging time if 0, need to prompt is in the calculation

任务栏电源插件,获取充电时间如果为0,需要提示正在计算中,产品回复计算中用“....”表示
This commit is contained in:
chenwei 2020-03-10 19:47:03 +08:00
parent 26aac7425b
commit dfda7f325e
2 changed files with 12 additions and 4 deletions

View File

@ -235,8 +235,10 @@ void PowerPlugin::refreshTipsData()
uint hour = time.toString("hh").toUInt();
uint min = time.toString("mm").toUInt();
QString tips;
if (hour == 0) {
if(timeToFull == 0) {
tips = tr("Charging %1 ....").arg(value);
}
else if (hour == 0) {
tips = tr("Charging %1, %2 min until full").arg(value).arg(min);
}
else {

View File

@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS language="en" version="2.1">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<context>
<name>AbstractPluginsController</name>
<message>
@ -213,6 +215,10 @@
<source>Charging %1, %2 hr %3 min until full</source>
<translation>Charging %1, %2 hr %3 min until full</translation>
</message>
<message>
<source>Charging %1 ....</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShowDesktopPlugin</name>