summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall/MythVantage-app/mythinstall/vnc.cpp
blob: 96cb1079f556f47433f791134b6c949af307c7c0 (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
#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()
{
    HostLineEdit *gc = new HostLineEdit("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 HostCheckBox *HostXVNCEnable()
{
    HostCheckBox *gc = new HostCheckBox("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 TriggeredConfigurationGroup {
public:
    XVNCsettings():
    TriggeredConfigurationGroup(false,false,false,false) {
        setLabel(QObject::tr("XVNC Settings"));
        SetVertical(true);
        Setting* trigger = HostXVNCEnable() ;
        addChild(trigger);
        setTrigger(trigger);

        ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false,false,false);
        //settings->addChild(HostXVNClogin());
        settings->addChild(HostXVNCpassword());

        addTarget("0", new VerticalConfigurationGroup(false, false));
        addTarget("1", settings);
    };
};


//------------------
static HostLineEdit *HostVNCpassword()
{
    HostLineEdit *gc = new HostLineEdit("HostVNCpassword");
    gc->setLabel(QObject::tr("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 HostCheckBox *HostVNCEnable()
{
    HostCheckBox *gc = new HostCheckBox("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 TriggeredConfigurationGroup {
public:
    VNCsettings():
    TriggeredConfigurationGroup(false,false,false,false) {
        setLabel(QObject::tr("VNC Settings"));
        SetVertical(true);
        Setting* trigger = HostVNCEnable() ;
        addChild(trigger);
        setTrigger(trigger);

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

        addTarget("0", new VerticalConfigurationGroup(false, false));
        addTarget("1", settings);
    };
};



VNChostsettings::VNChostsettings():
    VerticalConfigurationGroup(false,false,false,false)
    {
        setLabel(QObject::tr("Screen Sharing Settings"));
        VNCsettings *vncframe = new VNCsettings();
        XVNCsettings *xvncframe = new XVNCsettings();
        addChild(vncframe);
        addChild(xvncframe);
    }