diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | baserender.c | 153 | ||||
-rw-r--r-- | baserender.h | 8 | ||||
-rw-r--r-- | config.c | 5 | ||||
-rw-r--r-- | config.h | 4 | ||||
-rw-r--r-- | displaychannel.c | 4 | ||||
-rw-r--r-- | displaymenu.c | 35 | ||||
-rw-r--r-- | displayreplay.c | 3 | ||||
-rw-r--r-- | po/de_DE.po | 147 | ||||
-rw-r--r-- | setup.c | 8 | ||||
-rwxr-xr-x | widgets/temperatures/temperatures | 2 | ||||
-rwxr-xr-x | widgets/temperatures/temperatures.g2v | 12 | ||||
-rw-r--r-- | widgets/weather/update_weather.php | 22 |
13 files changed, 281 insertions, 123 deletions
@@ -14,6 +14,7 @@ VDR Plugin 'skinflatplus' Revision History - Widget temperatures - Widget custom command - Please see the example scripts and README-files +- [add] Weather Widget in channelinfo and replayinfo - [update] default themes - background transparency slightly reduced - use color palette of android material design diff --git a/baserender.c b/baserender.c index 0934d930..7a094e43 100644 --- a/baserender.c +++ b/baserender.c @@ -2,6 +2,10 @@ #include "flat.h" #include <vdr/menu.h> #include "services/epgsearch.h" +#include <utility> +#include <fstream> +#include <iostream> + #include <ft2build.h> #include FT_FREETYPE_H @@ -1479,3 +1483,152 @@ int cFlatBaseRender::GetFontAscender(const char *Name, int CharHeight, int CharW return Ascender; } +void cFlatBaseRender::DrawWidgetWeather(void) { + cFont *fontTempSml = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize/2.0 ); + + std::string tempToday = ""; + std::string iconToday, iconTomorrow; + std::string tempMaxToday, tempMaxTomorrow; + std::string tempMinToday, tempMinTomorrow; + std::string precToday, precTomorrow; + + std::ifstream file; + cString filename; + + filename = cString::sprintf("%s/widgets/weather/weather.0.temp", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, tempToday); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.0.icon", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, iconToday); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.1.icon", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, iconTomorrow); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.0.tempMax", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, tempMaxToday); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.1.tempMax", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, tempMaxTomorrow); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.0.tempMin", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, tempMinToday); + file.close(); + } + + filename = cString::sprintf("%s/widgets/weather/weather.1.tempMin", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, tempMinTomorrow); + file.close(); + } + + double p = 0.0; + filename = cString::sprintf("%s/widgets/weather/weather.0.precipitation", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, precToday); + std::replace( precToday.begin(), precToday.end(), '.', ','); + file.close(); + p = atof(precToday.c_str()) * 100.0; + p = roundUp(p, 10); + precToday = cString::sprintf("%.0f%%", p); + } + + filename = cString::sprintf("%s/widgets/weather/weather.1.precipitation", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) ); + file.open(*filename, std::ifstream::in); + if( file.is_open() ) { + std::getline(file, precTomorrow); + std::replace( precTomorrow.begin(), precTomorrow.end(), '.', ','); + file.close(); + p = atof(precTomorrow.c_str()) * 100.0; + p = roundUp(p, 10); + precTomorrow = cString::sprintf("%.0f%%", p); + } + + int left = marginItem; + + int widthTempToday = max(fontTempSml->Width(tempMaxToday.c_str()), fontTempSml->Width(tempMinToday.c_str()) ); + int widthTempTomorrow = max(fontTempSml->Width(tempMaxTomorrow.c_str()), fontTempSml->Width(tempMinTomorrow.c_str()) ); + + int wTop = topBarHeight + Config.decorBorderTopBarSize*2 + 20 + Config.decorBorderChannelEPGSize; + int wWidth = marginItem + font->Width(tempToday.c_str()) + marginItem*2 + fontHeight + marginItem \ + + widthTempToday + marginItem + fontHeight - marginItem*2 \ + + fontTempSml->Width(precToday.c_str()) + marginItem*4 + fontHeight + marginItem \ + + widthTempTomorrow + marginItem + fontHeight - marginItem*2 \ + + fontTempSml->Width(precTomorrow.c_str()) + marginItem*2; + int wLeft = osdWidth - wWidth - 20; + + weatherWidget.Clear(); + weatherWidget.SetOsd(osd); + weatherWidget.SetPosition(cRect(wLeft, wTop, wWidth, fontHeight)); + weatherWidget.SetBGColor(Config.decorBorderChannelBg); + weatherWidget.SetScrollingActive(false); + + weatherWidget.AddText(tempToday.c_str(), false, cRect(left, 0, 0, 0), Theme.Color(clrChannelFontEpg), Config.decorBorderChannelBg, font); + left += font->Width(tempToday.c_str()) + marginItem*2; + + cString weatherIcon = cString::sprintf("widgets/%s", iconToday.c_str()); + cImage *img = imgLoader.LoadIcon(*weatherIcon, fontHeight, fontHeight - marginItem*2); + if( img ) { + weatherWidget.AddImage(img, cRect(left, 0 + marginItem, fontHeight, fontHeight)); + left += fontHeight + marginItem; + } + weatherWidget.AddText(tempMaxToday.c_str(), false, cRect(left, 0, 0, 0), Theme.Color(clrChannelFontEpg), Config.decorBorderChannelBg, fontTempSml); + weatherWidget.AddText(tempMinToday.c_str(), false, cRect(left, 0 + fontTempSml->Height(), 0, 0), Theme.Color(clrChannelFontEpg), Config.decorBorderChannelBg, fontTempSml); + left += widthTempToday + marginItem; + + img = imgLoader.LoadIcon("widgets/umbrella", fontHeight, fontHeight - marginItem*2); + if( img ) { + weatherWidget.AddImage(img, cRect(left, 0 + marginItem, fontHeight, fontHeight)); + left += fontHeight - marginItem*2; + } + weatherWidget.AddText(precToday.c_str(), false, cRect(left, 0 + (fontHeight/2 - fontTempSml->Height()/2), 0, 0), Theme.Color(clrChannelFontEpg), Config.decorBorderChannelBg, fontTempSml); + left += fontTempSml->Width(precToday.c_str()) + marginItem*4; + + weatherWidget.AddRect(cRect(left - marginItem*2, 0, wWidth - left + marginItem*2, fontHeight), Theme.Color(clrChannelBg)); + + weatherIcon = cString::sprintf("widgets/%s", iconTomorrow.c_str()); + img = imgLoader.LoadIcon(*weatherIcon, fontHeight, fontHeight - marginItem*2); + if( img ) { + weatherWidget.AddImage(img, cRect(left, 0 + marginItem, fontHeight, fontHeight)); + left += fontHeight + marginItem; + } + weatherWidget.AddText(tempMaxTomorrow.c_str(), false, cRect(left, 0, 0, 0), Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontTempSml); + weatherWidget.AddText(tempMinTomorrow.c_str(), false, cRect(left, 0 + fontTempSml->Height(), 0, 0), Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontTempSml); + left += widthTempTomorrow + marginItem; + + img = imgLoader.LoadIcon("widgets/umbrella", fontHeight, fontHeight - marginItem*2); + if( img ) { + weatherWidget.AddImage(img, cRect(left, 0 + marginItem, fontHeight, fontHeight)); + left += fontHeight - marginItem*2; + } + weatherWidget.AddText(precTomorrow.c_str(), false, cRect(left, 0 + (fontHeight/2 - fontTempSml->Height()/2), 0, 0), Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontTempSml); + left += fontTempSml->Width(precTomorrow.c_str()); + + //weatherWidget.AddRect(cRect(left, 0, wWidth - left, fontHeight), clrTransparent); + + weatherWidget.CreatePixmaps(false); + weatherWidget.Draw(); +} diff --git a/baserender.h b/baserender.h index a027d6d5..4cae5fd6 100644 --- a/baserender.h +++ b/baserender.h @@ -4,6 +4,7 @@ #include <list> #include "flat.h" #include "textscroller.h" +#include "complexcontent.h" enum eBorder { BorderMenuItem, @@ -13,7 +14,8 @@ enum eBorder { BorderButton, BorderContent, BorderTVSPoster, - BorderSetRecording + BorderSetRecording, + BorderMMWidget }; struct sDecorBorder { @@ -103,6 +105,8 @@ class cFlatBaseRender cTextWrapper contentWrapperPoster; const cEvent *contentEvent; + cComplexContent weatherWidget; + cPixmap *decorPixmap; std::list<sDecorBorder> Borders; // for clear specific Borders (clear only MenuItems and not TopBar) @@ -172,4 +176,6 @@ class cFlatBaseRender void DecorBorderClearByFrom(int From); int GetFontAscender(const char *Name, int CharHeight, int CharWidth = 0); + + void DrawWidgetWeather(void); }; @@ -112,6 +112,9 @@ cFlatConfig::cFlatConfig(void) { MainMenuWidgetWeatherDays = 5; MainMenuWidgetWeatherType = 0; + ChannelWeatherShow = 1; + PlaybackWeatherShow = 1; + TopBarFontClockScale = 0.01; TopBarHideClockText = 0; @@ -336,6 +339,8 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "MainMenuWidgetWeatherPosition") == 0) MainMenuWidgetWeatherPosition = atoi(Value); else if (strcmp(Name, "MainMenuWidgetWeatherDays") == 0) MainMenuWidgetWeatherDays = atoi(Value); else if (strcmp(Name, "MainMenuWidgetWeatherType") == 0) MainMenuWidgetWeatherType = atoi(Value); + else if (strcmp(Name, "ChannelWeatherShow") == 0) ChannelWeatherShow = atoi(Value); + else if (strcmp(Name, "PlaybackWeatherShow") == 0) PlaybackWeatherShow = atoi(Value); else return false; @@ -205,6 +205,10 @@ class cFlatConfig int ChannelBitrateShow; int ChannelBitrateShowCalcInterval; // hidden config int ChannelTimeLeft; + + int ChannelWeatherShow; + int PlaybackWeatherShow; + int RecordingResolutionAspectShow; int RecordingFormatShow; int RecordingSimpleAspectFormat; diff --git a/displaychannel.c b/displaychannel.c index 0b76f0f9..488ff3d1 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -97,6 +97,10 @@ cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) : m_Receiver(NULL) { cDevice::ActualDevice()->AttachReceiver(m_Receiver); } } + + if( Config.ChannelWeatherShow ) + DrawWidgetWeather(); + DecorBorderDraw(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightTop + heightBottom + Config.decorProgressChannelSize+marginItem*2, Config.decorBorderChannelSize, Config.decorBorderChannelType, Config.decorBorderChannelFg, Config.decorBorderChannelBg); diff --git a/displaymenu.c b/displaymenu.c index eb61c823..00e76aeb 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -3879,6 +3879,7 @@ const char* cFlatDisplayMenu::GetGenreIcon(uchar genre) { void cFlatDisplayMenu::DrawMainMenuWidgets(void) { int wLeft = osdWidth * Config.MainMenuItemScale + marginItem + Config.decorBorderMenuContentSize; int wTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuContentSize; + int wWidth = osdWidth - wLeft - Config.decorBorderMenuContentSize; int wHeight = menuPixmap->ViewPort().Height() - marginItem*2; int ContentTop = 0; @@ -3961,7 +3962,7 @@ void cFlatDisplayMenu::DrawMainMenuWidgets(void) { contentWidget.Draw(); DecorBorderDraw(wLeft, wTop, wWidth, contentWidget.ContentHeight(false), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType, - Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); + Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg, BorderMMWidget); } int cFlatDisplayMenu::DrawMainMenuWidgetDVBDevices(int wLeft, int wWidth, int ContentTop) { @@ -4828,38 +4829,6 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte return contentWidget.ContentHeight(false); } -/* -int cFlatDisplayMenu::DrawMainMenuWidgetTimerConflicts(int wLeft, int wTop, int wWidth) { - int wHeight = fontHeight + 6 + (Config.MainMenuWidgetLastRecMaxCount * fontSmlHeight) + Config.decorBorderMenuContentSize*2; - int ContentTop = marginItem; - - contentWidgetTimerConflicts.Clear(); - contentWidgetTimerConflicts.SetOsd(osd); - contentWidgetTimerConflicts.SetPosition(cRect(wLeft, wTop, wWidth, wHeight)); - contentWidgetTimerConflicts.SetBGColor(Theme.Color(clrMenuRecBg)); - contentWidgetTimerConflicts.SetScrollingActive(false); - - contentWidgetTimerConflicts.AddText(tr("Last Recordings"), false, cRect(marginItem*10, ContentTop, 0, 0), Theme.Color(clrMenuEventFontTitle), Theme.Color(clrMenuEventBg), font); - ContentTop += fontHeight; - contentWidgetTimerConflicts.AddRect(cRect(0, ContentTop, wWidth, 3), Theme.Color(clrMenuEventTitleLine)); - ContentTop += 6; - - if( wTop + contentWidgetTimerConflicts.ContentHeight(false) + fontSmlHeight > menuPixmap->ViewPort().Height() ) - return 0; - - contentWidgetTimerConflicts.AddText(strRec.str().c_str(), true, cRect(marginItem, ContentTop, wWidth - marginItem*2, fontSmlHeight), - Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml); - ContentTop += fontSmlHeight; - - contentWidgetTimerConflicts.CreatePixmaps(false); - contentWidgetTimerConflicts.Draw(); - - DecorBorderDraw(wLeft, wTop, wWidth, contentWidgetTimerConflicts.ContentHeight(false), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType, - Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); - - return contentWidgetTimerConflicts.ContentHeight(false); -} -*/ void cFlatDisplayMenu::PreLoadImages(void) { // menu icons cString Path = cString::sprintf("%s%s/menuIcons", *Config.iconPath, Setup.OSDTheme); diff --git a/displayreplay.c b/displayreplay.c index bb26fe35..c1dd97a9 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -31,6 +31,9 @@ cFlatDisplayReplay::cFlatDisplayReplay(bool ModeOnly) { iconsPixmap->Fill(clrTransparent); fontSecs = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize * Config.TimeSecsScale * 100.0); + + if( Config.PlaybackWeatherShow ) + DrawWidgetWeather(); } cFlatDisplayReplay::~cFlatDisplayReplay() { diff --git a/po/de_DE.po b/po/de_DE.po index 836cbbbc..3527448c 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.4.3\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-11-16 12:23+0100\n" +"POT-Creation-Date: 2014-11-16 14:15+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -28,7 +28,7 @@ msgid "clock" msgstr "Uhr" msgid "Genre" -msgstr "" +msgstr "Kategorie" msgid "FSK" msgstr "" @@ -136,43 +136,43 @@ msgid "Recording information" msgstr "Aufnahme Informationen" msgid "DVB Devices" -msgstr "" +msgstr "DVB Geräte" msgid "LiveTV" msgstr "" msgid "Unknown" -msgstr "" +msgstr "Unbekannt" msgid "recording" -msgstr "" +msgstr "Nimmt auf" msgid "not used" -msgstr "" +msgstr "Nicht verwendet" msgid "Active Timer" -msgstr "" +msgstr "Aktive Timer" msgid "no active timer" -msgstr "" +msgstr "Keine aktiven Timer" msgid "Last Recordings" -msgstr "" +msgstr "Letzte Aufnahmen" msgid "Timer Conflicts" -msgstr "" +msgstr "Timerkonflikte" msgid "no timer conflicts" -msgstr "" +msgstr "Keine Timerkonflikte" msgid "timer conflicts" -msgstr "" +msgstr "timerkonflikte" msgid "System Information" -msgstr "" +msgstr "Systeminformation" msgid "no information available please check the script" -msgstr "" +msgstr "Keine Informationen verfügbar; Bitte Skript prüfen" msgid "System Version" msgstr "" @@ -181,67 +181,67 @@ msgid "Kernel Version" msgstr "" msgid "Uptime" -msgstr "" +msgstr "Läuft" msgid "Load" -msgstr "" +msgstr "Last" msgid "Processes" -msgstr "" +msgstr "Prozesse" msgid "Memory Usage" -msgstr "" +msgstr "Speicherbelegung" msgid "Swap Usage" -msgstr "" +msgstr "Swap-Nutzung" msgid "Root Usage" -msgstr "" +msgstr "Root-Nutzung" msgid "Video Usage" -msgstr "" +msgstr "Video-Nutzung" msgid "VDR CPU Usage" -msgstr "" +msgstr "VDR CPU-Nutzung" msgid "VDR MEM Usage" -msgstr "" +msgstr "VDR Speichernutzung" msgid "Temp CPU" -msgstr "" +msgstr "CPU-Temperatur" msgid "Temp GPU" -msgstr "" +msgstr "GPU-Temperatur" msgid "Temp PC-Case" -msgstr "" +msgstr "Gehäuse-Temperatur" msgid "Temp MB" -msgstr "" +msgstr "MB-Temperatur" msgid "Updates" -msgstr "" +msgstr "Aktualisierungen" msgid "Security Updates" -msgstr "" +msgstr "Sicherheitsupdates" msgid "System Updates" -msgstr "" +msgstr "Systemupdates" msgid "Updatestatus not available please check the widget" -msgstr "" +msgstr "Updatestatus nicht vorhanden; Bitte Widget prüfen" msgid "Temperatures" -msgstr "" +msgstr "Temperaturen" msgid "Temperatures not available please check the widget" -msgstr "" +msgstr "Temperaturen nicht vorhanden; Bitte Widget prüfen" msgid "CPU" msgstr "" msgid "PC-Case" -msgstr "" +msgstr "Gehäuse" msgid "MB" msgstr "" @@ -250,13 +250,13 @@ msgid "GPU" msgstr "" msgid "no title available" -msgstr "" +msgstr "Kein Titel vorhanden" msgid "no output available" -msgstr "" +msgstr "Keine Ausgabe vorhanden" msgid "Weather" -msgstr "" +msgstr "Wetter" msgid "Audio Tracks" msgstr "Audio Spuren" @@ -391,10 +391,10 @@ msgid "remaining" msgstr "verbleibend" msgid "short" -msgstr "" +msgstr "kurz" msgid "long" -msgstr "" +msgstr "lang" msgid "General settings" msgstr "Allgemeine Einstellungen" @@ -412,7 +412,7 @@ msgid "Volume settings" msgstr "Lautstärke Einstellungen" msgid "Tracks settings" -msgstr "Audiospur Einstellungen" +msgstr "Tonspur Einstellungen" msgid "TVScraper / scraper2vdr settings" msgstr "TVScraper / scraper2vdr Einstellungen" @@ -421,7 +421,7 @@ msgid "TVScraper / scraper2vdr not installed" msgstr "TVScraper / scraper2vdr nicht installiert" msgid "Main menu widgets settings" -msgstr "" +msgstr "Hauptmenü: Widget Einstellungen" msgid "configfile" msgstr "Konfigdatei" @@ -543,6 +543,9 @@ msgstr "Zeige Kanalinfo Logos" msgid "Show signal quality" msgstr "Zeige Signalqualität" +msgid "Show weather widget" +msgstr "Zeige Wetter Widget" + msgid "Colors for signal quality" msgstr "Farben für Signalqualität" @@ -721,16 +724,16 @@ msgid "Volume progress size" msgstr "Lautstärke Fortschritt Größe" msgid "Tracks border by decor-file?" -msgstr "Audiospur Rand aus Dekordatei?" +msgstr "Tonspur Rand aus Dekordatei?" msgid "Tracks border type" -msgstr "Audiospur Rand Typ" +msgstr "Tonspur Rand Typ" msgid "Tracks border size" -msgstr "Audiospur Rand Größe" +msgstr "Tonspur Rand Größe" msgid "TVScraper settings" -msgstr "" +msgstr "TVScraper: Einstellungen" msgid "Channelinfo show poster?" msgstr "Kanalinfo zeige Poster?" @@ -751,82 +754,82 @@ msgid "recording info show actors?" msgstr "Aufnahmeinfo zeige Schauspieler?" msgid "Enable main menu widgets" -msgstr "" +msgstr "Hauptmenü Widgets anzeigen" msgid "Main menu item scale" -msgstr "" +msgstr "Hauptmenü Widgets: Breite (%)" msgid "Widget weather: enable" -msgstr "" +msgstr "Wetter-Widget anzeigen" msgid "Widget weather: position" -msgstr "" +msgstr "Wetter-Widget: Position" msgid "Widget weather: show days" -msgstr "" +msgstr "Wetter-Widget: Zeige Tage" msgid "Widget weather: type" -msgstr "" +msgstr "Wetter-Widget: Typ" msgid "Widget DVB devices: enable" -msgstr "" +msgstr "DVB Geräte-Widget: Anzeigen" msgid "Widget DVB devices: position" -msgstr "" +msgstr "DVB Geräte-Widget: Position" msgid "Widget active timer: enable" -msgstr "" +msgstr "Aktive Timer-Widget: Anzeigen" msgid "Widget active timer: position" -msgstr "" +msgstr "Aktive Timer-Widget: Position" msgid "Widget active timer: max show" -msgstr "" +msgstr "Aktive Timer-Widget: Zeige max." msgid "Widget active timer: hide if empty" -msgstr "" +msgstr "Aktive Timer-Widget: Verstecken wenn Leer" msgid "Widget last recordings: enable" -msgstr "" +msgstr "Letzte Aufnahmen-Widget: Anzeigen" msgid "Widget last recordings: position" -msgstr "" +msgstr "Letzte Aufnahmen-Widget: Position" msgid "Widget last recordings: max show" -msgstr "" +msgstr "Letzte Aufnahmen-Widget: Zeige max." msgid "Widget timer conflicts: enable" -msgstr "" +msgstr "Timerkonflikte-Widget: Anzeigen" msgid "Widget timer conflicts: position" -msgstr "" +msgstr "Timerkonflikte-Widget: Position" msgid "Widget timer conflicts: hide if empty" -msgstr "" +msgstr "Timerkonflikte-Widget: Verstecken wenn Leer" msgid "Widget system information: enable" -msgstr "" +msgstr "Systeminformation-Widget: Anzeigen" msgid "Widget system information: position" -msgstr "" +msgstr "Systeminformation-Widget: Position" msgid "Widget system updates: enable" -msgstr "" +msgstr "Systemupdates-Widget: Anzeigen" msgid "Widget system updates: position" -msgstr "" +msgstr "Systemupdates-Widget: Position" msgid "Widget system updates: hide if empty" -msgstr "" +msgstr "Systemupdates-Widget: Verstecken wenn Leer" msgid "Widget temperatures: enable" -msgstr "" +msgstr "Temperaturen-Widget: Anzeigen" msgid "Widget temperatures: position" -msgstr "" +msgstr "Temperaturen-Widget: Position" msgid "Widget custom commands: enable" -msgstr "" +msgstr "Eigene Befehle-Widget: Anzeigen" msgid "Widget custom commands: position" -msgstr "" +msgstr "Eigene Befehle-Widget: Position" @@ -308,6 +308,8 @@ void cFlatSetup::Store(void) { SetupStore("MainMenuWidgetWeatherPosition", Config.MainMenuWidgetWeatherPosition); SetupStore("MainMenuWidgetWeatherDays", Config.MainMenuWidgetWeatherDays); SetupStore("MainMenuWidgetWeatherType", Config.MainMenuWidgetWeatherType); + SetupStore("ChannelWeatherShow", Config.ChannelWeatherShow); + SetupStore("PlaybackWeatherShow", Config.PlaybackWeatherShow); Config.Init(); } @@ -481,6 +483,8 @@ bool cFlatSetupGeneral::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "MainMenuWidgetWeatherPosition") == 0) SetupConfig->MainMenuWidgetWeatherPosition = atoi(Value); else if (strcmp(Name, "MainMenuWidgetWeatherDays") == 0) SetupConfig->MainMenuWidgetWeatherDays = atoi(Value); else if (strcmp(Name, "MainMenuWidgetWeatherType") == 0) SetupConfig->MainMenuWidgetWeatherType = atoi(Value); + else if (strcmp(Name, "ChannelWeatherShow") == 0) SetupConfig->ChannelWeatherShow = atoi(Value); + else if (strcmp(Name, "PlaybackWeatherShow") == 0) SetupConfig->PlaybackWeatherShow = atoi(Value); else return false; return true; @@ -636,6 +640,8 @@ void cFlatSetupGeneral::SaveCurrentSettings(void) { Config.Store("MainMenuWidgetWeatherPosition", SetupConfig->MainMenuWidgetWeatherPosition, *Filename); Config.Store("MainMenuWidgetWeatherDays", SetupConfig->MainMenuWidgetWeatherDays, *Filename); Config.Store("MainMenuWidgetWeatherType", SetupConfig->MainMenuWidgetWeatherType, *Filename); + Config.Store("ChannelWeatherShow", SetupConfig->ChannelWeatherShow, *Filename); + Config.Store("PlaybackWeatherShow", SetupConfig->PlaybackWeatherShow, *Filename); cString msg = cString::sprintf("%s %s", tr("saved settings in file:"), *File); Skins.Message(mtInfo, msg); @@ -807,6 +813,7 @@ void cFlatSetupChannelInfo::Setup(void) { Add(new cMenuEditBoolItem(tr("Show Channelinfo icons"), &SetupConfig->ChannelIconsShow)); Add(new cMenuEditBoolItem(tr("Show signal quality"), &SetupConfig->SignalQualityShow)); + Add(new cMenuEditBoolItem(tr("Show weather widget"), &SetupConfig->ChannelWeatherShow)); Add(new cMenuEditBoolItem(tr("Colors for signal quality"), &SetupConfig->SignalQualityUseColors)); Add(new cMenuEditBoolItem(tr("Show resolution & aspect"), &SetupConfig->ChannelResolutionAspectShow)); Add(new cMenuEditBoolItem(tr("Show format (hd/sd)"), &SetupConfig->ChannelFormatShow)); @@ -1016,6 +1023,7 @@ void cFlatSetupReplay::Setup(void) { Add(new cMenuEditBoolItem(tr("Show format (hd/sd)"), &SetupConfig->RecordingFormatShow)); Add(new cMenuEditBoolItem(tr("Simple aspect & format"), &SetupConfig->RecordingSimpleAspectFormat)); Add(new cMenuEditPrcItem(tr("Time seconds font scale"), &SetupConfig->TimeSecsScale, 0.003, 0.01, 1)); + Add(new cMenuEditBoolItem(tr("Show weather widget"), &SetupConfig->PlaybackWeatherShow)); if( SetupConfig->decorBorderReplayByTheme ) { cString type = cString::sprintf("%s:\t%s", tr("Replay border type"), Bordertypes[SetupConfig->decorBorderReplayTypeTheme]); diff --git a/widgets/temperatures/temperatures b/widgets/temperatures/temperatures index 56259ddd..be764be0 100755 --- a/widgets/temperatures/temperatures +++ b/widgets/temperatures/temperatures @@ -8,7 +8,7 @@ LANG=de_DE.UTF-8 # there can be 4 files, cpu, gpu, pccase, motherboard -rm -f ./cpu ./pccase ./gpu +rm -f ./cpu ./pccase ./gpu ./motherboard # intel core-i cpu temp sensors -A coretemp-isa-0000 | grep "Core 0" | awk '{print $3}' | tr -d "+" > ./cpu diff --git a/widgets/temperatures/temperatures.g2v b/widgets/temperatures/temperatures.g2v index 7da4d68e..0f0472ff 100755 --- a/widgets/temperatures/temperatures.g2v +++ b/widgets/temperatures/temperatures.g2v @@ -8,23 +8,25 @@ LANG=de_DE.UTF-8 # there can be 4 files, cpu, gpu, pccase, motherboard -rm -f ./cpu ./pccase ./gpu +rm -f ./cpu ./gpu ./pccase ./motherboard # intel core-i cpu temp #sensors -A coretemp-isa-0000 | grep "Core 0" | awk '{print $3}' | tr -d "+" > ./cpu # cpu temp CPUTEMP=($(sensors -A | grep "CPU Temperature")) -CPUTEMP[2]=${CPUTEMP[2]/+} +CPUTEMP[2]=${CPUTEMP[2]/+} # +36.0°C -> 36.0°C #echo "${CPUTEMP[2]/./,}" > ./cpu # 36,0°C echo "${CPUTEMP[2]%.*}°C" > ./cpu # 36°C # pc case temp #sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ./pccase + +# motherboard temp MBTEMP=($(sensors -A | grep "MB Temperature")) -MBTEMP[2]=${MBTEMP[2]/+} -#echo "${MBTEMP[2]/./,}" > ./pccase # 36,0°C -echo "${MBTEMP[2]%.*}°C" > ./pccase # 36°C +MBTEMP[2]=${MBTEMP[2]/+} # +36.0°C -> 36.0°C +#echo "${MBTEMP[2]/./,}" > ./motherboard # 36,0°C +echo "${MBTEMP[2]%.*}°C" > ./motherboard # 36°C # nvidia gpu temp # nvidia-settings must be run as the user of the x server diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php index d2d38c1e..800f3f7b 100644 --- a/widgets/weather/update_weather.php +++ b/widgets/weather/update_weather.php @@ -18,6 +18,17 @@ array_map('unlink', glob("weather.*")); // forecast query $forecast = new ForecastIO($api_key); +$condition = $forecast->getCurrentConditions($latitude, $longitude, $units, $lang); +if( !$handle = fopen("weather.0.temp", "w") ) { + print "can't create file!\n"; + continue; +} +$temp = round($condition->getTemperature(), 1); +fwrite($handle, $temp); +fwrite($handle, $degree_sign); +fclose($handle); + + // get daily conditions for next 7 days $conditions_week = $forecast->getForecastWeek($latitude, $longitude, $units, $lang); @@ -40,17 +51,6 @@ foreach($conditions_week as $conditions) { fwrite($handle, $conditions->getSummary()); fclose($handle); -/* - if( !$handle = fopen("weather.".$index.".temp", "w") ) { - print "can't create file!\n"; - continue; - } - // we only have min & max so we must calc - $temp = round(($conditions->getMinTemperature() + $conditions->getMaxTemperature()) / 2.0, 1); - fwrite($handle, $temp); - fwrite($handle, $degree_sign); - fclose($handle); - */ if( !$handle = fopen("weather.".$index.".tempMin", "w") ) { print "can't create file!\n"; continue; |