merge branch into master
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
class TopBarWidget :public QWidget{
|
||||
Q_OBJECT
|
||||
public :
|
||||
explicit TopBarWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "RollingMessageWidget.h"
|
||||
#include <QLabel>
|
||||
#include <QThread>
|
||||
#include <qDebug>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
const int ROLL_DISTANCE = 32;
|
||||
|
||||
@@ -206,6 +206,32 @@ bool NetworkManager::setDefaultGateway(const QString& gw, 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);
|
||||
QStringList args;
|
||||
args << "-c" << cmd;
|
||||
connect(myProcess, SIGNAL(finished(int)), myProcess, SLOT(deleteLater()));
|
||||
//qDebug()<<args;
|
||||
myProcess->start("/bin/sh", args);
|
||||
if (!myProcess->waitForFinished()) {
|
||||
err_info.append("failed...\n");
|
||||
return false;
|
||||
}
|
||||
if (myProcess->exitCode() == 0) {
|
||||
err_info.append("success...\n");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
err_info.append(myProcess->readAllStandardError());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool NetworkManager::setIpRouteList(const QList<QStringList>& list, QString& err_info)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
static QList<QStringList> getIpRouteList();
|
||||
|
||||
//static void setInterfaceName(const QString& name);
|
||||
static bool checkPassWord(const QString &pwd,QString& err_info);
|
||||
static bool restart(QString& err_info);
|
||||
static bool setJsonDHCP(bool enable);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "GUIErrorLE.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include <qDebug>
|
||||
#include <QDebug>
|
||||
#include <QApplication>
|
||||
|
||||
void GUIErrorLE::parse(const QString &errorMsg) {
|
||||
|
||||
@@ -326,6 +326,8 @@ QString JsonObject::interfaceName()
|
||||
|
||||
QString JsonObject::passWord()
|
||||
{
|
||||
if (!loadcfg())
|
||||
return QString("");
|
||||
return tmp_psw;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<location filename="../AdminSettingForm.cpp" line="30"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="69"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="77"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="80"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="84"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
@@ -360,7 +360,7 @@
|
||||
<context>
|
||||
<name>GetAdminPsw</name>
|
||||
<message>
|
||||
<location filename="../network/getadminpsw.cpp" line="15"/>
|
||||
<location filename="../network/getadminpsw.cpp" line="16"/>
|
||||
<source>Admin Password</source>
|
||||
<translation>管理员密码</translation>
|
||||
</message>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<location filename="../AdminSettingForm.cpp" line="30"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="69"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="77"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="80"/>
|
||||
<location filename="../AdminSettingForm.cpp" line="84"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
@@ -360,7 +360,7 @@
|
||||
<context>
|
||||
<name>GetAdminPsw</name>
|
||||
<message>
|
||||
<location filename="../network/getadminpsw.cpp" line="15"/>
|
||||
<location filename="../network/getadminpsw.cpp" line="16"/>
|
||||
<source>Admin Password</source>
|
||||
<translation>管理员密码</translation>
|
||||
</message>
|
||||
|
||||
Reference in New Issue
Block a user