summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp')
-rwxr-xr-xabs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp177
1 files changed, 87 insertions, 90 deletions
diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp
index 37dc7c9..04307ee 100755
--- a/abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp
+++ b/abs/core/mythinstall/MythVantage-app/mythinstall/installsettings.cpp
@@ -4,8 +4,7 @@
#include <QtNetwork>
-//Added by qt3to4:
-#include <Q3TextStream>
+#include <QTextStream>
//#include "tv.h"
#include <stdlib.h>
#include "mythprogressdialog.h"
@@ -21,7 +20,7 @@
-int timezone_unknown = FALSE;
+int timezone_unknown = false;
extern HostParms hostparm;
//extern DDCinfo ddcinfo;
@@ -141,13 +140,13 @@ QString findnet()
QFile file("/tmp/.netinfo");
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if ( line.contains("HWaddr"))
{
- QString s = line.simplifyWhiteSpace();
+ QString s = line.simplified();
s = s.section( " ", 0, 0 ); // s == "surname"
netdev+=s;
netdev+=" ";
@@ -168,13 +167,13 @@ QString findnet_wireless()
QFile file("/tmp/.netinfo_wireless");
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if ( line.contains("Nickname") || line.contains("ESSID"))
{
- QString s = line.simplifyWhiteSpace();
+ QString s = line.simplified();
s = s.section( " ", 0, 0 ); // s == "surname"
netdev+=s;
netdev+=" ";
@@ -222,7 +221,7 @@ static HostComboBox *HostNetDevice()
return gc;
};
-
+/*
static HostCheckBox *HostActiveonboot()
{
HostCheckBox *gc = new HostCheckBox("HostActiveonboot");
@@ -232,7 +231,6 @@ static HostCheckBox *HostActiveonboot()
return gc;
};
-/*
static HostCheckBox *HostServiceSamba()
{
HostCheckBox *gc = new HostCheckBox("HostServiceSamba");
@@ -292,8 +290,8 @@ static HostComboBox *HostServiceSamba_domain()
QFile file("/tmp/smbdomainlist");
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if ( line.startsWith("domain"))
@@ -307,7 +305,7 @@ static HostComboBox *HostServiceSamba_domain()
}
gc->addSelection("type_workgroup_here");
return gc;
-};*/
+};
static HostCheckBox *HostLircWait()
{
@@ -317,7 +315,7 @@ static HostCheckBox *HostLircWait()
gc->setHelpText(QObject::tr("System will wait for lirc before starting the UI "));
return gc;
};
-
+*/
static HostCheckBox *HostBEWait()
{
HostCheckBox *gc = new HostCheckBox("HostBEWait");
@@ -376,33 +374,32 @@ static HostCheckBox *HostServiceMythWEB()
return gc;
};
-// static HostCheckBox *HostServiceHobbitclient()
-// {
-// HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostServiceHobbitclient()
+{
+ HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostServiceRRD()
-// {
-// HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostServiceRRD()
+{
+ HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostUseDHCP()
{
@@ -462,8 +459,8 @@ static HostComboBox *HostMysqlserverip_listbox()
QFile file("/tmp/mysqllist");
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if ( line.startsWith(" address"))
@@ -484,7 +481,7 @@ static HostComboBox *HostMysqlserverip_listbox()
gc->setHelpText(QObject::tr("The IP address of the MasterBackend MySQL server."));
QString NETBOOT = getenv("NETBOOT");
- NETBOOT=NETBOOT.stripWhiteSpace();
+ NETBOOT=NETBOOT.trimmed();
if ( NETBOOT != "YES" )
{
if ( ((gCoreContext->GetSetting("HostaccesshostypeSystemtype")) == "0" ))
@@ -676,8 +673,8 @@ static HostComboBox *HostGScreensaverTheme()
QFile file(dirtxt);
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
gc->addSelection(line);
@@ -700,8 +697,8 @@ static HostComboBox *HostXScreensaverTheme()
QFile file(dirtxt);
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
gc->addSelection(line);
@@ -1177,7 +1174,7 @@ static HostComboBox *Hostfoldingusername()
if ((new_line = strchr (username, '\n')))
new_line[0] = 0;
- cout << "found old username " << username << endl;
+ std::cout << "found old username " << username << endl;
//FIXME??
//gCoreContext->SetSetting("Hostfoldingusername", username);
gCoreContext->SaveSetting("Hostfoldingusername", username);
@@ -2375,20 +2372,20 @@ QString NetworkOptionsFrame::find_hostname()
cmdtxt.append("bin/systemconfig.py -m dhcp_request -d " );
cmdtxt.append(hostparm.ThisHostDefaultInterface);
myth_system(cmdtxt);
- system(cmdtxt);
+ system(qPrintable(cmdtxt));
QString line;
QFile file("/tmp/mvnetwork.dhcpinfo");
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if ( line.contains("new_host_name"))
{
- QString s = line.simplifyWhiteSpace();
+ QString s = line.simplified();
s = s.section( "=", 1, 1 ); // s == "surname"
- new_host = s.simplifyWhiteSpace();
+ new_host = s.simplified();
}
}
file.close();
@@ -2420,14 +2417,14 @@ static HostCheckBox *HostAutodown()
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 *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()
{
@@ -2449,23 +2446,23 @@ static HostSpinBox *HostShutdownTime2()
-static HostCheckBox *HostUseWOL()
-{
- HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostUseWOL()
+//{
+// HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostUseNVRAM()
-{
- HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostUseNVRAM()
+//{
+// HostCheckBox *gc = new HostCheckBox("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 HostCheckBox *HostUseXLargeMouse()
@@ -2845,7 +2842,7 @@ void SoundOSSsettings::loadossdriver()
cmdtxt="sudo ";
cmdtxt.append(MV_ROOT) ;
cmdtxt.append("bin/soundconfig.sh -t LOAD -i OSS &");
- system(cmdtxt);
+ system(qPrintable(cmdtxt));
int return_code = 0;
QString msgtext = "Loading OSS driver" ;
@@ -2906,7 +2903,7 @@ void SoundALSAsettings::loadalsadriver()
cmdtxt="sudo ";
cmdtxt.append(MV_ROOT) ;
cmdtxt.append("bin/soundconfig.sh -t LOAD -i ALSA &");
- system(cmdtxt);
+ system(qPrintable(cmdtxt));
int return_code = 0;
QString msgtext = "Loading ALSA driver" ;
@@ -2975,8 +2972,8 @@ void SoundOSSsettings::fillossselection()
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if (line.contains("device index") )
@@ -2984,7 +2981,7 @@ void SoundOSSsettings::fillossselection()
legacy_device = t.readLine();
legacy_device= legacy_device.section( "/",2,2);
currentitemtext=line.section( "/" , 0 ,0 );
- simpleitem = currentitemtext.simplifyWhiteSpace();
+ simpleitem = currentitemtext.simplified();
simpleitem = simpleitem.remove ( "(" );
simpleitem = simpleitem.remove ( ")" );
simpleitem.append(" (");
@@ -3019,8 +3016,8 @@ void SoundALSAsettings::fillALSAselection()
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if (line.contains("no soundcards found..."))
@@ -3057,8 +3054,8 @@ void SoundALSAsettings::fillALSAselection()
QFile file1(currentfile);
if ( file1.open(QIODevice::ReadOnly | QIODevice::Text) )
{
- Q3TextStream t( &file1 ); // use a text stream
- while ( !t.eof() )
+ QTextStream t( &file1 ); // use a text stream
+ while ( !t.atEnd() )
{
line = t.readLine();
if (line.startsWith("iec958:") )
@@ -3100,7 +3097,7 @@ void SoundOSSsettings::soundossgathersettings(void)
QString cmdtxt;
cmdtxt=MV_ROOT ;
cmdtxt.append("bin/soundconfig.sh -t test -i OSS -d " + hostparm.ThisHostSoundDevice + "&");
- system(cmdtxt);
+ system(qPrintable(cmdtxt));
int return_code = 0;
QString msgtext = "Playing Test Audio" ;
@@ -3165,7 +3162,7 @@ void SoundALSAsettings::soundalsagathersettings(void)
QString cmdtxt;
cmdtxt=MV_ROOT ;
cmdtxt.append("bin/soundconfig.sh -t test -i ALSA -d " + hostparm.ThisHostSoundDevice + "&");
- system(cmdtxt);
+ system(qPrintable(cmdtxt));
int return_code = 0;
QString msgtext = "Playing Test Audio" ;
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
@@ -3365,7 +3362,7 @@ void pre_writesettings ()
//I don't think this is needed anymore
tz=gCoreContext->GetSetting("HostTimeZone");
if ( tz.isEmpty() || (tz == "Unknown"))
- timezone_unknown = TRUE;
+ timezone_unknown = true;
//-----------
tregion=gCoreContext->GetSetting("HostTimeZoneRegion");
@@ -3953,7 +3950,7 @@ void writesettings ()
QString divider;
QFile f( "/etc/systemconfig" );
- if( !f.open( IO_WriteOnly ) )
+ if( !f.open( QIODevice::WriteOnly | QIODevice::Text ) )
std::cout << "Failed to open file /etc/systemconfig." << std::endl;
QTextStream myfile( &f );