From b8cf78a49035d240588a230b6622cd79d54372b3 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 25 Mar 2012 20:14:26 +0200 Subject: [PATCH] infoviewer: only show remaining time if time is set --- src/gui/infoviewer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 5800aebf8..97f84a2ce 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1750,10 +1750,12 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { int seit = (abs(jetzt - info_CurrentNext.current_zeit.startzeit) + 30) / 60; int rest = (info_CurrentNext.current_zeit.dauer / 60) - seit; - if (jetzt < info_CurrentNext.current_zeit.startzeit) { - runningPercent = 0; + runningPercent = 0; + if (!gotTime) + snprintf(runningRest, sizeof(runningRest), "%d min", info_CurrentNext.current_zeit.dauer / 60); + else if (jetzt < info_CurrentNext.current_zeit.startzeit) snprintf (runningRest, sizeof(runningRest), "in %d min", seit); - } else { + else { runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) runningPercent = 100;