2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "vtimeredit.h"
23 VTimerEdit::VTimerEdit(RecTimer* trt)
28 if (Video::getInstance()->getFormat() == Video::PAL)
38 setBackgroundColour(Colour::VIEWBACKGROUND);
40 setTitleText(tr("Edit Timer"));
41 setTitleBarColour(Colour::TITLEBARBACKGROUND);
50 drawText(tr("Active"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
51 drawText(tr("Channel"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
52 drawText(tr("Name"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
53 drawText(tr("Directory"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
54 ypos += surface->getFontHeight();
55 drawText(tr("Start"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
56 drawText(tr("Stop"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
57 drawText(tr("Priority"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
58 drawText(tr("Lifetime"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
59 ypos += surface->getFontHeight();
60 drawText(tr("Current"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
61 drawText(tr("Recording"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
71 if (recTimer->active) strcpy(buffer, "Yes");
72 else strcpy(buffer, "No");
73 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
76 SNPRINTF(buffer, 999, "%lu", recTimer->channelNumber);
77 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
80 SNPRINTF(buffer, 999, "%s", recTimer->getName());
81 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
84 if (recTimer->getDirectory()) SNPRINTF(buffer, 999, "%s", recTimer->getDirectory());
85 else strcpy(buffer, "");
86 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
87 ypos += surface->getFontHeight();
90 tms = localtime((time_t*)&recTimer->startTime);
91 strftime(buffer, 999, "%d/%m %H:%M", tms);
92 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
95 tms = localtime((time_t*)&recTimer->stopTime);
96 strftime(buffer, 999, "%d/%m %H:%M", tms);
97 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
100 SNPRINTF(buffer, 999, "%lu", recTimer->priority);
101 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
104 SNPRINTF(buffer, 999, "%lu", recTimer->lifeTime);
105 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
106 ypos += surface->getFontHeight();
109 if (recTimer->pending) strcpy(buffer, "Yes");
110 else strcpy(buffer, "No");
111 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
114 if (recTimer->recording) strcpy(buffer, "Yes");
115 else strcpy(buffer, "No");
116 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
121 VTimerEdit::~VTimerEdit()
125 int VTimerEdit::handleCommand(int command)
133 ViewMan::getInstance()->updateView(this);
136 case Remote::DF_DOWN:
140 ViewMan::getInstance()->updateView(this);
153 // stop command getting to any more views