translation improvement
This commit is contained in:
@@ -32,8 +32,16 @@
|
||||
// args << "-c" << cmd;
|
||||
// myProcess->start("/bin/sh", args);
|
||||
//}
|
||||
host NetworkManager::getLocalHost()
|
||||
{
|
||||
return JsonObject::Instance()->getServer(JsonObject::LOCAL);
|
||||
}
|
||||
|
||||
|
||||
bool NetworkManager::setLocalHost(const host& h)
|
||||
{
|
||||
JsonObject::Instance()->setServer(JsonObject::LOCAL, h);
|
||||
return true;
|
||||
}
|
||||
QString NetworkManager::interfaceName()
|
||||
{
|
||||
return JsonObject::Instance()->interfaceName();
|
||||
@@ -67,7 +75,7 @@ bool NetworkManager::restart(QString& err_info)
|
||||
QProcess* myProcess = new QProcess;
|
||||
QString inface = JsonObject::Instance()->interfaceName();
|
||||
QString pwd = JsonObject::Instance()->passWord();
|
||||
QString cmd = QString("echo %1 | sudo -S rcnetwork restart %2").arg(pwd).arg(inface);
|
||||
QString cmd = QString("echo %1 | sudo -S rcnetwork restart %2").arg(pwd).arg(inface);
|
||||
QStringList args;
|
||||
args << "-c" << cmd;
|
||||
connect(myProcess, SIGNAL(finished(int)), myProcess, SLOT(deleteLater()));
|
||||
@@ -206,12 +214,12 @@ bool NetworkManager::setDefaultGateway(const QString& gw, QString& err_info)
|
||||
|
||||
}
|
||||
|
||||
bool NetworkManager::checkPassWord(const QString &pwd,QString& err_info)
|
||||
bool NetworkManager::checkPassWord(const QString& pwd, QString& err_info)
|
||||
{
|
||||
|
||||
QProcess* myProcess = new QProcess;
|
||||
//QString pwd = JsonObject::Instance()->passWord();
|
||||
QString cmd = QString("echo %1 | sudo -S -k whoami").arg(pwd);
|
||||
//QString pwd = JsonObject::Instance()->passWord();
|
||||
QString cmd = QString("echo %1 | sudo -S -k whoami").arg(pwd);
|
||||
QStringList args;
|
||||
args << "-c" << cmd;
|
||||
connect(myProcess, SIGNAL(finished(int)), myProcess, SLOT(deleteLater()));
|
||||
|
||||
Reference in New Issue
Block a user