From de89e518a6fe20c219682d1494e53a25ac6d2a01 Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 31 Jan 2010 16:28:49 +0000 Subject: [PATCH] neutrino: improve display of 'overtime' events in infobar git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@239 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/infoviewer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e186dfc3c..c4c42ed32 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1329,10 +1329,13 @@ void CInfoViewer::show_Data (bool calledFromEvent) runningPercent = 0; sprintf (runningRest, "in %d min", -seit); } else { - runningPercent = (unsigned) ((float) (jetzt - info_CurrentNext.current_zeit.startzeit) / (float) info_CurrentNext.current_zeit.dauer * 100.); + runningPercent = (jetzt - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; if (runningPercent > 100) runningPercent = 100; - sprintf (runningRest, "%d / %d min", seit, rest); + if (rest >= 0) + sprintf(runningRest, "%d / %d min", seit, rest); + else + sprintf(runningRest, "%d +%d min", info_CurrentNext.current_zeit.dauer / 60, -rest); } struct tm *pStartZeit = localtime (&info_CurrentNext.current_zeit.startzeit);