summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c4
-rw-r--r--config.h2
-rw-r--r--displaymenu.c6
-rw-r--r--displaymenuview.c68
-rw-r--r--displaymenuview.h11
-rw-r--r--nopacity.c1
-rw-r--r--po/de_DE.po8
-rw-r--r--setup.c4
8 files changed, 28 insertions, 76 deletions
diff --git a/config.c b/config.c
index ec8a276..969ab4d 100644
--- a/config.c
+++ b/config.c
@@ -80,6 +80,8 @@ cNopacityConfig::cNopacityConfig() {
menuItemLogoHeight = 100;
detailViewLogoWidth = 260;
detailViewLogoHeight = 200;
+ timersLogoWidth = 90;
+ timersLogoHeight = 70;
epgImageWidth = 210;
epgImageHeight = 160;
menuRecFolderSize = 128;
@@ -233,6 +235,8 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "menuHeaderLogoHeight") == 0) menuHeaderLogoHeight = atoi(Value);
else if (strcmp(Name, "detailViewLogoWidth") == 0) detailViewLogoWidth = atoi(Value);
else if (strcmp(Name, "detailViewLogoHeight") == 0) detailViewLogoHeight = atoi(Value);
+ else if (strcmp(Name, "timersLogoWidth") == 0) timersLogoWidth = atoi(Value);
+ else if (strcmp(Name, "timersLogoHeight") == 0) timersLogoHeight = atoi(Value);
else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value);
else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value);
else if (strcmp(Name, "menuRecFolderSize") == 0) menuRecFolderSize = atoi(Value);
diff --git a/config.h b/config.h
index ebbf4c5..c0c4c47 100644
--- a/config.h
+++ b/config.h
@@ -106,6 +106,8 @@ class cNopacityConfig {
int menuHeaderLogoHeight;
int detailViewLogoWidth;
int detailViewLogoHeight;
+ int timersLogoWidth;
+ int timersLogoHeight;
int epgImageWidth;
int epgImageHeight;
int menuRecFolderSize;
diff --git a/displaymenu.c b/displaymenu.c
index 747d89d..7475943 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -73,7 +73,7 @@ void cNopacityDisplayMenu::DrawTimers(void) {
if (initial)
if (FadeTime)
t->SetAlpha(0);
- currentHeight += t->pixmap->ViewPort().Height() + menuView->spaceMenu;
+ currentHeight += t->GetHeight() + menuView->spaceMenu;
if (currentHeight < maxTimersHeight) {
timers.Add(t);
} else {
@@ -84,7 +84,7 @@ void cNopacityDisplayMenu::DrawTimers(void) {
}
} else {
for (cNopacityTimer *t = timers.First(); t; t = timers.Next(t)) {
- t->SetLayer(2);
+ t->Show();
}
}
timersDrawn = true;
@@ -185,7 +185,7 @@ void cNopacityDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) {
}
if (config.showTimers) {
for (cNopacityTimer *t = timers.First(); t; t = timers.Next(t)) {
- t->SetLayer(-1);
+ t->Hide();
}
timersDrawn = false;
}
diff --git a/displaymenuview.c b/displaymenuview.c
index 93445a7..8416357 100644
--- a/displaymenuview.c
+++ b/displaymenuview.c
@@ -1,13 +1,5 @@
#include "displaymenuview.h"
-cNopacityTimer::cNopacityTimer(cOsd *osd) {
- this->osd = osd;
-}
-
-cNopacityTimer::~cNopacityTimer(void) {
- osd->DestroyPixmap(pixmap);
-}
-
cNopacityDisplayMenuView::cNopacityDisplayMenuView() {
diskUsageAlert = 95;
pixmapStatus = NULL;
@@ -520,59 +512,13 @@ int cNopacityDisplayMenuView::GetTimersMaxHeight(void) {
}
cNopacityTimer *cNopacityDisplayMenuView::DrawTimer(const cTimer *Timer, int y) {
- const cChannel *Channel = Timer->Channel();
- const cEvent *Event = Timer->Event();
- cString channelName(""), title("");
- if (Channel) {
- channelName = Channel->Name();
- }
- if (Event) {
- title = Event->Title();
- }
- cTextWrapper titleLines;
- titleLines.Set(*title, fontTimers, timersWidth-10);
-
- cString Date;
- if (Timer->Recording()) {
- Date = cString::sprintf("-%s", *TimeString(Timer->StopTime()));
- } else {
- time_t Now = time(NULL);
- cString Today = WeekDayName(Now);
- cString Time = TimeString(Timer->StartTime());
- cString Day = WeekDayName(Timer->StartTime());
- if (Timer->StartTime() > Now + 6 * SECSINDAY)
- Date = DayDateTime(Timer->StartTime());
- else if (strcmp(Day, Today) != 0)
- Date = cString::sprintf("%s %s", *Day, *Time);
- else
- Date = Time;
- if (Timer->Flags() & tfVps)
- Date = cString::sprintf("VPS %s", *Date);
- }
-
- int numLines = titleLines.Lines();
- int lineHeight = fontTimers->Height();
- int timerHeight = (numLines + 2)*lineHeight + spaceMenu;
-
- cNopacityTimer *t = new cNopacityTimer(osd);
- t->pixmap = osd->CreatePixmap(2, cRect(osdWidth - timersWidth - 10, y, timersWidth, timerHeight));
-
- cImageLoader imgLoader;
- if(Timer->Recording()) {
- t->pixmap->Fill(Theme.Color(clrDiskAlert));
- imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), timersWidth-2, timerHeight-2);
- t->pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
- } else {
- t->pixmap->Fill(Theme.Color(clrMenuBorder));
- imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), timersWidth-2, timerHeight-2);
- t->pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
- }
- t->pixmap->DrawText(cPoint(5, 0), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontTimersHead);
- t->pixmap->DrawText(cPoint(5, lineHeight+2), *channelName, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontTimers);
- int yStart = 2*lineHeight + 3;
- for (int line=0; line<numLines; line++)
- t->pixmap->DrawText(cPoint(5, yStart+line*(lineHeight-2)), titleLines.GetLine(line), Theme.Color(clrMenuFontTimers), clrTransparent, fontTimers);
-
+ cNopacityTimer *t = new cNopacityTimer(osd, Timer, fontTimers, fontTimersHead);
+ t->SetGeometry(timersWidth, y);
+ t->CreateDate();
+ t->CreateShowName();
+ t->CalculateHeight(spaceMenu);
+ t->CreatePixmaps(osdWidth - timersWidth - 10);
+ t->Render();
return t;
}
diff --git a/displaymenuview.h b/displaymenuview.h
index 07be7c5..1658dac 100644
--- a/displaymenuview.h
+++ b/displaymenuview.h
@@ -3,17 +3,6 @@
enum eDetailViewType {dvEvent = 0, dvRecording, dvText};
-class cNopacityTimer : public cListObject {
- private:
- cOsd *osd;
- public:
- cNopacityTimer(cOsd *osd);
- virtual ~cNopacityTimer(void);
- void SetAlpha(int alpha) {pixmap->SetAlpha(alpha);}
- void SetLayer(int layer) {pixmap->SetLayer(layer);}
- cPixmap *pixmap;
-};
-
class cNopacityDisplayMenuView {
private:
cOsd *osd;
diff --git a/nopacity.c b/nopacity.c
index a75033a..5316570 100644
--- a/nopacity.c
+++ b/nopacity.c
@@ -126,6 +126,7 @@ cNopacityConfig config;
#include "helpers.c"
#include "displaychannel.c"
#include "textwindow.c"
+#include "timers.c"
#include "menuitem.c"
#include "menudetailview.c"
#include "displaymenuview.c"
diff --git a/po/de_DE.po b/po/de_DE.po
index fe092c6..fcda992 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-12 17:41+0100\n"
+"POT-Creation-Date: 2013-01-13 12:10+0100\n"
"PO-Revision-Date: 2012-11-11 17:49+0200\n"
"Last-Translator: louis\n"
"Language-Team: \n"
@@ -176,6 +176,12 @@ msgstr "Breite der Kanallogos auf den Menübuttons"
msgid "Channel Logo Height (on the Menu Buttons)"
msgstr "Höhe der Kanallogos auf den Menübuttons"
+msgid "Channel Logo Width (on timers in main menu)"
+msgstr "Breite der Kanallogos auf den Timern im Hauptmenü"
+
+msgid "Channel Logo Height (on timers in main menu)"
+msgstr "Höhe der Kanallogos auf den Timern im Hauptmenü"
+
msgid "Main Menu Header Logo Width"
msgstr "Höhe des Logos im Hauptmenü"
diff --git a/setup.c b/setup.c
index 4eb663d..b19c6dc 100644
--- a/setup.c
+++ b/setup.c
@@ -125,6 +125,8 @@ void cNopacitySetup::Store(void) {
SetupStore("menuHeaderLogoHeight", config.menuHeaderLogoHeight);
SetupStore("detailViewLogoWidth", config.detailViewLogoWidth);
SetupStore("detailViewLogoHeight", config.detailViewLogoHeight);
+ SetupStore("timersLogoWidth", config.timersLogoWidth);
+ SetupStore("timersLogoHeight", config.timersLogoHeight);
SetupStore("epgImageWidth", config.epgImageWidth);
SetupStore("epgImageHeight", config.epgImageHeight);
SetupStore("menuRecFolderSize", config.menuRecFolderSize);
@@ -228,6 +230,8 @@ void cNopacitySetupMenuDisplayGeometry::Set(void) {
Add(new cMenuEditIntItem(tr("Header Icon Size (Square Header Menu Icons)"), &tmpNopacityConfig->headerIconHeight, 30, 200));
Add(new cMenuEditIntItem(tr("Channel Logo Width (on the Menu Buttons)"), &tmpNopacityConfig->menuItemLogoWidth, 30, 200));
Add(new cMenuEditIntItem(tr("Channel Logo Height (on the Menu Buttons)"), &tmpNopacityConfig->menuItemLogoHeight, 30, 200));
+ Add(new cMenuEditIntItem(tr("Channel Logo Width (on timers in main menu)"), &tmpNopacityConfig->timersLogoWidth, 30, 300));
+ Add(new cMenuEditIntItem(tr("Channel Logo Height (on timers in main menu)"), &tmpNopacityConfig->timersLogoHeight, 30, 300));
Add(new cMenuEditIntItem(tr("Main Menu Header Logo Width"), &tmpNopacityConfig->menuHeaderLogoWidth, 30, 500));
Add(new cMenuEditIntItem(tr("Main Menu Header Logo Height"), &tmpNopacityConfig->menuHeaderLogoHeight, 30, 500));
Add(new cMenuEditIntItem(tr("Recordings Menu Folder Icon Size"), &tmpNopacityConfig->menuRecFolderSize, 30, 300));