From dfda7f325eae40215fb3d808c92e028c5e7c7240 Mon Sep 17 00:00:00 2001 From: chenwei Date: Tue, 10 Mar 2020 19:47:03 +0800 Subject: [PATCH] fix:Task bar power plugin, get charging time if 0, need to prompt is in the calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 任务栏电源插件,获取充电时间如果为0,需要提示正在计算中,产品回复计算中用“....”表示 --- plugins/power/powerplugin.cpp | 6 ++++-- translations/dde-dock.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/power/powerplugin.cpp b/plugins/power/powerplugin.cpp index a0a604d4b..963d7c3c5 100644 --- a/plugins/power/powerplugin.cpp +++ b/plugins/power/powerplugin.cpp @@ -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 { diff --git a/translations/dde-dock.ts b/translations/dde-dock.ts index 97e132941..fc769a0bb 100644 --- a/translations/dde-dock.ts +++ b/translations/dde-dock.ts @@ -1,4 +1,6 @@ - + + + AbstractPluginsController @@ -213,6 +215,10 @@ Charging %1, %2 hr %3 min until full Charging %1, %2 hr %3 min until full + + Charging %1 .... + + ShowDesktopPlugin @@ -371,4 +377,4 @@ Wireless Network %1 - \ No newline at end of file +