diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | config.h | 3 | ||||
-rw-r--r-- | displaymenu.c | 41 | ||||
-rw-r--r-- | displaymenu.h | 3 | ||||
-rw-r--r-- | displaymenuview.c | 10 | ||||
-rw-r--r-- | displaymenuview.h | 1 | ||||
-rw-r--r-- | po/de_DE.po | 11 | ||||
-rw-r--r-- | setup.c | 2 | ||||
-rw-r--r-- | timers.c | 74 | ||||
-rw-r--r-- | timers.h | 4 |
11 files changed, 130 insertions, 24 deletions
@@ -103,3 +103,4 @@ Version 0.0.6 - Changed channel info icons in DisplayChannel - Fixed a possible division by zero in DisplayChannel - Fixed a segfault with newer ImageMagick Versions +- Added display of Timer Conflicts with epgsearch in Main Menu @@ -68,7 +68,8 @@ cNopacityConfig::cNopacityConfig() { menuInfoScrollSpeed = 2; menuWidthRightItems = 12; showDiscUsage = 1; - showTimers = 1; + showTimers = 1; + checkTimerConflict = 1; headerHeight = 7; footerHeight = 7; numDefaultMenuItems = 16; @@ -224,6 +225,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "menuHeightInfoWindow") == 0) menuHeightInfoWindow = atoi(Value); else if (strcmp(Name, "showDiscUsage") == 0) showDiscUsage = atoi(Value); else if (strcmp(Name, "showTimers") == 0) showTimers = atoi(Value); + else if (strcmp(Name, "checkTimerConflict") == 0) checkTimerConflict = atoi(Value); else if (strcmp(Name, "headerHeight") == 0) headerHeight = atoi(Value); else if (strcmp(Name, "footerHeight") == 0) footerHeight = atoi(Value); else if (strcmp(Name, "numDefaultMenuItems") == 0) numDefaultMenuItems = atoi(Value); @@ -94,7 +94,8 @@ class cNopacityConfig { int menuHeightInfoWindow;
int menuWidthRightItems;
int showDiscUsage;
- int showTimers;
+ int showTimers;
+ int checkTimerConflict;
int headerHeight;
int footerHeight;
int numDefaultMenuItems;
diff --git a/displaymenu.c b/displaymenu.c index 7475943..e6d6f41 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -59,14 +59,45 @@ void cNopacityDisplayMenu::DrawDisk(void) { } } -void cNopacityDisplayMenu::DrawTimers(void) { +int cNopacityDisplayMenu::CheckTimerConflict(bool timersChanged) { + int numConflicts = 0; + if (initial || ((menuCategoryLast!=mcMain)&&(MenuCategory()==mcMain))) { + if (timersChanged) { + cPlugin *p = cPluginManager::GetPlugin("epgsearch"); + if (p) { + Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0; + if (serviceData) { + serviceData->nextConflict = 0; + serviceData->relevantConflicts = 0; + serviceData->totalConflicts = 0; + p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData); + if (serviceData->relevantConflicts > 0) { + numConflicts = serviceData->relevantConflicts; + } + delete serviceData; + } + } + } + } + return numConflicts; +} + +void cNopacityDisplayMenu::DrawTimers(bool timersChanged, int numConflicts) { int maxTimersHeight = menuView->GetTimersMaxHeight(); if (initial || ((menuCategoryLast!=mcMain)&&(MenuCategory()==mcMain)&&!timersDrawn)) { - if (Timers.Modified(lastTimersState)) { + if (timersChanged) { timers.Clear(); cSortedTimers SortedTimers; int numTimers = SortedTimers.Size(); int currentHeight = menuView->GetTimersInitHeight(); + if (numConflicts > 0) { + cNopacityTimer *t = menuView->DrawTimerConflict(numConflicts, currentHeight); + if (initial) + if (FadeTime) + t->SetAlpha(0); + currentHeight += t->GetHeight() + menuView->spaceMenu; + timers.Add(t); + } for (int i = 0; i < numTimers; i++) { if (const cTimer *Timer = SortedTimers[i]) { cNopacityTimer *t = menuView->DrawTimer(Timer, currentHeight); @@ -573,8 +604,12 @@ void cNopacityDisplayMenu::Flush(void) { if (MenuCategory() == mcMain) { if (config.showDiscUsage) DrawDisk(); + bool timersChanged = Timers.Modified(lastTimersState); + int numConflicts = 0; + if (config.checkTimerConflict) + numConflicts = CheckTimerConflict(timersChanged); if (config.showTimers) - DrawTimers(); + DrawTimers(timersChanged, numConflicts); } if (initial) { if (config.menuFadeTime) diff --git a/displaymenu.h b/displaymenu.h index 6937efe..97a4931 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -25,7 +25,8 @@ private: int positionButtons[4]; cRect videoWindowRect; void DrawDisk(void); - void DrawTimers(void); + int CheckTimerConflict(bool timersChanged); + void DrawTimers(bool timersChanged, int numConflicts); void SplitItem(const char *Text, cString *strItems, int *tabItems); void SetButtonPositions(void); virtual void Action(void); diff --git a/displaymenuview.c b/displaymenuview.c index 8416357..f0e64a3 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -511,6 +511,16 @@ int cNopacityDisplayMenuView::GetTimersMaxHeight(void) { return headerHeight + contentHeight; } +cNopacityTimer *cNopacityDisplayMenuView::DrawTimerConflict(int numConflicts, int y) { + cNopacityTimer *t = new cNopacityTimer(osd, numConflicts, fontTimers, fontTimersHead); + t->SetGeometry(timersWidth, y); + t->CreateConflictText(); + t->CalculateHeight(spaceMenu); + t->CreatePixmaps(osdWidth - timersWidth - 10); + t->Render(); + return t; +} + cNopacityTimer *cNopacityDisplayMenuView::DrawTimer(const cTimer *Timer, int y) { cNopacityTimer *t = new cNopacityTimer(osd, Timer, fontTimers, fontTimersHead); t->SetGeometry(timersWidth, y); diff --git a/displaymenuview.h b/displaymenuview.h index 1658dac..1c903c7 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -91,6 +91,7 @@ class cNopacityDisplayMenuView { void ClearButton(int num); int GetTimersInitHeight(void); int GetTimersMaxHeight(void); + cNopacityTimer *DrawTimerConflict(int numConflicts, int y); cNopacityTimer *DrawTimer(const cTimer *Timer, int y); void DrawScrollbar(double Height, double Offset); void ClearScrollbar(void); diff --git a/po/de_DE.po b/po/de_DE.po index fcda992..9f2691a 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-13 12:10+0100\n" +"POT-Creation-Date: 2013-01-26 13:46+0100\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -122,6 +122,9 @@ msgstr "Festplattenstatus anzeigen" msgid "Display Timers" msgstr "Timer anzeigen" +msgid "Show Timer Conflicts" +msgstr "Timer Konflikte anzeigen" + msgid "Menu Items Scrolling Speed" msgstr "Scroll Geschwindigkeit der Menüelemente" @@ -334,3 +337,9 @@ msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)" msgid "Hight of Volume Display (Percent of OSD Height)" msgstr "Breite der Lautstärken Anzeige (Proz. der OSD Breite)" + +msgid "conflict" +msgstr "" + +msgid "conflicts" +msgstr "" @@ -114,6 +114,7 @@ void cNopacitySetup::Store(void) { SetupStore("menuInfoScrollSpeed", config.menuInfoScrollSpeed); SetupStore("showDiscUsage", config.showDiscUsage); SetupStore("showTimers", config.showTimers); + SetupStore("checkTimerConflict", config.checkTimerConflict); SetupStore("headerHeight", config.headerHeight); SetupStore("footerHeight", config.footerHeight); SetupStore("numDefaultMenuItems", config.numDefaultMenuItems); @@ -198,6 +199,7 @@ void cNopacitySetupMenuDisplay::Set(void) { Add(new cMenuEditIntItem(tr("Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuFadeTime, 0, 1000)); Add(new cMenuEditBoolItem(tr("Display Disk Usage"), &tmpNopacityConfig->showDiscUsage)); Add(new cMenuEditBoolItem(tr("Display Timers"), &tmpNopacityConfig->showTimers)); + Add(new cMenuEditBoolItem(tr("Show Timer Conflicts"), &tmpNopacityConfig->checkTimerConflict)); Add(new cMenuEditStraItem(tr("Menu Items Scrolling Speed"), &tmpNopacityConfig->menuScrollSpeed, 4, scrollSpeed)); Add(new cMenuEditIntItem(tr("Menu Items Scrolling Delay in s"), &tmpNopacityConfig->menuScrollDelay, 0, 3)); Add(new cMenuEditIntItem(tr("EPG Window Fade-In Time in ms (Zero for switching off fading)"), &tmpNopacityConfig->menuEPGWindowFadeTime, 0, 1000)); @@ -5,6 +5,15 @@ cNopacityTimer::cNopacityTimer(cOsd *osd, const cTimer *timer, const cFont *font this->timer = timer;
this->font = font;
this->fontLarge = fontLarge;
+ isTimerConflict = false;
+}
+
+cNopacityTimer::cNopacityTimer(cOsd *osd, int numConflicts, const cFont *font, const cFont *fontLarge) {
+ this->osd = osd;
+ this->numConflicts = numConflicts;
+ this->font = font;
+ this->fontLarge = fontLarge;
+ isTimerConflict = true;
}
cNopacityTimer::~cNopacityTimer(void) {
@@ -60,10 +69,25 @@ void cNopacityTimer::CreateShowName(void) { showName.Set(*title, font, width-10);
}
+void cNopacityTimer::CreateConflictText(void) {
+ cString conflictText;
+ if (numConflicts == 1) {
+ conflictText = cString::sprintf("%d Timer %s", numConflicts, tr("conflict"));
+ } else {
+ conflictText = cString::sprintf("%d Timer %s", numConflicts, tr("conflicts"));
+ }
+ showName.Set(*conflictText, fontLarge, width-10);
+}
+
void cNopacityTimer::CalculateHeight(int space) {
- int numLines = showName.Lines() + 1;
- int lineHeight = font->Height();
- height = config.timersLogoHeight + numLines * lineHeight + 2*space;
+ int numLines = showName.Lines();
+ if (isTimerConflict) {
+ int lineHeight = fontLarge->Height();
+ height = numLines * lineHeight + 2*space;
+ } else {
+ int lineHeight = font->Height();
+ height = config.timersLogoHeight + (numLines +1)* lineHeight + 2*space;
+ }
}
void cNopacityTimer::CreatePixmaps(int x) {
@@ -72,26 +96,42 @@ void cNopacityTimer::CreatePixmaps(int x) { }
void cNopacityTimer::Render(void) {
- DrawLogo();
cImageLoader imgLoader;
- if (timer->Recording()) {
+ if (isTimerConflict) {
+ pixmapLogo->Fill(clrTransparent);
pixmap->Fill(Theme.Color(clrDiskAlert));
imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ int numLines = showName.Lines();
+ int textWidth = 0;
+ int x = 0;
+ int y = 5;
+ for (int line=0; line<numLines; line++) {
+ textWidth = fontLarge->Width(showName.GetLine(line));
+ x = (width - textWidth)/2;
+ y += line*fontLarge->Height();
+ pixmap->DrawText(cPoint(x, y), showName.GetLine(line), Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge);
+ }
} else {
- pixmap->Fill(Theme.Color(clrMenuBorder));
- imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), width-2, height-2);
- pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
- }
-
- pixmap->DrawText(cPoint(5, config.timersLogoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge);
-
- int lineHeight = font->Height();
- int yStart = config.timersLogoHeight + lineHeight + 3;
- int numLines = showName.Lines();
- for (int line=0; line<numLines; line++)
- pixmap->DrawText(cPoint(5, yStart+line*(lineHeight-2)), showName.GetLine(line), Theme.Color(clrMenuFontTimers), clrTransparent, font);
+ DrawLogo();
+ if (timer->Recording()) {
+ pixmap->Fill(Theme.Color(clrDiskAlert));
+ imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ } else {
+ pixmap->Fill(Theme.Color(clrMenuBorder));
+ imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ }
+ pixmap->DrawText(cPoint(5, config.timersLogoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge);
+
+ int lineHeight = font->Height();
+ int yStart = config.timersLogoHeight + lineHeight + 3;
+ int numLines = showName.Lines();
+ for (int line=0; line<numLines; line++)
+ pixmap->DrawText(cPoint(5, yStart+line*(lineHeight-2)), showName.GetLine(line), Theme.Color(clrMenuFontTimers), clrTransparent, font);
+ }
}
void cNopacityTimer::DrawLogo(void) {
@@ -7,6 +7,8 @@ class cNopacityTimer : public cListObject { cPixmap *pixmap;
cPixmap *pixmapLogo;
const cTimer *timer;
+ int numConflicts;
+ bool isTimerConflict;
const cFont *font;
const cFont *fontLarge;
int width;
@@ -17,10 +19,12 @@ class cNopacityTimer : public cListObject { void DrawLogo(void);
public:
cNopacityTimer(cOsd *osd, const cTimer *timer, const cFont *font, const cFont *fontLarge);
+ cNopacityTimer(cOsd *osd, int numConflicts, const cFont *font, const cFont *fontLarge);
virtual ~cNopacityTimer(void);
void SetGeometry(int width, int y);
void CreateDate(void);
void CreateShowName(void);
+ void CreateConflictText(void);
void CalculateHeight(int space);
void CreatePixmaps(int x);
void SetAlpha(int alpha);
|