Refactor cRecMenuSwitchTimerConfirm

This commit is contained in:
kamel5 2019-11-09 14:41:42 +01:00
parent 97c8bc23fd
commit 403af35519

View File

@ -1119,18 +1119,14 @@ cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) {
}
// --- cRecMenuSwitchTimerConfirm ---------------------------------------------------------
cRecMenuSwitchTimerConfirm::cRecMenuSwitchTimerConfirm(bool success) {
cRecMenuSwitchTimerConfirm::cRecMenuSwitchTimerConfirm(bool success) { // OK
SetWidthPercent(50);
cString message1 = tr("Switch Timer sucessfully created");
cString message2 = tr("Switch Timer NOT sucessfully created");
cString infoText = success?message1:message2;
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText);
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true));
const cString line1 = (success) ? tr("Switch Timer sucessfully created") : tr("Switch Timer NOT sucessfully created");
AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border));
AddFooter(new cRecMenuItemButton(tr("OK"), rmsClose, true));
CalculateHeight();
CreatePixmap();
Arrange();