summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 12:43:30 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 12:43:30 +0100
commitefdb12a81dd96d913651b8b2bd5bbcbd8b135cbb (patch)
tree1c8b26612abe39c49fd494c32ea33554bcbaff55
parentff62c44e6cfdf5b015d04256341e950de76c6b92 (diff)
downloadskin-flatplus-efdb12a81dd96d913651b8b2bd5bbcbd8b135cbb.tar.gz
skin-flatplus-efdb12a81dd96d913651b8b2bd5bbcbd8b135cbb.tar.bz2
update widgets
-rw-r--r--baserender.c12
-rw-r--r--complexcontent.c4
-rw-r--r--displaymenu.c111
-rw-r--r--po/de_DE.po19
-rw-r--r--setup.c12
-rwxr-xr-xwidgets/system_information/system_information.g2v175
-rwxr-xr-xwidgets/temperatures/temperatures9
-rwxr-xr-xwidgets/temperatures/temperatures.g2v32
-rw-r--r--widgets/weather/GetLatLangFromCity.php25
-rw-r--r--widgets/weather/README9
-rw-r--r--widgets/weather/update_weather.config15
-rw-r--r--widgets/weather/update_weather.php38
12 files changed, 382 insertions, 79 deletions
diff --git a/baserender.c b/baserender.c
index 3fd4e3e6..0934d930 100644
--- a/baserender.c
+++ b/baserender.c
@@ -124,11 +124,11 @@ void cFlatBaseRender::TopBarCreate(void) {
topBarHeight = topBarFontSmlHeight * 2;
topBarPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight));
- dsyslog("skinflatplus: topBarPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
+ //dsyslog("skinflatplus: topBarPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
topBarIconBGPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight));
- dsyslog("skinflatplus: topBarIconBGPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
+ //dsyslog("skinflatplus: topBarIconBGPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
topBarIconPixmap = osd->CreatePixmap(3, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight));
- dsyslog("skinflatplus: topBarIconPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
+ //dsyslog("skinflatplus: topBarIconPixmap left: %d top: %d width: %d height: %d", Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight);
topBarPixmap->Fill(clrTransparent);
topBarIconBGPixmap->Fill(clrTransparent);
topBarIconPixmap->Fill(clrTransparent);
@@ -489,7 +489,7 @@ void cFlatBaseRender::ButtonsCreate(void) {
buttonsPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderButtonSize,
buttonsTop, buttonsWidth - Config.decorBorderButtonSize*2, buttonsHeight));
buttonsPixmap->Fill(clrTransparent);
- dsyslog("skinflatplus: buttonsPixmap left: %d top: %d width: %d height: %d", Config.decorBorderButtonSize, buttonsTop, buttonsWidth - Config.decorBorderButtonSize*2, buttonsHeight);
+ //dsyslog("skinflatplus: buttonsPixmap left: %d top: %d width: %d height: %d", Config.decorBorderButtonSize, buttonsTop, buttonsWidth - Config.decorBorderButtonSize*2, buttonsHeight);
}
void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char *Yellow, const char *Blue) {
@@ -554,8 +554,8 @@ void cFlatBaseRender::MessageCreate(void) {
messageIconPixmap = osd->CreatePixmap(5, cRect(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight));
messageIconPixmap->Fill(clrTransparent);
- dsyslog("skinflatplus: messagePixmap left: %d top: %d width: %d height: %d", Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight);
- dsyslog("skinflatplus: messageIconPixmap left: %d top: %d width: %d height: %d", Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight);
+ //dsyslog("skinflatplus: messagePixmap left: %d top: %d width: %d height: %d", Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight);
+ //dsyslog("skinflatplus: messageIconPixmap left: %d top: %d width: %d height: %d", Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight);
messageScroller.SetOsd(osd);
messageScroller.SetScrollStep( Config.ScrollerStep );
diff --git a/complexcontent.c b/complexcontent.c
index d77a1139..7c265414 100644
--- a/complexcontent.c
+++ b/complexcontent.c
@@ -62,8 +62,8 @@ void cComplexContent::CreatePixmaps(bool fullFillBackground) {
Pixmap = Osd->CreatePixmap(1, Position, PositionDraw);
PixmapImage = Osd->CreatePixmap(2, Position, PositionDraw);
- dsyslog("skinflatplus: ComplexContentPixmap left: %d top: %d width: %d height: %d", Position.Left(), Position.Top(), Position.Width(), Position.Height() );
- dsyslog("skinflatplus: ComplexContentPixmap drawport left: %d top: %d width: %d height: %d", PositionDraw.Left(), PositionDraw.Top(), PositionDraw.Width(), PositionDraw.Height() );
+ //dsyslog("skinflatplus: ComplexContentPixmap left: %d top: %d width: %d height: %d", Position.Left(), Position.Top(), Position.Width(), Position.Height() );
+ //dsyslog("skinflatplus: ComplexContentPixmap drawport left: %d top: %d width: %d height: %d", PositionDraw.Left(), PositionDraw.Top(), PositionDraw.Width(), PositionDraw.Height() );
if( FullFillBackground ) {
Pixmap->Fill(ColorBg);
diff --git a/displaymenu.c b/displaymenu.c
index a0cdb4b6..eb61c823 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -55,23 +55,23 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) {
menuWidth = osdWidth;
menuTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize;
menuPixmap = osd->CreatePixmap(1, cRect(0, menuTop, menuWidth, scrollBarHeight ));
- dsyslog("skinflatplus: menuPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
+ //dsyslog("skinflatplus: menuPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
menuIconsBGPixmap = osd->CreatePixmap(2, cRect(0, menuTop, menuWidth, scrollBarHeight ));
- dsyslog("skinflatplus: menuIconsBGPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
+ //dsyslog("skinflatplus: menuIconsBGPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
menuIconsPixmap = osd->CreatePixmap(3, cRect(0, menuTop, menuWidth, scrollBarHeight ));
- dsyslog("skinflatplus: menuIconsPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
+ //dsyslog("skinflatplus: menuIconsPixmap left: %d top: %d width: %d height: %d", 0, menuTop, menuWidth, scrollBarHeight );
chLeft = Config.decorBorderMenuContentHeadSize;
chTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuContentHeadSize;
chWidth = menuWidth - Config.decorBorderMenuContentHeadSize*2;
chHeight = fontHeight + fontSmlHeight*2 + marginItem*2;
contentHeadPixmap = osd->CreatePixmap(1, cRect(chLeft, chTop, chWidth, chHeight));
- dsyslog("skinflatplus: contentHeadPixmap left: %d top: %d width: %d height: %d", chLeft, chTop, chWidth, chHeight );
+ //dsyslog("skinflatplus: contentHeadPixmap left: %d top: %d width: %d height: %d", chLeft, chTop, chWidth, chHeight );
contentHeadIconsPixmap = osd->CreatePixmap(2, cRect(chLeft, chTop, chWidth, chHeight));
scrollbarPixmap = osd->CreatePixmap(2, cRect(0, scrollBarTop, menuWidth, scrollBarHeight + buttonsHeight + Config.decorBorderButtonSize*2));
- dsyslog("skinflatplus: scrollbarPixmap left: %d top: %d width: %d height: %d", 0, scrollBarTop, menuWidth, scrollBarHeight + buttonsHeight + Config.decorBorderButtonSize*2 );
+ //dsyslog("skinflatplus: scrollbarPixmap left: %d top: %d width: %d height: %d", 0, scrollBarTop, menuWidth, scrollBarHeight + buttonsHeight + Config.decorBorderButtonSize*2 );
menuPixmap->Fill(clrTransparent);
menuIconsPixmap->Fill(clrTransparent);
@@ -2945,7 +2945,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) {
chWidth = menuWidth - Config.decorBorderMenuContentHeadSize*2;
chHeight = fontHeight + fontSmlHeight*2 + marginItem*2;
contentHeadPixmap = osd->CreatePixmap(1, cRect(chLeft, chTop, chWidth, chHeight));
- dsyslog("skinflatplus: contentHeadPixmap left: %d top: %d width: %d height: %d", chLeft, chTop, chWidth, chHeight );
+ //dsyslog("skinflatplus: contentHeadPixmap left: %d top: %d width: %d height: %d", chLeft, chTop, chWidth, chHeight );
contentHeadIconsPixmap->Fill(clrTransparent);
@@ -4230,7 +4230,6 @@ int cFlatDisplayMenu::DrawMainMenuWidgetSystemInformation(int wLeft, int wWidth,
cReadDir d(configsPath);
struct dirent *e;
while ((e = d.Next()) != NULL) {
- dsyslog("FILE: %s", e->d_name);
std::string fname = e->d_name;
std::size_t found = fname.find("_");
if( found != std::string::npos ) {
@@ -4380,6 +4379,18 @@ int cFlatDisplayMenu::DrawMainMenuWidgetSystemInformation(int wLeft, int wWidth,
ContentLeft = marginItem;
ContentTop += fontSmlHeight;
}
+ } else if( ! item.compare("vdr_mem_usage") ) {
+ cString str = cString::sprintf("%s: %s", tr("VDR MEM Usage"), item_content.c_str());
+ contentWidget.AddText(*str, false, cRect(ContentLeft, ContentTop, wWidth - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ if( Column == 1 ) {
+ Column = 2;
+ ContentLeft = wWidth / 2;
+ } else {
+ Column = 1;
+ ContentLeft = marginItem;
+ ContentTop += fontSmlHeight;
+ }
} else if( ! item.compare("cpu") ) {
cString str = cString::sprintf("%s: %s", tr("Temp CPU"), item_content.c_str());
contentWidget.AddText(*str, false, cRect(ContentLeft, ContentTop, wWidth - marginItem*2, fontSmlHeight),
@@ -4416,6 +4427,18 @@ int cFlatDisplayMenu::DrawMainMenuWidgetSystemInformation(int wLeft, int wWidth,
ContentLeft = marginItem;
ContentTop += fontSmlHeight;
}
+ } else if( ! item.compare("motherboard") ) {
+ cString str = cString::sprintf("%s: %s", tr("Temp MB"), item_content.c_str());
+ contentWidget.AddText(*str, false, cRect(ContentLeft, ContentTop, wWidth - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ if( Column == 1 ) {
+ Column = 2;
+ ContentLeft = wWidth / 2;
+ } else {
+ Column = 1;
+ ContentLeft = marginItem;
+ ContentTop += fontSmlHeight;
+ }
} else if( ! item.compare("updates") ) {
cString str = cString::sprintf("%s: %s", tr("Updates"), item_content.c_str());
contentWidget.AddText(*str, false, cRect(ContentLeft, ContentTop, wWidth - marginItem*2, fontSmlHeight),
@@ -4521,12 +4544,15 @@ int cFlatDisplayMenu::DrawMainMenuWidgetTemperaturs(int wLeft, int wWidth, int C
int r = system(*execFile);
r += 0; // prevent Warning for unused variable
- std::string tempCPU, tempCase, tempGPU;
+ int countTemps = 0;
+
+ std::string tempCPU, tempCase, tempMB, tempGPU;
cString itemFilename = cString::sprintf("%s/widgets/temperatures/cpu", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) );
std::ifstream file(*itemFilename, std::ifstream::in);
if( file.is_open() ) {
std::getline(file, tempCPU);
file.close();
+ countTemps++;
} else {
tempCPU = "-1";
}
@@ -4537,33 +4563,61 @@ int cFlatDisplayMenu::DrawMainMenuWidgetTemperaturs(int wLeft, int wWidth, int C
std::string cont;
std::getline(file2, tempCase);
file2.close();
+ countTemps++;
} else {
tempCase = "-1";
}
- itemFilename = cString::sprintf("%s/widgets/temperatures/gpu", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) );
+ itemFilename = cString::sprintf("%s/widgets/temperatures/motherboard", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) );
std::ifstream file3(*itemFilename, std::ifstream::in);
if( file3.is_open() ) {
std::string cont;
- std::getline(file3, tempGPU);
+ std::getline(file3, tempMB);
file3.close();
+ countTemps++;
+ } else {
+ tempMB = "-1";
+ }
+ itemFilename = cString::sprintf("%s/widgets/temperatures/gpu", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N) );
+ std::ifstream file4(*itemFilename, std::ifstream::in);
+ if( file4.is_open() ) {
+ std::string cont;
+ std::getline(file4, tempGPU);
+ file4.close();
+ countTemps++;
} else {
tempGPU = "-1";
}
- if( !strcmp(tempCPU.c_str(), "-1") && !strcmp(tempCase.c_str(), "-1") && !strcmp(tempGPU.c_str(), "-1") ) {
+ if( !strcmp(tempCPU.c_str(), "-1") && !strcmp(tempCase.c_str(), "-1") && !strcmp(tempMB.c_str(), "-1") && !strcmp(tempGPU.c_str(), "-1") ) {
contentWidget.AddText(tr("Temperatures not available please check the widget"), false, cRect(marginItem, ContentTop, wWidth - marginItem*2, fontSmlHeight),
Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
} else {
- cString str = cString::sprintf("%s: %s", tr("CPU"), tempCPU.c_str());
- contentWidget.AddText(*str, false, cRect(marginItem, ContentTop, wWidth - marginItem*2, fontSmlHeight),
- Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
- str = cString::sprintf("%s: %s", tr("PC-Case"), tempCase.c_str());
- contentWidget.AddText(*str, false, cRect(wWidth/3 + marginItem, ContentTop, wWidth/3 - marginItem*2, fontSmlHeight),
- Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
- str = cString::sprintf("%s: %s", tr("GPU"), tempGPU.c_str());
- contentWidget.AddText(*str, false, cRect(wWidth/3*2 + marginItem, ContentTop, wWidth/3*2 - marginItem*2, fontSmlHeight),
- Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ int Left = marginItem;
+ int addLeft = wWidth / (countTemps);
+ if( strcmp(tempCPU.c_str(), "-1") ) {
+ cString str = cString::sprintf("%s: %s", tr("CPU"), tempCPU.c_str());
+ contentWidget.AddText(*str, false, cRect(Left, ContentTop, wWidth - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ Left += addLeft;
+ }
+ if( strcmp(tempCase.c_str(), "-1") ) {
+ cString str = cString::sprintf("%s: %s", tr("PC-Case"), tempCase.c_str());
+ contentWidget.AddText(*str, false, cRect(Left, ContentTop, wWidth/3 - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ Left += addLeft;
+ }
+ if( strcmp(tempMB.c_str(), "-1") ) {
+ cString str = cString::sprintf("%s: %s", tr("MB"), tempMB.c_str());
+ contentWidget.AddText(*str, false, cRect(Left, ContentTop, wWidth/3*2 - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ Left += addLeft;
+ }
+ if( strcmp(tempGPU.c_str(), "-1") ) {
+ cString str = cString::sprintf("%s: %s", tr("GPU"), tempGPU.c_str());
+ contentWidget.AddText(*str, false, cRect(Left, ContentTop, wWidth/3*2 - marginItem*2, fontSmlHeight),
+ Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, wWidth - marginItem*2);
+ }
}
return contentWidget.ContentHeight(false);
@@ -4692,7 +4746,6 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte
p = atof(prec.c_str()) * 100.0;
p = roundUp(p, 10);
precString = cString::sprintf("%.0f%%", p);
- dsyslog("WEATHER: %s %f %s", prec.c_str(), p, *precString);
} else
continue;
@@ -4714,7 +4767,7 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte
weekDayName = WeekDayName(t2);
if( Config.MainMenuWidgetWeatherType == 0 ) { // short
- if( left + fontHeight*2 + font->Width("XXX") + font->Width("XXXX") + marginItem*6 > wWidth )
+ if( left + fontHeight*2 + fontTempSml->Width("XXXXX") + fontTempSml->Width("XXXX") + marginItem*6 > wWidth )
break;
if( index > 0 ) {
contentWidget.AddText("|", false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), font);
@@ -4729,15 +4782,15 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte
}
contentWidget.AddText(tempMax.c_str(), false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
contentWidget.AddText(tempMin.c_str(), false, cRect(left, ContentTop + fontTempSml->Height(), 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
- left += font->Width("XXX") + marginItem;
+ left += fontTempSml->Width("XXXXX") + marginItem;
img = imgLoader.LoadIcon("widgets/umbrella", fontHeight, fontHeight - marginItem*2);
if( img ) {
contentWidget.AddImage(img, cRect(left, ContentTop + marginItem, fontHeight, fontHeight));
left += fontHeight - marginItem;
}
- contentWidget.AddText(*precString, false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), font);
- left += font->Width(*precString) + marginItem*2;
+ contentWidget.AddText(*precString, false, cRect(left, ContentTop + (fontHeight/2 - fontTempSml->Height()/2), 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
+ left += fontTempSml->Width(*precString) + marginItem*2;
} else { // long
if( ContentTop + marginItem > menuPixmap->ViewPort().Height() )
break;
@@ -4756,17 +4809,17 @@ int cFlatDisplayMenu::DrawMainMenuWidgetWeather(int wLeft, int wWidth, int Conte
}
contentWidget.AddText(tempMax.c_str(), false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
contentWidget.AddText(tempMin.c_str(), false, cRect(left, ContentTop + fontTempSml->Height(), 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
- left += font->Width("XXX") + marginItem;
+ left += fontTempSml->Width("XXXXX") + marginItem;
img = imgLoader.LoadIcon("widgets/umbrella", fontHeight, fontHeight - marginItem*2);
if( img ) {
contentWidget.AddImage(img, cRect(left, ContentTop + marginItem, fontHeight, fontHeight));
left += fontHeight - marginItem;
}
- contentWidget.AddText(*precString, false, cRect(left, ContentTop, 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), font);
- left += font->Width("XXXX") + marginItem;
+ contentWidget.AddText(*precString, false, cRect(left, ContentTop + (fontHeight/2 - fontTempSml->Height()/2), 0, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml);
+ left += fontTempSml->Width("XXXX") + marginItem;
- contentWidget.AddText(summary.c_str(), true, cRect(left, ContentTop, wWidth - left, fontHeight), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml, wWidth - left, fontHeight);
+ contentWidget.AddText(summary.c_str(), false, cRect(left, ContentTop + (fontHeight/2 - fontTempSml->Height()/2), wWidth - left, fontHeight), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontTempSml, wWidth - left);
ContentTop += fontHeight;
}
diff --git a/po/de_DE.po b/po/de_DE.po
index 18483ec4..836cbbbc 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-15 15:41+0100\n"
+"POT-Creation-Date: 2014-11-16 12:23+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"
@@ -204,6 +204,9 @@ msgstr ""
msgid "VDR CPU Usage"
msgstr ""
+msgid "VDR MEM Usage"
+msgstr ""
+
msgid "Temp CPU"
msgstr ""
@@ -213,6 +216,9 @@ msgstr ""
msgid "Temp PC-Case"
msgstr ""
+msgid "Temp MB"
+msgstr ""
+
msgid "Updates"
msgstr ""
@@ -237,6 +243,9 @@ msgstr ""
msgid "PC-Case"
msgstr ""
+msgid "MB"
+msgstr ""
+
msgid "GPU"
msgstr ""
@@ -747,16 +756,16 @@ msgstr ""
msgid "Main menu item scale"
msgstr ""
-msgid "Widget DVB weather: enable"
+msgid "Widget weather: enable"
msgstr ""
-msgid "Widget DVB weather: position"
+msgid "Widget weather: position"
msgstr ""
-msgid "Widget DVB weather: show days"
+msgid "Widget weather: show days"
msgstr ""
-msgid "Widget DVB weather: type"
+msgid "Widget weather: type"
msgstr ""
msgid "Widget DVB devices: enable"
diff --git a/setup.c b/setup.c
index 3285d37b..770c9618 100644
--- a/setup.c
+++ b/setup.c
@@ -1221,12 +1221,12 @@ void cFlatSetupMMWidget::Setup(void) {
if( SetupConfig->MainMenuWidgetsEnable ) {
Add(new cMenuEditPrcItem(tr("Main menu item scale"), &SetupConfig->MainMenuItemScale, 0.3, 0.7, 0));
- Add(new cOsdItem("Widget DVB weather", osUnknown, false));
- Add(new cMenuEditBoolItem(tr("Widget DVB weather: enable"), &SetupConfig->MainMenuWidgetWeatherShow));
+ Add(new cOsdItem("Widget weather", osUnknown, false));
+ Add(new cMenuEditBoolItem(tr("Widget weather: enable"), &SetupConfig->MainMenuWidgetWeatherShow));
if( SetupConfig->MainMenuWidgetWeatherShow ) {
- Add(new cMenuEditIntItem(tr("Widget DVB weather: position"), &SetupConfig->MainMenuWidgetWeatherPosition));
- Add(new cMenuEditIntItem(tr("Widget DVB weather: show days"), &SetupConfig->MainMenuWidgetWeatherDays));
- Add(new cMenuEditStraItem(tr("Widget DVB weather: type"), &SetupConfig->MainMenuWidgetWeatherType, WeatherTypes.Size(), &WeatherTypes[0]));
+ Add(new cMenuEditIntItem(tr("Widget weather: position"), &SetupConfig->MainMenuWidgetWeatherPosition));
+ Add(new cMenuEditIntItem(tr("Widget weather: show days"), &SetupConfig->MainMenuWidgetWeatherDays));
+ Add(new cMenuEditStraItem(tr("Widget weather: type"), &SetupConfig->MainMenuWidgetWeatherType, WeatherTypes.Size(), &WeatherTypes[0]));
}
Add(new cOsdItem("Widget DVB devices", osUnknown, false));
@@ -1304,7 +1304,7 @@ eOSState cFlatSetupMMWidget::ProcessKey(eKeys Key) {
if( Key == kLeft || Key == kRight ) {
const char* ItemText = Get(Current())->Text();
if( strstr(ItemText, tr("Enable main menu widgets")) != NULL ||
- strstr(ItemText, tr("Widget DVB weather: enable")) != NULL ||
+ strstr(ItemText, tr("Widget weather: enable")) != NULL ||
strstr(ItemText, tr("Widget DVB devices: enable")) != NULL ||
strstr(ItemText, tr("Widget active timer: enable")) != NULL ||
strstr(ItemText, tr("Widget last recordings: enable")) != NULL ||
diff --git a/widgets/system_information/system_information.g2v b/widgets/system_information/system_information.g2v
new file mode 100755
index 00000000..56480fa3
--- /dev/null
+++ b/widgets/system_information/system_information.g2v
@@ -0,0 +1,175 @@
+#!/bin/bash
+
+# this script will be executed when the widget will be drawn
+# so make it short and fast
+
+# enable/disable items
+SHOW_SYS_VERSION=1
+SHOW_KERNEL_VERSION=0
+SHOW_UPTIME=1
+SHOW_LOAD=1
+SHOW_PROCESSES=1
+SHOW_MEM_USAGE=1
+SHOW_SWAP_USAGE=1
+SHOW_ROOT_USAGE=1
+SHOW_VIDEO_USAGE=1
+SHOW_VDR_CPU_USAGE=1
+SHOW_VDR_MEM_USAGE=1
+
+SHOW_TEMPERATURES=0
+SHOW_SYSUPDATES=0
+
+# Position of items
+# sys_version & kernel_version are drawn in one line
+# all others will be drawn in two column
+# for example
+# System Version: Ubuntu 14.04.1 LTS
+# Uptime: 1:20 5m Load: 0.41
+
+# must begin with 01
+SYS_VERSION_POS="01"
+KERNEL_VERSION_POS="02"
+UPTIME_POS="03"
+LOAD_POS="04"
+PROCESSES_POS="05"
+MEM_USAGE_POS="06"
+SWAP_USAGE_POS="07"
+ROOT_USAGE_POS="08"
+VIDEO_USAGE_POS="09"
+VDR_CPU_USAGE_POS="10"
+VDR_MEM_USAGE_POS="11"
+
+TEMP_CPU_POS=15
+TEMP_PCCASE_POS=16
+TEMP_GPU_POS=17
+
+SYSUPD_POS=20
+SYSSECUPD_POS=21
+
+# mount point of vdr video disk
+VIDEO_MOUNT="/video"
+
+# force english output for filters
+LANG=en_EN
+
+# Release-File (PRETTY_NAME & VERSION)
+REL_FILE="/etc/g2v-release"
+
+# delete all files
+rm -f [0-99]*
+
+if [ $SHOW_SYS_VERSION = 1 ]; then
+ if [ -e $REL_FILE ] ; then
+ while IFS= read -r; do
+ [[ ${REPLY} =~ PRETTY_NAME ]] && declare "${REPLY}" # locale Variable
+ [[ ${REPLY} =~ VERSION ]] && declare "${REPLY}" # locale Variable
+ done < $REL_FILE
+ [ -n "$PRETTY_NAME" ] && echo "${PRETTY_NAME//\"/} ${VERSION//\"/}" > ./${SYS_VERSION_POS}_sys_version
+ fi
+fi
+
+if [ $SHOW_KERNEL_VERSION = 1 ]; then
+ uname -r > ./${KERNEL_VERSION_POS}_kernel_version
+fi
+
+if [ $SHOW_UPTIME = 1 ]; then
+ UPTIME=($(cat /proc/uptime)) # UpTime in Array
+ UPTIME[0]=${UPTIME[0]%.*} # .* entfernen (UpTime in Sekunden)
+ TAGE=$((UPTIME[0] / 86400)) ; STD=$((UPTIME[0] % 86400 / 3600))
+ MIN=$((UPTIME[0] % 3600 / 60)) ; SEK=$((UPTIME[0] % 60))
+ if [ $TAGE -ge 1 ] ; then
+ echo "${TAGE}T ${STD}S ${MIN}M" > ./${UPTIME_POS}_uptime
+ else
+ [ $STD -ge 1 ] && echo -n "${STD} Std. " > ./${UPTIME_POS}_uptime
+ echo "${MIN} Min." >> ./${UPTIME_POS}_uptime
+ fi
+fi
+
+if [ $SHOW_LOAD = 1 ]; then
+ LOADAVG=($(cat /proc/loadavg)) # Zeile in Array
+ echo "${LOADAVG[0]//./,}" > ./${LOAD_POS}_load
+fi
+
+if [ $SHOW_PROCESSES = 1 ]; then
+ PROCS=($(ls -d /proc/[0-9]*/))
+ echo "${#PROCS[@]}" > ./${PROCESSES_POS}_processes
+fi
+
+if [ $SHOW_MEM_USAGE = 1 ]; then
+ mapfile -t < <(free -m) # Ausgabe von free in Array (Vier Zeilen)
+ MEM=(${MAPFILE[1]}) # 2. Zeile
+ BUF=(${MAPFILE[2]}) # 3. Zeile
+ MEM_USAGE=$((${BUF[2]} * 1000 / ${MEM[1]}))
+ [ $MEM_USAGE -lt 10 ] && MEM_USAGE="0${MEM_USAGE}"
+ MEM_DEC=${MEM_USAGE: -1}
+ echo "${MEM_USAGE:0: -1},${MEM_DEC}%" > ./${MEM_USAGE_POS}_mem_usage
+fi
+
+if [ $SHOW_SWAP_USAGE = 1 ]; then
+ mapfile -t < <(free -m) # Ausgabe von free in Array (Vier Zeilen)
+ SWAP=(${MAPFILE[3]}) # 4. Zeile
+ if [ ${SWAP[1]} -gt 0 ]; then # Swap Total
+ if [ ${SWAP[2]} -gt 0 ]; then # Swap Used
+ SWP=$((${SWAP[2]} * 1000 / ${SWAP[1]}))
+ [ $SWP -lt 10 ] && SWP="0${SWP}"
+ SWP_DEC=${SWP: -1} ; SWP=${SWP:0: -1},${SWP_DEC}
+ echo "${SWP}%" > ./${SWAP_USAGE_POS}_swap_usage
+ else
+ echo "0,0%" > ./${SWAP_USAGE_POS}_swap_usage
+ fi
+ fi
+fi
+
+if [ $SHOW_ROOT_USAGE = 1 ]; then
+ mapfile -t < <(df -Ph /) # Ausgabe von df in Array (Zwei Zeilen)
+ ROOTUSAGE=(${MAPFILE[1]}) # 2. Zeile in Array
+ # Beispiel 2. Zeile: tmpfs 128M 30M 99M 23% /root
+ echo "${ROOTUSAGE[4]}" > ./${ROOT_USAGE_POS}_root_usage
+fi
+
+if [ $SHOW_VIDEO_USAGE = 1 ] && [ -d ${VIDEO_MOUNT} ]; then
+ mapfile -t < <(df -Ph ${VIDEO_MOUNT}) # Ausgabe von df in Array (Zwei Zeilen)
+ VIDEOUSAGE=(${MAPFILE[1]}) # 2. Zeile in Array
+ # Beispiel 2. Zeile: tmpfs 128M 30M 99M 23% /root
+ echo "${VIDEOUSAGE[4]}" > ./${VIDEO_USAGE_POS}_video_usage
+fi
+
+if [ $SHOW_VDR_CPU_USAGE = 1 ]; then
+ vdr_pid=$(pidof vdr)
+ if [ $? = 0 ]; then
+ mapfile -t < <(ps -p ${vdr_pid} -o %cpu) # Ausgabe von ps in Array (Zwei Zeilen)
+ CPU_USAGE=${MAPFILE[1]/./,} # 24.2 -> 24,2
+ echo "${CPU_USAGE}%" > ./${VDR_CPU_USAGE_POS}_vdr_cpu_usage
+ fi
+fi
+
+if [ $SHOW_VDR_MEM_USAGE = 1 ]; then
+ vdr_pid=$(pidof vdr)
+ if [ $? = 0 ]; then
+ mapfile -t < <(ps -p ${vdr_pid} -o %mem) # Ausgabe von ps in Array (Zwei Zeilen)
+ VDR_MEM_USAGE=${MAPFILE[1]/./,} # 24.2 -> 24,2
+ echo "${VDR_MEM_USAGE}%" > ./${VDR_MEM_USAGE_POS}_vdr_mem_usage
+ fi
+fi
+
+if [ $SHOW_TEMPERATURES = 1 ]; then
+ ./../temperatures/temperatures
+ if [ -f ./cpu ]; then
+ mv ./cpu ${TEMP_CPU_POS}_cpu
+ fi
+ if [ -f ./pccase ]; then
+ mv ./pccase ${TEMP_PCCASE_POS}_pccase
+ fi
+ if [ -f ./gpu ]; then
+ mv ./gpu ${TEMP_GPU_POS}_gpu
+ fi
+fi
+
+if [ $SHOW_SYSUPDATES = 1 ]; then
+ if [ -f ./../system_updatestatus/updates ]; then
+ cp ./../system_updatestatus/updates ${SYSUPD_POS}_updates
+ fi
+ if [ -f ./../system_updatestatus/security_updates ]; then
+ cp ./../system_updatestatus/security_updates ${SYSSECUPD_POS}_security_updates
+ fi
+fi
diff --git a/widgets/temperatures/temperatures b/widgets/temperatures/temperatures
index 75a35796..56259ddd 100755
--- a/widgets/temperatures/temperatures
+++ b/widgets/temperatures/temperatures
@@ -6,7 +6,7 @@
# if the script is executed from system_information script set the locale back for "°C"
LANG=de_DE.UTF-8
-# there can be 3 files, cpu, gpu, case
+# there can be 4 files, cpu, gpu, pccase, motherboard
rm -f ./cpu ./pccase ./gpu
@@ -14,9 +14,12 @@ rm -f ./cpu ./pccase ./gpu
sensors -A coretemp-isa-0000 | grep "Core 0" | awk '{print $3}' | tr -d "+" > ./cpu
# pc case temp
-sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ./pccase
+#sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ./pccase
+
+# motherboard temp
+sensors -A acpitz-virtual-0 | grep "temp1" | awk '{print $2}' | tr -d "+" > ./motherboard
# nvidia gpu temp
# nvidia-settings must be run as the user of the x server
GPU=`nvidia-settings -c :0 -t -query GPUCoreTemp | head -n 1`
-echo "$GPU°C" > ./gpu
+echo "${GPU}°C" > ./gpu
diff --git a/widgets/temperatures/temperatures.g2v b/widgets/temperatures/temperatures.g2v
new file mode 100755
index 00000000..7da4d68e
--- /dev/null
+++ b/widgets/temperatures/temperatures.g2v
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# please update this script to fit your needs
+# this script is call every time the widget will be drawn, so keep it short and fast ;)
+
+# if the script is executed from system_information script set the locale back for "°C"
+LANG=de_DE.UTF-8
+
+# there can be 4 files, cpu, gpu, pccase, motherboard
+
+rm -f ./cpu ./pccase ./gpu
+
+# 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]/+}
+#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
+MBTEMP=($(sensors -A | grep "MB Temperature"))
+MBTEMP[2]=${MBTEMP[2]/+}
+#echo "${MBTEMP[2]/./,}" > ./pccase # 36,0°C
+echo "${MBTEMP[2]%.*}°C" > ./pccase # 36°C
+
+# nvidia gpu temp
+# nvidia-settings must be run as the user of the x server
+GPU=$(nvidia-settings -c :0 -t -query GPUCoreTemp | head -n 1)
+echo "${GPU}°C" > ./gpu
diff --git a/widgets/weather/GetLatLangFromCity.php b/widgets/weather/GetLatLangFromCity.php
new file mode 100644
index 00000000..e05c1bc8
--- /dev/null
+++ b/widgets/weather/GetLatLangFromCity.php
@@ -0,0 +1,25 @@
+<?php
+
+$handle = fopen ("php://stdin","r");
+echo "Country (like DE for Germany): ";
+$country = fgets($handle);
+echo "City (like Berlin): ";
+$city = fgets($handle);
+
+// get lat & long from google maps
+$MAPSURL = "http://maps.googleapis.com/maps/api/geocode/json?address=".$city.",".$country."&sensor=false";
+$json = file_get_contents($MAPSURL);
+$data = json_decode($json, true);
+
+if( !isset($data['results'][0]) ) {
+ echo "no latitude and longitude find for: ".$city.",".$country." !\n";
+ exit;
+}
+$latitude = $data['results'][0]['geometry']['location']['lat'];
+$longitude = $data['results'][0]['geometry']['location']['lng'];
+
+echo "latitude: ".$latitude."\n";
+echo "longitude: ".$longitude."\n";
+echo "put these values in update_weather.config\n";
+
+?>
diff --git a/widgets/weather/README b/widgets/weather/README
new file mode 100644
index 00000000..956c7a26
--- /dev/null
+++ b/widgets/weather/README
@@ -0,0 +1,9 @@
+This widget provide information about weather for a defined location.
+
+Since the command usually needs long time to execute this is not called from skin flatPlus.
+You have to call the command from the system via cron or at system start.
+For example call the command from cron.daily.
+
+You need php5 with command line support for this widget. For example in Ubuntu you need the package "php5-cli".
+
+Please configur your location and others in update_weather.config. Use php-script "GetLatLangFromCity.php" to get latitude & longitude from your location.
diff --git a/widgets/weather/update_weather.config b/widgets/weather/update_weather.config
new file mode 100644
index 00000000..4a749212
--- /dev/null
+++ b/widgets/weather/update_weather.config
@@ -0,0 +1,15 @@
+[main]
+# use GetLatLangFromCity.php to get latitude/langitude
+Latitude = 52.5200066
+Longitude = 13.404954
+# location shown in Skin
+LocationSkin = "Berlin"
+# Can be set to 'us', 'si', 'ca', 'uk' or 'auto' (see forecast.io API); default is auto
+Units = "si"
+DegreeSign = "°C"
+# Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
+Lang = "de"
+# We have only 1000 api calls per day, so please only do one update per day!
+# Or request an own key for free at forecast.io
+ApiKey = "137f2d85a1f1db5762e5e073103541d2"
+
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index 8d2d8be9..d2d38c1e 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -1,38 +1,20 @@
<?php
-/*
- * USER CONFIG
- */
-$city = "Berlin";
-$country = "DE";
-$locationSkin = "Berlin"; // location shown in skin
-$units = 'si'; // Can be set to 'us', 'si', 'ca', 'uk' or 'auto' (see forecast.io API); default is auto
-$degree_sign = "°C";
-$lang = 'de'; // Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
-// We have only 1000 api calls per day, so please only do one update per day!
-// Or request an own key for free at forecast.io
-$api_key = '137f2d85a1f1db5762e5e073103541d2';
-
-/*
- * DO NOT CHANGE ANYTHING FROM HERE
- */
+$ini_array = parse_ini_file("./update_weather.config");
+
+$latitude = $ini_array['Latitude'];
+$longitude = $ini_array['Longitude'];
+$locationSkin = $ini_array['LocationSkin'];
+$units = $ini_array['Units'];
+$degree_sign = $ini_array['DegreeSign'];
+$lang = $ini_array['Lang'];
+$api_key = $ini_array['ApiKey'];
+
include('lib/forecast.io.php');
// delete old files
array_map('unlink', glob("weather.*"));
-// get lat & long from google maps
-$MAPSURL = "http://maps.googleapis.com/maps/api/geocode/json?address=".$city.",".$country."&sensor=false";
-$json = file_get_contents($MAPSURL);
-$data = json_decode($json, true);
-
-if( !isset($data['results'][0]) ) {
- echo "no latitude and longitude find for: ".$city.",".$country." !\n";
- exit;
-}
-$latitude = $data['results'][0]['geometry']['location']['lat'];
-$longitude = $data['results'][0]['geometry']['location']['lng'];
-
// forecast query
$forecast = new ForecastIO($api_key);