Refactor cRecMenuTimerConflicts

This commit is contained in:
kamel5 2019-11-09 11:43:44 +01:00
parent 56cab4a666
commit 73e331f97f
6 changed files with 45 additions and 60 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2021-12-15 15:05+0100\n" "POT-Creation-Date: 2022-04-29 13:18+0200\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n" "PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n" "Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -180,14 +180,14 @@ msgstr "Sí"
msgid "No" msgid "No"
msgstr "No" msgstr "No"
msgid "One" msgid "Timer Conflicts"
msgstr "Un" msgstr "Conflicte al temporitzador"
msgid "detected" msgid "detected"
msgstr "detectat" msgstr "detectat"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Conflicte al temporitzador" msgstr "Ignora conflictes"
msgid "Show conflict" msgid "Show conflict"
msgstr "Mostra conflicte" msgstr "Mostra conflicte"
@ -195,9 +195,6 @@ msgstr "Mostra conflicte"
msgid "timers involved" msgid "timers involved"
msgstr "temporitzadors involucrats" msgstr "temporitzadors involucrats"
msgid "Ignore Conflicts"
msgstr "Ignora conflictes"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Ignora conflicte" msgstr "Ignora conflicte"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2021-12-15 15:05+0100\n" "POT-Creation-Date: 2022-04-29 13:18+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n" "Last-Translator: Horst\n"
"Language-Team: \n" "Language-Team: \n"
@ -177,14 +177,14 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
msgid "One" msgid "Timer Conflicts"
msgstr "Ein" msgstr "Timerkonflikte"
msgid "detected" msgid "detected"
msgstr "gefunden" msgstr "gefunden"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Timerkonflikte" msgstr "Konflikte ignorieren"
msgid "Show conflict" msgid "Show conflict"
msgstr "Konflikt zeigen" msgstr "Konflikt zeigen"
@ -192,9 +192,6 @@ msgstr "Konflikt zeigen"
msgid "timers involved" msgid "timers involved"
msgstr "Timer beteiligt" msgstr "Timer beteiligt"
msgid "Ignore Conflicts"
msgstr "Konflikte ignorieren"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Konflikt ignorieren" msgstr "Konflikt ignorieren"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2021-12-15 15:05+0100\n" "POT-Creation-Date: 2022-04-29 13:18+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n" "Last-Translator: fiveten_59\n"
"Language-Team: \n" "Language-Team: \n"
@ -177,14 +177,14 @@ msgstr "Si"
msgid "No" msgid "No"
msgstr "No" msgstr "No"
msgid "One" msgid "Timer Conflicts"
msgstr "Uno" msgstr "Conflitti del Timer"
msgid "detected" msgid "detected"
msgstr "rilevato" msgstr "rilevato"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Conflitti del Timer" msgstr "Ignora conflitti"
msgid "Show conflict" msgid "Show conflict"
msgstr "Mostra conflitto" msgstr "Mostra conflitto"
@ -192,9 +192,6 @@ msgstr "Mostra conflitto"
msgid "timers involved" msgid "timers involved"
msgstr "Timers impegnati" msgstr "Timers impegnati"
msgid "Ignore Conflicts"
msgstr "Ignora conflitti"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Ignora conflitto" msgstr "Ignora conflitto"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n" "Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2021-12-15 15:05+0100\n" "POT-Creation-Date: 2022-04-29 13:18+0200\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n" "PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n" "Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -177,14 +177,14 @@ msgstr "Да"
msgid "No" msgid "No"
msgstr "Нет" msgstr "Нет"
msgid "One" msgid "Timer Conflicts"
msgstr "Один" msgstr "Таймер-конфликты"
msgid "detected" msgid "detected"
msgstr "обнаружен" msgstr "обнаружен"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Таймер-конфликты" msgstr "Игнорировать конфликты"
msgid "Show conflict" msgid "Show conflict"
msgstr "Показать конфликты" msgstr "Показать конфликты"
@ -192,9 +192,6 @@ msgstr "Показать конфликты"
msgid "timers involved" msgid "timers involved"
msgstr "Таймер" msgstr "Таймер"
msgid "Ignore Conflicts"
msgstr "Игнорировать конфликты"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Игнорировать конфликт" msgstr "Игнорировать конфликт"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n" "Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2021-12-15 15:05+0100\n" "POT-Creation-Date: 2022-04-29 13:18+0200\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n" "PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -177,14 +177,14 @@ msgstr "
msgid "No" msgid "No"
msgstr "Nie" msgstr "Nie"
msgid "One" msgid "Timer Conflicts"
msgstr "Jeden" msgstr "Konflikty plánov"
msgid "detected" msgid "detected"
msgstr "nájdených" msgstr "nájdených"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Konflikty plánov" msgstr "Ignorova» konflikty"
msgid "Show conflict" msgid "Show conflict"
msgstr "Zobrazi» konflikt" msgstr "Zobrazi» konflikt"
@ -192,9 +192,6 @@ msgstr "Zobrazi
msgid "timers involved" msgid "timers involved"
msgstr "plány komplikované" msgstr "plány komplikované"
msgid "Ignore Conflicts"
msgstr "Ignorova» konflikty"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Ignorova» konflikt" msgstr "Ignorova» konflikt"

View File

@ -196,34 +196,34 @@ cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) { // OK
} }
// --- cRecMenuTimerConflicts --------------------------------------------------------- // --- cRecMenuTimerConflicts ---------------------------------------------------------
cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts) { cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts) { // OK
SetWidthPercent(50); SetWidthPercent(50);
int numConflicts = (conflicts) ? conflicts->NumConflicts() : 0; int numConflicts = (conflicts) ? conflicts->NumConflicts() : 0;
cString text;
if (numConflicts == 1) { const cString line1 = cString::sprintf("%d %s %s",
text = cString::sprintf("%s %s %s", tr("One"), tr("Timer Conflict"), tr("detected")); numConflicts,
} else { (numConflicts == 1) ? tr("Timer Conflict") : tr("Timer Conflicts"),
text = cString::sprintf("%d %s %s", conflicts->NumConflicts(), tr("Timer Conflicts"), tr("detected")); tr("detected"));
} AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border, true));
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text, true); AddFooter(new cRecMenuItemButton(tr("Ignore Conflicts"), rmsClose, false));
for (int i=0; i<numConflicts; i++) { for (int i = 0; i < numConflicts; i++) {
cTVGuideTimerConflict *conflict = conflicts->GetConflict(i); cTVGuideTimerConflict *conflict = conflicts->GetConflict(i);
if (!conflict) if (!conflict)
continue; continue;
cString dateTime = DayDateTime(conflict->time); const cString dateTime = DayDateTime(conflict->time);
int numTimers = conflict->timerIDs.size(); int numTimers = conflict->timerIDs.size();
cString textConflict = cString::sprintf("%s: %s (%d %s)", tr("Show conflict"), *dateTime, numTimers, tr("timers involved")); AddMenuItem(new cRecMenuItemButton(cString::sprintf("%s: %s (%d %s)",
bool isActive = (i==0)?true:false; tr("Show conflict"),
AddMenuItem(new cRecMenuItemButton(*textConflict, rmsTimerConflict, isActive)); *dateTime,
numTimers,
tr("timers involved")),
rmsTimerConflict, (i == 0) ? true : false));
} }
SetWidthPixel(CalculateOptimalWidth() + 4*border); SetWidthPixel(CalculateOptimalWidth() + 4 * border);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("Ignore Conflicts"), rmsClose, false));
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();