summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall/MythVantage-app/mythinstall/vnc.cpp
blob: 11bc371a342ceb20527bbecd381b04db9b020a5f (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include <unistd.h>
#include "misc_settings.h"
#include "mv_common.h"
#include "mythuihelper.h"

#include "vnc.h"


using namespace std;

extern  HostParms hostparm;

// static HostLineEdit *HostVNClogin()
// {
//     HostLineEdit *gc = new HostLineEdit("HostVNClogin");
//     gc->setLabel(QObject::tr("Login"));
//     gc->setValue("");
//     gc->setHelpText(QObject::tr("Login for vnc account"));
//     return gc;
// };
//---------x11vnc
//static HostLineEdit *HostXVNCpassword()
static HostTextEditSetting *HostXVNCpassword()
{
    HostTextEditSetting *gc = new HostTextEditSetting("HostXVNCpassword");
    gc->setLabel(QObject::tr("Password"));
    gc->setValue("");
    gc->SetPasswordEcho(true);
    gc->setHelpText(QObject::tr("Password for XVNC account must be at least 5 characters long. Passwords shorter than 5 characters long will silently fail."));
    return gc;
};

static HostCheckBoxSetting *HostXVNCEnable()
{
    HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostXVNCEnable");
    gc->setLabel(QObject::tr("Enable XVNC"));
    gc->setValue(false);
    gc->setHelpText(QObject::tr("This will allow you to remotely see what is currently displayed on the main screen. The session will be available on vnc:2 (port 5902)."));
    return gc;
};
/*
class XVNCsettings: public GroupSetting {
public:
    XVNCsettings()
//    TriggeredConfigurationGroup(false,false,false,false) {
    {
        setLabel(QObject::tr("XVNC Settings"));
//        SetVertical(true);
//        Setting* trigger = HostXVNCEnable() ;
        HostCheckBoxSetting* trigger = HostXVNCEnable();
        addChild(trigger);
//        setTrigger(trigger);

//        ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false,false,false);
        //settings->addChild(HostXVNClogin());
//        settings->addChild(HostXVNCpassword());
        HostTextEditSetting* settings = HostXVNCpassword();
//        settings->addTargetedChild("0", new VerticalConfigurationGroup(false, false));
        settings->addTargetedChild("1", settings);
    }
};
*/

//------------------
static HostTextEditSetting *HostVNCpassword()
{
    HostTextEditSetting *gc = new HostTextEditSetting("HostVNCpassword");
    gc->setLabel(QObject::tr("VNC Password"));
    gc->setValue("");
    gc->SetPasswordEcho(true);
    gc->setHelpText(QObject::tr("Password for VNC account must be at least 5 characters long. Passwords shorter than 5 characters long will silently fail."));
    return gc;
};

static HostCheckBoxSetting *HostVNCEnable()
{
    HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostVNCEnable");
    gc->setLabel(QObject::tr("Enable VNC"));
    gc->setValue(false);
    gc->setHelpText(QObject::tr("This will start a seperate VNC session that can be used for remote administration. The session will be available on vnc:1 (port 5901)."));
    return gc;
};
/*
class VNCsettings: public GroupSetting {
public:
    VNCsettings()
//    TriggeredConfigurationGroup(false,false,false,false) {
    {
        setLabel(QObject::tr("VNC Settings"));
//        SetVertical(true);
//        Setting* trigger = HostVNCEnable() ;
        HostCheckBoxSetting* trigger = HostVNCEnable();
        addChild(trigger);
//        setTrigger(trigger);

//        ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false,false,false);
        //settings->addChild(HostVNClogin());
        //settings->addChild(HostVNCpassword());

        HostTextEditSetting* settings = HostVNCpassword();
//        addTarget("0", new VerticalConfigurationGroup(false, false));
        settings->addTargetedChild("1", settings);
//        addTarget("1", settings);
    }
};
*/


VNChostsettings::VNChostsettings()
{
    GroupSetting* SSsettings = new GroupSetting();
    SSsettings->setLabel(QObject::tr("Screen Sharing Settings"));
    HostCheckBoxSetting* vnctrigger = HostVNCEnable();
    addChild(vnctrigger);
    vnctrigger->addTargetedChild("1", HostVNCpassword());
        //HostTextEditSetting* vncsettings = HostVNCpassword();
        //vncsettings->addTargetedChild("1", vncsettings);

        //SSsettings->addChild(XVNCsettings());
    setLabel(QObject::tr("XVNC Settings"));
    HostCheckBoxSetting* xvnctrigger = HostXVNCEnable();
    addChild(xvnctrigger);
    HostTextEditSetting* xvncsettings = HostXVNCpassword();
//        settings->addTargetedChild("0", new VerticalConfigurationGroup(false, false));
    xvncsettings->addTargetedChild("1", xvncsettings);

        //addChild(SSsettings);
}