summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-01-12 17:58:59 +0100
committerlouis <louis.braun@gmx.de>2013-01-12 17:58:59 +0100
commitd0837be96f032dec191fb56a28f6376efc4dbc4c (patch)
tree58ba57a81a609f14211de42ca6833690e4782e64
parentf73517cef1405ad496dda3cd30838f637cd64524 (diff)
downloadskin-nopacity-d0837be96f032dec191fb56a28f6376efc4dbc4c.tar.gz
skin-nopacity-d0837be96f032dec191fb56a28f6376efc4dbc4c.tar.bz2
Added some more information (encrypted, source, transponder, frequency) to channels menu
-rw-r--r--config.c4
-rw-r--r--config.h2
-rw-r--r--displaymenu.c3
-rw-r--r--displaymenuview.c8
-rw-r--r--displaymenuview.h2
-rw-r--r--icons/encrypted.pngbin0 -> 3543 bytes
-rw-r--r--menuitem.c31
-rw-r--r--menuitem.h3
-rw-r--r--po/de_DE.po11
-rw-r--r--setup.c5
10 files changed, 59 insertions, 10 deletions
diff --git a/config.c b/config.c
index 5570ce4..ec8a276 100644
--- a/config.c
+++ b/config.c
@@ -88,6 +88,8 @@ cNopacityConfig::cNopacityConfig() {
fontMenuitemLarge = 0;
fontMenuitemSchedule = 0;
fontMenuitemScheduleSmall = 0;
+ fontMenuitemChannel = 0;
+ fontMenuitemChannelSmall = 0;
fontMenuitemRecordings = 0;
fontMenuitemRecordingsSmall = 0;
fontMenuitemDefault = 0;
@@ -239,6 +241,8 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "fontMenuitemLarge") == 0) fontMenuitemLarge = atoi(Value);
else if (strcmp(Name, "fontMenuitemSchedule") == 0) fontMenuitemSchedule = atoi(Value);
else if (strcmp(Name, "fontMenuitemScheduleSmall") == 0) fontMenuitemScheduleSmall = atoi(Value);
+ else if (strcmp(Name, "fontMenuitemChannel") == 0) fontMenuitemChannel = atoi(Value);
+ else if (strcmp(Name, "fontMenuitemChannelSmall") == 0) fontMenuitemChannelSmall = atoi(Value);
else if (strcmp(Name, "fontMenuitemRecordings") == 0) fontMenuitemRecordings = atoi(Value);
else if (strcmp(Name, "fontMenuitemRecordingsSmall") == 0) fontMenuitemRecordingsSmall = atoi(Value);
else if (strcmp(Name, "fontMenuitemDefault") == 0) fontMenuitemDefault = atoi(Value);
diff --git a/config.h b/config.h
index c8ba516..ebbf4c5 100644
--- a/config.h
+++ b/config.h
@@ -114,6 +114,8 @@ class cNopacityConfig {
int fontMenuitemLarge;
int fontMenuitemSchedule;
int fontMenuitemScheduleSmall;
+ int fontMenuitemChannel;
+ int fontMenuitemChannelSmall;
int fontMenuitemRecordings;
int fontMenuitemRecordingsSmall;
int fontMenuitemDefault;
diff --git a/displaymenu.c b/displaymenu.c
index a371512..747d89d 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -530,7 +530,6 @@ void cNopacityDisplayMenu::SetEvent(const cEvent *Event) {
}
void cNopacityDisplayMenu::SetRecording(const cRecording *Recording) {
- esyslog("nopacity: aga0");
if (!Recording)
return;
const cRecordingInfo *Info = Recording->Info();
@@ -541,9 +540,7 @@ void cNopacityDisplayMenu::SetRecording(const cRecording *Recording) {
detailView = new cNopacityMenuDetailRecordingView(osd, Recording);
menuView->SetDetailViewSize(dvRecording, detailView);
detailView->SetFonts();
- esyslog("nopacity: aga");
detailView->LoadRecordingInformation(Recording);
- esyslog("nopacity: aga2");
detailView->SetContent(Recording->Info()->Description());
detailView->CreatePixmaps();
detailView->Render();
diff --git a/displaymenuview.c b/displaymenuview.c
index 5731beb..93445a7 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -33,6 +33,8 @@ cNopacityDisplayMenuView::~cNopacityDisplayMenuView(void) {
delete fontMenuitemLarge;
delete fontMenuitemSchedule;
delete fontMenuitemScheduleSmall;
+ delete fontMenuitemChannel;
+ delete fontMenuitemChannelSmall;
delete fontMenuitemRecordings;
delete fontMenuitemRecordingsSmall;
delete fontMenuitemDefault;
@@ -135,6 +137,8 @@ void cNopacityDisplayMenuView::CreateFonts(void) {
fontMenuitemLarge = cFont::CreateFont(config.fontName, menuItemHeightMain/3 + 4 + config.fontMenuitemLarge);
fontMenuitemSchedule = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 4 + 5 + config.fontMenuitemSchedule);
fontMenuitemScheduleSmall = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 4 - 5 + config.fontMenuitemScheduleSmall);
+ fontMenuitemChannel = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 3 + config.fontMenuitemChannel);
+ fontMenuitemChannelSmall = cFont::CreateFont(config.fontName, menuItemHeightSchedule / 5 - 2 + config.fontMenuitemChannelSmall);
fontMenuitemRecordings = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 2 - 14 + config.fontMenuitemRecordings);
fontMenuitemRecordingsSmall = cFont::CreateFont(config.fontName, menuItemHeightRecordings / 4 - 3 + config.fontMenuitemRecordingsSmall);
fontMenuitemDefault = cFont::CreateFont(config.fontName, menuItemHeightDefault * 2 / 3 + config.fontMenuitemDefault);
@@ -155,7 +159,7 @@ cFont *cNopacityDisplayMenuView::GetMenuItemFont(eMenuCategory menuCat) {
case mcSchedule:
return fontMenuitemSchedule;
case mcChannel:
- return fontMenuitemLarge;
+ return fontMenuitemChannel;
case mcRecording:
return fontMenuitemRecordings;
default:
@@ -168,6 +172,8 @@ cFont *cNopacityDisplayMenuView::GetMenuItemFontSmall(eMenuCategory menuCat) {
switch (menuCat) {
case mcSchedule:
return fontMenuitemScheduleSmall;
+ case mcChannel:
+ return fontMenuitemChannelSmall;
case mcRecording:
return fontMenuitemRecordingsSmall;
default:
diff --git a/displaymenuview.h b/displaymenuview.h
index 68b6b69..07be7c5 100644
--- a/displaymenuview.h
+++ b/displaymenuview.h
@@ -36,6 +36,8 @@ class cNopacityDisplayMenuView {
cFont *fontMenuitemLarge;
cFont *fontMenuitemSchedule;
cFont *fontMenuitemScheduleSmall;
+ cFont *fontMenuitemChannel;
+ cFont *fontMenuitemChannelSmall;
cFont *fontMenuitemRecordings;
cFont *fontMenuitemRecordingsSmall;
cFont *fontMenuitemDefault;
diff --git a/icons/encrypted.png b/icons/encrypted.png
new file mode 100644
index 0000000..81b26d9
--- /dev/null
+++ b/icons/encrypted.png
Binary files differ
diff --git a/menuitem.c b/menuitem.c
index dc05670..89ecc60 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -519,6 +519,12 @@ void cNopacityChannelMenuItem::CreatePixmapTextScroller(int totalWidth) {
void cNopacityChannelMenuItem::CreateText() {
strEntry = Channel->Name();
+ const cSource *source = Sources.Get(Channel->Source());
+ if (source)
+ strChannelSource = cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description());
+ else
+ strChannelSource = "";
+ strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency());
}
int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
@@ -538,13 +544,31 @@ int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
void cNopacityChannelMenuItem::SetTextFull(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- pixmapTextScroller->DrawText(cPoint(5, (height - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
+ pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
}
void cNopacityChannelMenuItem::SetTextShort(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- pixmapTextScroller->DrawText(cPoint(5, (height - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+ pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+}
+
+void cNopacityChannelMenuItem::DrawBackground(int handleBackground) {
+ pixmap->Fill(Theme.Color(clrMenuBorder));
+ pixmap->DrawImage(cPoint(1, 1), handleBackground);
+
+ int encryptedSize = height/4-2;
+ int sourceX = config.menuItemLogoWidth + 15;
+
+ pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall);
+ if (Channel->Ca()) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadIcon("encrypted", encryptedSize)) {
+ pixmapIcon->DrawImage(cPoint(sourceX, height/2+1), imgLoader.GetImage());
+ sourceX += encryptedSize + 10;
+ }
+ }
+ pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall);
}
void cNopacityChannelMenuItem::Render() {
@@ -552,10 +576,9 @@ void cNopacityChannelMenuItem::Render() {
int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4];
if (selectable) { //Channels
- pixmap->Fill(Theme.Color(clrMenuBorder));
+ DrawBackground(handleBgrd);
int logoWidth = config.menuItemLogoWidth;
int logoHeight = config.menuItemLogoHeight;
- pixmap->DrawImage(cPoint(1, 1), handleBgrd);
if (!drawn) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {
diff --git a/menuitem.h b/menuitem.h
index 1cf63e5..e92434f 100644
--- a/menuitem.h
+++ b/menuitem.h
@@ -106,8 +106,11 @@ private:
const cChannel *Channel;
std::string strEntry;
std::string strEntryFull;
+ cString strChannelSource;
+ cString strChannelInfo;
void SetTextFull(void);
void SetTextShort(void);
+ void DrawBackground(int handleBackground);
public:
cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel);
~cNopacityChannelMenuItem(void);
diff --git a/po/de_DE.po b/po/de_DE.po
index 9562983..fe092c6 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: skinnopacity 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2013-01-09 20:30+0100\n"
+"POT-Creation-Date: 2013-01-12 17:41+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -44,6 +44,9 @@ msgstr "Format"
msgid "Est. bitrate"
msgstr "Geschätzte Bitrate"
+msgid "Transp."
+msgstr "Transp."
+
msgid "Duration"
msgstr "Dauer"
@@ -209,6 +212,12 @@ msgstr "Schriftgröße anpassen - Programmübersicht Menübuttons"
msgid "Adjust Font Size - Schedule Menu Item Small"
msgstr "Schriftgröße anpassen - Programmübersicht Menübuttons klein"
+msgid "Adjust Font Size - Channels Menu Item"
+msgstr "Schriftgröße anpassen - Kanäle Menübuttons"
+
+msgid "Adjust Font Size - Channels Menu Item Small"
+msgstr "Schriftgröße anpassen - Kanäle Menübuttons klein"
+
msgid "Adjust Font Size - Recordings Menu Item"
msgstr "Schriftgröße anpassen - Aufzeichnungen Menübuttons"
diff --git a/setup.c b/setup.c
index 32f46ad..4eb663d 100644
--- a/setup.c
+++ b/setup.c
@@ -133,6 +133,8 @@ void cNopacitySetup::Store(void) {
SetupStore("fontMenuitemLarge", config.fontMenuitemLarge);
SetupStore("fontMenuitemSchedule", config.fontMenuitemSchedule);
SetupStore("fontMenuitemScheduleSmall", config.fontMenuitemScheduleSmall);
+ SetupStore("fontMenuitemChannel", config.fontMenuitemChannel);
+ SetupStore("fontMenuitemChannelSmall", config.fontMenuitemChannelSmall);
SetupStore("fontMenuitemRecordings", config.fontMenuitemRecordings);
SetupStore("fontMenuitemRecordingsSmall", config.fontMenuitemRecordingsSmall);
SetupStore("fontMenuitemDefault", config.fontMenuitemDefault);
@@ -145,7 +147,6 @@ void cNopacitySetup::Store(void) {
SetupStore("fontDetailViewHeader", config.fontDetailViewHeader);
SetupStore("fontDetailViewHeaderLarge", config.fontDetailViewHeaderLarge);
SetupStore("fontEPGInfoWindow", config.fontEPGInfoWindow);
-
}
//------------------------------------------------------------------------------------------------------------------
@@ -252,6 +253,8 @@ void cNopacitySetupMenuDisplayFonts::Set(void) {
Add(new cMenuEditIntItem(tr("Adjust Font Size - Large Menu Item"), &tmpNopacityConfig->fontMenuitemLarge, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Schedule Menu Item"), &tmpNopacityConfig->fontMenuitemSchedule, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Schedule Menu Item Small"), &tmpNopacityConfig->fontMenuitemScheduleSmall, -20, 20));
+ Add(new cMenuEditIntItem(tr("Adjust Font Size - Channels Menu Item"), &tmpNopacityConfig->fontMenuitemChannel, -20, 20));
+ Add(new cMenuEditIntItem(tr("Adjust Font Size - Channels Menu Item Small"), &tmpNopacityConfig->fontMenuitemChannelSmall, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item"), &tmpNopacityConfig->fontMenuitemRecordings, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Recordings Menu Item Small"), &tmpNopacityConfig->fontMenuitemRecordingsSmall, -20, 20));
Add(new cMenuEditIntItem(tr("Adjust Font Size - Default Menu Item"), &tmpNopacityConfig->fontMenuitemDefault, -20, 20));