commit before modify
This commit is contained in:
@@ -28,7 +28,7 @@ source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${project_cxx})
|
|||||||
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${project_cc})
|
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${project_cc})
|
||||||
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${project_c})
|
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${project_c})
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Core Widgets Gui OpenGL Sql VirtualKeyboard REQUIRED)
|
find_package(Qt5 COMPONENTS Core Widgets Gui OpenGL Sql VirtualKeyboard Network REQUIRED)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
file(GLOB project_uis ./src/*.ui)
|
file(GLOB project_uis ./src/*.ui)
|
||||||
@@ -40,9 +40,9 @@ file(GLOB project_res ./src/*.qrc)
|
|||||||
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} )
|
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES} )
|
||||||
if(UNIX AND USE_SHIMLIB)
|
if(UNIX AND USE_SHIMLIB)
|
||||||
link_directories(/usr/local/lib64)
|
link_directories(/usr/local/lib64)
|
||||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network pthread usct_shim dmapi log4c cunit ctomat hdf5 matio m)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard)
|
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql Qt5::VirtualKeyboard Qt5::Network)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#ifndef GUI_ADMINSETTINGFORM_H
|
#ifndef GUI_ADMINSETTINGFORM_H
|
||||||
#define GUI_ADMINSETTINGFORM_H
|
#define GUI_ADMINSETTINGFORM_H
|
||||||
|
|
||||||
#include "TabFormWidget.h"
|
#include "tabformwidget.h"
|
||||||
|
|
||||||
class AdminSettingForm:public TabFormWidget {
|
class AdminSettingForm:public TabFormWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "guimacros.h"
|
#include "guimacros.h"
|
||||||
#include "event/EventCenter.h"
|
#include "event/EventCenter.h"
|
||||||
#include "AccountFormDialog.h"
|
#include "AccountFormDialog.h"
|
||||||
#include <qDebug>
|
#include <QDebug>
|
||||||
#include "log/UserOperationLog.h"
|
#include "log/UserOperationLog.h"
|
||||||
|
|
||||||
#define ADD_CENTER_ITEM(row,col,text)\
|
#define ADD_CENTER_ITEM(row,col,text)\
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma execution_character_set("utf-8")
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
#include "imageswitch.h"
|
#include "imageswitch.h"
|
||||||
#include "qpainter.h"
|
#include "qpainter.h"
|
||||||
@@ -19,6 +19,7 @@ void ImageSwitch::mousePressEvent(QMouseEvent*)
|
|||||||
imgFile = isChecked ? imgOffFile : imgOnFile;
|
imgFile = isChecked ? imgOffFile : imgOnFile;
|
||||||
isChecked = !isChecked;
|
isChecked = !isChecked;
|
||||||
this->update();
|
this->update();
|
||||||
|
emit clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageSwitch::paintEvent(QPaintEvent*)
|
void ImageSwitch::paintEvent(QPaintEvent*)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#ifndef IMAGESWITCH_H
|
#ifndef IMAGESWITCH_H
|
||||||
#define IMAGESWITCH_H
|
#define IMAGESWITCH_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,7 +48,8 @@ public:
|
|||||||
ButtonStyle getButtonStyle() const;
|
ButtonStyle getButtonStyle() const;
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSize minimumSizeHint() const;
|
QSize minimumSizeHint() const;
|
||||||
|
signals:
|
||||||
|
void clicked();
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
//设置是否选中
|
//设置是否选中
|
||||||
void setChecked(bool isChecked);
|
void setChecked(bool isChecked);
|
||||||
|
|||||||
@@ -291,11 +291,20 @@ void JsonObject::setServer(ServerType type, const host& list)
|
|||||||
localhost JsonObject::getLocalHost()
|
localhost JsonObject::getLocalHost()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
localhost lhost;
|
localhost lhost;
|
||||||
|
//lhost.ip = IPConfig::getDeviceIP();
|
||||||
lhost.ip = QString(getJsonString("localhost", "ip"));
|
lhost.ip = QString(getJsonString("localhost", "ip"));
|
||||||
lhost.mask = QString(getJsonString("localhost", "mask"));
|
lhost.mask = QString(getJsonString("localhost", "mask"));
|
||||||
lhost.gateway = QString(getJsonString("localhost", "gateway"));
|
lhost.gateway = QString(getJsonString("localhost", "gateway"));
|
||||||
return lhost;
|
return lhost;
|
||||||
|
|
||||||
|
|
||||||
|
// localhost lhost;
|
||||||
|
// lhost.ip = QString(getJsonString("localhost", "ip"));
|
||||||
|
// lhost.mask = QString(getJsonString("localhost", "mask"));
|
||||||
|
// lhost.gateway = QString(getJsonString("localhost", "gateway"));
|
||||||
|
// return lhost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define JSONOBJECT_H
|
#define JSONOBJECT_H
|
||||||
|
|
||||||
//#include <QObject>
|
//#include <QObject>
|
||||||
|
#include <QString>
|
||||||
class QStringList;
|
class QStringList;
|
||||||
class QTranslator;
|
class QTranslator;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QTextStream>
|
#include <QtCore/QTextStream>
|
||||||
#include "LogFileTableModel.h"
|
#include "LogFileTableModel.h"
|
||||||
#include <qDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
LogFileTableModel::LogFileTableModel(QObject *parent) : QAbstractTableModel(parent) {
|
LogFileTableModel::LogFileTableModel(QObject *parent) : QAbstractTableModel(parent) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,10 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include "json/jsonobject.h"
|
#include "json/jsonobject.h"
|
||||||
#include "SelectDialog.h"
|
#include "SelectDialog.h"
|
||||||
#include "components/ImageSwitch.h"
|
#include "components/imageswitch.h"
|
||||||
#include "components/ipaddress.h"
|
#include "components/ipaddress.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
|
||||||
systemSettingForm::systemSettingForm(QWidget* parent) : QWidget(parent)
|
systemSettingForm::systemSettingForm(QWidget* parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
@@ -399,6 +400,13 @@ systemSettingForm::systemSettingForm(QWidget* parent) : QWidget(parent)
|
|||||||
loadServersInfo();
|
loadServersInfo();
|
||||||
|
|
||||||
//connection
|
//connection
|
||||||
|
connect(swt_verify, &ImageSwitch::clicked, [=]() {
|
||||||
|
if(swt_verify->getChecked())
|
||||||
|
{
|
||||||
|
autoDHCP();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(btnCancel, &QToolButton::clicked, [=]() {
|
connect(btnCancel, &QToolButton::clicked, [=]() {
|
||||||
loadServersInfo();
|
loadServersInfo();
|
||||||
});
|
});
|
||||||
@@ -471,7 +479,32 @@ void systemSettingForm::loadServersInfo()
|
|||||||
local_Mask->setIP(lhost.mask);
|
local_Mask->setIP(lhost.mask);
|
||||||
local_Gate->setIP(lhost.gateway);
|
local_Gate->setIP(lhost.gateway);
|
||||||
|
|
||||||
|
qIfConfig(lhost);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void systemSettingForm::qIfConfig(const localhost &lhost)
|
||||||
|
{
|
||||||
|
QProcess *myProcess = new QProcess;
|
||||||
|
//QString cmd = QString("echo %1 | sudo -S ifconfig eth0 %2 up").;
|
||||||
|
QString cmd = QString("echo %1 | sudo -S ifconfig eth0 %2 netmask %3 up; sudo -S route del default dev eth0; \
|
||||||
|
sudo -S route add default gw %4").arg("klxts4047").arg(lhost.ip).arg(lhost.mask).arg(lhost.gateway);
|
||||||
|
QStringList args;
|
||||||
|
args<<"-c"<<cmd;
|
||||||
|
myProcess->start("/bin/sh",args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void systemSettingForm::autoDHCP()
|
||||||
|
{
|
||||||
|
QProcess *myProcess = new QProcess;
|
||||||
|
//QString cmd = QString("echo %1 | sudo -S cp cfgs/ifcfg-eth0 /etc/sysconfig/network/ifcfg-eth0; sudo -S rcnetwork restart eth0").arg("klxts4047");
|
||||||
|
//we propose that the default config is DHCP
|
||||||
|
QString cmd = QString("echo %1 | sudo -S rcnetwork restart eth0").arg("klxts4047");
|
||||||
|
QStringList args;
|
||||||
|
args<<"-c"<<cmd;
|
||||||
|
myProcess->start("/bin/sh",args);
|
||||||
|
}
|
||||||
|
|
||||||
void systemSettingForm::saveServersInfo()
|
void systemSettingForm::saveServersInfo()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -508,4 +541,6 @@ void systemSettingForm::saveServersInfo()
|
|||||||
lhost.gateway = local_Gate->getIP();
|
lhost.gateway = local_Gate->getIP();
|
||||||
JsonObject::Instance()->setLocalHost(lhost);
|
JsonObject::Instance()->setLocalHost(lhost);
|
||||||
|
|
||||||
|
qIfConfig(lhost);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ class SelectDialog;
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class ImageSwitch;
|
class ImageSwitch;
|
||||||
class IPAddress;
|
class IPAddress;
|
||||||
|
class localhost;
|
||||||
class systemSettingForm : public QWidget
|
class systemSettingForm : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -26,7 +26,8 @@ private:
|
|||||||
|
|
||||||
void loadServersInfo();
|
void loadServersInfo();
|
||||||
void saveServersInfo();
|
void saveServersInfo();
|
||||||
|
void qIfConfig(const localhost &lhost);
|
||||||
|
void autoDHCP();
|
||||||
QLineEdit* pacs_Name;
|
QLineEdit* pacs_Name;
|
||||||
QLineEdit* recon_IP;
|
QLineEdit* recon_IP;
|
||||||
QLineEdit* daq_AE;
|
QLineEdit* daq_AE;
|
||||||
|
|||||||
Reference in New Issue
Block a user