summaryrefslogtreecommitdiff
path: root/menu.c
blob: b3b6e076edb0db566900de5d4f550293ec2390e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
 *  GraphLCD plugin for the Video Disk Recorder
 *
 *  menu.c  -  setup menu class
 *
 *  (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online de>
 **/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program;                                              *
 *   if not, write to the Free Software Foundation, Inc.,                  *
 *   59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *
 *                                                                         *
 ***************************************************************************/

#include "menu.h"


cGraphLCDMenuSetup::cGraphLCDMenuSetup()
{
    static const char * showDateTimeValues[3];
    showDateTimeValues[0] = trVDR("no");
    showDateTimeValues[1] = trVDR("yes");
    showDateTimeValues[2] = tr("not in menu");
    static const char * showSymbolsValues[3];
    showSymbolsValues[0] = trVDR("no");
    showSymbolsValues[1] = trVDR("yes");
    showSymbolsValues[2] = tr("compressed");
    static const char * showLogoValues[4];
    showLogoValues[0] = trVDR("no");
    showLogoValues[1] = tr("auto");
    showLogoValues[2] = tr("medium");
    showLogoValues[3] = tr("large");
    static const char * scrollModeValues[3];
    scrollModeValues[0] = tr("never");
    scrollModeValues[1] = tr("once");
    scrollModeValues[2] = tr("always");

    newGraphLCDSetup = GraphLCDSetup;

    Add(new cMenuEditBoolItem(tr("Plugin active"), &newGraphLCDSetup.PluginActive));
    Add(new cMenuEditStraItem(tr("Show Date/Time"), &newGraphLCDSetup.ShowDateTime, 3, showDateTimeValues));
    Add(new cMenuEditBoolItem(tr("Show Channel"), &newGraphLCDSetup.ShowChannel));
    Add(new cMenuEditStraItem(tr("Show Logo"), &newGraphLCDSetup.ShowLogo, 4, showLogoValues));
    Add(new cMenuEditStraItem(tr("Show Symbols"), &newGraphLCDSetup.ShowSymbols, 3, showSymbolsValues));
    Add(new cMenuEditBoolItem(tr("Show ET Symbols"), &newGraphLCDSetup.ShowETSymbols));
    Add(new cMenuEditBoolItem(tr("Show Program"), &newGraphLCDSetup.ShowProgram));
    Add(new cMenuEditBoolItem(tr("Show Timebar"), &newGraphLCDSetup.ShowTimebar));
    Add(new cMenuEditBoolItem(tr("Show Menu"), &newGraphLCDSetup.ShowMenu));
    Add(new cMenuEditBoolItem(tr("Show Messages"), &newGraphLCDSetup.ShowMessages));
    Add(new cMenuEditBoolItem(tr("Show Color Buttons"), &newGraphLCDSetup.ShowColorButtons));
    Add(new cMenuEditBoolItem(tr("Show Volume"), &newGraphLCDSetup.ShowVolume));
    Add(new cMenuEditBoolItem(tr("Show free Cards"), &newGraphLCDSetup.ShowNotRecording));
    Add(new cMenuEditBoolItem(tr("Identify replay type"), &newGraphLCDSetup.IdentifyReplayType));
    if (newGraphLCDSetup.IdentifyReplayType)
    {
        Add(new cMenuEditBoolItem(tr("Modify replay string"), &newGraphLCDSetup.ModifyReplayString));
        Add(new cMenuEditStraItem(tr("Show Logo on Replay"), &newGraphLCDSetup.ReplayLogo, 4, showLogoValues));
    }
    Add(new cMenuEditStraItem(tr("Scroll text lines"), &newGraphLCDSetup.ScrollMode, 3, scrollModeValues));
    Add(new cMenuEditIntItem(tr("Scroll speed"), &newGraphLCDSetup.ScrollSpeed, 1, 10));
    Add(new cMenuEditIntItem(tr("Scroll time interval"), &newGraphLCDSetup.ScrollTime, 100, 2000));
    Add(new cMenuEditIntItem(tr("Brightness on user activity"), &newGraphLCDSetup.BrightnessActive, 0, 100));
    Add(new cMenuEditIntItem(tr("Brightness on user inactivity"), &newGraphLCDSetup.BrightnessIdle, 0, 100));
    Add(new cMenuEditIntItem(tr("Brightness delay [s]"), &newGraphLCDSetup.BrightnessDelay, 0, 600));
}

void cGraphLCDMenuSetup::Store()
{
    SetupStore("PluginActive", GraphLCDSetup.PluginActive  = newGraphLCDSetup.PluginActive);
    SetupStore("ShowDateTime",GraphLCDSetup.ShowDateTime = newGraphLCDSetup.ShowDateTime);
    SetupStore("ShowChannel", GraphLCDSetup.ShowChannel = newGraphLCDSetup.ShowChannel);
    SetupStore("ShowLogo",    GraphLCDSetup.ShowLogo = newGraphLCDSetup.ShowLogo);
    SetupStore("ShowSymbols", GraphLCDSetup.ShowSymbols = newGraphLCDSetup.ShowSymbols);
    SetupStore("ShowETSymbols",GraphLCDSetup.ShowETSymbols = newGraphLCDSetup.ShowETSymbols);
    SetupStore("ShowProgram", GraphLCDSetup.ShowProgram = newGraphLCDSetup.ShowProgram);
    SetupStore("ShowTimebar", GraphLCDSetup.ShowTimebar = newGraphLCDSetup.ShowTimebar);
    SetupStore("ShowMenu",    GraphLCDSetup.ShowMenu = newGraphLCDSetup.ShowMenu);
    SetupStore("ShowMessages",GraphLCDSetup.ShowMessages = newGraphLCDSetup.ShowMessages);
    SetupStore("ShowColorButtons",GraphLCDSetup.ShowColorButtons = newGraphLCDSetup.ShowColorButtons);
    SetupStore("ShowVolume",  GraphLCDSetup.ShowVolume = newGraphLCDSetup.ShowVolume);
    SetupStore("ShowNotRecording", GraphLCDSetup.ShowNotRecording = newGraphLCDSetup.ShowNotRecording);
    SetupStore("IdentifyReplayType", GraphLCDSetup.IdentifyReplayType = newGraphLCDSetup.IdentifyReplayType);
    SetupStore("ReplayLogo", GraphLCDSetup.ReplayLogo = newGraphLCDSetup.ReplayLogo);
    SetupStore("ModifyReplayString", GraphLCDSetup.ModifyReplayString = newGraphLCDSetup.ModifyReplayString);
    SetupStore("ScrollMode", GraphLCDSetup.ScrollMode = newGraphLCDSetup.ScrollMode);
    SetupStore("ScrollSpeed", GraphLCDSetup.ScrollSpeed = newGraphLCDSetup.ScrollSpeed);
    SetupStore("ScrollTime", GraphLCDSetup.ScrollTime = newGraphLCDSetup.ScrollTime);
    SetupStore("BrightnessActive", GraphLCDSetup.BrightnessActive = newGraphLCDSetup.BrightnessActive);
    SetupStore("BrightnessIdle", GraphLCDSetup.BrightnessIdle = newGraphLCDSetup.BrightnessIdle);
    SetupStore("BrightnessDelay", GraphLCDSetup.BrightnessDelay = newGraphLCDSetup.BrightnessDelay);
}