//_include #include #include #include #include //#include "tv.h" #include #include "mythprogressdialog.h" #include "mythsystemlegacy.h" #include "xorgsettings.h" #include "password_manage.h" #include "misc_settings.h" #include "infrared.h" #include "supplemental.h" #include "vnc.h" #include "fileshare.h" int timezone_unknown = false; extern HostParms hostparm; //extern DDCinfo ddcinfo; bool displaymysqlonly = false ; bool displayshownetwork =false ; bool displayshowhostype = false ; bool displayshowmisc =false ; bool displayshowshutdown =false ; bool displayshowadvanced = false; bool displayshowsound = false ; bool displayshowadvancedX = false; bool displayaccesscontrol= false; bool displayplugins = false; bool displaysoftware = false; bool displayuser = false; bool displaywebuser = false; bool displayddns = false; bool displayinfrared = false; bool displayscreensaver = false; //bool install_hobbit = false; bool displaysupplemental = false; bool displayremotesonly = false; bool displayvnc = false; bool displayfileshare = false; static HostComboBoxSetting *ThemePainter() { HostComboBoxSetting *gc = new HostComboBoxSetting("ThemePainter"); gc->setLabel(QObject::tr("Paint Engine")); gc->addSelection(QObject::tr("Qt"), "qt"); gc->addSelection(QObject::tr("OpenGL"), "opengl"); gc->setHelpText(QObject::tr("This selects what Myth uses to draw. If you have decent hardware, select OpenGL. Changing this requires a restart.")); return gc; } static HostTextEditSetting *HostDDnslogin() { HostTextEditSetting *gc = new HostTextEditSetting("HostDDnslogin"); gc->setLabel(QObject::tr("Login")); gc->setValue(""); gc->setHelpText(QObject::tr("Login for DDNS account.")); return gc; }; static HostTextEditSetting *HostDDnspassword() { HostTextEditSetting *gc = new HostTextEditSetting("HostDDnspassword"); gc->setLabel(QObject::tr("Password")); gc->setValue(""); gc->SetPasswordEcho(true); gc->setHelpText(QObject::tr("Password for DDNS account.")); return gc; }; static HostTextEditSetting *HostDDnshostname() { HostTextEditSetting *gc = new HostTextEditSetting("HostDDnshostname"); gc->setLabel(QObject::tr("DDNS hostname")); gc->setValue(""); gc->setHelpText(QObject::tr("Hostname used for DDNS.")); return gc; }; static HostCheckBoxSetting *HostDDnsEnable() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostDDnsEnable"); gc->setLabel(QObject::tr("Enable DDNS")); gc->setValue(false); gc->setHelpText(QObject::tr("Update DDNS records at dyndns.com. Visit http://dyndns.com to setup your account.")); return gc; }; /* class DDnssettings: public GroupSetting { public: DDnssettings(): GroupSetting(false,false,false,false) { setLabel(QObject::tr("DDNS Settings")); SetVertical(true); Setting* trigger = HostDDnsEnable() ; addChild(trigger); setTrigger(trigger); ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false,false,false); settings->addChild(HostDDnshostname()); settings->addChild(HostDDnslogin()); settings->addChild(HostDDnspassword()); addTarget("0", new VerticalConfigurationGroup(false, false)); addTarget("1", settings); }; }; */ QString findnet() { QString netdev=""; //QString netdev="eth0 eth1 wlan0 wlan1 ath0 "; //QString netdev="eth0 eth1"; QList ifaces = QNetworkInterface::allInterfaces(); for (int i = 0; i < ifaces.count(); ++i) { netdev+=ifaces[i].name(); } return netdev; } /* system("/sbin/ifconfig -a > /tmp/.netinfo"); QString line; QFile file("/tmp/.netinfo"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if ( line.contains("HWaddr")) { QString s = line.simplified(); s = s.section( " ", 0, 0 ); // s == "surname" netdev+=s; netdev+=" "; } } file.close(); } return netdev;*/ //} QString findnet_wireless() { QString netdev=""; //QString netdev="eth0 eth1 wlan0 wlan1 ath0 "; int sysRet = system("/usr/sbin/iwconfig > /tmp/.netinfo_wireless"); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running iwconfig"); QString line; QFile file("/tmp/.netinfo_wireless"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if ( line.contains("Nickname") || line.contains("ESSID")) { QString s = line.simplified(); s = s.section( " ", 0, 0 ); // s == "surname" netdev+=s; netdev+=" "; } } file.close(); } return netdev; } static HostComboBoxSetting *HostNetDevice() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostNetDevice"); gc->setLabel(QObject::tr("Device")); QString foundnet=findnet(); if (foundnet.contains(hostparm.ThisHostnetOLD)) { QString s = "HostActiveonboot"; s+=hostparm.ThisHostnetOLD; gCoreContext->SaveSetting(s, hostparm.ThisHostnetActiveOLD ); } if (foundnet.contains("eth0")) gc->addSelection("eth0"); if (foundnet.contains("eth1")) gc->addSelection("eth1"); if (foundnet.contains("wlan0")) gc->addSelection("wlan0"); if (foundnet.contains("wlan1")) gc->addSelection("wlan1"); if (foundnet.contains("ath0")) gc->addSelection("ath0"); //int findoldnetdevice=gc->findSelection(hostparm.ThisHostnetOLD); QString findoldnetdevice = gCoreContext->GetSetting("ThisHostnetOLD"); gc->setValue(findoldnetdevice); gc->setHelpText(QObject::tr("Network interface")); return gc; }; /* static HostCheckBoxSetting *HostActiveonboot() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostActiveonboot"); gc->setLabel(QObject::tr("Device is active on boot")); gc->setValue(false); gc->setHelpText(QObject::tr("Network is started on boot")); return gc; }; static HostCheckBoxSetting *HostServiceSamba() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceSamba"); gc->setLabel(QObject::tr("Windows sharing")); gc->setValue(false); gc->setHelpText(QObject::tr("Allow window machines to access recorded files")); return gc; }; static HostCheckBoxSetting *HostServiceSamba_write() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceSamba_write"); gc->setLabel(QObject::tr("Readonly")); gc->setValue(false); gc->setHelpText(QObject::tr("If checked, all remote connections will be read only. If not checked then remote clients will have write and delete abilites. ")); return gc; }; static HostCheckBoxSetting *HostServiceSamba_writehome() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceSamba_writehome"); gc->setLabel(QObject::tr("Readonly")); gc->setValue(false); gc->setHelpText(QObject::tr("If checked, all remote connections will be read only. If not checked then remote clients will have write and delete abilites. ")); return gc; }; static HostCheckBoxSetting *HostServiceSamba_media() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceSamba_media"); gc->setLabel(QObject::tr("share media")); gc->setValue(true); gc->setHelpText(QObject::tr(" ")); return gc; }; static HostCheckBoxSetting *HostServiceSamba_home() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceSamba_home"); gc->setLabel(QObject::tr("share home")); gc->setValue(true); gc->setHelpText(QObject::tr(" ")); return gc; }; static HostComboBoxSetting *HostServiceSamba_domain() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostServiceSamba_domain",true); gc->setLabel(QObject::tr("Workgroup")); gc->setHelpText(QObject::tr("Workgroup for smb share")); gc->addSelection("WORKGROUP"); QString currentitem; QString line; QFile file("/tmp/smbdomainlist"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if ( line.startsWith("domain")) { currentitem = line.section( " ", 1, 1 ); if ( currentitem != "-" ) gc->addSelection(currentitem); } } file.close(); } gc->addSelection("type_workgroup_here"); return gc; }; static HostCheckBoxSetting *HostLircWait() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostLircWait"); gc->setLabel(QObject::tr("Wait for lirc")); gc->setValue(false); gc->setHelpText(QObject::tr("System will wait for lirc before starting the UI ")); return gc; }; */ static HostCheckBoxSetting *HostBEWait() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostBEWait"); gc->setLabel(QObject::tr("Delay starting mythfrontend until mythbackend is running")); gc->setValue(true); gc->setHelpText(QObject::tr("The system will check if mythbackend is online before starting mythfrontend. This will avoid connection errors and configuration screens.")); return gc; }; // static HostComboBoxSetting *HostEvrouterConfig() // { // HostComboBoxSetting *gc = new HostComboBoxSetting("HostEvrouterConfig",true); // gc->setLabel(QObject::tr("Key Configuration")); // gc->setHelpText(QObject::tr("Choose the key definations that will be used by the event router")); // QString dirtxt; // dirtxt=MV_ROOT; // dirtxt.append("templates/evrouter"); // QDir evrouter(dirtxt); // // evrouter.setSorting(QDir::Name | QDir::IgnoreCase); // QFileInfoList fil = evrouter.entryInfoList(QDir::Dirs); // for( QFileInfoList::iterator it = fil.begin(); // it != fil.end(); // ++it ) // { // QFileInfo ¤titem = *it; // //JM VERBOSE(VB_IMPORTANT, currentitem.fileName()); // if ( currentitem.fileName() != ".." && currentitem.fileName() != "." && currentitem.fileName() != "") // { // gc->addSelection(currentitem.fileName()); // } // } // gc->addSelection("tinker"); // return gc; // }; // static HostCheckBoxSetting *HostServiceNFS() // { // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceNFS"); // gc->setLabel(QObject::tr("Standard file sharing")); // gc->setValue(true); // gc->setHelpText(QObject::tr("Allow all machines to access recorded files with nfs")); // return gc; // }; static HostCheckBoxSetting *HostServiceMythWEB() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceMythWEB"); gc->setLabel(QObject::tr("Enable MythWeb")); gc->setValue(false); gc->setHelpText(QObject::tr("Allow MythTV scheduling using a web browser.")); return gc; }; /* static HostCheckBoxSetting *HostServiceHobbitclient() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceHobbitclient"); gc->setLabel(QObject::tr("Hobbit-client")); gc->setValue(false); gc->setHelpText(QObject::tr("Report stats and other stuff to the master backend")); return gc; }; static GlobalCheckBox *GlobalServiceHobbitserver() { GlobalCheckBox *gc = new GlobalCheckBox("GlobalServiceHobbitserver"); gc->setLabel(QObject::tr("Hobbit-server")); gc->setValue(true); gc->setHelpText(QObject::tr("Run the hobbit server to collect stats and other stuff")); return gc; }; static HostCheckBoxSetting *HostServiceRRD() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostServiceRRD"); gc->setLabel(QObject::tr("rrd_stats")); gc->setValue(false); gc->setHelpText(QObject::tr("Collect stats and create graphs of various system resources.")); return gc; }; */ static HostCheckBoxSetting *HostUseDHCP() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseDHCP"); gc->setLabel(QObject::tr("Static ip address")); gc->setValue(false); gc->setHelpText(QObject::tr("Enable to use a static ip address, otherwise dhcp will be used.")); return gc; }; static HostCheckBoxSetting *HostRunDHCP() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostRunDHCP"); gc->setLabel(QObject::tr("DHCP Server")); gc->setValue(false); gc->setHelpText(QObject::tr("Only one DHCP server should run on a network. Leave this unchecked if you are not sure.")); return gc; }; // static HostCheckBoxSetting *HostRunEvrouter() // { // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostRunEvrouter"); // gc->setLabel(QObject::tr("Use evrouter")); // gc->setValue(false); // gc->setHelpText(QObject::tr("Evrouter will run custom actions, based on the user defined events.")); // return gc; // }; static HostCheckBoxSetting *HostUsemythfrontend() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseMythWelcome"); gc->setLabel(QObject::tr("Run MythWelcome")); gc->setValue(false); gc->setHelpText(QObject::tr("If checked mythwelcome will be started instead of mythfrontend.")); return gc; }; static HostCheckBoxSetting *HostRunFrontend() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostRunFrontend"); gc->setLabel(QObject::tr("Run Frontend")); gc->setValue(true); gc->setHelpText(QObject::tr("If checked the frontend X windows GUI will start. Most people will want this checked. Disable the frontend if you want the system to run without a display connected.")); return gc; }; static HostComboBoxSetting *HostMysqlserverip_listbox() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostMysqlServer",true); gc->setLabel(QObject::tr("MySQL Server")); myth_system("avahi-browse -l -r -t _mysql._tcp > /tmp/mysqllist"); QString currentitem; QString prevline; QString line; QFile file("/tmp/mysqllist"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if ( line.startsWith(" address")) { currentitem = line.section( " ", 5, 5 ); currentitem = currentitem.section( "[" , 1,1 ); currentitem = currentitem.section( "]" , 0, 0 ); currentitem = currentitem + "\t" + prevline.section( " ",5,5 ); gc->addSelection(currentitem); } prevline = line; } file.close(); //system ("rm -f /tmp/mysqllist"); } gc->addSelection("Manual: Enter IP Address"); gc->setHelpText(QObject::tr("The IP address of the MasterBackend MySQL server.")); QString NETBOOT = getenv("NETBOOT"); NETBOOT=NETBOOT.simplified(); if ( NETBOOT != "YES" ) { if ( ((gCoreContext->GetSetting("HostaccesshostypeSystemtype")) == "0" )) gc->setEnabled(false); } return gc; } static HostCheckBoxSetting *HostRemoteBackup() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostRemoteBackup"); gc->setLabel(QObject::tr("Remote Backup")); gc->setValue(false); gc->setHelpText(QObject::tr("Copy the system backup file to another directory or host.")); return gc; }; static HostComboBoxSetting *HostRemoteBackupDir() { QString tempItem; HostComboBoxSetting *gc = new HostComboBoxSetting("HostRemoteBackupDir",true); gc->setLabel(QObject::tr("Dir or Host" )); gc->addSelection("dir:/data/storage/disk0"); MSqlQuery query(MSqlQuery::InitCon()); query.prepare( "SELECT DISTINCT hostname from settings where hostname is not null and not (hostname=:HOSTNAME);"); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); if (query.exec() && query.isActive() && query.size() > 0) { while (query.next()) { tempItem = query.value(0).toString(); gc->addSelection(tempItem); } } gc->setHelpText(QObject::tr("Remote host that will receive a copy of the backup file. To copy the file to a local dir instead of a remote host use dir:/backup_dir_name")); return gc; }; class Backupsettings: public GroupSetting { public: Backupsettings(): GroupSetting() { // SetVertical(false); setLabel(QObject::tr("Backup Settings")); // Setting* trigger = HostRemoteBackup(); addChild(HostRemoteBackup()); // setTrigger(trigger); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false); // addTargetedChild(HostRemoteBackupDir(),true); // addTarget("0", new VerticalConfigurationGroup(false, false)); // addTarget("1", settings); }; }; // static HostCheckBoxSetting *HostPKG_MIRROR() // { // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostPKG_MIRROR"); // gc->setLabel(QObject::tr("Use Local mirror")); // gc->setValue(false); // gc->setHelpText(QObject::tr("Master Backend will be used as the repo source.")); // return gc; // }; // static GlobalCheckBox *GlobalPKG_MIRROR() // { // GlobalCheckBox *gc = new GlobalCheckBox("GlobalPKG_MIRROR"); // gc->setLabel(QObject::tr("Local mirror")); // gc->setValue(false); // gc->setHelpText(QObject::tr("Keep a local copy of the packages. Allow other frontends to install from the local copy.")); // return gc; // }; static HostCheckBoxSetting *HostncidClient() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostncidClient"); gc->setLabel(QObject::tr("Show CallerID")); gc->setValue(false); gc->setHelpText(QObject::tr("Show CallerID popup. The backend must be running the CallerID program.")); return gc; }; static HostCheckBoxSetting *HostncidDaemon() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostncidDaemon"); gc->setLabel(QObject::tr("Run CallerID")); gc->setValue(false); gc->setHelpText(QObject::tr("Run daemon to collect CallerID information.")); return gc; }; static HostComboBoxSetting *HostSerialPortncid() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostSerialPortncid",false); gc->setLabel(QObject::tr("Serial Port")); gc->addSelection("ttyS0"); gc->addSelection("ttyS1"); gc->addSelection("ttyS2"); gc->addSelection("ttyS3"); gc->addSelection("ttyACM0"); gc->setHelpText(QObject::tr("Serial port where callerid capable modem is connected")); return gc; } static HostCheckBoxSetting *HostNcidDeviceNetCallerID() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostNcidDeviceNetCallerID"); gc->setLabel(QObject::tr("Using a NetCallerID")); gc->setValue(false); gc->setHelpText(QObject::tr("Instead of a typical modem, the serial device is a NetCallerID")); return gc; }; static HostCheckBoxSetting *Hostbootsplash() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostbootsplash"); gc->setLabel(QObject::tr("Enable Boot Splash")); gc->setValue(false); gc->setHelpText(QObject::tr("Covers up boot messages with LinHES logo.")); return gc; }; //-------------------------------------screensaver settings------------------- /* static HostComboBoxSetting *HostScreensaverType() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostScreensaverType"); gc->setLabel(QObject::tr("Screensaver Program")); gc->addSelection("xscreensaver"); //gc->addSelection("gscreensaver"); gc->addSelection("none"); gc->addSelection("tinker"); gc->setHelpText(QObject::tr("Set the screensaver program.")); gc->setValue("none"); return gc; }; static HostSpinBoxSetting *HostScreensaverIdle() { HostSpinBox *gc = new HostSpinBox("HostScreensaverIdle", 5, 60, 1, true); gc->setLabel(QObject::tr("Idle Time")); gc->setValue(5); gc->setHelpText(QObject::tr("Number of minutes to wait before starting the screensaver." )); return gc; } static HostCheckBoxSetting *HostScreensaverBlank() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostScreensaverBlank"); gc->setLabel(QObject::tr("Blank")); gc->setValue(false); gc->setHelpText(QObject::tr("Blank the screen instead of using a screensaver")); return gc; }; static HostCheckBoxSetting *HostScreensaverRandom() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostScreensaverRandom"); gc->setLabel(QObject::tr("Random")); gc->setValue(false); gc->setHelpText(QObject::tr("Use a random screensaver.")); return gc; }; static HostComboBoxSetting *HostGScreensaverTheme() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostGScreensaverTheme"); gc->setLabel(QObject::tr("Screensaver")); gc->setHelpText(QObject::tr("Screen saver program to use.")); QString line; QString dirtxt=MV_ROOT; dirtxt.append("templates/gscreensavers"); QFile file(dirtxt); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); gc->addSelection(line); } file.close(); } return gc; }; static HostComboBoxSetting *HostXScreensaverTheme() { HostComboBoxSetting *gc = new HostComboBoxSetting("HostXScreensaverTheme"); gc->setLabel(QObject::tr("Screensaver")); gc->setHelpText(QObject::tr("Screensaver to display.")); QString dirtxt; dirtxt=MV_ROOT; dirtxt.append("templates/xscreensavers"); //read in from a file. QString line; QFile file(dirtxt); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); gc->addSelection(line); } file.close(); } return gc; }; class Screensaverhostsettings: public GroupSetting { public: Screensaverhostsettings(): GroupSetting() { SetVertical(true); setLabel(QObject::tr("Screensaver Settings")); Setting* trigger = HostScreensaverType() ; addChild(trigger); setTrigger(trigger); ConfigurationGroup* screensaversettings = new GridConfigurationGroup(2); screensaversettings->addChild(HostScreensaverBlank()); screensaversettings->addChild(HostScreensaverRandom()); ConfigurationGroup* xscreensaversettings = new VerticalConfigurationGroup(); xscreensaversettings->addChild(screensaversettings); xscreensaversettings->addChild(HostScreensaverIdle()); xscreensaversettings->addChild(HostXScreensaverTheme()); ConfigurationGroup* gscreensaversettings = new VerticalConfigurationGroup(); gscreensaversettings->addChild(screensaversettings); gscreensaversettings->addChild(HostScreensaverIdle()); gscreensaversettings->addChild(HostGScreensaverTheme()); addTarget("tinker", new VerticalConfigurationGroup(false, false)); addTarget("none", new VerticalConfigurationGroup(false, false)); addTarget("gscreensaver", gscreensaversettings); addTarget("xscreensaver", xscreensaversettings); }; }; */ //-------------------------------------access setting---------------------- static HostCheckBoxSetting *Hostaccessnetwork() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessnetwork"); gc->setLabel(QObject::tr("Network")); gc->setValue(false); gc->setHelpText(QObject::tr("Control access to Network Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccesshostype() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccesshostype"); gc->setLabel(QObject::tr("Host")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Host Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *HostaccesshostypeSystemtype() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostaccesshostypeSystemtype"); gc->setLabel(QObject::tr("Change System Type")); gc->setValue(false); gc->setHelpText(QObject::tr("Ability to change the System Type in Host Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessmisc() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessmisc"); gc->setLabel(QObject::tr("Miscellanous")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Miscellanous Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccesssleep() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccesssleep"); gc->setLabel(QObject::tr("Shutdown")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Shutdown Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessadvanced() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessadvanced"); gc->setLabel(QObject::tr("Advanced")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Advanced Settings. Checked means the screen is enabled. ")); return gc; }; static HostCheckBoxSetting *HostaccessadvancedX() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostaccessadvancedX"); gc->setLabel(QObject::tr("Display")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Display Settings. Checked means the screen is enabled. ")); return gc; }; static HostCheckBoxSetting *Hostaccessddns() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessddns"); gc->setLabel(QObject::tr("Dynamic DNS")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to DDNS Settings. Checked means the screen is enabled. ")); return gc; }; static HostCheckBoxSetting *Hostaccesssound() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccesssound"); gc->setLabel(QObject::tr("Audio")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Audio Settings. Checked means the screen is enabled.")); return gc; }; /* static HostCheckBoxSetting *Hostaccessscreensaver() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessscreensaver"); gc->setLabel(QObject::tr("Screensaver")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Screensaver Settings. Checked means the screen is enabled.")); return gc; }; */ static HostCheckBoxSetting *Hostaccessir() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessir"); gc->setLabel(QObject::tr("Remotes")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Remotes Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessplugins() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessplugins"); gc->setLabel(QObject::tr("Programs")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Programs. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessuser() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessuser"); gc->setLabel(QObject::tr("User Accounts")); gc->setValue(false); gc->setHelpText(QObject::tr("Control access to User Accounts. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccesswebuser() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccesswebuser"); gc->setLabel(QObject::tr("Web Security")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Web Security Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessvnc() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessvnc"); gc->setLabel(QObject::tr("Screen Sharing")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to Screen Sharing Settings. Checked means the screen is enabled.")); return gc; }; static HostCheckBoxSetting *Hostaccessfileshare() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostaccessfileshare"); gc->setLabel(QObject::tr("File Sharing")); gc->setValue(true); gc->setHelpText(QObject::tr("Control access to File Sharing Settings. Checked means the screen is enabled.")); return gc; }; /* class ACCESShostsettings: public GroupSetting { public: ACCESShostsettings(): GroupSetting(false,false,false,false) { SetVertical(false); Setting* trigger = Hostaccesshostype () ; addChild(trigger); setTrigger(trigger); ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false,false,false); //settings->addChild(HostServiceSamba()); settings->addChild(HostaccesshostypeSystemtype()); addTarget("0", new VerticalConfigurationGroup(false, false)); addTarget("1", settings); }; }; */ //---------------------------------- PLUGINS ---------------------- static HostCheckBoxSetting *Hostpluginmytharchive() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmytharchive"); gc->setLabel(QObject::tr("MythArchive")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythArchive.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythbrowser() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythbrowser"); gc->setLabel(QObject::tr("MythBrowser")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythBrowser.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythnetvision() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythnetvision"); gc->setLabel(QObject::tr("MythNetvision")); gc->setValue(true); gc->setHelpText(QObject::tr("Check to enable MythNetvision.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythgallery() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythgallery"); gc->setLabel(QObject::tr("MythGallery")); gc->setValue(true); gc->setHelpText(QObject::tr("Check to enable MythGallery.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythgame() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythgame"); gc->setLabel(QObject::tr("MythGame")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythGame.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythgamesnes9x() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythgamesnes9x"); gc->setLabel(QObject::tr("snes9x")); gc->setValue(false); gc->setHelpText(QObject::tr("Super Nintendo emulator")); return gc; }; static HostCheckBoxSetting *Hostpluginmythgamefceux() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythgamefceux"); gc->setLabel(QObject::tr("fceux")); gc->setValue(false); gc->setHelpText(QObject::tr("NES emulator")); return gc; }; static HostCheckBoxSetting *HostpluginmythgameMame() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostpluginmythgameMame"); gc->setLabel(QObject::tr("mame")); gc->setValue(false); gc->setHelpText(QObject::tr("Mame, Multiple Arcade Machine Emulator")); return gc; }; static HostCheckBoxSetting *HostpluginmythgameMednafen() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostpluginmythgameMednafen"); gc->setLabel(QObject::tr("Mednafen")); gc->setValue(false); gc->setHelpText(QObject::tr("Mednafen is a portable, utilizing OpenGL and SDL, command-line driven multi-system emulator with many advanced features.")); return gc; }; static HostCheckBoxSetting *HostpluginmythgameROMDB() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostpluginmythgameROMDB"); gc->setLabel(QObject::tr("RomDB")); gc->setValue(true); gc->setHelpText(QObject::tr("Table used my MythGame to store information about games. If you are into games, this is recommended.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythgamemupen64() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythgamemupen64"); gc->setLabel(QObject::tr("mupen64")); gc->setValue(false); gc->setHelpText(QObject::tr("n64 emulator")); return gc; }; static HostCheckBoxSetting *HostpluginmythgameDolphin() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostpluginmythgameDolphin"); gc->setLabel(QObject::tr("Dolphin")); gc->setValue(false); gc->setHelpText(QObject::tr("Nintendo Wii emulator")); return gc; }; static HostCheckBoxSetting *HostpluginmythgameXe() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostpluginmythgameXe"); gc->setLabel(QObject::tr("Xe")); gc->setValue(false); gc->setHelpText(QObject::tr("Xe is a multisystem emulator. http://www.xe-emulator.com/ for the complete list.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythmusic() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythmusic"); gc->setLabel(QObject::tr("MythMusic")); gc->setValue(true); gc->setHelpText(QObject::tr("Check to enable MythMusic.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythnews() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythnews"); gc->setLabel(QObject::tr("MythNews")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythNews.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythvideo_dvdcss() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythvideo_dvdcss"); gc->setLabel(QObject::tr("dvdcss")); gc->setValue(false); gc->setHelpText(QObject::tr("libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythappletrailers() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythappletrailers"); gc->setLabel(QObject::tr("MythAppleTrailers")); gc->setValue(false); gc->setHelpText(QObject::tr("Stream trailer's from Apple's website.")); return gc; }; static HostCheckBoxSetting *Hostpluginmythweather() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythweather"); gc->setLabel(QObject::tr("MythWeather")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythWeather.")); return gc; }; static HostCheckBoxSetting *Hostwebmin() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostwebmin"); gc->setLabel(QObject::tr("Webmin")); gc->setValue(false); gc->setHelpText(QObject::tr("Webmin is a web-based interface for system administration. Once installed, access it at https://ip.of.back.end:10000 using your root password.")); return gc; }; static HostCheckBoxSetting *Hostfoldingathome() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostfoldingathome"); gc->setLabel(QObject::tr("Folding@home")); gc->setValue(false); gc->setHelpText(QObject::tr("A distributed computing project which studies protein folding, misfolding, aggregation, and related diseases.")); return gc; }; static HostCheckBoxSetting *Hostwebonlinhes() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostwebonlinhes"); gc->setLabel(QObject::tr("Web On LinHES")); gc->setValue(false); gc->setHelpText(QObject::tr("Includes Google Chrome and multiple websites with 10' UIs in Media Library --> Online Content.")); return gc; }; static HostCheckBoxSetting *HostXBMC() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostXBMC"); gc->setLabel(QObject::tr("Kodi")); gc->setValue(false); gc->setHelpText(QObject::tr("Kodi (formerly known as XBMC) is an award-winning free and open source (GPL) software media player and entertainment hub, featuring a 10-foot user interface for use with televisions and remote controls.")); return gc; }; static HostCheckBoxSetting *HostPLEXHT() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostPLEXHT"); gc->setLabel(QObject::tr("OpenPHT")); gc->setValue(false); gc->setHelpText(QObject::tr("OpenPHT is a community driven fork of Plex Home Theater. OpenPHT is a full-featured, powerful App that connects to Plex Media Server and is designed to be used in the living room from the comfort of your lounge.")); return gc; }; static HostCheckBoxSetting *HostPLEXMS() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostPLEXMS"); gc->setLabel(QObject::tr("Plex Media Server")); gc->setValue(false); gc->setHelpText(QObject::tr("Plex is a centralized home media playback system with a powerful central server - the Plex Media Server - that streams its media to many Plex player Apps.")); return gc; }; static HostComboBoxSetting *Hostfoldingusername() { // If there is an old R5.5 style folding directory /myth/folding@home, attempt // to retrieve the old username. FILE *username_pipe; username_pipe = popen ( "grep username= /myth/folding@home/client.cfg 2> /dev/null | " "sed 's/username=//g'", "r"); if (username_pipe) { char username[200]; if (fgets (username, sizeof (username), username_pipe)) { char *new_line; username[sizeof(username)-1]=0; if ((new_line = strchr (username, '\n'))) new_line[0] = 0; //std::cout << "found old username " << username << endl; //FIXME?? //gCoreContext->SetSetting("Hostfoldingusername", username); gCoreContext->SaveSetting("Hostfoldingusername", username); } pclose (username_pipe); } HostComboBoxSetting *gc = new HostComboBoxSetting("Hostfoldingusername",true); gc->setLabel(QObject::tr("Folding Username")); gc->setValue(""); gc->setHelpText(QObject::tr("The username associated to the work-units you return.")); return gc; }; static HostComboBoxSetting *Hostfoldingworksize() { HostComboBoxSetting *gc = new HostComboBoxSetting("Hostfoldingworksize"); gc->setLabel(QObject::tr("Work Packet Size")); gc->addSelection("Big", "big"); gc->addSelection("Normal", "normal"); gc->addSelection("Small", "small"); gc->setHelpText(QObject::tr("Acceptable size of work assignment and work result packets (bigger units may have large memory demands).")); return gc; }; // static HostCheckBoxSetting *HostXscreensaver() // { // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostXscreensaver"); // gc->setLabel(QObject::tr("Screensaver")); // gc->setValue(false); // gc->setHelpText(QObject::tr("Run screensaver after 10 minutes of inactivity.")); // return gc; // }; static HostCheckBoxSetting *Hostpluginmythzoneminder() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("Hostpluginmythzoneminder"); gc->setLabel(QObject::tr("MythZoneMinder")); gc->setValue(false); gc->setHelpText(QObject::tr("Check to enable MythZoneMinder.")); return gc; }; // -------------End plugins-------------------------------- /* class NCIDsettings: public GroupSetting { public: NCIDsettings(): GroupSetting(false, false, true, true,false, false, true, true) { SetVertical(true); Setting* trigger = HostncidDaemon() ; addChild(trigger); setTrigger(trigger); ConfigurationGroup* settings = new GridConfigurationGroup(1,false,false); settings->addChild(HostSerialPortncid()); settings->addChild(HostNcidDeviceNetCallerID()); addTarget("0", new HorizontalConfigurationGroup(false, false)); addTarget("1", settings); }; }; */ // class SAMBAsettings: public GroupSetting { // public: // SAMBAsettings(): // GroupSetting(false, true, true, true,false, false, true, true) { // SetVertical(false); // Setting* trigger = HostServiceSamba() ; // addChild(trigger); // setTrigger(trigger); // // ConfigurationGroup* settings = new GridConfigurationGroup(2,false,false); // //settings->addChild(HostServiceSamba()); // settings->addChild(HostServiceSamba_media()); // settings->addChild(HostServiceSamba_write()); // settings->addChild(HostServiceSamba_home()); // settings->addChild(HostServiceSamba_writehome()); // settings->addChild(HostServiceSamba_domain()); // // addTarget("0", new GridConfigurationGroup(2,false, false)); // addTarget("1", settings); // }; // }; // class Evroutersettings: public GroupSetting { // public: // Evroutersettings(): // GroupSetting(false, false, true, true,false, false, true, true) { // setLabel(QObject::tr("Evrouter config")); // Setting* trigger = HostRunEvrouter() ; // addChild(trigger); // setTrigger(trigger); // // ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false); // settings->addChild(HostEvrouterConfig()); // // addTarget("0", new VerticalConfigurationGroup(false, false)); // addTarget("1", settings); // }; // }; class MythGamesettings: public GroupSetting { public: MythGamesettings(): GroupSetting() { //setLabel(QObject::tr("Programs - Games")); HostCheckBoxSetting* trigger = Hostpluginmythgame(); addChild(trigger); trigger->addTargetedChild("1", HostpluginmythgameROMDB()); trigger->addTargetedChild("1", Hostpluginmythgamesnes9x()); trigger->addTargetedChild("1", Hostpluginmythgamefceux()); trigger->addTargetedChild("1", HostpluginmythgameMame()); trigger->addTargetedChild("1", HostpluginmythgameMednafen()); trigger->addTargetedChild("1", Hostpluginmythgamemupen64()); trigger->addTargetedChild("1", HostpluginmythgameDolphin()); trigger->addTargetedChild("1", HostpluginmythgameXe()); }; }; //____________________________________________________________________________ class eth0_settings: public GroupSetting { public: eth0_settings(): GroupSetting() { HostComboBoxSetting *HOSTESSIDeth0 = new HostComboBoxSetting("HOSTESSIDeth0"); HOSTESSIDeth0->setLabel(QObject::tr("ESSID")); HOSTESSIDeth0->addSelection("MythVantage"); HOSTESSIDeth0->addSelection("home_lan"); HOSTESSIDeth0->addSelection("type_it_here"); HOSTESSIDeth0->setHelpText(QObject::tr("ESSID")); addChild(HOSTESSIDeth0); // HostCheckBoxSetting* HostUseEncryption = HostUseEncryptioneth0; // addChild(HostUseEncryption); HostComboBoxSetting *HostUseEncryptioneth0 = new HostComboBoxSetting("HostUseEncryptioneth0"); HostUseEncryptioneth0->setLabel(QObject::tr("Encryption")); HostUseEncryptioneth0->setHelpText(QObject::tr("WPA uses a shared key phrase this is the most secure. For WEP use the generated key, this type of encryption is not recommended.")); HostUseEncryptioneth0->addSelection("None"); HostUseEncryptioneth0->addSelection("WPA"); HostUseEncryptioneth0->addSelection("WEP"); HostTextEditSetting *Hostkeyeth0 = new HostTextEditSetting("Hostkeyeth0"); Hostkeyeth0->setLabel(QObject::tr("Encryption Key")); Hostkeyeth0->setHelpText(QObject::tr("Key to use for encryption.")); addChild(Hostkeyeth0); }; }; NetworkSettingseth0::NetworkSettingseth0() { setLabel(QObject::tr("Network Settings")); HostTextEditSetting *HostIPeth0 = new HostTextEditSetting("HostIPeth0"); HostIPeth0->setLabel(QObject::tr("IP Address")); HostIPeth0->setValue("192.168.1.12"); HostIPeth0->setHelpText(QObject::tr("IP address of the new installation.")); HostComboBoxSetting *HostNETMASKeth0 = new HostComboBoxSetting("HostNETMASKeth0"); HostNETMASKeth0->setLabel(QObject::tr("Netmask")); HostNETMASKeth0->addSelection("/0 0.0.0.0"); HostNETMASKeth0->addSelection("/1 128.0.0.0"); HostNETMASKeth0->addSelection("/2 192.0.0.0"); HostNETMASKeth0->addSelection("/3 224.0.0.0"); HostNETMASKeth0->addSelection("/4 240.0.0.0"); HostNETMASKeth0->addSelection("/5 248.0.0.0"); HostNETMASKeth0->addSelection("/6 252.0.0.0"); HostNETMASKeth0->addSelection("/7 254.0.0.0"); HostNETMASKeth0->addSelection("/8 255.0.0.0"); HostNETMASKeth0->addSelection("/9 255.128.0.0"); HostNETMASKeth0->addSelection("/10 255.192.0.0 "); HostNETMASKeth0->addSelection("/11 255.224.0.0"); HostNETMASKeth0->addSelection("/12 255.240.0.0"); HostNETMASKeth0->addSelection("/13 255.248.0.0"); HostNETMASKeth0->addSelection("/14 255.252.0.0"); HostNETMASKeth0->addSelection("/15 255.254.0.0"); HostNETMASKeth0->addSelection("/16 255.255.0.0"); HostNETMASKeth0->addSelection("/17 255.255.128.0"); HostNETMASKeth0->addSelection("/18 255.255.192.0"); HostNETMASKeth0->addSelection("/19 255.255.224.0"); HostNETMASKeth0->addSelection("/20 255.255.240.0"); HostNETMASKeth0->addSelection("/21 255.255.248.0"); HostNETMASKeth0->addSelection("/22 255.255.252.0"); HostNETMASKeth0->addSelection("/23 255.255.254.0"); HostNETMASKeth0->addSelection("/24 255.255.255.0"); HostNETMASKeth0->addSelection("/25 255.255.255.128"); HostNETMASKeth0->addSelection("/26 255.255.255.192"); HostNETMASKeth0->addSelection("/27 255.255.255.224"); HostNETMASKeth0->addSelection("/28 255.255.255.240"); HostNETMASKeth0->addSelection("/29 255.255.255.248"); HostNETMASKeth0->addSelection("/30 255.255.255.252"); HostNETMASKeth0->addSelection("/31 255.255.255.254"); HostNETMASKeth0->addSelection("/32 255.255.255.255"); HostNETMASKeth0->setHelpText(QObject::tr("Netmask")); HostNETMASKeth0->setValue(24); HostTextEditSetting *HostGWeth0 = new HostTextEditSetting("HostGWeth0"); HostGWeth0->setLabel(QObject::tr("Gateway")); HostGWeth0->setValue("192.168.1.1"); HostGWeth0->setHelpText(QObject::tr("This is the default route.")); HostTextEditSetting *HostDNSeth0 = new HostTextEditSetting("HostDNSeth0"); HostDNSeth0->setLabel(QObject::tr("Name Server")); HostDNSeth0->setValue("192.168.1.1"); HostDNSeth0->setHelpText(QObject::tr("Name server")); HostCheckBoxSetting *HostActiveonbooteth0 = new HostCheckBoxSetting("HostActiveonbooteth0"); HostActiveonbooteth0->setLabel(QObject::tr("Active")); HostActiveonbooteth0->setValue(true); HostActiveonbooteth0->setHelpText(QObject::tr("Network is started on boot.")); HostDefaulteth0 = new HostCheckBoxSetting("HostDefaulteth0"); HostDefaulteth0->setLabel(QObject::tr("Default")); HostDefaulteth0->setValue(true); HostDefaulteth0->setHelpText(QObject::tr("Will be used as the primary interface.")); connect(HostDefaulteth0, SIGNAL(valueChanged(bool)), this, SLOT(eth0_disable_others())); HostCheckBoxSetting *HostUseDHCPeth0 = new HostCheckBoxSetting("HostUseDHCPeth0"); HostUseDHCPeth0->setLabel(QObject::tr("Static IP Address")); HostUseDHCPeth0->setValue(false); HostUseDHCPeth0->setHelpText(QObject::tr("Enable to use a static IP address, otherwise DHCP will be used.")); wirelessbuttoneth0 = new ButtonStandardSetting("Wireless Settings"); connect(wirelessbuttoneth0, SIGNAL(pressed()), this, SLOT(eth0_wireless_settings())); HostDNSeth0->setLabel(QObject::tr("Name Server")); HostDNSeth0->setValue("192.168.1.1"); HostDNSeth0->setHelpText(QObject::tr("Name server")); // ConfigurationGroup* settings1 = new GridConfigurationGroup(3,false, false, true, true); addChild(HostActiveonbooteth0); addChild(HostDefaulteth0); addChild(wirelessbuttoneth0); // addChild(settings1); // Setting* dhcpEnabled = HostUseDHCPeth0; addChild(HostUseDHCPeth0); // setTrigger(dhcpEnabled); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false, false, false); HostUseDHCPeth0->addTargetedChild("1", HostIPeth0); HostUseDHCPeth0->addTargetedChild("1", HostNETMASKeth0); HostUseDHCPeth0->addTargetedChild("1", HostGWeth0); HostUseDHCPeth0->addTargetedChild("1", HostDNSeth0); // addTarget("0", new VerticalConfigurationGroup(false,false,false,false)); // addTarget("1", settings); }; eth0options::eth0options() { // VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false); GroupSetting* rec = new GroupSetting; rec->setLabel(QObject::tr("Wireless Configuration for eth0")); //rec->setUseLabel(true); rec->addChild(new eth0_settings); addChild(rec); } void NetworkSettingseth0::eth0_disable_others() { QString my_current_value; my_current_value = HostDefaulteth0->getValue(); if ( my_current_value == "1" ) { hostparm.ThisHostDefaultInterface="eth0"; emit eth0_is_default(); } } void NetworkSettingseth0::eth0_disabled() { HostDefaulteth0->setValue(0); } void NetworkSettingseth0::eth0_wireless_settings(void) { eth0options eth0screen; // eth0screen.exec(); } void NetworkSettingseth0::eth0_wireless_disable() { wirelessbuttoneth0->setEnabled(false); } class eth1_settings: public GroupSetting { public: eth1_settings(): GroupSetting() { HostComboBoxSetting *HOSTESSIDeth1 = new HostComboBoxSetting("HOSTESSIDeth1"); HOSTESSIDeth1->setLabel(QObject::tr("ESSID")); HOSTESSIDeth1->addSelection("MythVantage"); HOSTESSIDeth1->addSelection("home_lan"); HOSTESSIDeth1->addSelection("type_it_here"); HOSTESSIDeth1->setHelpText(QObject::tr("ESSID")); addChild(HOSTESSIDeth1); // HostComboBoxSetting *HostUseEncryptioneth0 = new HostComboBoxSetting("HostUseEncryptioneth0"); HostComboBoxSetting *HostUseEncryptioneth1 = new HostComboBoxSetting("HostUseEncryptioneth1"); HostUseEncryptioneth1->setLabel(QObject::tr("Encryption")); HostUseEncryptioneth1->setHelpText(QObject::tr("WPA, WEP, none")); HostUseEncryptioneth1->addSelection("none"); HostUseEncryptioneth1->addSelection("WPA"); HostUseEncryptioneth1->addSelection("WEP"); HostTextEditSetting *Hostkeyeth1 = new HostTextEditSetting("Hostkeyeth1"); Hostkeyeth1->setLabel(QObject::tr("Encryption Key")); Hostkeyeth1->setHelpText(QObject::tr("Key to use for encryption.")); addChild(Hostkeyeth1); }; }; NetworkSettingseth1::NetworkSettingseth1() { setLabel(QObject::tr("Network Settings")); HostTextEditSetting *HostIPeth1 = new HostTextEditSetting("HostIPeth1"); HostIPeth1->setLabel(QObject::tr("IP Address")); HostIPeth1->setValue("192.168.1.12"); HostIPeth1->setHelpText(QObject::tr("IP address of the new installation")); HostComboBoxSetting *HostNETMASKeth1 = new HostComboBoxSetting("HostNETMASKeth1"); HostNETMASKeth1->setLabel(QObject::tr("Netmask")); HostNETMASKeth1->addSelection("/0 0.0.0.0"); HostNETMASKeth1->addSelection("/1 128.0.0.0"); HostNETMASKeth1->addSelection("/2 192.0.0.0"); HostNETMASKeth1->addSelection("/3 224.0.0.0"); HostNETMASKeth1->addSelection("/4 240.0.0.0"); HostNETMASKeth1->addSelection("/5 248.0.0.0"); HostNETMASKeth1->addSelection("/6 252.0.0.0"); HostNETMASKeth1->addSelection("/7 254.0.0.0"); HostNETMASKeth1->addSelection("/8 255.0.0.0"); HostNETMASKeth1->addSelection("/9 255.128.0.0"); HostNETMASKeth1->addSelection("/10 255.192.0.0 "); HostNETMASKeth1->addSelection("/11 255.224.0.0"); HostNETMASKeth1->addSelection("/12 255.240.0.0"); HostNETMASKeth1->addSelection("/13 255.248.0.0"); HostNETMASKeth1->addSelection("/14 255.252.0.0"); HostNETMASKeth1->addSelection("/15 255.254.0.0"); HostNETMASKeth1->addSelection("/16 255.255.0.0"); HostNETMASKeth1->addSelection("/17 255.255.128.0"); HostNETMASKeth1->addSelection("/18 255.255.192.0"); HostNETMASKeth1->addSelection("/19 255.255.224.0"); HostNETMASKeth1->addSelection("/20 255.255.240.0"); HostNETMASKeth1->addSelection("/21 255.255.248.0"); HostNETMASKeth1->addSelection("/22 255.255.252.0"); HostNETMASKeth1->addSelection("/23 255.255.254.0"); HostNETMASKeth1->addSelection("/24 255.255.255.0"); HostNETMASKeth1->addSelection("/25 255.255.255.128"); HostNETMASKeth1->addSelection("/26 255.255.255.192"); HostNETMASKeth1->addSelection("/27 255.255.255.224"); HostNETMASKeth1->addSelection("/28 255.255.255.240"); HostNETMASKeth1->addSelection("/29 255.255.255.248"); HostNETMASKeth1->addSelection("/30 255.255.255.252"); HostNETMASKeth1->addSelection("/31 255.255.255.254"); HostNETMASKeth1->addSelection("/32 255.255.255.255"); HostNETMASKeth1->setHelpText(QObject::tr("Netmask")); HostNETMASKeth1->setValue(24); HostTextEditSetting *HostGWeth1 = new HostTextEditSetting("HostGWeth1"); HostGWeth1->setLabel(QObject::tr("Gateway")); HostGWeth1->setValue("192.168.1.1"); HostGWeth1->setHelpText(QObject::tr("This is the default route")); HostTextEditSetting *HostDNSeth1 = new HostTextEditSetting("HostDNSeth1"); HostDNSeth1->setLabel(QObject::tr("Name Server")); HostDNSeth1->setValue("192.168.1.1"); HostDNSeth1->setHelpText(QObject::tr("Name server")); HostCheckBoxSetting *HostActiveonbooteth1 = new HostCheckBoxSetting("HostActiveonbooteth1"); HostActiveonbooteth1->setLabel(QObject::tr("Active")); HostActiveonbooteth1->setValue(false); HostActiveonbooteth1->setHelpText(QObject::tr("Network is started on boot")); HostDefaulteth1 = new HostCheckBoxSetting("HostDefaulteth1"); HostDefaulteth1->setLabel(QObject::tr("Default")); HostDefaulteth1->setValue(false); HostDefaulteth1->setHelpText(QObject::tr("Will be used as the primary interface")); connect(HostDefaulteth1, SIGNAL(valueChanged(bool)), this, SLOT(eth1_disable_others())); HostCheckBoxSetting *HostUseDHCPeth1 = new HostCheckBoxSetting("HostUseDHCPeth1"); HostUseDHCPeth1 ->setLabel(QObject::tr("Static IP Address")); HostUseDHCPeth1 ->setValue(false); HostUseDHCPeth1 ->setHelpText(QObject::tr("Enable to use a static ip address, otherwise dhcp will be used.")); wirelessbuttoneth1 = new ButtonStandardSetting("Wireless Settings"); connect(wirelessbuttoneth1, SIGNAL(pressed()), this, SLOT(eth1_wireless_settings())); // ConfigurationGroup* settings1 = new GridConfigurationGroup(3,false, false, false,false); addChild(HostActiveonbooteth1); addChild(HostDefaulteth1); addChild(wirelessbuttoneth1); // addChild(settings1); // Setting* dhcpEnabled = HostUseDHCPeth1; addChild(HostUseDHCPeth1); // setTrigger(dhcpEnabled); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false,false,false); HostUseDHCPeth1->addTargetedChild("1", HostIPeth1); HostUseDHCPeth1->addTargetedChild("1", HostNETMASKeth1); HostUseDHCPeth1->addTargetedChild("1", HostGWeth1); HostUseDHCPeth1->addTargetedChild("1", HostDNSeth1); // addTarget("0", new VerticalConfigurationGroup(false,false,false,false)); // addTarget("1", settings); }; eth1options::eth1options() { // VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false); GroupSetting* rec = new GroupSetting; rec->setLabel(QObject::tr("Wireless Configuration for eth1")); //rec->setUseLabel(true); rec->addChild(new eth1_settings); addChild(rec); } void NetworkSettingseth1::eth1_disable_others() { QString my_current_value; my_current_value = HostDefaulteth1->getValue(); if ( my_current_value == "1" ) { hostparm.ThisHostDefaultInterface="eth1"; emit eth1_is_default(); } } void NetworkSettingseth1::eth1_disabled() { HostDefaulteth1->setValue(0); } void NetworkSettingseth1::eth1_wireless_settings(void) { eth1options eth1screen; // eth1screen.exec(); } void NetworkSettingseth1::eth1_wireless_disable() { wirelessbuttoneth1->setEnabled(false); } class wlan0_settings: public GroupSetting { public: wlan0_settings(): GroupSetting() { HostComboBoxSetting *HOSTESSIDwlan0 = new HostComboBoxSetting("HOSTESSIDwlan0",true); HOSTESSIDwlan0->setLabel(QObject::tr("ESSID")); HOSTESSIDwlan0->addSelection("MythVantage"); HOSTESSIDwlan0->addSelection("home_lan"); HOSTESSIDwlan0->addSelection("type_it_here"); HOSTESSIDwlan0->setHelpText(QObject::tr("ESSID")); addChild(HOSTESSIDwlan0); HostComboBoxSetting *HostUseEncryptionwlan0 = new HostComboBoxSetting("HostUseEncryptionwlan0"); HostUseEncryptionwlan0->setLabel(QObject::tr("Encryption")); HostUseEncryptionwlan0->setHelpText(QObject::tr("WPA, WEP, none")); HostUseEncryptionwlan0->addSelection("none"); HostUseEncryptionwlan0->addSelection("WPA"); HostUseEncryptionwlan0->addSelection("WEP"); // Setting* HostUseEncryption = HostUseEncryptionwlan0; // addChild(HostUseEncryption); // setTrigger(HostUseEncryption); HostTextEditSetting *Hostkeywlan0 = new HostTextEditSetting("Hostkeywlan0"); Hostkeywlan0->setLabel(QObject::tr("Encryption Key")); Hostkeywlan0->setHelpText(QObject::tr("Key to use for encryption")); addChild(Hostkeywlan0); }; }; NetworkSettingswlan0::NetworkSettingswlan0() { setLabel(QObject::tr("Network Settings")); HostIPwlan0 = new HostTextEditSetting("HostIPwlan0"); HostIPwlan0->setLabel(QObject::tr("IP Address")); HostIPwlan0->setValue("192.168.1.12"); HostIPwlan0->setHelpText(QObject::tr("IP address of the new installation")); HostNETMASKwlan0 = new HostComboBoxSetting("HostNETMASKwlan0"); HostNETMASKwlan0->setLabel(QObject::tr("Netmask")); HostNETMASKwlan0->addSelection("/0 0.0.0.0"); HostNETMASKwlan0->addSelection("/1 128.0.0.0"); HostNETMASKwlan0->addSelection("/2 192.0.0.0"); HostNETMASKwlan0->addSelection("/3 224.0.0.0"); HostNETMASKwlan0->addSelection("/4 240.0.0.0"); HostNETMASKwlan0->addSelection("/5 248.0.0.0"); HostNETMASKwlan0->addSelection("/6 252.0.0.0"); HostNETMASKwlan0->addSelection("/7 254.0.0.0"); HostNETMASKwlan0->addSelection("/8 255.0.0.0"); HostNETMASKwlan0->addSelection("/9 255.128.0.0"); HostNETMASKwlan0->addSelection("/10 255.192.0.0 "); HostNETMASKwlan0->addSelection("/11 255.224.0.0"); HostNETMASKwlan0->addSelection("/12 255.240.0.0"); HostNETMASKwlan0->addSelection("/13 255.248.0.0"); HostNETMASKwlan0->addSelection("/14 255.252.0.0"); HostNETMASKwlan0->addSelection("/15 255.254.0.0"); HostNETMASKwlan0->addSelection("/16 255.255.0.0"); HostNETMASKwlan0->addSelection("/17 255.255.128.0"); HostNETMASKwlan0->addSelection("/18 255.255.192.0"); HostNETMASKwlan0->addSelection("/19 255.255.224.0"); HostNETMASKwlan0->addSelection("/20 255.255.240.0"); HostNETMASKwlan0->addSelection("/21 255.255.248.0"); HostNETMASKwlan0->addSelection("/22 255.255.252.0"); HostNETMASKwlan0->addSelection("/23 255.255.254.0"); HostNETMASKwlan0->addSelection("/24 255.255.255.0"); HostNETMASKwlan0->addSelection("/25 255.255.255.128"); HostNETMASKwlan0->addSelection("/26 255.255.255.192"); HostNETMASKwlan0->addSelection("/27 255.255.255.224"); HostNETMASKwlan0->addSelection("/28 255.255.255.240"); HostNETMASKwlan0->addSelection("/29 255.255.255.248"); HostNETMASKwlan0->addSelection("/30 255.255.255.252"); HostNETMASKwlan0->addSelection("/31 255.255.255.254"); HostNETMASKwlan0->addSelection("/32 255.255.255.255"); HostNETMASKwlan0->setHelpText(QObject::tr("Netmask")); HostNETMASKwlan0->setValue(24); HostGWwlan0 = new HostTextEditSetting("HostGWwlan0"); HostGWwlan0->setLabel(QObject::tr("Gateway")); HostGWwlan0->setValue("192.168.1.1"); HostGWwlan0->setHelpText(QObject::tr("This is the default route")); HostDNSwlan0 = new HostTextEditSetting("HostDNSwlan0"); HostDNSwlan0->setLabel(QObject::tr("Name server")); HostDNSwlan0->setValue("192.168.1.1"); HostDNSwlan0->setHelpText(QObject::tr("Name server")); HostActiveonbootwlan0 = new HostCheckBoxSetting("HostActiveonbootwlan0"); HostActiveonbootwlan0->setLabel(QObject::tr("Active")); HostActiveonbootwlan0->setValue(false); HostActiveonbootwlan0->setHelpText(QObject::tr("Network is started on boot")); HostDefaultwlan0 = new HostCheckBoxSetting("HostDefaultwlan0"); HostDefaultwlan0->setLabel(QObject::tr("Default")); HostDefaultwlan0->setValue(false); HostDefaultwlan0->setHelpText(QObject::tr("Will be used as the primary interface")); connect(HostDefaultwlan0, SIGNAL(valueChanged(bool)), this, SLOT(wlan0_disable_others())); HostUseDHCPwlan0 = new HostCheckBoxSetting("HostUseDHCPwlan0"); HostUseDHCPwlan0 ->setLabel(QObject::tr("Static IP Address")); HostUseDHCPwlan0 ->setValue(false); HostUseDHCPwlan0 ->setHelpText(QObject::tr("Enable to use a static ip address, otherwise dhcp will be used.")); wirelessbuttonwlan0 = new ButtonStandardSetting("Wireless Settings"); connect(wirelessbuttonwlan0, SIGNAL(pressed()), this, SLOT(wlan0_wireless_settings())); // ConfigurationGroup* settings1 = new GridConfigurationGroup(3,false, false, false,false) addChild(HostActiveonbootwlan0); addChild(HostDefaultwlan0); addChild(wirelessbuttonwlan0); // addChild(settings1); // Setting* dhcpEnabled = HostUseDHCPwlan0; addChild(HostUseDHCPwlan0); // setTrigger(dhcpEnabled); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false,false,false); HostUseDHCPwlan0->addTargetedChild("1", HostIPwlan0); HostUseDHCPwlan0->addTargetedChild("1", HostNETMASKwlan0); HostUseDHCPwlan0->addTargetedChild("1", HostGWwlan0); HostUseDHCPwlan0->addTargetedChild("1", HostDNSwlan0); // addTarget("0", new VerticalConfigurationGroup(false,false,false,false)); // addTarget("1", settings); }; Wlan0options::Wlan0options() { // VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false); GroupSetting* rec = new GroupSetting; rec->setLabel(QObject::tr("Wireless Configuration for wlan0")); //rec->setUseLabel(true); rec->addChild(new wlan0_settings); addChild(rec); } void NetworkSettingswlan0::wlan0_disable_others() { QString my_current_value; my_current_value = HostDefaultwlan0->getValue(); if ( my_current_value == "1" ) { hostparm.ThisHostDefaultInterface="wlan0"; emit wlan0_is_default(); } } void NetworkSettingswlan0::wlan0_disabled() { HostDefaultwlan0->setValue(0); } void NetworkSettingswlan0::wlan0_wireless_settings(void) { Wlan0options wlan0screen; // wlan0screen.exec(); } void NetworkSettingswlan0::wlan0_wireless_disable() { wirelessbuttonwlan0->setEnabled(false); } class wlan1_settings: public GroupSetting { public: wlan1_settings(): GroupSetting() { HostComboBoxSetting *HOSTESSIDwlan1 = new HostComboBoxSetting("HOSTESSIDwlan1"); HOSTESSIDwlan1->setLabel(QObject::tr("ESSID")); HOSTESSIDwlan1->addSelection("MythVantage"); HOSTESSIDwlan1->addSelection("home_lan"); HOSTESSIDwlan1->addSelection("type_it_here"); HOSTESSIDwlan1->setHelpText(QObject::tr("ESSID")); addChild(HOSTESSIDwlan1); HostComboBoxSetting *HostUseEncryptionwlan1 = new HostComboBoxSetting("HostUseEncryptionwlan1"); HostUseEncryptionwlan1->setLabel(QObject::tr("Encryption")); HostUseEncryptionwlan1->setHelpText(QObject::tr("WPA, WEP, none")); HostUseEncryptionwlan1->addSelection("none"); HostUseEncryptionwlan1->addSelection("WPA"); HostUseEncryptionwlan1->addSelection("WEP"); // Setting* HostUseEncryption = HostUseEncryptionwlan1; // addChild(HostUseEncryption); // setTrigger(HostUseEncryption); HostTextEditSetting *Hostkeywlan1 = new HostTextEditSetting("Hostkeywlan1"); Hostkeywlan1->setLabel(QObject::tr("Encryption Key")); Hostkeywlan1->setHelpText(QObject::tr("Key to use for encryption")); addChild(Hostkeywlan1); }; }; NetworkSettingswlan1::NetworkSettingswlan1() { setLabel(QObject::tr("Network Settings")); HostIPwlan1 = new HostTextEditSetting("HostIPwlan1"); HostIPwlan1->setLabel(QObject::tr("IP Address")); HostIPwlan1->setValue("192.168.1.12"); HostIPwlan1->setHelpText(QObject::tr("IP address of the new installation")); HostNETMASKwlan1 = new HostComboBoxSetting("HostNETMASKwlan1"); HostNETMASKwlan1->setLabel(QObject::tr("Netmask")); HostNETMASKwlan1->addSelection("/0 0.0.0.0"); HostNETMASKwlan1->addSelection("/1 128.0.0.0"); HostNETMASKwlan1->addSelection("/2 192.0.0.0"); HostNETMASKwlan1->addSelection("/3 224.0.0.0"); HostNETMASKwlan1->addSelection("/4 240.0.0.0"); HostNETMASKwlan1->addSelection("/5 248.0.0.0"); HostNETMASKwlan1->addSelection("/6 252.0.0.0"); HostNETMASKwlan1->addSelection("/7 254.0.0.0"); HostNETMASKwlan1->addSelection("/8 255.0.0.0"); HostNETMASKwlan1->addSelection("/9 255.128.0.0"); HostNETMASKwlan1->addSelection("/10 255.192.0.0 "); HostNETMASKwlan1->addSelection("/11 255.224.0.0"); HostNETMASKwlan1->addSelection("/12 255.240.0.0"); HostNETMASKwlan1->addSelection("/13 255.248.0.0"); HostNETMASKwlan1->addSelection("/14 255.252.0.0"); HostNETMASKwlan1->addSelection("/15 255.254.0.0"); HostNETMASKwlan1->addSelection("/16 255.255.0.0"); HostNETMASKwlan1->addSelection("/17 255.255.128.0"); HostNETMASKwlan1->addSelection("/18 255.255.192.0"); HostNETMASKwlan1->addSelection("/19 255.255.224.0"); HostNETMASKwlan1->addSelection("/20 255.255.240.0"); HostNETMASKwlan1->addSelection("/21 255.255.248.0"); HostNETMASKwlan1->addSelection("/22 255.255.252.0"); HostNETMASKwlan1->addSelection("/23 255.255.254.0"); HostNETMASKwlan1->addSelection("/24 255.255.255.0"); HostNETMASKwlan1->addSelection("/25 255.255.255.128"); HostNETMASKwlan1->addSelection("/26 255.255.255.192"); HostNETMASKwlan1->addSelection("/27 255.255.255.224"); HostNETMASKwlan1->addSelection("/28 255.255.255.240"); HostNETMASKwlan1->addSelection("/29 255.255.255.248"); HostNETMASKwlan1->addSelection("/30 255.255.255.252"); HostNETMASKwlan1->addSelection("/31 255.255.255.254"); HostNETMASKwlan1->addSelection("/32 255.255.255.255"); HostNETMASKwlan1->setHelpText(QObject::tr("Netmask")); HostNETMASKwlan1->setValue(24); HostGWwlan1 = new HostTextEditSetting("HostGWwlan1"); HostGWwlan1->setLabel(QObject::tr("Gateway")); HostGWwlan1->setValue("192.168.1.1"); HostGWwlan1->setHelpText(QObject::tr("This is the default route")); HostDNSwlan1 = new HostTextEditSetting("HostDNSwlan1"); HostDNSwlan1->setLabel(QObject::tr("Name server")); HostDNSwlan1->setValue("192.168.1.1"); HostDNSwlan1->setHelpText(QObject::tr("Name server")); HostActiveonbootwlan1 = new HostCheckBoxSetting("HostActiveonbootwlan1"); HostActiveonbootwlan1->setLabel(QObject::tr("Active")); HostActiveonbootwlan1->setValue(false); HostActiveonbootwlan1->setHelpText(QObject::tr("Network is started on boot")); HostUseDHCPwlan1 = new HostCheckBoxSetting("HostUseDHCPwlan1"); HostUseDHCPwlan1 ->setLabel(QObject::tr("Static ip address")); HostUseDHCPwlan1 ->setValue(false); HostUseDHCPwlan1 ->setHelpText(QObject::tr("Enable to use a static ip address, otherwise dhcp will be used.")); wirelessbuttonwlan1 = new ButtonStandardSetting("Wireless Settings"); connect(wirelessbuttonwlan1, SIGNAL(pressed()), this, SLOT(wlan1_wireless_settings())); HostDefaultwlan1 = new HostCheckBoxSetting("HostDefaultwlan1"); HostDefaultwlan1->setLabel(QObject::tr("Default")); HostDefaultwlan1->setValue(false); HostDefaultwlan1->setHelpText(QObject::tr("Will be used as the primary interface")); connect(HostDefaultwlan1, SIGNAL(valueChanged(bool)), this, SLOT(wlan1_disable_others())); // ConfigurationGroup* settings1 = new GridConfigurationGroup(3,false, false, false, false); addChild(HostActiveonbootwlan1); addChild(HostDefaultwlan1); addChild(wirelessbuttonwlan1); // addChild(settings1); // Setting* dhcpEnabled = HostUseDHCPwlan1; addChild(HostDefaultwlan1); // setTrigger(dhcpEnabled); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false,false,false); HostDefaultwlan1->addTargetedChild("1", HostIPwlan1); HostDefaultwlan1->addTargetedChild("1", HostNETMASKwlan1); HostDefaultwlan1->addTargetedChild("1", HostGWwlan1); HostDefaultwlan1->addTargetedChild("1", HostDNSwlan1); // addTarget("0", new VerticalConfigurationGroup(true)); // addTarget("1", settings); }; wlan1options::wlan1options() { // VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false); GroupSetting* rec = new GroupSetting; rec->setLabel(QObject::tr("Wireless Configuration for wlan1")); //rec->setUseLabel(true); rec->addChild(new wlan1_settings); addChild(rec); } void NetworkSettingswlan1::wlan1_disable_others() { QString my_current_value; my_current_value = HostDefaultwlan1->getValue(); if ( my_current_value == "1" ) { hostparm.ThisHostDefaultInterface="wlan1"; emit wlan1_is_default(); } } void NetworkSettingswlan1::wlan1_disabled() { HostDefaultwlan1->setValue(0); } void NetworkSettingswlan1::wlan1_wireless_disable() { wirelessbuttonwlan1->setEnabled(false); } void NetworkSettingswlan1::wlan1_wireless_settings(void) { wlan1options wlan1screen; // wlan1screen.exec(); } //--- class ath0_settings: public GroupSetting { public: ath0_settings(): GroupSetting() { HostComboBoxSetting *HOSTESSIDath0 = new HostComboBoxSetting("HOSTESSIDath0",true); HOSTESSIDath0->setLabel(QObject::tr("ESSID")); HOSTESSIDath0->addSelection("MythVantage"); HOSTESSIDath0->addSelection("home_lan"); HOSTESSIDath0->addSelection("type_it_here"); HOSTESSIDath0->setHelpText(QObject::tr("ESSID")); addChild(HOSTESSIDath0); HostComboBoxSetting *HostUseEncryptionath0 = new HostComboBoxSetting("HostUseEncryptionath0"); HostUseEncryptionath0->setLabel(QObject::tr("Encryption")); HostUseEncryptionath0->setHelpText(QObject::tr("WPA, WEP, none")); HostUseEncryptionath0->addSelection("none"); HostUseEncryptionath0->addSelection("WPA"); HostUseEncryptionath0->addSelection("WEP"); // Setting* HostUseEncryption = HostUseEncryptionath0; // addChild(HostUseEncryption); // setTrigger(HostUseEncryption); HostTextEditSetting *Hostkeyath0 = new HostTextEditSetting("Hostkeyath0"); Hostkeyath0->setLabel(QObject::tr("Encryption Key")); Hostkeyath0->setHelpText(QObject::tr("Key to use for encryption")); addChild(Hostkeyath0); }; }; NetworkSettingsath0::NetworkSettingsath0() { setLabel(QObject::tr("Network Settings")); HostTextEditSetting *HostIPath0 = new HostTextEditSetting("HostIPath0"); HostIPath0->setLabel(QObject::tr("IP Address")); HostIPath0->setValue("192.168.1.12"); HostIPath0->setHelpText(QObject::tr("IP address of the new installation")); HostComboBoxSetting *HostNETMASKath0 = new HostComboBoxSetting("HostNETMASKath0"); HostNETMASKath0->setLabel(QObject::tr("Netmask")); HostNETMASKath0->addSelection("/0 0.0.0.0"); HostNETMASKath0->addSelection("/1 128.0.0.0"); HostNETMASKath0->addSelection("/2 192.0.0.0"); HostNETMASKath0->addSelection("/3 224.0.0.0"); HostNETMASKath0->addSelection("/4 240.0.0.0"); HostNETMASKath0->addSelection("/5 248.0.0.0"); HostNETMASKath0->addSelection("/6 252.0.0.0"); HostNETMASKath0->addSelection("/7 254.0.0.0"); HostNETMASKath0->addSelection("/8 255.0.0.0"); HostNETMASKath0->addSelection("/9 255.128.0.0"); HostNETMASKath0->addSelection("/10 255.192.0.0 "); HostNETMASKath0->addSelection("/11 255.224.0.0"); HostNETMASKath0->addSelection("/12 255.240.0.0"); HostNETMASKath0->addSelection("/13 255.248.0.0"); HostNETMASKath0->addSelection("/14 255.252.0.0"); HostNETMASKath0->addSelection("/15 255.254.0.0"); HostNETMASKath0->addSelection("/16 255.255.0.0"); HostNETMASKath0->addSelection("/17 255.255.128.0"); HostNETMASKath0->addSelection("/18 255.255.192.0"); HostNETMASKath0->addSelection("/19 255.255.224.0"); HostNETMASKath0->addSelection("/20 255.255.240.0"); HostNETMASKath0->addSelection("/21 255.255.248.0"); HostNETMASKath0->addSelection("/22 255.255.252.0"); HostNETMASKath0->addSelection("/23 255.255.254.0"); HostNETMASKath0->addSelection("/24 255.255.255.0"); HostNETMASKath0->addSelection("/25 255.255.255.128"); HostNETMASKath0->addSelection("/26 255.255.255.192"); HostNETMASKath0->addSelection("/27 255.255.255.224"); HostNETMASKath0->addSelection("/28 255.255.255.240"); HostNETMASKath0->addSelection("/29 255.255.255.248"); HostNETMASKath0->addSelection("/30 255.255.255.252"); HostNETMASKath0->addSelection("/31 255.255.255.254"); HostNETMASKath0->addSelection("/32 255.255.255.255"); HostNETMASKath0->setHelpText(QObject::tr("Netmask")); HostNETMASKath0->setValue(24); HostTextEditSetting *HostGWath0 = new HostTextEditSetting("HostGWath0"); HostGWath0->setLabel(QObject::tr("Gateway")); HostGWath0->setValue("192.168.1.1"); HostGWath0->setHelpText(QObject::tr("This is the default route")); HostTextEditSetting *HostDNSath0 = new HostTextEditSetting("HostDNSath0"); HostDNSath0->setLabel(QObject::tr("Name server")); HostDNSath0->setValue("192.168.1.1"); HostDNSath0->setHelpText(QObject::tr("Name server")); HostCheckBoxSetting *HostActiveonbootath0 = new HostCheckBoxSetting("HostActiveonbootath0"); HostActiveonbootath0->setLabel(QObject::tr("Active")); HostActiveonbootath0->setValue(false); HostActiveonbootath0->setHelpText(QObject::tr("Network is started on boot")); HostDefaultath0 = new HostCheckBoxSetting("HostDefaultath0"); HostDefaultath0->setLabel(QObject::tr("Default")); HostDefaultath0->setValue(false); HostDefaultath0->setHelpText(QObject::tr("Will be used as the primary interface")); connect(HostDefaultath0, SIGNAL(valueChanged(bool)), this, SLOT(ath0_disable_others())); HostCheckBoxSetting *HostUseDHCPath0 = new HostCheckBoxSetting("HostUseDHCPath0"); HostUseDHCPath0 ->setLabel(QObject::tr("Static ip address")); HostUseDHCPath0 ->setValue(false); HostUseDHCPath0 ->setHelpText(QObject::tr("Enable to use a static ip address, otherwise dhcp will be used.")); wirelessbuttonath0 = new ButtonStandardSetting("Wireless Settings"); connect(wirelessbuttonath0, SIGNAL(pressed()), this, SLOT(ath0_wireless_settings())); // ConfigurationGroup* settings1 = new GridConfigurationGroup(3,false, false, false,false); addChild(HostActiveonbootath0); addChild(HostDefaultath0); addChild(wirelessbuttonath0); // addChild(settings1); // Setting* dhcpEnabled = HostUseDHCPath0; addChild(HostUseDHCPath0); // setTrigger(dhcpEnabled); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false,false,false); HostUseDHCPath0->addTargetedChild("1", HostIPath0); HostUseDHCPath0->addTargetedChild("1", HostNETMASKath0); HostUseDHCPath0->addTargetedChild("1", HostGWath0); HostUseDHCPath0->addTargetedChild("1", HostDNSath0); // addTarget("0", new VerticalConfigurationGroup(false,false,false,false)); // addTarget("1", settings); }; ath0options::ath0options() { // VerticalConfigurationGroup* rec = new VerticalConfigurationGroup(false); GroupSetting* rec = new GroupSetting; rec->setLabel(QObject::tr("Wireless Configuration for ath0")); //rec->setUseLabel(true); rec->addChild(new ath0_settings); addChild(rec); } void NetworkSettingsath0::ath0_disable_others() { QString my_current_value; my_current_value = HostDefaultath0->getValue(); if ( my_current_value == "1" ) { hostparm.ThisHostDefaultInterface="ath0"; emit ath0_is_default(); } } void NetworkSettingsath0::ath0_disabled() { HostDefaultath0->setValue(0); } void NetworkSettingsath0::ath0_wireless_settings(void) { ath0options ath0screen; // ath0screen.exec(); } void NetworkSettingsath0::ath0_wireless_disable() { wirelessbuttonath0->setEnabled(false); } //-- class NetworkSettingsFrame: public GroupSetting { public: NetworkSettingsFrame(): GroupSetting() { setLabel(QObject::tr("Network Settings")); // Setting* netdevice = HostNetDevice(); HostComboBoxSetting* netdevice = HostNetDevice(); addChild(netdevice); // setTrigger(netdevice); NetworkSettingswlan0 *Nwlan0 = new NetworkSettingswlan0 ; NetworkSettingswlan1 *Nwlan1 = new NetworkSettingswlan1 ; NetworkSettingseth0 *Neth0 = new NetworkSettingseth0 ; NetworkSettingseth1 *Neth1 = new NetworkSettingseth1 ; NetworkSettingsath0 *Nath0 = new NetworkSettingsath0 ; QString found_wireless=findnet_wireless(); if ( not found_wireless.contains("eth0")) { Neth0->eth0_wireless_disable(); hostparm.ThisHOST_iswirelesseth0="0"; } else { hostparm.ThisHOST_iswirelesseth0="1"; } if ( not found_wireless.contains("eth1")) { Neth1->eth1_wireless_disable(); hostparm.ThisHOST_iswirelesseth1="0"; } else { hostparm.ThisHOST_iswirelesseth1="1"; } if ( not found_wireless.contains("wlan0")) { Nwlan0->wlan0_wireless_disable(); hostparm.ThisHOST_iswirelesswlan0="0"; } else { hostparm.ThisHOST_iswirelesswlan0="1"; } if ( not found_wireless.contains("wlan1")) { Nwlan1->wlan1_wireless_disable(); hostparm.ThisHOST_iswirelesswlan1="0"; } else { hostparm.ThisHOST_iswirelesswlan0="1"; } if ( not found_wireless.contains("ath0")) { Nath0->ath0_wireless_disable(); hostparm.ThisHOST_iswirelessath0="0"; } else { hostparm.ThisHOST_iswirelessath0="1"; } connect(Nwlan1, SIGNAL(wlan1_is_default(void)), Nwlan0, SLOT(wlan0_disabled())); connect(Nwlan1, SIGNAL(wlan1_is_default(void)), Neth0, SLOT(eth0_disabled())); connect(Nwlan1, SIGNAL(wlan1_is_default(void)), Neth1, SLOT(eth1_disabled())); connect(Nwlan1, SIGNAL(wlan1_is_default(void)), Nath0, SLOT(ath0_disabled())); connect(Nwlan0, SIGNAL(wlan0_is_default(void)), Nwlan1, SLOT(wlan1_disabled())); connect(Nwlan0, SIGNAL(wlan0_is_default(void)), Neth0, SLOT(eth0_disabled())); connect(Nwlan0, SIGNAL(wlan0_is_default(void)), Neth1, SLOT(eth1_disabled())); connect(Nwlan0, SIGNAL(wlan0_is_default(void)), Nath0, SLOT(ath0_disabled())); connect(Neth1, SIGNAL(eth1_is_default(void)), Nwlan1, SLOT(wlan1_disabled())); connect(Neth1, SIGNAL(eth1_is_default(void)), Nwlan0, SLOT(wlan0_disabled())); connect(Neth1, SIGNAL(eth1_is_default(void)), Neth0, SLOT(eth0_disabled())); connect(Neth1, SIGNAL(eth1_is_default(void)), Nath0, SLOT(ath0_disabled())); connect(Neth0, SIGNAL(eth0_is_default(void)), Nwlan0, SLOT(wlan0_disabled())); connect(Neth0, SIGNAL(eth0_is_default(void)), Nwlan1, SLOT(wlan1_disabled())); connect(Neth0, SIGNAL(eth0_is_default(void)), Neth1, SLOT(eth1_disabled())); connect(Neth0, SIGNAL(eth0_is_default(void)), Nath0, SLOT(ath0_disabled())); connect(Nath0, SIGNAL(ath0_is_default(void)), Nwlan0, SLOT(wlan0_disabled())); connect(Nath0, SIGNAL(ath0_is_default(void)), Nwlan1, SLOT(wlan1_disabled())); connect(Nath0, SIGNAL(ath0_is_default(void)), Neth1, SLOT(eth1_disabled())); connect(Nath0, SIGNAL(ath0_is_default(void)), Neth0, SLOT(eth0_disabled())); HostTextEditSetting *HostMTUeth0 = new HostTextEditSetting("HostMTUeth0"); HostMTUeth0->setLabel(QObject::tr("MTU")); HostMTUeth0->setValue(""); HostMTUeth0->setHelpText(QObject::tr("Leave this blank for default values. Changing this setting can have adverse affects, use with caution. Not all values will be supported by the device.")); // ConfigurationGroup* settingseth0 = new GridConfigurationGroup(1,false, false, false, false); addChild(Neth0); addChild(HostMTUeth0); HostTextEditSetting *HostMTUeth1 = new HostTextEditSetting("HostMTUeth1"); HostMTUeth1->setLabel(QObject::tr("MTU")); HostMTUeth1->setValue(""); HostMTUeth1->setHelpText(QObject::tr("Leave this blank for default values. Changing this setting can have adverse affects, use with caution. Not all values will be supported by the device.")); // ConfigurationGroup* settingseth1 = new GridConfigurationGroup(1,false, false, true, true); addChild(Neth1); addChild(HostMTUeth1); HostTextEditSetting *HostMTUwlan0 = new HostTextEditSetting("HostMTUwlan0"); HostMTUwlan0->setLabel(QObject::tr("MTU")); HostMTUwlan0->setValue(""); HostMTUwlan0->setHelpText(QObject::tr("Leave this blank for default values. Changing this setting can have adverse affects, use with caution. Not all values will be supported by the device.")); // ConfigurationGroup* settingswlan0 = new GridConfigurationGroup(1,false, false, false, false); addChild(Nwlan0); addChild(HostMTUwlan0); HostTextEditSetting *HostMTUwlan1 = new HostTextEditSetting("HostMTUwlan1"); HostMTUwlan1->setLabel(QObject::tr("MTU")); HostMTUwlan1->setValue(""); HostMTUwlan1->setHelpText(QObject::tr("Leave this blank for default values. Changing this setting can have adverse affects, use with caution. Not all values will be supported by the device.")); // ConfigurationGroup* settingswlan1 = new GridConfigurationGroup(1,false, false, false, false); addChild(Nwlan1); addChild(HostMTUwlan1); HostTextEditSetting *HostMTUath0 = new HostTextEditSetting("HostMTUath0"); HostMTUath0->setLabel(QObject::tr("MTU")); HostMTUath0->setValue(""); HostMTUath0->setHelpText(QObject::tr("Leave this blank for default values. Changing this setting can have adverse affects, use with caution. Not all values will be supported by the device.")); // ConfigurationGroup* settingsath0 = new GridConfigurationGroup(1,false, false, false, false); addChild(Nath0); addChild(HostMTUath0); /* addTarget("wlan0", settingswlan0); addTarget("wlan1", settingswlan1); addTarget("eth0", settingseth0); addTarget("eth1", settingseth1); addTarget("ath0", settingsath0); */ }; }; NetworkOptionsFrame::NetworkOptionsFrame(): GroupSetting() { setLabel(QObject::tr("Network Settings (2/2)")); HostMyhostname = new HostComboBoxSetting("HostMyhostname",true); HostMyhostname->setLabel(QObject::tr("Hostname")); HostMyhostname->addSelection("Envy"); HostMyhostname->addSelection("Greed"); HostMyhostname->addSelection("Lust"); HostMyhostname->addSelection("Sloth"); HostMyhostname->addSelection("Wrath"); HostMyhostname->addSelection("Gluttony"); HostMyhostname->addSelection("Pride"); HostMyhostname->addSelection("Humility"); HostMyhostname->addSelection("Generosity"); HostMyhostname->addSelection("Love"); HostMyhostname->addSelection("Kindness"); HostMyhostname->addSelection("SelfControl"); HostMyhostname->addSelection("Faith"); HostMyhostname->addSelection("Zeal"); HostMyhostname->addSelection("type_hostname_here"); HostMyhostname->setHelpText(QObject::tr("The hostname must resolve via DNS. If DNS is not available then append .local to the end of the hostname. When using .local, names must not include an additional .")); FetchDhcpHostnameButton = new ButtonStandardSetting("Ask DHCP Server for Hostname"); connect(FetchDhcpHostnameButton, SIGNAL(pressed()), this, SLOT(fetch_hostname())); QString labelstring; labelstring = "Will use " + hostparm.ThisHostDefaultInterface + " to check for hostname."; FetchDhcpHostnameButton->setHelpText(labelstring); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false, false,false,false); addChild(HostMyhostname); addChild(FetchDhcpHostnameButton); // addChild(settings); } QString NetworkOptionsFrame::find_hostname() { QString new_host; QString cmdtxt; new_host="null"; cmdtxt="sudo "; cmdtxt.append(MV_ROOT) ; cmdtxt.append("bin/systemconfig.py -m dhcp_request -d " ); cmdtxt.append(hostparm.ThisHostDefaultInterface); myth_system(cmdtxt); //system(qPrintable(cmdtxt)); QString line; QFile file("/tmp/mvnetwork.dhcpinfo"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if ( line.contains("new_host_name")) { QString s = line.simplified(); s = s.section( "=", 1, 1 ); // s == "surname" new_host = s.simplified(); } } file.close(); } return new_host; } void NetworkOptionsFrame::fetch_hostname() { QString new_host; new_host=find_hostname(); if ( new_host != "null" ) { // networklabel->setValue("Updated the hostname."); // FIXME Need dialog ok box HostMyhostname->addSelection(new_host); HostMyhostname->setValue(new_host); } // else // FIXME Need dialog ok box // networklabel->setValue("DHCP server did not return a hostname."); } /* static HostCheckBoxSetting *HostAutodown() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostAutodown"); gc->setLabel(QObject::tr("Turn off machine at a specified time")); gc->setValue(false); gc->setHelpText(QObject::tr("Will turn off this system.")); return gc; }; */ //static HostSpinBox *HostWakeupTime() //{ // HostSpinBox *gc = new HostSpinBox("HostWakeupTime", -1, 23, 1, true); // gc->setLabel(QObject::tr("Power on time")); // gc->setValue(6); // gc->setHelpText(QObject::tr("Select the hour to auto poweron this system. Use -1 to disable" )); // return gc; //} /* static HostSpinBox *HostShutdownTime() { HostSpinBox *gc = new HostSpinBox("HostShutdownTime", -1, 23, 1, true); gc->setLabel(QObject::tr("Auto Shutdown time")); gc->setValue(2); gc->setHelpText(QObject::tr("Select the hour to poweroff this syste. Times are in 24hour format. Use -1 to disable" )); return gc; } static HostSpinBoxSetting *HostShutdownTime2() { HostSpinBoxSetting *gc = new HostSpinBoxSetting("HostShutdownTime2", -1, 23, 1, true); gc->setLabel(QObject::tr("2nd auto Shutdown time")); gc->setValue(2); gc->setHelpText(QObject::tr("Select the hour to poweroff this syste. Times are in 24hour format. Use -1 to disable" )); return gc; } */ //static HostCheckBoxSetting *HostUseWOL() //{ // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseWOL"); // gc->setLabel(QObject::tr("Use Wake on Lan to turn on system")); // gc->setValue(true); // gc->setHelpText(QObject::tr("Unless you know what your doing leave it checked")); // return gc; //}; //static HostCheckBoxSetting *HostUseNVRAM() //{ // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseNVRAM"); // gc->setLabel(QObject::tr("Use nvram to turn on system")); // gc->setValue(true); // gc->setHelpText(QObject::tr("Leaved checked unless nvram causes problems.")); // return gc; //}; static HostCheckBoxSetting *HostUseXLargeMouse() { HostCheckBoxSetting *gc = new HostCheckBoxSetting("HostUseXLargeMouse"); gc->setLabel(QObject::tr("Large Mouse Pointer")); gc->setValue(true); gc->setHelpText(QObject::tr("Use an extra large mouse pointer. This takes effect the next time the frontend is started.")); return gc; }; /* class WakeSettings: public GroupSetting { public: WakeSettings(): GroupSetting(true) { setLabel(QObject::tr("Shutdown Settings")); Setting* Autodown = HostAutodown(); addChild(Autodown); setTrigger(Autodown); ConfigurationGroup* settings = new VerticalConfigurationGroup(false); settings->addChild(HostShutdownTime()); settings->addChild(HostShutdownTime2()); // settings->addChild(HostWakeupTime()); // settings->addChild(HostUseNVRAM()); // settings->addChild(HostUseWOL()); addTarget("0", new VerticalConfigurationGroup(true)); addTarget("1", settings); }; }; */ class Frontend_settings_group: public GroupSetting { public: Frontend_settings_group(): GroupSetting() { HostCheckBoxSetting* fe = HostRunFrontend(); addChild(fe); // ConfigurationGroup* setting1 = new GridConfigurationGroup(2,false); fe->addTargetedChild("1", HostUseXLargeMouse()); fe->addTargetedChild("1", HostUsemythfrontend()); // setting1->addChild(HostXres()); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false); // settings->addChild(setting1); // settings->addChild(new HostRemoteType); // addTarget("0", new VerticalConfigurationGroup(false)); // addTarget("1", settings); }; }; SystemtypeGroup::SystemtypeGroup() { setLabel(QObject::tr("System Type")); HostSystemType = new HostComboBoxSetting("HostSystemType"); HostSystemType->setLabel(QObject::tr("System Type")); HostSystemType->addSelection("Master_backend"); HostSystemType->addSelection("Frontend_only"); // HostSystemType->addSelection("Standalone"); HostSystemType->addSelection("Slave_backend"); if ( ((gCoreContext->GetSetting("HostaccesshostypeSystemtype")) == "0" ) ) HostSystemType->setEnabled(false); addChild(HostSystemType); // ConfigurationGroup* fe1 = new GridConfigurationGroup(2,false,false,true,true); HostSystemType->addTargetedChild("Master_backend", HostUseXLargeMouse()); HostSystemType->addTargetedChild("Master_backend", HostUsemythfrontend()); // ConfigurationGroup* standalone = new VerticalConfigurationGroup(false,false,true,true); // standalone->addChild(HostXres()); //FIXME // standalone->addChild(new HostRemoteType); // ConfigurationGroup* frontend = new VerticalConfigurationGroup(false,false,true,true); HostSystemType->addTargetedChild("Frontend_only", HostMysqlserverip_listbox()); // frontend->addChild(HostXres()); //FIXME // frontend->addChild(new HostRemoteType); HostSystemType->addTargetedChild("Frontend_only", HostUseXLargeMouse()); HostSystemType->addTargetedChild("Frontend_only", HostUsemythfrontend()); // ConfigurationGroup* backend = new VerticalConfigurationGroup(false,false,false,false); HostSystemType->addTargetedChild("Slave_backend", new Frontend_settings_group); // ConfigurationGroup* slave = new VerticalConfigurationGroup(false,false,true,true); HostSystemType->addTargetedChild("Slave_backend", HostMysqlserverip_listbox()); HostSystemType->addTargetedChild("Slave_backend", new Frontend_settings_group); // addTarget("Standalone", standalone); // addTarget("Frontend_only", frontend); // addTarget("Master_backend", backend); // addTarget("Slave_backend", slave); // connect(HostSystemType, SIGNAL(valueChanged(const QString&)), this, // SLOT(SystemtypeHelp())); }; void SystemtypeGroup::SystemtypeHelp(void) { QString msg = (QObject::tr("Type of configuration for this system")); QString selectedhostype; selectedhostype = HostSystemType->getValue(); if ( selectedhostype.isEmpty()) { HostSystemType->setHelpText(msg) ; return; } if (selectedhostype == "Standalone") msg="Complete System, that doesn't allow outside connections."; if (selectedhostype == "Frontend_only") msg="Frontend_only needs a primary system (master backend) already on the network."; if (selectedhostype == "Master_backend") msg="Primary system with tuners, scheduling and database. This allows for remote frontend and slave backends."; if (selectedhostype == "Slave_backend") msg="Secondary system for extra tuners."; HostSystemType->setHelpText(msg) ; } // HostRemoteType::HostRemoteType(): // HostImageSelect("HostRemoteType") { // setLabel(QObject::tr("Remote")); // QString dirtxt; // dirtxt=MV_ROOT; // dirtxt.append("templates/remotes"); // QDir remotes(dirtxt); // remotes.setFilter(QDir::Dirs); // remotes.setSorting(QDir::Name | QDir::IgnoreCase); // QFileInfoList fil = remotes.entryInfoList(QDir::Dirs); // for( QFileInfoList::iterator it = fil.begin(); // it != fil.end(); // ++it ) // { // QFileInfo &remote = *it; // if (remote.fileName() == "." || remote.fileName() == ".." ) // continue; // // QString name = remote.fileName(); // QString defaultpreview = remotes.absolutePath(); // defaultpreview += "/"; // defaultpreview += name; // defaultpreview += "/preview.jpg"; // QFileInfo preview(defaultpreview); // if (!preview.exists()) // { // LOG(VB_GENERAL, LOG_ERR, QString("Theme %1 missing preview image.").arg(remote.fileName())); // } // else // { // QImage* previewImage = new QImage(preview.absoluteFilePath()); // if (previewImage->width() == 0 || previewImage->height() == 0) // LOG(VB_GENERAL, LOG_ERR, QString("Problem reading remote preview %1").arg(preview.filePath())); // // //Add the remote // addImageSelection(name, previewImage, remote.fileName()); // LOG(VB_GENERAL, LOG_DEBUG, QString("Adding remote %1.").arg(name)); // } // } // // } class AdvancedSettings: public GroupSetting { public: AdvancedSettings(): GroupSetting() { setLabel(QObject::tr("Advanced Settings (1/2)")); // Setting* Autodown = HostAutodown(); // setTrigger(Autodown); hostparm.ThisSystemType = gCoreContext->GetSetting("HostSystemType"); // ConfigurationGroup *checkbox = new GridConfigurationGroup(2,false); // addChild(HostServiceMythWEB()); // checkbox->addChild(HostServiceNFS()); // addChild(Hostbootsplash()); //addChild(HostncidClient()); // ConfigurationGroup* settings = new VerticalConfigurationGroup(false); // if ( hostparm.ThisSystemType == "Standalone" ) // { // smb_busy_box(); // settings->addChild(new NCIDsettings); // settings->addChild(new SAMBAsettings); // checkbox->addChild(HostServiceRRD() ); // settings->addChild(checkbox) ; // } if ( hostparm.ThisSystemType == "Master_backend" ) { // smb_busy_box(); // checkbox->addChild(GlobalPKG_MIRROR()); //settings->addChild(new NCIDsettings); // settings->addChild(new SAMBAsettings); // checkbox->addChild(HostServiceRRD() ); addChild(HostServiceMythWEB()); addChild(Hostbootsplash()); // addChild(checkbox) ; } else if ( hostparm.ThisSystemType == "Frontend_only" ) { addChild(Hostbootsplash()); //settings->addChild(HostncidClient()); // settings->addChild(HostServiceRRD() ); } else if ( hostparm.ThisSystemType == "Slave_backend" ) { addChild(Hostbootsplash()); //settings->addChild(HostncidClient()); // settings->addChild(HostServiceRRD() ); // if ( (gCoreContext->GetSetting("GlobalPKG_MIRROR")) == "1") // settings->addChild(HostPKG_MIRROR()); }; //addTarget("", settings); }; }; class AdvancedSettings_2: public GroupSetting { public: AdvancedSettings_2(): GroupSetting() { setLabel(QObject::tr("Advanced Settings (2/2)")); // Setting* Autodown = HostAutodown(); // setTrigger(Autodown); hostparm.ThisSystemType = gCoreContext->GetSetting("HostSystemType"); /* ConfigurationGroup *checkbox = new GridConfigurationGroup(2,false); checkbox->addChild(HostServiceMythWEB()); checkbox->addChild(HostServiceNFS()); checkbox->addChild(Hostbootsplash()); checkbox->addChild(HostncidClient());*/ // ConfigurationGroup* settings = new VerticalConfigurationGroup(false); if ( hostparm.ThisSystemType == "Standalone" ) { addChild(HostRunDHCP()); addChild(HostBEWait()); //settings->addChild(new Evroutersettings); } else if (hostparm.ThisSystemType == "Master_backend" ) { addChild(new Backupsettings); addChild(HostRunDHCP()); addChild(HostBEWait()); //settings->addChild(new Evroutersettings); } else if (hostparm.ThisSystemType == "Frontend_only" ) { //settings->addChild(new Evroutersettings); addChild(HostBEWait()); } else if (hostparm.ThisSystemType == "Slave_backend" ) { //settings->addChild(new Evroutersettings); addChild(HostBEWait()); }; //addTarget("", settings); }; }; /*_______________________________Sound settings ____________________*/ SoundSettings::SoundSettings(): GroupSetting() { setLabel(QObject::tr("Audio Settings")); // HostAudiotype = new HostComboBoxSetting("HostAudiotype",false); // HostAudiotype->setLabel(QObject::tr("Sound Card Driver")); // HostAudiotype->addSelection("OSS"); // HostAudiotype->addSelection("ALSA"); // HostAudiotype->setHelpText(QObject::tr("Select the sound driver, ALSA or OSS." ) ); // addChild(HostAudiotype); // setTrigger(HostAudiotype); // HorizontalConfigurationGroup *lp = new HorizontalConfigurationGroup(false, false, true, true); // HorizontalConfigurationGroup *lpalsa = new HorizontalConfigurationGroup(false, false, true, true); // TransButtonSetting *LoadOSSbutton = new TransButtonSetting(); // LoadOSSbutton->setLabel(tr("Load OSS Driver")); ButtonStandardSetting *LoadALSAbutton = new ButtonStandardSetting("Load ALSA Driver"); // LoadALSAbutton->setLabel(tr("Load ALSA Driver")); // ButtonStandardSetting *TestAudiobutton = new TransButtonSetting(); // TestAudiobutton->setLabel(tr("Test Device")); // TestAudiobutton->setHelpText(QObject::tr("Play a sound using the selected default device.")); // addChild(TestAudiobutton); // lp->addChild(LoadOSSbutton); ButtonStandardSetting *TestALSAAudiobutton = new ButtonStandardSetting(tr("Test Device")); // TestALSAAudiobutton->setLabel(tr("Test Device")); TestALSAAudiobutton->setHelpText(QObject::tr("Play a sound using the selected default device.")); addChild(TestALSAAudiobutton); addChild(LoadALSAbutton); // TransLabelSetting *osslabel = new TransLabelSetting(); // osslabel->setValue("OSS- Open Sound System\nhttp://opensound.com\n\nTo configure sound for MythTV go to:\nService Menu --> MythTV Settings --> Setup --> Audio\n"); // TransLabelSetting *AlsaLabel = new TransLabelSetting(); // AlsaLabel->setValue("ALSA - Advanced Linux Sound Architecture\nhttp://alsa-project.org\n\nTo configure sound for MythTV go to:\nService Menu --> MythTV Settings --> Setup --> Audio\n"); /* // OSS GROUP SoundOSSsettings *OSS = new SoundOSSsettings ; ConfigurationGroup* osssettings = new VerticalConfigurationGroup(false); osssettings->addChild(osslabel); osssettings->addChild(OSS); osssettings->addChild(lp); connect(this, SIGNAL(oss_sig()), OSS, SLOT(soundossgathersettings())); connect(TestAudiobutton, SIGNAL(pressed()), this, SLOT(soundossgathersettings_1())); connect(LoadOSSbutton, SIGNAL(pressed()), OSS, SLOT(loadossdriver())); */ // ALSA GROUP SoundALSAsettings *ALSA = new SoundALSAsettings ; // ConfigurationGroup* alsasettings = new VerticalConfigurationGroup(false); // addChild(AlsaLabel); addChild(ALSA); // alsasettings->addChild(lpalsa); connect(this, SIGNAL(alsa_sig()), ALSA, SLOT(soundalsagathersettings())); connect(TestALSAAudiobutton, SIGNAL(pressed()), this, SLOT(soundalsagathersettings_1())); connect(LoadALSAbutton, SIGNAL(pressed()), ALSA, SLOT(loadalsadriver())); // addTarget("ALSA", alsasettings); // addTarget("OSS", osssettings); }; /* SoundOSSsettings::SoundOSSsettings(): GroupSetting() { SetVertical(true); HostSoundOssAll = new HostComboBoxSetting("HostSoundOssAll"); HostSoundOssAll->setLabel(QObject::tr("Default Device")); HostSoundOssAll->setHelpText(QObject::tr("Select the default audio output device for the system.")); fillossselection(); int findossall=HostSoundOssAll->findSelection(hostparm.OLDHostSoundOSSAll ); HostSoundOssAll->setValue(findossall); addTarget("All", HostSoundOssAll); }; */ SoundALSAsettings::SoundALSAsettings(): GroupSetting() { // SetVertical(true); HostSoundALSAAll = new HostComboBoxSetting("HostSoundALSAAll"); HostSoundALSAAll->setLabel(QObject::tr("Default Device")); HostSoundALSAAll->setHelpText(QObject::tr("Select the default audio output device for the system. Chrome, aplay and other programs that use the default system device for audio will use this device. Mplayer will be set to use this device.")); fillALSAselection(); // int findalsaall=HostSoundALSAAll->findSelection(hostparm.OLDHostSoundALSAAll ); // HostSoundALSAAll->setValue(findalsaall); addChild( HostSoundALSAAll); }; /* void SoundOSSsettings::loadossdriver() { // Add info popup right here QString cmdtxt; cmdtxt="sudo "; cmdtxt.append(MV_ROOT) ; cmdtxt.append("bin/soundconfig.sh -t LOAD -i OSS &"); int sysRet = system(qPrintable(cmdtxt)); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running soundconfig.sh"); int return_code = 0; QString msgtext = "Loading OSS driver" ; MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack, "ossbusy"); int progressbar=1; MythProgressDialog *popupProgress = NULL; popupProgress = new MythProgressDialog(msgtext, 50); if (popupProgress) { popupProgress->setProgress(progressbar); } if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } while ( return_code == 0 ) { progressbar++; popupProgress->setProgress(progressbar); if (progressbar > 50 ) progressbar = 10; return_code = myth_system("ps -ef|grep soundconfig.sh|grep -v grep > /dev/null"); qApp->processEvents (); usleep(900); } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } if (popupProgress) { popupProgress->Close(); popupProgress->deleteLater(); } fillossselection(); } void SoundALSAsettings::loadalsadriver() { QString cmdtxt; cmdtxt="sudo "; cmdtxt.append(MV_ROOT) ; cmdtxt.append("bin/soundconfig.sh -t LOAD -i ALSA &"); int sysRet = system(qPrintable(cmdtxt)); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running soundconfig.sh"); int return_code = 0; QString msgtext = "Loading ALSA driver" ; MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy"); if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } int progressbar=1; MythProgressDialog *popupProgress = NULL; popupProgress = new MythProgressDialog(msgtext, 50); if (popupProgress) { popupProgress->setProgress(progressbar); } while ( return_code == 0 ) { progressbar++; popupProgress->setProgress(progressbar); if (progressbar > 50 ) progressbar = 10; return_code = myth_system("ps -ef|grep soundconfig.sh|grep -v grep > /dev/null"); qApp->processEvents (); usleep(900); } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } if (popupProgress) { popupProgress->Close(); popupProgress->deleteLater(); } fillALSAselection(); } void SoundOSSsettings::fillossselection() { myth_system("ossinfo -v1 -a |grep device > /tmp/ossdevices"); QString currentitem; QString currentfile = "/tmp/ossdevices"; QString line; QString legacy_device; QString simpleitem; QString currentitemtext; QRegExp sep( "\t" ); QFile file(currentfile); QString ossfound="false"; HostSoundOssAll->clearSelections(); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if (line.contains("device index") ) { legacy_device = t.readLine(); legacy_device= legacy_device.section( "/",2,2); currentitemtext=line.section( "/" , 0 ,0 ); simpleitem = currentitemtext.simplified(); simpleitem = simpleitem.remove ( "(" ); simpleitem = simpleitem.remove ( ")" ); simpleitem.append(" ("); simpleitem.append(legacy_device); simpleitem.append(")"); HostSoundOssAll->addSelection(simpleitem); ossfound="true"; } } if (ossfound=="false") { simpleitem="No devices found, try loading the OSS driver"; HostSoundOssAll->addSelection(simpleitem); } } return ; }; */ void SoundALSAsettings::fillALSAselection() { HostSoundALSAAll-> clearSelections(); myth_system("aplay -l > /tmp/alsadevices 2>&1"); QString currentfile = "/tmp/alsadevices"; QString line; QString hwdevice; QString alsadescription; QString alsadescription2; QString temphwdevice; QString simpleitem; QFile file(currentfile); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if (line.contains("no soundcards found...")) { simpleitem="No devices found, try loading the ALSA driver"; HostSoundALSAAll->addSelection(simpleitem); break; } if (line.startsWith("card") ) { //card 0: I82801DBICH4:q [Intel 82801DB-ICH4], device 0: Intel ICH [Intel 82801DB-ICH4] alsadescription=line.section( ", " , 0 ,0 ); alsadescription=alsadescription.section(": ",1,1); alsadescription=alsadescription.section(" ",0,0); alsadescription2=line.section( ", " , 1 ,1 ); //alsadescription2=alsadescription.section(":",0,0); hwdevice=line.section( ":" , 0 ,0 ); hwdevice=hwdevice.section( " " , -1,-1 ); //grabbing 2nd half of device temphwdevice=line.section(",",1,1); temphwdevice=temphwdevice.section(":",0,0); temphwdevice=temphwdevice.section(" ",-1,-1 ); hwdevice.append(","); hwdevice.append(temphwdevice); simpleitem=alsadescription + " " + alsadescription2 + "(plughw:" + alsadescription + "," + temphwdevice + ")"; HostSoundALSAAll->addSelection(simpleitem); } } } myth_system("aplay -L > /tmp/alsapcm"); currentfile = "/tmp/alsapcm"; QFile file1(currentfile); if ( file1.open(QIODevice::ReadOnly | QIODevice::Text) ) { QTextStream t( &file1 ); // use a text stream while ( !t.atEnd() ) { line = t.readLine(); if (line.startsWith("iec958:") ) { alsadescription=line; simpleitem=alsadescription + "(plug:iec958)"; HostSoundALSAAll->addSelection(simpleitem); break; } } } return ; } /* void SoundSettings::soundossgathersettings_1 (void) { hostparm.ThisHostAudiotype = HostAudiotype->getValue(); // emit the signal to call soundossgathersetting. emit oss_sig(); }; */ void SoundSettings::soundalsagathersettings_1 (void) { hostparm.ThisHostAudiotype = HostAudiotype->getValue(); // emit the signal to call soundALSAgathersetting. emit alsa_sig(); }; /* void SoundOSSsettings::soundossgathersettings(void) { hostparm.ThisHostSoundOSSAll = HostSoundOssAll->getValue(); QString tempdevice; tempdevice = hostparm.ThisHostSoundOSSAll ; tempdevice = tempdevice.section( "(", 1,1 ); tempdevice = tempdevice.section( ")", 0,0 ); hostparm.ThisHostSoundDevice = "/dev/"; hostparm.ThisHostSoundDevice.append(tempdevice); // Add info popup right here QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/soundconfig.sh -t test -i OSS -d " + hostparm.ThisHostSoundDevice + "&"); int sysRet = system(qPrintable(cmdtxt)); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running soundconfig.sh"); int return_code = 0; QString msgtext = "Playing Test Audio" ; MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy"); int progressbar=1; MythProgressDialog *popupProgress = NULL; popupProgress = new MythProgressDialog(msgtext, 50); if (popupProgress) { popupProgress->setProgress(progressbar); } if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } while ( return_code == 0 ) { progressbar++; popupProgress->setProgress(progressbar); if (progressbar > 50 ) progressbar = 10; return_code = myth_system("ps -ef|grep soundconfig.sh|grep -v grep > /dev/null"); qApp->processEvents (); usleep(900); } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } if (popupProgress) { popupProgress->Close(); popupProgress->deleteLater(); } }; */ void SoundALSAsettings::soundalsagathersettings(void) { hostparm.ThisHostSoundALSAAll = HostSoundALSAAll->getValue(); QString tempdevice; tempdevice = hostparm.ThisHostSoundALSAAll ; tempdevice = tempdevice.section( "(", 1,1 ); tempdevice = tempdevice.section( ")", 0,0 ); hostparm.ThisHostSoundDevice = tempdevice; // Add info popup right here QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/soundconfig.sh -t test -i ALSA -d " + hostparm.ThisHostSoundDevice + "&"); int sysRet = system(qPrintable(cmdtxt)); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running soundconfig.sh"); int return_code = 0; QString msgtext = "Playing Test Audio" ; MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy"); if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } /* int progressbar=1; MythProgressDialog *popupProgress = NULL; popupProgress = new MythProgressDialog(msgtext, 50); if (popupProgress) { popupProgress->setProgress(progressbar); } */ while ( return_code == 0 ) { // progressbar++; // popupProgress->setProgress(progressbar); // if (progressbar > 50 ) // progressbar = 10; return_code = myth_system("ps -ef|grep soundconfig.sh|grep -v grep > /dev/null"); qApp->processEvents (); usleep(900); } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } /* if (popupProgress) { popupProgress->Close(); popupProgress->deleteLater(); } */ }; /* __________________________ END OF CLASSES_________________________*/ void pre_writesettings () { hostparm.ThisSystemType = gCoreContext->GetSetting("HostSystemType"); hostparm.ThisDBhost = gCoreContext->GetSetting("HostMysqlServer"); hostparm.ThisHostName = gCoreContext->GetSetting("HostMyhostname"); if ( hostparm.ThisSystemType == "Standalone" ) { hostparm.ThisDBhost = "localhost" ; hostparm.ThisRunfrontend = "1" ; gCoreContext->SaveSetting("HostRunFrontend", hostparm.ThisRunfrontend ); // disable pkgmirror // hostparm.ThisHostPKG_MIRROR = "0"; // //gCoreContext->SaveSetting("GlobalPKG_MIRROR", hostparm.ThisHostPKG_MIRROR ); // hostparm.ThisHostServiceHobbit = gCoreContext->GetSetting("GlobalServiceHobbitserver"); // if (hostparm.ThisHostServiceHobbit == "" ) // { // hostparm.ThisHostServiceHobbit = "1"; // QString s = "GlobalServiceHobbitserver"; // gCoreContext->SaveSettingOnHost(s, hostparm.ThisHostServiceHobbit ,NULL); // } } else if (hostparm.ThisSystemType == "Master_backend" ) { if ( hostparm.ThisNFS =="" && gCoreContext->GetSetting("HostServiceNFS") == "" ) { hostparm.ThisNFS = "1"; gCoreContext->SaveSetting("HostServiceNFS",hostparm.ThisNFS ); } hostparm.ThisDBhost = "127.0.0.1" ; //GlobalPKG is only an option for MBE // hostparm.ThisHostPKG_MIRROR = (gCoreContext->GetSetting("GlobalPKG_MIRROR")) ; // hostparm.ThisHostServiceHobbit = gCoreContext->GetSetting("GlobalServiceHobbitserver"); // if (hostparm.ThisHostServiceHobbit == "" ) // { // hostparm.ThisHostServiceHobbit = "1"; // QString s = "GlobalServiceHobbitserver"; // gCoreContext->SaveSettingOnHost(s, hostparm.ThisHostServiceHobbit,NULL ); // } } else if (hostparm.ThisSystemType == "Frontend_only" ) { hostparm.ThisRunfrontend = "1" ; hostparm.ThisSamba = "0"; hostparm.ThisNFS = "0"; hostparm.ThisMythWEB = "0"; gCoreContext->SaveSetting("HostRunFrontend", hostparm.ThisRunfrontend ); gCoreContext->SaveSetting("HostServiceSamba", hostparm.ThisSamba ); gCoreContext->SaveSetting("HostServiceNFS", hostparm.ThisNFS ); gCoreContext->SaveSetting("HostServiceMythWEB",hostparm.ThisMythWEB ); // if GBL is enabled, then check for host setting, else disable it // if ( (gCoreContext->GetSetting("GlobalPKG_MIRROR") ) == "1" ) // { // hostparm.ThisHostPKG_MIRROR = gCoreContext->GetSetting("HostPKG_MIRROR"); // } // else // { // hostparm.ThisHostPKG_MIRROR = "0"; // }; // // if ( ((gCoreContext->GetSetting("GlobalServiceHobbitserver") ) == "1") || install_hobbit ) // { // hostparm.ThisHostServiceHobbit = gCoreContext->GetSetting("HostServiceHobbitclient"); // } // else // { // hostparm.ThisHostServiceHobbit = "0"; // } // // gCoreContext->SaveSetting("HostPKG_MIRROR", hostparm.ThisHostPKG_MIRROR ); // gCoreContext->SaveSetting("HostServiceHobbitclient", hostparm.ThisHostServiceHobbit); } else if (hostparm.ThisSystemType == "Slave_backend" ) { hostparm.ThisSamba = "0"; hostparm.ThisNFS = "0"; hostparm.ThisMythWEB = "0"; gCoreContext->SaveSetting("HostServiceSamba", hostparm.ThisSamba ); gCoreContext->SaveSetting("HostServiceNFS", hostparm.ThisNFS ); gCoreContext->SaveSetting("HostServiceMythWEB",hostparm.ThisMythWEB ); // if ( (gCoreContext->GetSetting("GlobalPKG_MIRROR") ) == "1" ) // { // hostparm.ThisHostPKG_MIRROR = gCoreContext->GetSetting("HostPKG_MIRROR"); // } // else // { // hostparm.ThisHostPKG_MIRROR = "0"; // } // if ( ((gCoreContext->GetSetting("GlobalServiceHobbitserver") ) == "1") || install_hobbit ) // { // hostparm.ThisHostServiceHobbit = gCoreContext->GetSetting("HostServiceHobbitclient"); // } // else // { // // hostparm.ThisHostServiceHobbit = "0"; // } // // gCoreContext->SaveSetting("HostPKG_MIRROR", hostparm.ThisHostPKG_MIRROR ); // gCoreContext->SaveSetting("HostServiceHobbitclient", hostparm.ThisHostServiceHobbit); }; // if ( hostparm.ThisHostDefaultInterface == "" ) // { // if ( gCoreContext->GetSetting("HostDefaulteth0") == "1" ) // hostparm.ThisHostDefaultInterface = "eth0"; // else if ( gCoreContext->GetSetting("HostDefaulteth1") == "1" ) // hostparm.ThisHostDefaultInterface = "eth1"; // else if ( gCoreContext->GetSetting("HostDefaultwlan0") == "1" ) // hostparm.ThisHostDefaultInterface = "wlan0"; // else if ( gCoreContext->GetSetting("HostDefaultwlan1") == "1" ) // hostparm.ThisHostDefaultInterface = "wlan1"; // else if ( gCoreContext->GetSetting("HostActiveonbooteth0") == "1" ) // hostparm.ThisHostDefaultInterface = "eth0"; // else if ( gCoreContext->GetSetting("HostActiveonbooteth1") == "1" ) // hostparm.ThisHostDefaultInterface = "eth1"; // else if ( gCoreContext->GetSetting("HostActiveonbootwlan0") == "1" ) // hostparm.ThisHostDefaultInterface = "wlan0"; // else if ( gCoreContext->GetSetting("HostActiveonbootwlan1") == "1" ) // hostparm.ThisHostDefaultInterface = "wlan1"; // else // hostparm.ThisHostDefaultInterface = "ack"; // } // Even after all the above, it's still possible to set the Default interface to one that isn't active. hostparm.ThisDBhost = hostparm.ThisDBhost.section( "\t", 0, 0 ); if ( hostparm.ThisHostName == "" || hostparm.ThisHostName == "type_hostname_here") hostparm.ThisHostName = "diamonds"; //remove spaces from hostname QString s = hostparm.ThisHostName.replace ( QRegExp(" "),""); hostparm.ThisHostName = s; if ( hostparm.ThisHostName == "" ) { hostparm.ThisHostName=gCoreContext->GetHostName(); } // piece togther the timezone QString tz; QString tregion; QString tsubregion; //----------------- //I don't think this is needed anymore tz=gCoreContext->GetSetting("HostTimeZone"); if ( tz.isEmpty() || (tz == "Unknown")) timezone_unknown = true; //----------- tregion=gCoreContext->GetSetting("HostTimeZoneRegion"); tsubregion=gCoreContext->GetSetting("HostTimeZoneRegion_"+tregion); if ( tsubregion.isEmpty() ) hostparm.ThisTimeZone = tregion; else hostparm.ThisTimeZone = tregion + "/" + tsubregion; gCoreContext->SaveSetting("HostMyhostname" , hostparm.ThisHostName ); gCoreContext->SaveSetting("HostMysqlserver", hostparm.ThisDBhost ); gCoreContext->SaveSetting("HostTimeZone", hostparm.ThisTimeZone ); } void run_systemconfig(QString modulelist, bool restart, QString dbcommand) { QString cmdtxt; cmdtxt="sudo "; cmdtxt.append(MV_ROOT) ; cmdtxt.append("bin/systemconfig.sh " + modulelist + " &"); myth_system(cmdtxt); int return_code = 0; QString msgtext = "Configuring " ; msgtext.append(gCoreContext->GetSetting("HostMyhostname")); msgtext.append("..."); MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack,"installbusy"); if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } while ( return_code == 0 ) { return_code = myth_system("ps -ef|grep systemconfig.sh|grep -v grep > /dev/null"); qApp->processEvents (); usleep(900); } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } if (restart) { return_code = 1; int loopnumber=0 ; bool doloop = true; QString msgtext = "Transferring Database Settings..." ; MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); MythUIBusyDialog *busyPopup = new MythUIBusyDialog(msgtext, popupStack, "installbusy"); if (busyPopup->Create()) { popupStack->AddScreen(busyPopup, false); } else { delete busyPopup; busyPopup = NULL; } while ( doloop ) { return_code = myth_system(dbcommand); qApp->processEvents (); usleep(100); loopnumber++ ; if ( return_code == 0 || loopnumber >= 20000000 ) doloop=false; } if (busyPopup) { busyPopup->Close(); busyPopup = NULL; } }; } void settingsWait() { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); //mainStack->AddScreen(ssd); // Block by running an event loop until last screen is removed QEventLoop block; QObject::connect(mainStack, &MythScreenStack::topScreenChanged, &block, [&](MythScreenType* screen) { if (!screen) block.quit(); }); block.exec(); } int runsettings (bool mysqlonly , bool shownetwork , bool showhostype, bool showmisc , bool showshutdown, bool showadvanced, bool showsound,bool showadvancedX, bool showaccesscontrol, bool showplugins , bool showsoftware, bool showuser , bool showwebuser , bool showddns , bool showinfrared , bool showscreensaver , bool showsupplemental, bool showremotesonly, bool showvnc, bool showfileshare) { displaymysqlonly = false ; displayshownetwork = false ; displayshowhostype = false ; displayshowmisc = false ; displayshowshutdown = false ; displayshowadvanced = false; displayshowsound = false ; displayshowadvancedX = false; displayaccesscontrol = false; displayplugins = false; displaysoftware = false; displayuser = false; displaywebuser = false; displayddns = false; displayinfrared = false; displayscreensaver = false; displaysupplemental = false; displayremotesonly = false; displayvnc = false; displayfileshare = false; //gCoreContext->ActivateSettingsCache(true); //gCoreContext->ClearSettingsCache(); bool runothers = false; bool continuerun = true; int retc = 0 ; displaymysqlonly = mysqlonly; if ( displaymysqlonly ) { MythInstallSettings mysqlsettings; // mysqlsettings.Load(); // mysqlsettings.Save(); // if ( mysqlsettings.exec() == QDialog::Accepted ) // { // retc = 1; // } // else // { // retc = 2; // }; }; if ( shownetwork ) { displayshownetwork = shownetwork; MythInstallSettings settings; // settings.Load(); // settings.Save(); // if ( settings.exec() == QDialog::Accepted ) // { // retc = 1; // } // else // { // continuerun=false; // retc = 2; // }; // displayshownetwork = false; }; if ( showhostype && continuerun ) { displayshowhostype = showhostype; int sysRet = system("avahi-browse -l -r -t _mysql._tcp > /tmp/mysqllist"); if (sysRet < 0) LOG(VB_GENERAL, LOG_ERR, "Error running avahi-browse"); MythInstallSettings settings1; // settings1.Load(); // settings1.Save(); // if ( settings1.exec() == QDialog::Accepted ) // { // retc = 1; // } // else // { // continuerun=false; // retc = 2; // }; displayshowhostype=false; } if ( showmisc || showshutdown || showsound || showadvancedX || showadvanced || showaccesscontrol || showplugins || showsoftware || showuser || showwebuser || showddns || showinfrared || showscreensaver || showsupplemental || showremotesonly || showvnc || showfileshare) { runothers=true; displayshowmisc = showmisc; displayshowshutdown = showshutdown; displayshowadvanced = showadvanced; displayshowsound = showsound; displayshowadvancedX = showadvancedX; hostparm.displayshowadvancedX=showadvancedX; displayaccesscontrol = showaccesscontrol ; displayplugins = showplugins; displaysoftware = showsoftware; displayuser = showuser; displaywebuser = showwebuser; displayddns = showddns ; displayinfrared = showinfrared; displayscreensaver = showscreensaver; displaysupplemental = showsupplemental ; displayremotesonly = showremotesonly ; displayvnc = showvnc ; displayfileshare = showfileshare; // if (displayshowadvancedX) // { // ReadDDCvalues(); // } }; if ( runothers && continuerun ) { //do I need this prewerite? pre_writesettings(); //FINDME DatabaseParams params = gContext->GetDatabaseParams(); QString cmdtxt=MV_ROOT; cmdtxt.append("bin/timezip.py -m "); QString zipcommand=cmdtxt; zipcommand.append(hostparm.ThisDBhost); //FINDME zipcommand.append(" -d " + params.dbHostName ); //cout << zipcommand << endl; myth_system(zipcommand); //hostparm.ThisHostZipcode = gCoreContext->GetSetting("HostZipcode"); hostparm.ThisTimeZone = gCoreContext->GetSetting("HostTimeZone"); // hostparm.ThisHostServiceHobbit = gCoreContext->GetSetting("HostServiceHobbitclient"); // if ( hostparm.ThisHostServiceHobbit == "1" ) // install_hobbit = true; MythInstallSettings settings2; // settings2.Load(); // settings2.Save(); // gCoreContext->SaveSetting("HostServiceHobbitclient", hostparm.ThisHostServiceHobbit ); // if ( settings2.exec() == QDialog::Accepted ) // { // retc = 1; // } // else // { // continuerun=false; // retc = 2; // }; }; pre_writesettings(); if ( mysqlonly ) { QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/systemconfig.sh Mysql_only " + hostparm.ThisDBhost); myth_system(cmdtxt); } else { if (retc == 1) writesettings(); } return retc; }; void writesettings() { // ofstream myfile; //gCoreContext->ClearSettingsCache(); //gCoreContext->ActivateSettingsCache(false); hostparm.language = gCoreContext->GetSetting("language"); hostparm.ThisHostName = gCoreContext->GetSetting("HostMyhostname").toLower(); hostparm.ThisTimeZone = gCoreContext->GetSetting("HostTimeZone"); hostparm.ThisHostIPeth0 = gCoreContext->GetSetting("HostIPeth0"); hostparm.ThisHostNETMASKeth0 = gCoreContext->GetSetting("HostNETMASKeth0"); hostparm.ThisHostDNSeth0 = gCoreContext->GetSetting("HostDNSeth0"); hostparm.ThisHostUSEDHCPeth0 = gCoreContext->GetSetting("HostUseDHCPeth0"); hostparm.ThisHostGWeth0 = gCoreContext->GetSetting("HostGWeth0"); hostparm.ThisHostActiveonbooteth0 = gCoreContext->GetSetting("HostActiveonbooteth0"); hostparm.ThisHOSTESSIDeth0 = gCoreContext->GetSetting("HOSTESSIDeth0"); hostparm.ThisHostUseEncryptioneth0 = gCoreContext->GetSetting("HostUseEncryptioneth0"); hostparm.ThisHostkeyeth0 = gCoreContext->GetSetting("Hostkeyeth0"); hostparm.ThisHostMTUeth0 = gCoreContext->GetSetting("HostMTUeth0"); hostparm.ThisHostIPeth1 = gCoreContext->GetSetting("HostIPeth1"); hostparm.ThisHostNETMASKeth1 = gCoreContext->GetSetting("HostNETMASKeth1"); hostparm.ThisHostDNSeth1 = gCoreContext->GetSetting("HostDNSeth1"); hostparm.ThisHostUSEDHCPeth1 = gCoreContext->GetSetting("HostUseDHCPeth1"); hostparm.ThisHostGWeth1 = gCoreContext->GetSetting("HostGWeth1"); hostparm.ThisHostActiveonbooteth1 = gCoreContext->GetSetting("HostActiveonbooteth1"); hostparm.ThisHOSTESSIDeth1 = gCoreContext->GetSetting("HOSTESSIDeth1"); hostparm.ThisHostUseEncryptioneth1 = gCoreContext->GetSetting("HostUseEncryptioneth1"); hostparm.ThisHostkeyeth1 = gCoreContext->GetSetting("Hostkeyeth1"); hostparm.ThisHostMTUeth1 = gCoreContext->GetSetting("HostMTUeth1"); hostparm.ThisHostIPwlan0 = gCoreContext->GetSetting("HostIPwlan0"); hostparm.ThisHostNETMASKwlan0 = gCoreContext->GetSetting("HostNETMASKwlan0"); hostparm.ThisHostDNSwlan0 = gCoreContext->GetSetting("HostDNSwlan0"); hostparm.ThisHostUSEDHCPwlan0 = gCoreContext->GetSetting("HostUseDHCPwlan0"); hostparm.ThisHostGWwlan0 = gCoreContext->GetSetting("HostGWwlan0"); hostparm.ThisHostActiveonbootwlan0 = gCoreContext->GetSetting("HostActiveonbootwlan0"); hostparm.ThisHOSTESSIDwlan0 = gCoreContext->GetSetting("HOSTESSIDwlan0"); hostparm.ThisHostUseEncryptionwlan0 = gCoreContext->GetSetting("HostUseEncryptionwlan0"); hostparm.ThisHostkeywlan0 = gCoreContext->GetSetting("Hostkeywlan0"); hostparm.ThisHostMTUwlan0 = gCoreContext->GetSetting("HostMTUwlan0"); hostparm.ThisHostIPwlan1 = gCoreContext->GetSetting("HostIPwlan1"); hostparm.ThisHostNETMASKwlan1 = gCoreContext->GetSetting("HostNETMASKwlan1"); hostparm.ThisHostDNSwlan1 = gCoreContext->GetSetting("HostDNSwlan1"); hostparm.ThisHostUSEDHCPwlan1 = gCoreContext->GetSetting("HostUseDHCPwlan1"); hostparm.ThisHostGWwlan1 = gCoreContext->GetSetting("HostGWwlan1"); hostparm.ThisHostActiveonbootwlan1 = gCoreContext->GetSetting("HostActiveonbootwlan1"); hostparm.ThisHOSTESSIDwlan1 = gCoreContext->GetSetting("HOSTESSIDwlan1"); hostparm.ThisHostUseEncryptionwlan1 = gCoreContext->GetSetting("HostUseEncryptionwlan1"); hostparm.ThisHostkeywlan1 = gCoreContext->GetSetting("Hostkeywlan1"); hostparm.ThisHostMTUwlan1 = gCoreContext->GetSetting("HostMTUwlan1"); hostparm.ThisHostIPath0 = gCoreContext->GetSetting("HostIPath0"); hostparm.ThisHostNETMASKath0 = gCoreContext->GetSetting("HostNETMASKath0"); hostparm.ThisHostDNSath0 = gCoreContext->GetSetting("HostDNSath0"); hostparm.ThisHostUSEDHCPath0 = gCoreContext->GetSetting("HostUseDHCPath0"); hostparm.ThisHostGWath0 = gCoreContext->GetSetting("HostGWath0"); hostparm.ThisHostActiveonbootath0 = gCoreContext->GetSetting("HostActiveonbootath0"); hostparm.ThisHOSTESSIDath0 = gCoreContext->GetSetting("HOSTESSIDath0"); hostparm.ThisHostUseEncryptionath0 = gCoreContext->GetSetting("HostUseEncryptionath0"); hostparm.ThisHostkeyath0 = gCoreContext->GetSetting("Hostkeyath0"); hostparm.ThisHostMTUath0 = gCoreContext->GetSetting("HostMTUath0"); // hostparm.ThisHostServiceRRD = gCoreContext->GetSetting("HostServiceRRD"); hostparm.ThisSamba = gCoreContext->GetSetting("HostServiceSamba"); hostparm.ThisHostServiceSamba_media = gCoreContext->GetSetting("HostServiceSamba_media"); hostparm.ThisHostServiceSamba_write = gCoreContext->GetSetting("HostServiceSamba_write"); hostparm.ThisHostServiceSamba_home = gCoreContext->GetSetting("HostServiceSamba_home"); hostparm.ThisHostServiceSamba_writehome = gCoreContext->GetSetting("HostServiceSamba_writehome"); hostparm.ThisHostServiceSamba_domain = gCoreContext->GetSetting("HostServiceSamba_domain"); hostparm.ThisNFS = gCoreContext->GetSetting("HostServiceNFS"); hostparm.ThisHostCentralNFSallhosts = gCoreContext->GetSetting("HostCentralNFSallhosts"); hostparm.ThisMythWEB = gCoreContext->GetSetting("HostServiceMythWEB"); hostparm.ThisHostwebauth = gCoreContext->GetSetting("HOSTwebauth"); hostparm.ThisHostRunDHCP = gCoreContext->GetSetting("HostRunDHCP"); hostparm.ThisSystemType = gCoreContext->GetSetting("HostSystemType"); // determine the remote based off the host bucket. hostparm.ThisHostRemotebucket = gCoreContext->GetSetting("HostRemotebucket"); if ( hostparm.ThisHostRemotebucket == "favorites" ) hostparm.ThisRemote = gCoreContext->GetSetting("HostRemoteType_favorites"); if ( hostparm.ThisHostRemotebucket == "user" ) hostparm.ThisRemote = gCoreContext->GetSetting("HostRemoteType_user"); if ( hostparm.ThisHostRemotebucket == "other" ) hostparm.ThisRemote = gCoreContext->GetSetting("HostRemoteType_other"); if ( hostparm.ThisHostRemotebucket == "hauppauge" ) hostparm.ThisRemote = gCoreContext->GetSetting("HostRemoteType_hauppauge"); if ( hostparm.ThisHostRemotebucket == "ATI" ) hostparm.ThisRemote = gCoreContext->GetSetting("HostRemoteType_ATI"); hostparm.ThisHostBEWait = gCoreContext->GetSetting("HostBEWait"); hostparm.ThisHostLircWait = gCoreContext->GetSetting("HostLircWait"); hostparm.ThisHDHRlirc_device = gCoreContext->GetSetting("HostHDHRlirc_device"); hostparm.ThisReceiverType = gCoreContext->GetSetting("HostReceiverType"); hostparm.ThisHostSerialPortlirc = gCoreContext->GetSetting("HostSerialPortlirc"); // hostparm.ThisHostUseEvrouter = gCoreContext->GetSetting("HostRunEvrouter"); // hostparm.ThisHostEvrouterConfig = gCoreContext->GetSetting("HostEvrouterConfig"); hostparm.ThisXres = gCoreContext->GetSetting("HostXres"); hostparm.ThisHostUseXLargeMouse = gCoreContext->GetSetting("HostUseXLargeMouse"); hostparm.ThisAutodown = gCoreContext->GetSetting("HostAutodown"); hostparm.ThisShutdowntime = gCoreContext->GetSetting("HostShutdownTime"); hostparm.ThisShutdowntime2 = gCoreContext->GetSetting("HostShutdownTime2"); hostparm.ThisWakeuptime = gCoreContext->GetSetting("HostWakeupTime"); hostparm.ThisUseNVRAM = gCoreContext->GetSetting("HostUseNVRAM"); hostparm.ThisUseWOL = gCoreContext->GetSetting("HostUseWOL"); hostparm.ThisKeepPackage = gCoreContext->GetSetting("HostKeepPackages"); hostparm.ThisMythWelcome = gCoreContext->GetSetting("HostUseMythWelcome"); hostparm.ThisHaveNFS = gCoreContext->GetSetting("HostHaveCentralNFS"); hostparm.ThisNFSserver = gCoreContext->GetSetting("HostCentralNFSIP"); hostparm.ThisNFSmountpoint = gCoreContext->GetSetting("HostNFSmountpoint"); hostparm.ThisHostupdateplan = gCoreContext->GetSetting("Hostupdateplan"); hostparm.ThisShowToolTips = gCoreContext->GetSetting("HostShowToolTips"); hostparm.ThisRunfrontend = gCoreContext->GetSetting("HostRunFrontend"); //hostparm.ThisHostZipcode = gCoreContext->GetSetting("HostZipcode"); hostparm.ThisHostncidClient = gCoreContext->GetSetting("HostncidClient"); hostparm.ThisHostncidDaemon = gCoreContext->GetSetting("HostncidDaemon"); hostparm.ThisHostSerialPortncid = gCoreContext->GetSetting("HostSerialPortncid"); hostparm.ThisHostNcidDeviceNetCallerID = gCoreContext->GetSetting("HostNcidDeviceNetCallerID"); hostparm.ThisHostbootsplash = gCoreContext->GetSetting("Hostbootsplash"); hostparm.ThisXIgnoreConfig =gCoreContext->GetSetting("HostXIgnoreConfig"); hostparm.ThisXcardtype =gCoreContext->GetSetting("HostXcardtype"); hostparm.ThisXUseAdvanced =gCoreContext->GetSetting("HostXUseAdvanced"); hostparm.ThisXIgnoreEDID =gCoreContext->GetSetting("HostXIgnoreEDID"); hostparm.ThisXconnection =gCoreContext->GetSetting("HostXconnection"); hostparm.ThisXDisplaysize =gCoreContext->GetSetting("HostXDisplaysize"); hostparm.ThisHostXNvidia1080p =gCoreContext->GetSetting("HostXNvidia1080p"); hostparm.ThisHostXNvidia1080i =gCoreContext->GetSetting("HostXNvidia1080i"); hostparm.ThisHostXNvidia720p =gCoreContext->GetSetting("HostXNvidia720p"); hostparm.ThisHostXNvidia480p =gCoreContext->GetSetting("HostXNvidia480p"); // EDID settings QString tempstring; tempstring = gCoreContext->GetSetting("HostXHsyncLow"); tempstring.append(" - "); tempstring.append(gCoreContext->GetSetting("HostXHsyncHigh") ); hostparm.ThisXHsync=tempstring; tempstring =""; tempstring=gCoreContext->GetSetting("HostXVrefreshLow"); tempstring.append(" - "); tempstring.append(gCoreContext->GetSetting("HostXVrefreshHigh")); hostparm.ThisXVrefresh=tempstring; // Assemble the advanced modeline string QString modelinetype = gCoreContext->GetSetting("HostXModelineCatagory");; QString tempmodeline = "HostXadvancedres" + modelinetype ; QString modeline = gCoreContext->GetSetting(tempmodeline); hostparm.ThisXresadvanced = modelinetype +"_"+modeline; // Gather settings based on card type if ( hostparm.ThisXcardtype == "nVidia" ) { hostparm.ThisXTVstandard = gCoreContext->GetSetting("HostXnVidiaTVstandard"); hostparm.ThisXTVconnection= gCoreContext->GetSetting("HostXnVidiaTVformat"); modelinetype = gCoreContext->GetSetting("HostXNvidiaModelineCatagory");; tempmodeline = "HostXNvidiaadvancedres" + modelinetype ; modeline = gCoreContext->GetSetting(tempmodeline); hostparm.ThisXresadvanced = modelinetype +"_"+modeline; } else if ( hostparm.ThisXcardtype == "ATI" ) { hostparm.ThisXTVstandard = gCoreContext->GetSetting("HostXATITVstandard"); hostparm.ThisXTVconnection= gCoreContext->GetSetting("HostXati-tvformat"); } //-------------------------------------------------------------------------------- // AUDIO SETTINGS //-------------------------------------------------------------------------------- hostparm.ThisHostAudiotype = gCoreContext->GetSetting("HostAudiotype"); hostparm.ThisHostSoundOSSAll = gCoreContext->GetSetting("HostSoundOssAll"); hostparm.ThisHostSoundALSAAll = gCoreContext->GetSetting("HostSoundALSAAll"); if ( hostparm.ThisHostAudiotype == "OSS" ) { QString tempdevice; QChar tempchar ; hostparm.ThisHostSoundDevice = "/dev/dsp"; tempdevice = hostparm.ThisHostSoundOSSAll ; int tlength=(tempdevice.length() -2 ); if ( tlength > 0 ) { tempchar = tempdevice.at( tlength); hostparm.ThisHostSoundDevice.append(tempchar); }; } if ( hostparm.ThisHostAudiotype == "ALSA" ) { QString tempdevice; tempdevice=hostparm.ThisHostSoundALSAAll; tempdevice = tempdevice.section( "(", 1,1 ); tempdevice = tempdevice.section( ")", 0,0 ); hostparm.ThisHostSoundDevice = tempdevice; } // LCD TYPE hostparm.ThisHostLCDType = gCoreContext->GetSetting("HostLCDType"); if ( hostparm.ThisHostLCDType != "no_lcd" && hostparm.ThisHostLCDType != "tinker" && hostparm.ThisHostLCDType != "" ) { // enable mythtv lcddevice gCoreContext->SaveSetting("LCDEnable","1"); }; // Backupsettings hostparm.ThisHostRemoteBackup = gCoreContext->GetSetting("HostRemoteBackup"); hostparm.ThisHostRemoteBackupDir = gCoreContext->GetSetting("HostRemoteBackupDir"); //plugins hostparm.ThisHostpluginmytharchive = gCoreContext->GetSetting("Hostpluginmytharchive"); hostparm.ThisHostpluginmythbrowser = gCoreContext->GetSetting("Hostpluginmythbrowser"); hostparm.ThisHostpluginmythnetvision = gCoreContext->GetSetting("Hostpluginmythnetvision"); hostparm.ThisHostpluginmythgallery = gCoreContext->GetSetting("Hostpluginmythgallery"); hostparm.ThisHostpluginmythgame = gCoreContext->GetSetting("Hostpluginmythgame"); hostparm.ThisHostpluginmythmusic = gCoreContext->GetSetting("Hostpluginmythmusic"); hostparm.ThisHostpluginmythnews = gCoreContext->GetSetting("Hostpluginmythnews"); hostparm.ThisHostpluginmythweather = gCoreContext->GetSetting("Hostpluginmythweather"); hostparm.ThisHostpluginmythzoneminder = gCoreContext->GetSetting("Hostpluginmythzoneminder"); hostparm.ThisHostpluginmythgamefceux = gCoreContext->GetSetting("Hostpluginmythgamefceux"); hostparm.ThisHostpluginmythgamesnes9x = gCoreContext->GetSetting("Hostpluginmythgamesnes9x"); hostparm.ThisHostpluginmythgameMame = gCoreContext->GetSetting("HostpluginmythgameMame"); hostparm.ThisHostpluginmythgameDolphin = gCoreContext->GetSetting("HostpluginmythgameDolphin"); hostparm.ThisHostpluginmythgameXe = gCoreContext->GetSetting("HostpluginmythgameXe"); hostparm.ThisHostpluginmythvideo_dvdcss = gCoreContext->GetSetting("Hostpluginmythvideo_dvdcss"); hostparm.ThisHostpluginmythappletrailers= gCoreContext->GetSetting("Hostpluginmythappletrailers"); hostparm.ThisHostpluginmythgameMednafen= gCoreContext->GetSetting("HostpluginmythgameMednafen"); hostparm.ThisHostpluginmythgameROMDB= gCoreContext->GetSetting("HostpluginmythgameROMDB"); hostparm.ThisHostpluginmythgameMupen64= gCoreContext->GetSetting("HostpluginmythgameMupen64"); hostparm.ThisHostwebmin = gCoreContext->GetSetting("Hostwebmin"); hostparm.ThisHostwebonlinhes = gCoreContext->GetSetting("HostWebonlinhes"); hostparm.ThisHostXBMC = gCoreContext->GetSetting("HostXBMC"); hostparm.ThisHostPLEXHT = gCoreContext->GetSetting("HostPLEXHT"); hostparm.ThisHostPLEXMS = gCoreContext->GetSetting("HostPLEXMS"); hostparm.ThisHostfoldingathome = gCoreContext->GetSetting("Hostfoldingathome"); hostparm.ThisHostfoldingusername = gCoreContext->GetSetting("Hostfoldingusername"); hostparm.ThisHostfoldingworksize = gCoreContext->GetSetting("Hostfoldingworksize"); hostparm.ThisHostDDnslogin = gCoreContext->GetSetting("HostDDnslogin"); hostparm.ThisHostDDnspassword = gCoreContext->GetSetting("HostDDnspassword"); hostparm.ThisHostDDnshostname = gCoreContext->GetSetting("HostDDnshostname"); hostparm.ThisHostDDnsEnable = gCoreContext->GetSetting("HostDDnsEnable"); hostparm.ThisHostscreensavertype = gCoreContext->GetSetting("Hostscreensavertype"); hostparm.ThisHostscreensaveridle = gCoreContext->GetSetting("Hostscreensaveridle"); if (gCoreContext->GetSetting("HostScreensaverBlank") == "1" ) hostparm.ThisHostscreensavertheme="Blank"; else if (gCoreContext->GetSetting("HostScreensaverRandom") == "1" ) hostparm.ThisHostscreensavertheme="Random"; else { if ( hostparm.ThisHostscreensavertype == "gscreensaver" ) hostparm.ThisHostscreensavertheme = gCoreContext->GetSetting("HostGScreensavertheme"); if ( hostparm.ThisHostscreensavertype == "xscreensaver" ) hostparm.ThisHostscreensavertheme = gCoreContext->GetSetting("HostXScreensavertheme"); } hostparm.ThisHostTransmitproto_1 = gCoreContext->GetSetting("HostTransmitproto_1"); hostparm.ThisHostTransmitproto_2 = gCoreContext->GetSetting("HostTransmitproto_2"); hostparm.ThisHostTransmitproto_3 = gCoreContext->GetSetting("HostTransmitproto_3"); hostparm.ThisHostTransmitproto_4 = gCoreContext->GetSetting("HostTransmitproto_4"); hostparm.ThisHostBlasterType = gCoreContext->GetSetting("HostBlasterType"); hostparm.ThisHostSerialPort_blasterlirc = gCoreContext->GetSetting("HostSerialPort_blasterlirc"); hostparm.ThisHostnumblaster = "1"; if ( hostparm.ThisHostBlasterType == "CommandIR" ) hostparm.ThisHostnumblaster = "4" ; if ( hostparm.ThisHostBlasterType == "MCE" ) hostparm.ThisHostnumblaster = "2" ; hostparm.ThisHostTransmitDelay_1 = gCoreContext->GetSetting("HostTransmitDelay_1"); hostparm.ThisHostTransmitSend_after_1 = gCoreContext->GetSetting("HostTransmitSend_after_1"); hostparm.ThisHostTransmitDelay_2 = gCoreContext->GetSetting("HostTransmitDelay_2"); hostparm.ThisHostTransmitSend_after_2 = gCoreContext->GetSetting("HostTransmitSend_after_2"); hostparm.ThisHostTransmitDelay_3 = gCoreContext->GetSetting("HostTransmitDelay_3"); hostparm.ThisHostTransmitSend_after_3 = gCoreContext->GetSetting("HostTransmitSend_after_3"); hostparm.ThisHostTransmitDelay_4 = gCoreContext->GetSetting("HostTransmitDelay_4"); hostparm.ThisHostTransmitSend_after_4 = gCoreContext->GetSetting("HostTransmitSend_after_4"); hostparm.ThisHOSTrootSSH = gCoreContext->GetSetting("HOSTrootSSH"); hostparm.ThisHostSupplemental = gCoreContext->GetSetting("HostSupplemental"); hostparm.ThisHostWindowManager = gCoreContext->GetSetting("HostWindowManager"); hostparm.ThisHostEnhancedWMStyle = gCoreContext->GetSetting("HostEnhancedWMStyle"); hostparm.ThisHostVNCEnable = gCoreContext->GetSetting("HostVNCEnable"); hostparm.ThisHostVNCpassword = gCoreContext->GetSetting("HostVNCpassword"); hostparm.ThisHostXVNCEnable = gCoreContext->GetSetting("HostXVNCEnable"); hostparm.ThisHostXVNCpassword = gCoreContext->GetSetting("HostXVNCpassword"); //______________________WRITE OUT THE FILE__________________________ QString systemheader; QString divider; QFile f( "/etc/systemconfig" ); if( !f.open( QIODevice::WriteOnly | QIODevice::Text ) ) std::cout << "Failed to open file /etc/systemconfig." << std::endl; QTextStream myfile( &f ); divider = "#-----------------------------\n"; systemheader= "\n# Language \n" ; myfile << systemheader ; myfile << divider ; myfile << "language=\"" + hostparm.language + "\"\n"; divider = "#-----------------------------\n"; systemheader= "\n# Hostype \n" ; myfile << systemheader ; myfile << divider ; myfile << "SystemType=\"" + hostparm.ThisSystemType + "\"\n"; myfile << "dbhost=\"" + hostparm.ThisDBhost + "\"\n"; myfile << "RunFrontend=\"" + hostparm.ThisRunfrontend + "\"\n"; myfile << "UseMythWelcome=\"" + hostparm.ThisMythWelcome + "\"\n"; systemheader= "\n# Network config\n" ; myfile << systemheader ; myfile << divider ; myfile << "hostname=\"" + hostparm.ThisHostName + "\"\n"; myfile << "default_interface=\"" + hostparm.ThisHostDefaultInterface + "\"\n"; if ( hostparm.ThisHostActiveonbooteth0 == "1" ) { systemheader= "\n# Network config for eth0 \n" ; myfile << systemheader ; myfile << divider ; myfile << "Hostipeth0=\"" + hostparm.ThisHostIPeth0 + "\"\n"; myfile << "Hostnetmasketh0=\"" +hostparm.ThisHostNETMASKeth0 + "\"\n"; myfile << "HostDNSeth0=\"" +hostparm.ThisHostDNSeth0 + "\"\n"; myfile << "HostUSEDHCPeth0=\"" +hostparm.ThisHostUSEDHCPeth0 + "\"\n"; myfile << "HostGWeth0=\"" +hostparm.ThisHostGWeth0 + "\"\n"; myfile << "HostActiveeth0=\"" +hostparm.ThisHostActiveonbooteth0 + "\"\n"; myfile << "HostESSIDeth0=\"" + hostparm.ThisHOSTESSIDeth0 + "\"\n"; myfile << "HostUseEncryptioneth0=\"" + hostparm.ThisHostUseEncryptioneth0 + "\"\n"; myfile << "HostKeyeth0=\"" + hostparm.ThisHostkeyeth0 + "\"\n"; myfile << "HOST_iswirelesseth0=\"" + hostparm.ThisHOST_iswirelesseth0 + "\"\n"; myfile << "HostMTUeth0=\"" + hostparm.ThisHostMTUeth0 + "\"\n"; } if ( hostparm.ThisHostActiveonbooteth1 == "1" ) { systemheader= "\n# Network config for eth1 \n" ; myfile << systemheader ; myfile << divider ; myfile << "Hostipeth1=\"" + hostparm.ThisHostIPeth1 + "\"\n"; myfile << "Hostnetmasketh1=\"" +hostparm.ThisHostNETMASKeth1 + "\"\n"; myfile << "HostDNSeth1=\"" +hostparm.ThisHostDNSeth1 + "\"\n"; myfile << "HostUSEDHCPeth1=\"" +hostparm.ThisHostUSEDHCPeth1 + "\"\n"; myfile << "HostGWeth1=\"" +hostparm.ThisHostGWeth1 + "\"\n"; myfile << "HostActiveeth1=\"" +hostparm.ThisHostActiveonbooteth1 + "\"\n"; myfile << "HostESSIDeth1=\"" + hostparm.ThisHOSTESSIDeth1 + "\"\n"; myfile << "HostUseEncryptioneth1=\"" + hostparm.ThisHostUseEncryptioneth1 + "\"\n"; myfile << "HostKeyeth1=\"" + hostparm.ThisHostkeyeth1 + "\"\n"; myfile << "HOST_iswirelesseth1=\"" + hostparm.ThisHOST_iswirelesseth1 + "\"\n"; myfile << "HostMTUeth1=\"" + hostparm.ThisHostMTUeth1 + "\"\n"; } if ( hostparm.ThisHostActiveonbootwlan0 == "1" ) { systemheader= "\n# Network config for wlan0 \n" ; myfile << systemheader ; myfile << divider ; myfile << "Hostipwlan0=\"" + hostparm.ThisHostIPwlan0 + "\"\n"; myfile << "Hostnetmaskwlan0=\"" +hostparm.ThisHostNETMASKwlan0 + "\"\n"; myfile << "HostDNSwlan0=\"" +hostparm.ThisHostDNSwlan0 + "\"\n"; myfile << "HostUSEDHCPwlan0=\"" +hostparm.ThisHostUSEDHCPwlan0 + "\"\n"; myfile << "HostGWwlan0=\"" +hostparm.ThisHostGWwlan0 + "\"\n"; myfile << "HostActivewlan0=\"" +hostparm.ThisHostActiveonbootwlan0 + "\"\n"; myfile << "HostESSIDwlan0=\"" + hostparm.ThisHOSTESSIDwlan0 + "\"\n"; myfile << "HostUseEncryptionwlan0=\"" + hostparm.ThisHostUseEncryptionwlan0 + "\"\n"; myfile << "HostKeywlan0=\"" + hostparm.ThisHostkeywlan0 + "\"\n"; myfile << "HOST_iswirelesswlan0=\"" + hostparm.ThisHOST_iswirelesswlan0 + "\"\n"; myfile << "HostMTUwlan0=\"" + hostparm.ThisHostMTUwlan0 + "\"\n"; } if ( hostparm.ThisHostActiveonbootwlan1 == "1" ) { systemheader= "\n# Network config for wlan1 \n" ; myfile << systemheader ; myfile << divider ; myfile << "Hostipwlan1=\"" + hostparm.ThisHostIPwlan1 + "\"\n"; myfile << "Hostnetmaskwlan1=\"" +hostparm.ThisHostNETMASKwlan1 + "\"\n"; myfile << "HostDNSwlan1=\"" +hostparm.ThisHostDNSwlan1 + "\"\n"; myfile << "HostUSEDHCPwlan1=\"" +hostparm.ThisHostUSEDHCPwlan1 + "\"\n"; myfile << "HostGWwlan1=\"" +hostparm.ThisHostGWwlan1 + "\"\n"; myfile << "HostActivewlan1=\"" +hostparm.ThisHostActiveonbootwlan1 + "\"\n"; myfile << "HostESSIDwlan1=\"" + hostparm.ThisHOSTESSIDwlan1 + "\"\n"; myfile << "HostUseEncryptionwlan1=\"" + hostparm.ThisHostUseEncryptionwlan1 + "\"\n"; myfile << "HostKeywlan1=\"" + hostparm.ThisHostkeywlan1 + "\"\n"; myfile << "HOST_iswirelesswlan1=\"" + hostparm.ThisHOST_iswirelesswlan1 + "\"\n"; myfile << "HostMTUwlan1=\"" + hostparm.ThisHostMTUwlan1 + "\"\n"; } if ( hostparm.ThisHostActiveonbootath0 == "1" ) { systemheader= "\n# Network config for ath0 \n" ; myfile << systemheader ; myfile << divider ; myfile << "Hostipath0=\"" + hostparm.ThisHostIPath0 + "\"\n"; myfile << "Hostnetmaskath0=\"" +hostparm.ThisHostNETMASKath0 + "\"\n"; myfile << "HostDNSath0=\"" +hostparm.ThisHostDNSath0 + "\"\n"; myfile << "HostUSEDHCPath0=\"" +hostparm.ThisHostUSEDHCPath0 + "\"\n"; myfile << "HostGWath0=\"" +hostparm.ThisHostGWath0 + "\"\n"; myfile << "HostActiveath0=\"" +hostparm.ThisHostActiveonbootath0 + "\"\n"; myfile << "HostESSIDath0=\"" + hostparm.ThisHOSTESSIDath0 + "\"\n"; myfile << "HostUseEncryptionath0=\"" + hostparm.ThisHostUseEncryptionath0 + "\"\n"; myfile << "HostKeyath0=\"" + hostparm.ThisHostkeyath0 + "\"\n"; myfile << "HOST_iswirelessath0=\"" + hostparm.ThisHOST_iswirelessath0 + "\"\n"; myfile << "HostMTUath0=\"" + hostparm.ThisHostMTUath0 + "\"\n"; } systemheader= "\n# Misc \n" ; myfile << systemheader ; myfile << divider ; myfile << "timezone=\"" + hostparm.ThisTimeZone + "\"\n"; myfile << "Hostupdateplan=\"" + hostparm.ThisHostupdateplan + "\"\n"; myfile << "ShowTips=\"" + hostparm.ThisShowToolTips + "\"\n"; systemheader= "\n# Advanced \n" ; myfile << systemheader ; myfile << divider ; myfile << "bewait=\"" + hostparm.ThisHostBEWait + "\"\n"; myfile << "ncidclient=\"" + hostparm.ThisHostncidClient + "\"\n"; myfile << "Runncidd=\"" + hostparm.ThisHostncidDaemon + "\"\n"; myfile << "nciddSerialPort=\"" + hostparm.ThisHostSerialPortncid + "\"\n"; myfile << "nciddDeviceNetCallerID=\"" + hostparm.ThisHostNcidDeviceNetCallerID + "\"\n"; myfile << "Usebootsplash=\"" + hostparm.ThisHostbootsplash + "\"\n"; myfile << "RemoteBackup=\"" + hostparm.ThisHostRemoteBackup + "\"\n"; myfile << "RemoteBackupDir=\"" + hostparm.ThisHostRemoteBackupDir + "\"\n"; // special keys // myfile << "UseEvrouter=\"" + hostparm.ThisHostUseEvrouter + "\"\n"; // myfile << "EvrouterConfig=\"" + hostparm.ThisHostEvrouterConfig + "\"\n"; //run dhcp server myfile << "RunDHCP=\"" + hostparm.ThisHostRunDHCP + "\"\n"; myfile << "UseMythWEB=\"" + hostparm.ThisMythWEB + "\"\n"; systemheader= "\n# fileshare \n" ; myfile << systemheader ; myfile << divider ; myfile << "UseSamba=\"" + hostparm.ThisSamba + "\"\n"; myfile << "Samba_media=\"" + hostparm.ThisHostServiceSamba_media + "\"\n"; myfile << "Samba_mediareadonly=\"" + hostparm.ThisHostServiceSamba_write + "\"\n"; myfile << "Samba_home=\"" + hostparm.ThisHostServiceSamba_home + "\"\n"; myfile << "Samba_homereadonly=\"" + hostparm.ThisHostServiceSamba_writehome + "\"\n"; myfile << "Samba_domain=\"" + hostparm.ThisHostServiceSamba_domain + "\"\n"; myfile << "UseNFS=\"" + hostparm.ThisNFS + "\"\n"; myfile << "HaveCentralNFS=\"" + hostparm.ThisHaveNFS + "\"\n"; myfile << "NFSserver=\"" + hostparm.ThisNFSserver + "\"\n"; myfile << "NFSmount=\"" + hostparm.ThisNFSmountpoint + "\"\n"; myfile << "CentralNFSallhosts=\"" + hostparm.ThisHostCentralNFSallhosts + "\"\n"; //not used anymore // myfile << "UseDHCP=\"" + hostparm.ThisDHCP + "\"\n"; systemheader= "\n# sleep \n" ; myfile << systemheader ; myfile << divider ; myfile << "AutoShutdown=\"" + hostparm.ThisAutodown + "\"\n"; myfile << "Shutdowntime=\"" + hostparm.ThisShutdowntime + "\"\n"; myfile << "Shutdowntime2=\"" + hostparm.ThisShutdowntime2 + "\"\n"; //myfile << "Wakeuptime=\"" + hostparm.ThisWakeuptime + "\"\n"; //myfile << "UseNVRAM=\"" + hostparm.ThisUseNVRAM + "\"\n"; //myfile << "UseWOL=\"" + hostparm.ThisUseWOL + "\"\n"; //not used //myfile << "KeepPackages=\"" + hostparm.ThisKeepPackage + "\"\n"; // myfile << "PKG_MIRROR=\"" + hostparm.ThisHostPKG_MIRROR + "\"\n"; //myfile << "zipcode=\"" + hostparm.ThisHostZipcode + "\"\n"; systemheader= "\n# X display settings \n" ; myfile << systemheader ; myfile << divider ; myfile << "XIgnoreConfig=\"" + hostparm.ThisXIgnoreConfig + "\"\n"; myfile << "Xcardtype=\"" + hostparm.ThisXcardtype + "\"\n"; myfile << "XUseAdvanced=\"" + hostparm.ThisXUseAdvanced + "\"\n"; myfile << "Xres=\"" + hostparm.ThisXres + "\"\n"; myfile << "UseXLargeMouse=\"" + hostparm.ThisHostUseXLargeMouse + "\"\n"; // myfile << "XIgnoreEDID=\"" + hostparm.ThisXIgnoreEDID + "\"\n"; // myfile << "Xconnection=\"" + hostparm.ThisXconnection + "\"\n"; // myfile << "XHsync=\"" + hostparm.ThisXHsync + "\"\n"; // myfile << "XVrefresh=\"" + hostparm.ThisXVrefresh+ "\"\n"; // myfile << "Xresadvanced=\"" + hostparm.ThisXresadvanced + "\"\n"; // myfile << "XTVstandard=\"" + hostparm.ThisXTVstandard + "\"\n"; // myfile << "XTVconnection=\"" + hostparm.ThisXTVconnection + "\"\n"; // myfile << "XDisplaysize=\"" + hostparm.ThisXDisplaysize + "\"\n"; // myfile << "XnVidia1080p=\"" + hostparm.ThisHostXNvidia1080p+ "\"\n"; // myfile << "XnVidia1080i=\"" + hostparm.ThisHostXNvidia1080i+ "\"\n"; // myfile << "XnVidia720p=\"" + hostparm.ThisHostXNvidia720p+ "\"\n"; // myfile << "XnVidia480p=\"" + hostparm.ThisHostXNvidia480p+ "\"\n"; systemheader= "\n# Audio settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "Audiotype=\"" + hostparm.ThisHostAudiotype + "\"\n"; myfile << "SoundDevice=\"" + hostparm.ThisHostSoundDevice+ "\"\n"; systemheader= "\n# Software settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "mytharchive=\"" + hostparm.ThisHostpluginmytharchive + "\"\n"; myfile << "mythbrowser=\"" + hostparm.ThisHostpluginmythbrowser + "\"\n"; myfile << "mythnetvision=\"" + hostparm.ThisHostpluginmythnetvision + "\"\n"; myfile << "mythgallery=\"" + hostparm.ThisHostpluginmythgallery + "\"\n"; myfile << "mythgame=\"" + hostparm.ThisHostpluginmythgame + "\"\n"; myfile << "mythmusic=\"" + hostparm.ThisHostpluginmythmusic + "\"\n"; myfile << "mythnews=\"" + hostparm.ThisHostpluginmythnews + "\"\n"; myfile << "mythzoneminder=\"" + hostparm.ThisHostpluginmythzoneminder + "\"\n"; myfile << "mythweather=\"" + hostparm.ThisHostpluginmythweather + "\"\n"; myfile << divider ; //game emulator myfile << "romdb=\"" + hostparm.ThisHostpluginmythgameROMDB + "\"\n"; myfile << "snes9x=\"" + hostparm.ThisHostpluginmythgamesnes9x + "\"\n"; myfile << "fceux=\"" + hostparm.ThisHostpluginmythgamefceux + "\"\n"; myfile << "mame=\"" + hostparm.ThisHostpluginmythgameMame + "\"\n"; myfile << "mednafen=\"" + hostparm.ThisHostpluginmythgameMednafen + "\"\n"; myfile << "mupen64=\"" + hostparm.ThisHostpluginmythgameMupen64 + "\"\n"; myfile << "dolphinemu=\"" + hostparm.ThisHostpluginmythgameDolphin + "\"\n"; myfile << "xe=\"" + hostparm.ThisHostpluginmythgameXe + "\"\n"; myfile << divider ; //other myfile << "dvdcss=\"" + hostparm.ThisHostpluginmythvideo_dvdcss + "\"\n"; myfile << "mythappletrailers=\"" + hostparm.ThisHostpluginmythappletrailers + "\"\n"; myfile << "webonlinhes=\"" + hostparm.ThisHostwebonlinhes + "\"\n"; myfile << "kodi=\"" + hostparm.ThisHostXBMC + "\"\n"; myfile << "plexhometheater=\"" + hostparm.ThisHostPLEXHT + "\"\n"; myfile << "plexmediaserver=\"" + hostparm.ThisHostPLEXMS + "\"\n"; myfile << "foldingathome=\"" + hostparm.ThisHostfoldingathome + "\"\n"; myfile << "foldingusername=\"" + hostparm.ThisHostfoldingusername + "\"\n"; myfile << "foldingworksize=\"" + hostparm.ThisHostfoldingworksize + "\"\n"; myfile << "webmin=\"" + hostparm.ThisHostwebmin + "\"\n"; systemheader="\n# ddns settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "DDnslogin=\"" + hostparm.ThisHostDDnslogin + "\"\n"; myfile << "DDnspassword=\"" + hostparm.ThisHostDDnspassword + "\"\n"; myfile << "DDnshostname=\"" + hostparm.ThisHostDDnshostname + "\"\n"; myfile << "DDnsEnable=\"" + hostparm.ThisHostDDnsEnable + "\"\n"; systemheader="\n# screensaver settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "Screensavertype=\"" + hostparm.ThisHostscreensavertype + "\"\n"; myfile << "Screensaveridle=\"" + hostparm.ThisHostscreensaveridle + "\"\n"; myfile << "Screensavertheme=\"" + hostparm.ThisHostscreensavertheme + "\"\n"; systemheader="\n# IR settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "Remotetype=\"" + hostparm.ThisRemote + "\"\n"; myfile << "Remotebucket=\"" + hostparm.ThisHostRemotebucket + "\"\n"; myfile << "ReceiverType=\"" + hostparm.ThisReceiverType + "\"\n"; myfile << "HDHRlirc_device=\"" + hostparm.ThisHDHRlirc_device + "\"\n"; myfile << "HostLircWait=\"" + hostparm.ThisHostLircWait + "\"\n"; myfile << "ReceiverSerialport=\"" + hostparm.ThisHostSerialPortlirc + "\"\n"; myfile << "HostTransmitproto_1=\"" + hostparm.ThisHostTransmitproto_1 + "\"\n"; myfile << "HostTransmitproto_2=\"" + hostparm.ThisHostTransmitproto_2 + "\"\n"; myfile << "HostTransmitproto_3=\"" + hostparm.ThisHostTransmitproto_3 + "\"\n"; myfile << "HostTransmitproto_4=\"" + hostparm.ThisHostTransmitproto_4 + "\"\n"; myfile << "HostTransmitDelay_1=\"" + hostparm.ThisHostTransmitDelay_1 + "\"\n"; myfile << "HostTransmitDelay_2=\"" + hostparm.ThisHostTransmitDelay_2 + "\"\n"; myfile << "HostTransmitDelay_3=\"" + hostparm.ThisHostTransmitDelay_3 + "\"\n"; myfile << "HostTransmitDelay_4=\"" + hostparm.ThisHostTransmitDelay_4 + "\"\n"; // myfile << "HostTransmitSend_after_1=\"" + hostparm.ThisHostTransmitSend_after_1 + "\"\n"; // myfile << "HostTransmitSend_after_2=\"" + hostparm.ThisHostTransmitSend_after_2 + "\"\n"; // myfile << "HostTransmitSend_after_3=\"" + hostparm.ThisHostTransmitSend_after_3 + "\"\n"; // myfile << "HostTransmitSend_after_4=\"" + hostparm.ThisHostTransmitSend_after_4 + "\"\n"; myfile << "HostBlasterType=\"" + hostparm.ThisHostBlasterType + "\"\n"; myfile << "HostSerialPort_blasterlirc=\"" + hostparm.ThisHostSerialPort_blasterlirc + "\"\n"; myfile << "Hostnumblaster=\"" + hostparm.ThisHostnumblaster + "\"\n"; myfile << "LCDtype=\"" + hostparm.ThisHostLCDType + "\"\n"; systemheader="\n# user settings\n" ; myfile << systemheader ; myfile << divider ; myfile << "rootSSH=\"" + hostparm.ThisHOSTrootSSH + "\"\n"; systemheader="\n# Supplemental\n" ; myfile << systemheader ; myfile << divider ; myfile << "supplemental=\"" + hostparm.ThisHostSupplemental + "\"\n"; myfile << "windowmanager=\"" + hostparm.ThisHostWindowManager + "\"\n"; myfile << "EnhancedWMStyle=\"" + hostparm.ThisHostEnhancedWMStyle + "\"\n"; systemheader="\n# VNC\n" ; myfile << systemheader ; myfile << divider ; myfile << "vncenable=\"" + hostparm.ThisHostVNCEnable + "\"\n"; myfile << "vncpassword=\"" + hostparm.ThisHostVNCpassword + "\"\n"; myfile << "xvncenable=\"" + hostparm.ThisHostXVNCEnable + "\"\n"; myfile << "xvncpassword=\"" + hostparm.ThisHostXVNCpassword + "\"\n"; systemheader= "\n# webuser \n" ; myfile << systemheader ; myfile << divider ; myfile << "UseMythWEB_auth=\"" + hostparm.ThisHostwebauth + "\"\n"; f.close(); } MythInstallSettings::MythInstallSettings() : GroupSetting() { // VerticalConfigurationGroup* vcg = new VerticalConfigurationGroup(false,false,true,true); // VerticalConfigurationGroup* denied = new VerticalConfigurationGroup(false,false,true,true); // TransLabelSetting *deniedlabel = new TransLabelSetting(); // deniedlabel->setValue(" Access to these settings is disabled.\n Access can be enabled in Access Settings." ); // denied->addChild(deniedlabel); if ( displaymysqlonly ) { //vcg->setLabel(QObject::tr("Run MythFrontend Settings")); //vcg->addChild(HostMysqlserverip_listbox()); //vcg->addChild(ThemePainter()); //addChild(vcg); } else { // This is needed to stop default=interface from being wiped every time if ( gCoreContext->GetSetting("HostDefaulteth0") == "1" ) hostparm.ThisHostDefaultInterface = "eth0"; else if ( gCoreContext->GetSetting("HostDefaulteth1") == "1" ) hostparm.ThisHostDefaultInterface = "eth1"; else if ( gCoreContext->GetSetting("HostDefaultwlan0") == "1" ) hostparm.ThisHostDefaultInterface = "wlan0"; else if ( gCoreContext->GetSetting("HostDefaultwlan1") == "1" ) hostparm.ThisHostDefaultInterface = "wlan1"; else if ( gCoreContext->GetSetting("HostActiveonbooteth0") == "1" ) hostparm.ThisHostDefaultInterface = "eth0"; else if ( gCoreContext->GetSetting("HostActiveonbooteth1") == "1" ) hostparm.ThisHostDefaultInterface = "eth1"; else if ( gCoreContext->GetSetting("HostActiveonbootwlan0") == "1" ) hostparm.ThisHostDefaultInterface = "wlan0"; else if ( gCoreContext->GetSetting("HostActiveonbootwlan1") == "1" ) hostparm.ThisHostDefaultInterface = "wlan1"; else if ( gCoreContext->GetSetting("HostActiveonbootath0") == "1" ) hostparm.ThisHostDefaultInterface = "ath0"; else hostparm.ThisHostDefaultInterface = "eth0"; //vcg->setLabel(QObject::tr("Host Settings")); // Check to see if screen should appear if ( displayshownetwork ) { //Check to see if screen is allowed to appear if ( ((gCoreContext->GetSetting("Hostaccessnetwork")) == "0" ) ) { //denied ->setLabel(QObject::tr("Network Settings")); //addChild(denied); } else { hostparm.ThisHostnetOLD = gCoreContext->GetSetting("HostNetDevice"); QString s = "HostActiveonboot"; s+=hostparm.ThisHostnetOLD; hostparm.ThisHostnetActiveOLD = gCoreContext->GetSetting(s); MSqlQuery query(MSqlQuery::InitCon()); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTNetDevice'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); if ( gCoreContext->GetSetting("HostDefaulteth0") == "1" ) hostparm.ThisHostDefaultInterface = "eth0"; else if ( gCoreContext->GetSetting("HostDefaulteth1") == "1" ) hostparm.ThisHostDefaultInterface = "eth1"; else if ( gCoreContext->GetSetting("HostDefaultwlan0") == "1" ) hostparm.ThisHostDefaultInterface = "wlan0"; else if ( gCoreContext->GetSetting("HostDefaultwlan1") == "1" ) hostparm.ThisHostDefaultInterface = "wlan1"; else if ( gCoreContext->GetSetting("HostActiveonbooteth0") == "1" ) hostparm.ThisHostDefaultInterface = "eth0"; else if ( gCoreContext->GetSetting("HostActiveonbooteth1") == "1" ) hostparm.ThisHostDefaultInterface = "eth1"; else if ( gCoreContext->GetSetting("HostActiveonbootwlan0") == "1" ) hostparm.ThisHostDefaultInterface = "wlan0"; else if ( gCoreContext->GetSetting("HostActiveonbootwlan1") == "1" ) hostparm.ThisHostDefaultInterface = "wlan1"; else if ( gCoreContext->GetSetting("HostActiveonbootath0") == "1" ) hostparm.ThisHostDefaultInterface = "ath0"; else hostparm.ThisHostDefaultInterface = "eth0"; NetworkOptionsFrame *networkoptionsframe = new NetworkOptionsFrame(); NetworkSettingsFrame *netsettingsframe = new NetworkSettingsFrame(); // addChild(netsettingsframe); // addChild(networkoptionsframe); }; } if ( displayshowhostype ) { if ( ((gCoreContext->GetSetting("Hostaccesshostype")) =="0" )) { //denied ->setLabel(QObject::tr("Host Settings")); //addChild(denied); } else { SystemtypeGroup *systemtypegroup = new SystemtypeGroup(); //vcg->addChild(systemtypegroup); //addChild(vcg); } } if ( displayremotesonly ) { if ( ((gCoreContext->GetSetting("Hostaccessir")) =="0" )) { //denied ->setLabel(QObject::tr("Remotes Settings")); //addChild(denied); } else { IRFrame *irframe = new IRFrame(); // addChild(irframe); } } if ( displayshowadvancedX ) { if ( ((gCoreContext->GetSetting("HostaccessadvancedX")) == "0" )) { //denied ->setLabel(QObject::tr("Display Settings")); //addChild(denied); } else { AdvancedXSettings *advancedXsettings = new AdvancedXSettings(); // addChild(advancedXsettings); } } if ( displayvnc ) { if ( ((gCoreContext->GetSetting("Hostaccessvnc")) == "0" )) { //denied ->setLabel(QObject::tr("VNC Settings")); //addChild(denied); } else { //VNChostsettings* vnchostsettings= new VNChostsettings(); //addChild(vnchostsettings); MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "vncsettings", new VNChostsettings()); if (ssd->Create()) { mainStack->AddScreen(ssd); settingsWait(); // Block by running an event loop until last screen is removed //QEventLoop block; //QObject::connect(mainStack, &MythScreenStack::topScreenChanged, // &block, [&](MythScreenType* screen) //{ if (!screen) block.quit(); }); // block.exec(); } else delete ssd; } } if ( displayfileshare ) { if ( ((gCoreContext->GetSetting("Hostaccessfileshare")) == "0" )) { //denied ->setLabel(QObject::tr("File Sharing Settings")); //addChild(denied); } else { FileShareMainFrameClient *nfsclient = new FileShareMainFrameClient(); // addChild(nfsclient); FileShareMainFrameServer *fileserver = new FileShareMainFrameServer(); // addChild(fileserver); } } if ( displayshowmisc ) { if ( ((gCoreContext->GetSetting("Hostaccessmisc")) == "0" )) { //denied ->setLabel(QObject::tr("Miscellanous")); //addChild(denied); } else { MiscMainFrame *miscsettings = new MiscMainFrame(); // MiscMainFrame2 *miscsettings2 = new MiscMainFrame2(); // addChild(miscsettings); // addChild(miscsettings2); } } if ( displaysupplemental ) { //JM VERBOSE(VB_IMPORTANT, "screensaver"); Supplementalhostsettings *supplemental = new Supplementalhostsettings(); // addChild(supplemental); } if ( displayshowshutdown ) { if ( ((gCoreContext->GetSetting("Hostaccesssleep")) == "0" )) { //denied ->setLabel(QObject::tr("Shutdown Settings")); //addChild(denied); } else { // WakeSettings *wakesettings = new WakeSettings(); // addChild(wakesettings); } } if ( displayshowadvanced ) { if ( ((gCoreContext->GetSetting("Hostaccessadvanced")) == "0" ) ) { //denied ->setLabel(QObject::tr("Advanced Settings")); //addChild(denied); } else { AdvancedSettings *advancedsettings = new AdvancedSettings(); AdvancedSettings_2 *advancedsettings_2 = new AdvancedSettings_2(); // addChild(advancedsettings); // addChild(advancedsettings_2); } } if ( displayshowsound ) { if ( ((gCoreContext->GetSetting("Hostaccesssound")) =="0") ) { //denied ->setLabel(QObject::tr("Audio Settings")); //addChild(denied); } else { //remove old sound card setting from the db. This is useful for when the saved setting is no longer valid for this machine. // Later search the list and set the value to the old setting if found in the dropdown. hostparm.OLDHostSoundOSSAll = gCoreContext->GetSetting("HostSoundOssAll"); hostparm.OLDHostSoundALSAAll = gCoreContext->GetSetting("HostSoundALSAAll"); MSqlQuery query(MSqlQuery::InitCon()); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundOssAll'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundOssAnalog'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundOssDigital'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundALSAAll'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundALSAAnalog'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundALSADigital'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundALSATypeout'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); query.prepare( "delete from settings where hostname=:HOSTNAME and value = 'HOSTSoundTypeout'; " ); query.bindValue( ":HOSTNAME" , gCoreContext->GetHostName() ); query.exec(); SoundSettings *soundsettings = new SoundSettings(); // addChild(soundsettings); } } if ( displayaccesscontrol ) { // VerticalConfigurationGroup* accessettings = // new VerticalConfigurationGroup(false,true,false,false); // ConfigurationGroup *GridAccess = // new GridConfigurationGroup(2,false,false,false,false); addChild(Hostaccessadvanced()); addChild(Hostaccesssound()); addChild(HostaccessadvancedX()); addChild(Hostaccessddns()); addChild(Hostaccessfileshare()); addChild(Hostaccessmisc()); addChild(Hostaccessnetwork()); addChild(Hostaccessplugins()); addChild(Hostaccessir()); // addChild(Hostaccessscreensaver()); //screensaver addChild(Hostaccessvnc()); addChild(Hostaccesssleep()); // GridAccess->addChild(Hostaccessuser()); addChild(Hostaccesswebuser()); // accessettings->addChild(Hostaccessnetwork()); // addChild(new ACCESShostsettings); // addChild(GridAccess); // accessettings ->setLabel(QObject::tr("Access Settings")); // addChild(accessettings); } if ( displayplugins ) { if ( ((gCoreContext->GetSetting("Hostaccessplugins")) == "0" )) { //denied ->setLabel(QObject::tr("Programs")); //addChild(denied); } else { // ConfigurationGroup *GridShowPlugin = new GridConfigurationGroup(2,false); setLabel(QObject::tr("Programs (1/4)")); addChild(Hostpluginmytharchive()); addChild(Hostpluginmythbrowser()); addChild(Hostpluginmythnetvision()); addChild(Hostpluginmythgallery()); //ConfigurationGroup *GridShowPlugin2 = new GridConfigurationGroup(2); addChild(Hostpluginmythmusic()); addChild(Hostpluginmythnews()); addChild(Hostpluginmythweather()); addChild(Hostpluginmythzoneminder()); //ConfigurationGroup *GridShowPlugin3 = new VerticalConfigurationGroup(false,true); setLabel(QObject::tr("Programs (2/4)")); addChild(new MythGamesettings); addChild(Hostpluginmythvideo_dvdcss()); // addChild(GridShowPlugin); // addChild(GridShowPlugin2); // addChild(GridShowPlugin3); } } if ( displaysoftware ) { if ( ((gCoreContext->GetSetting("Hostaccessplugins")) == "0" )) { //denied ->setLabel(QObject::tr("Programs")); //addChild(denied); } else { //ConfigurationGroup *GridShowPlugin4 = new GridConfigurationGroup(2,false); setLabel(QObject::tr("Programs (3/4)")); addChild(Hostpluginmythappletrailers()); addChild(HostPLEXHT()); addChild(HostPLEXMS()); addChild(Hostwebmin()); addChild(Hostwebonlinhes()); addChild(HostXBMC()); //ConfigurationGroup *GridShowPlugin5 = new GridConfigurationGroup(2); //ConfigurationGroup *GridShowPlugin6 = new VerticalConfigurationGroup(false,true); //GridShowPlugin6->setLabel(QObject::tr("Programs (4/4)")); //addChild(Hostfoldingathome()); //addChild(Hostfoldingusername()); //addChild(Hostfoldingworksize()); // addChild(GridShowPlugin4); //addChild(GridShowPlugin5); // addChild(GridShowPlugin6); } } if ( displayuser ) { if ( ((gCoreContext->GetSetting("Hostaccessuser")) == "0" )) { //denied ->setLabel(QObject::tr("User Accounts")); //addChild(denied); } else { UserManagement *usermanagement = new UserManagement(); // addChild(usermanagement); } } if ( displaywebuser ) { if ( ((gCoreContext->GetSetting("Hostaccesswebuser")) == "0" )) { //denied ->setLabel(QObject::tr("Web Security Settings")); //addChild(denied); } else { WebPasswordFrame *webpasswordframe = new WebPasswordFrame(); // addChild(webpasswordframe); } } /* if ( displayddns ) { if ( ((gCoreContext->GetSetting("Hostaccessddns")) == "0" )) { //denied ->setLabel(QObject::tr("DDNS Settings")); //addChild(denied); } else { DDnssettings *ddnsframe = new DDnssettings(); // addChild(ddnsframe); } } */ if ( displayinfrared ) { if ( ((gCoreContext->GetSetting("Hostaccessir")) =="0" )) { //denied ->setLabel(QObject::tr("Remotes Settings")); //addChild(denied); } else { IRFrame *irframe = new IRFrame(); IR_TransmitFrame *transmitframe = new IR_TransmitFrame(); LCDFrame *lcdframe = new LCDFrame(); // addChild(irframe); // addChild(transmitframe); // addChild(lcdframe); } } if ( displayscreensaver ) { if ( ((gCoreContext->GetSetting("Hostaccessscreensaver")) =="0" )) { //denied ->setLabel(QObject::tr("Screensaver Settings")); //addChild(denied); } else { //JM VERBOSE(VB_IMPORTANT, "screensaver"); // Screensaverhostsettings *screensaver = new Screensaverhostsettings(); // addChild(screensaver); } } } };