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