#include #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); }