620 lines
23 KiB
C++
Executable File
620 lines
23 KiB
C++
Executable File
#include "dialog.h"
|
||
#include "ui_dialog.h"
|
||
#include "heads.h"
|
||
|
||
Dialog::Dialog(QWidget *parent) :
|
||
QDialog(parent),
|
||
ui(new Ui::Dialog),
|
||
warnMsgState(false),
|
||
modeState(false)
|
||
{
|
||
ui->setupUi(this);
|
||
formInit();
|
||
mainFormInit();
|
||
mainFormP1Init();
|
||
whiteListFormP1Init();
|
||
perlMgrFormP1Init();
|
||
logMgrInit();
|
||
pcDefFormInit();
|
||
pcNetDefFormInit();
|
||
sysMgrFormInit();
|
||
ui->stackedWidget->setCurrentIndex(0);
|
||
foreach (QAbstractButton* btn, ui->widgetTop->findChildren<QAbstractButton *>()) {
|
||
btn->setChecked(btn->objectName() == ui->btnMain->objectName());
|
||
}
|
||
|
||
|
||
}
|
||
|
||
Dialog::~Dialog()
|
||
{
|
||
delete ui;
|
||
}
|
||
|
||
void Dialog::paintEvent(QPaintEvent *event)
|
||
{
|
||
Q_UNUSED(event);
|
||
|
||
QPainter painter;
|
||
painter.begin(this);
|
||
QRect rect = ui->widgetTitle->rect();
|
||
painter.drawImage(rect, QImage(":/src/header-bg.png"));
|
||
painter.end();
|
||
}
|
||
|
||
bool Dialog::eventFilter(QObject *watched, QEvent *event)
|
||
{
|
||
if(ui->btnUser == watched || this->w == watched)
|
||
{
|
||
if(QEvent::Enter == event->type())
|
||
{
|
||
if(this->w->isHidden())
|
||
{
|
||
this->w->show();
|
||
return true;
|
||
}
|
||
}
|
||
else if(QEvent::Leave == event->type())
|
||
{
|
||
if(!this->w->isHidden())
|
||
{
|
||
if(!ui->btnUser->geometry().contains(this->mapFromGlobal(QCursor::pos()))&&
|
||
!this->w->geometry().contains(this->mapFromGlobal(QCursor::pos())))
|
||
{
|
||
this->w->hide();
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else if(ui->frameWarnMsg == watched)
|
||
{
|
||
if(QEvent::MouseButtonPress == event->type())
|
||
emit this->frameWarnMsgSignal();
|
||
}
|
||
else if(ui->frameDefMode == watched)
|
||
{
|
||
if(QEvent::MouseButtonPress == event->type() && modeState == false)
|
||
{
|
||
ui->frameDefMode->setStyleSheet("QFrame#frameDefMode{border: 1px solid rgb(0,73,153);border-radius:8px;}");
|
||
ui->labDefIntr->setStyleSheet("color:rgb(0,73,153);font:14px;padding-left:13px;");
|
||
ui->labDefMode->setStyleSheet("font:15px;font-weight:bold;color:rgb(0,73,153);padding-top:12px;padding-left:12px;");
|
||
|
||
ui->frameWarnMode->setStyleSheet("QFrame#frameWarnMode{border: 1px solid rgb(220,220,220);border-radius:8px;}");
|
||
ui->labWarnModeIntr->setStyleSheet("color:rgb(220,220,220);font:14px;padding-left:13px;");
|
||
ui->labWarnMode->setStyleSheet("font:15px;font-weight:bold;color:rgb(220,220,220);padding-top:12px;padding-left:12px;");
|
||
|
||
ui->rbtnDefMode->setChecked(true);
|
||
ui->rbtnWarnMode->setChecked(false);
|
||
modeState = !modeState;
|
||
}
|
||
}
|
||
else if(ui->frameWarnMode == watched)
|
||
{
|
||
if(QEvent::MouseButtonPress == event->type() && modeState == true)
|
||
{
|
||
ui->frameDefMode->setStyleSheet("QFrame#frameDefMode{border: 1px solid rgb(220,220,220);border-radius:8px;}");
|
||
ui->labDefIntr->setStyleSheet("color:rgb(220,220,220);font:14px;padding-left:13px;");
|
||
ui->labDefMode->setStyleSheet("font:15px;font-weight:bold;color:rgb(220,220,220);padding-top:12px;padding-left:12px;");
|
||
|
||
ui->frameWarnMode->setStyleSheet("QFrame#frameWarnMode{border: 1px solid rgb(0,73,153);border-radius:8px;}");
|
||
ui->labWarnModeIntr->setStyleSheet("color:rgb(0,73,153);font:14px;padding-left:13px;");
|
||
ui->labWarnMode->setStyleSheet("font:15px;font-weight:bold;color:rgb(0,73,153);padding-top:12px;padding-left:12px;");
|
||
|
||
ui->rbtnDefMode->setChecked(false);
|
||
ui->rbtnWarnMode->setChecked(true);
|
||
modeState = !modeState;
|
||
}
|
||
}
|
||
else
|
||
return false;
|
||
|
||
return QDialog::eventFilter(watched, event);
|
||
}
|
||
|
||
void Dialog::showEvent(QShowEvent *event)
|
||
{
|
||
Q_UNUSED(event);
|
||
QPoint pos = QPoint(ui->btnUser->mapToGlobal(ui->btnUser->rect().bottomLeft()));
|
||
this->w->move(pos);
|
||
ui->frameWarnMsg->setFixedWidth(ui->frameDefMode->width());
|
||
ui->frameWarnMode->setFixedWidth(ui->frameDefMode->width());
|
||
}
|
||
|
||
void Dialog::formInit()
|
||
{
|
||
this->setWindowIcon(QIcon(":/src/icon_logo_b.png"));
|
||
this->setWindowTitle("工业主机安全卫士");
|
||
this->setWindowFlag(Qt::FramelessWindowHint);
|
||
this->setProperty("form", true);
|
||
this->setProperty("canMove", true);
|
||
ui->labIcon->setPixmap(QPixmap(":/src/icon_logo.svg").scaled(20, 20));
|
||
ui->labTitle->setText("工业主机安全卫士v2.1");
|
||
ui->btnMenu_Min->setText("一");
|
||
ui->btnMenu_Close->setText("×");
|
||
ui->btnUser->installEventFilter(this);
|
||
foreach (QAbstractButton *btn, ui->widgetTop->findChildren<QAbstractButton*>()) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_tbtnMenu_All_clicked);
|
||
}
|
||
w = new QWidget(this);
|
||
w->installEventFilter(this);
|
||
w->setFixedSize(100, 80);
|
||
this->vlyMenu = new QVBoxLayout(w);
|
||
w->hide();
|
||
pbtnChpwd = new QPushButton("修改密码", w);
|
||
pbtnunlod = new QPushButton("退出", w);
|
||
vlyMenu->addWidget(pbtnChpwd);
|
||
vlyMenu->addWidget(pbtnunlod);
|
||
this->w->setLayout(vlyMenu);
|
||
this->w->setStyleSheet("QWidget{"
|
||
"background-color: white;"
|
||
"border-radius: 5px;"
|
||
"margin: 2px;}");
|
||
pbtnunlod->setStyleSheet("QPushButton{"
|
||
"color: red;"
|
||
"border-radius: 1px;"
|
||
"background-color: white;"
|
||
"margin: 0px;}");
|
||
|
||
pbtnChpwd->setStyleSheet("QPushButton{"
|
||
"color: black;"
|
||
"border-radius: 1px;"
|
||
"background-color: white;"
|
||
"margin: 0px;}");
|
||
this->setFixedSize(955, 635);
|
||
}
|
||
|
||
void Dialog::mainFormInit()
|
||
{
|
||
ui->labWarnMsg->setText("告警信息");
|
||
ui->labWarnNum->setText("0");
|
||
ui->labWarnNumLast->setText("条");
|
||
ui->labWarnMode->setText("告警模式");
|
||
ui->labWarnModeIntr->setText("所有白名单以外的行为只\n产生警告,不阻断");
|
||
ui->labDefMode->setText("防护模式");
|
||
ui->labDefIntr->setText("所有白名单以外的行为进\n行阻断,并产生警告");
|
||
|
||
shadow_effect = new QGraphicsDropShadowEffect(ui->stackedWidget);
|
||
shadow_effect->setOffset(0, 0);
|
||
shadow_effect->setColor(QColor(38, 78, 119, 127));
|
||
shadow_effect->setBlurRadius(22);
|
||
|
||
ui->frameWarnMsg->installEventFilter(this);
|
||
ui->frameWarnMsg->setGraphicsEffect(shadow_effect);
|
||
|
||
QStringList header1, header2, header3, header4, header5;
|
||
header1<< "序号"<< "时间"<< "事件名称"<< "关联程序" << "时间说明"<< "处理结果";
|
||
header2<< "序号"<< "时间"<< "时间名称"<< "处置结果";
|
||
header3<< "序号"<< "时间"<< "事件名称"<< "事件说明"<< "处置结果";
|
||
header4<< "序号"<< "时间"<< "事件名称"<< "事件说明"<< "处置结果";
|
||
header5<< "序号"<< "时间"<< "事件名称"<< "事件说明"<< "处置结果";
|
||
ui->tablepagewidgetWarnMsgP1->setTableHeaders(header1);
|
||
ui->tablepagewidgetWarnMsgP2->setTableHeaders(header2);
|
||
ui->tablepagewidgetWarnMsgP3->setTableHeaders(header3);
|
||
ui->tablepagewidgetWarnMsgP4->setTableHeaders(header4);
|
||
ui->tablepagewidgetWarnMsgP5->setTableHeaders(header5);
|
||
|
||
ui->frameWarnMode->installEventFilter(this);
|
||
ui->frameDefMode->installEventFilter(this);
|
||
|
||
connect(this, &Dialog::frameWarnMsgSignal, this, &Dialog::on_frameWarnMsg_clicked);
|
||
connect(ui->btnExeWarn, &QPushButton::clicked, this, &Dialog::on_pbtnWarnMsgMenu_clicked);
|
||
connect(ui->btnNetDefWarn, &QPushButton::clicked, this, &Dialog::on_pbtnWarnMsgMenu_clicked);
|
||
connect(ui->btnPcDefWarn, &QPushButton::clicked, this, &Dialog::on_pbtnWarnMsgMenu_clicked);
|
||
connect(ui->btnPeripheralWarn, &QPushButton::clicked, this, &Dialog::on_pbtnWarnMsgMenu_clicked);
|
||
connect(ui->btnSysWarn, &QPushButton::clicked, this, &Dialog::on_pbtnWarnMsgMenu_clicked);
|
||
}
|
||
|
||
void Dialog::mainFormP1Init()
|
||
{
|
||
ui->stackedWidgetMain->setCurrentIndex(0);
|
||
ui->labHostTitle->setText("DESKTOP-MNNGSWX");
|
||
}
|
||
|
||
void Dialog::whiteListFormP1Init()
|
||
{
|
||
//page1
|
||
ui->btnRm->setEnabled(false);
|
||
ui->btnChoiseAll->setEnabled(false);
|
||
QStringList header1;
|
||
header1<< "序号"<< "文件名"<< "文件类型"<< "路径";
|
||
ui->tablepagewidgetWhiteList->setTableHeaders(header1);
|
||
|
||
//page2
|
||
ui->btnRmTrustFiles->setEnabled(false);
|
||
ui->btnChoiseAllTrustFiles->setEnabled(false);
|
||
QStringList header2;
|
||
header2<< "序号"<< "路径";
|
||
ui->tablepagewidgetTrustFiles->setTableHeaders(header2);
|
||
|
||
foreach (QAbstractButton* btn, ui->frameWhiteListMenu->findChildren<QAbstractButton *>()) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnWhiteList_clicked);
|
||
}
|
||
ui->btnExeWhiteList->setChecked(true);
|
||
ui->stackedWidgetWhiteList->setCurrentIndex(0);
|
||
}
|
||
|
||
void Dialog::perlMgrFormP1Init()
|
||
{
|
||
//page1
|
||
this->m_udiskGroup = new QButtonGroup(this);
|
||
this->m_usbcdGroup = new QButtonGroup(this);
|
||
this->m_wlanGroup = new QButtonGroup(this);
|
||
m_udiskGroup->addButton(ui->rbtnUdiskdis);
|
||
m_udiskGroup->addButton(ui->rbtnUdiskr);
|
||
m_udiskGroup->addButton(ui->rbtnUdiskrw);
|
||
|
||
m_wlanGroup->addButton(ui->rbtnWlandis);
|
||
m_wlanGroup->addButton(ui->rbtnWlanen);
|
||
|
||
m_usbcdGroup->addButton(ui->rbtnCDdis);
|
||
m_usbcdGroup->addButton(ui->rbtnCDen);
|
||
|
||
|
||
//page2
|
||
ui->btnRmUdisk->setEnabled(false);
|
||
foreach (QAbstractButton* btn, ui->framePerlMgr->findChildren<QAbstractButton *>()) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnPeripheral_clicked);
|
||
}
|
||
ui->btnPerlManager->setChecked(true);
|
||
ui->stackedWidgetPerlMgr->setCurrentIndex(0);
|
||
QStringList header2;
|
||
header2<< "序号"<< "U盘名称"<< "设备名称"<< "品牌"<< "序列号";
|
||
ui->tablepagewidgetUdiskWhiteList->setTableHeaders(header2);
|
||
}
|
||
|
||
void Dialog::logMgrInit()
|
||
{
|
||
QStringList header1, header2, header3, header4, header5, header6;
|
||
header1<< "序号"<< "时间"<< "事件名称"<< "关联程序"<< "事件说明";
|
||
header2<< "序号"<< "时间"<< "事件名称";
|
||
header3<< "序号"<< "时间"<< "事件名称"<< "事件说明"<< "处置结果";
|
||
ui->tablepagewidgetLogMgr1->setTableHeaders(header1);
|
||
ui->tablepagewidgetLogMgr2->setTableHeaders(header2);
|
||
ui->tablepagewidgetLogMgr3->setTableHeaders(header3);
|
||
ui->tablepagewidgetLogMgr4->setTableHeaders(header3);
|
||
ui->tablepagewidgetLogMgr5->setTableHeaders(header3);
|
||
ui->tablepagewidgetLogMgr6->setTableHeaders(header3);
|
||
|
||
foreach (QAbstractButton* btn, ui->page_20->findChildren<QAbstractButton *>()) {
|
||
if(btn->text() == "查询" || btn->text() == "导出")
|
||
continue;
|
||
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnLogMgrMenu_clicked);
|
||
}
|
||
|
||
}
|
||
|
||
void Dialog::pcDefFormInit()
|
||
{
|
||
//page1
|
||
ui->btnPcDefRm->setEnabled(false);
|
||
ui->btnPcDefChoiseAll->setEnabled(false);
|
||
QStringList header1;
|
||
header1<< "序号"<< "注册表路径";
|
||
ui->tablepagewidgetPcDef->setTableHeaders(header1);
|
||
|
||
//page2
|
||
ui->btnPcDefChoiseAllFile->setEnabled(false);
|
||
ui->btnPcDefRmFilePath->setEnabled(false);
|
||
QStringList header2;
|
||
header2<< "序号"<< "文件路径";
|
||
ui->tablepagewidgetPcDefFile->setTableHeaders(header2);
|
||
|
||
foreach (QAbstractButton* btn, ui->framePcDef->findChildren<QAbstractButton *>()) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnPcDefense_clicked);
|
||
}
|
||
ui->btnRegisterProtect->setChecked(true);
|
||
ui->stackedWidgetPcDef->setCurrentIndex(0);
|
||
|
||
//page3
|
||
ui->sbtnDiskProtect->setBgColorOn(QColor(0,73,153));
|
||
QStringList header3;
|
||
header3<< "账号ID"<< "账号名"<< "账户类型"<< "账户状态"<< "操作";
|
||
ui->tablepagewidgetSysUser->setTableHeaders(header3);
|
||
|
||
//page4
|
||
ui->sbtnDoubleLog->setBgColorOn(QColor(0,73,153));
|
||
QStringList header4;
|
||
header4<< "序号"<< "账号名称"<< "用户名称"<< "绑定状态"<< "操作";
|
||
ui->tablepagewidgetDoubleLog->setTableHeaders(header4);
|
||
}
|
||
|
||
void Dialog::pcNetDefFormInit()
|
||
{
|
||
//page1
|
||
ui->sbtnDefCC->setBgColorOn(QColor(0,73,153));
|
||
ui->sbtnDefSYN->setBgColorOn(QColor(0,73,153));
|
||
//page 2
|
||
ui->sbtnWinDefwell->setBgColorOn(QColor(72, 103, 149));
|
||
ui->btnPcDefRmRules->setEnabled(false);
|
||
ui->btnChoiseAllRules->setEnabled(false);
|
||
ui->sbtnWinDefwell->setBgColorOn(QColor(0,73,153));
|
||
QStringList header2;
|
||
header2<< "规则名称"<< "规则类型"<< "协议类型"<< "操作方式"<< "规则方向"<< "操作";
|
||
ui->tablepagewidgetUnlawConnect->setTableHeaders(header2);
|
||
|
||
//page3
|
||
ui->btnRmUnlawList->setEnabled(false);
|
||
ui->btnChoiseAllUnlawPath->setEnabled(false);
|
||
QStringList header3;
|
||
header3<< "序号"<< "规则名称"<< "非法地址"<< "备注";
|
||
ui->tablepagewidgetUnlawConnect->setTableHeaders(header3);
|
||
|
||
|
||
}
|
||
|
||
|
||
void Dialog::sysMgrFormInit()
|
||
{
|
||
//page1
|
||
connect(ui->btnExeList, &QPushButton::clicked, this, &Dialog::on_pbtnSysMgr_clicked);
|
||
connect(ui->btnPcMsg, &QPushButton::clicked, this, &Dialog::on_pbtnSysMgr_clicked);
|
||
//page2
|
||
ui->wavechartCPU->setPointColor(QColor(194,217,255));
|
||
ui->wavechartCPU->setTitle("CPU利用率");
|
||
ui->wavechartCPU->setMaxValue(100);
|
||
ui->wavechartCPU->setBgColorStart(QColor(255,255,255));
|
||
ui->wavechartCPU->setBgColorEnd(QColor(255,255,255));
|
||
ui->wavechartCPU->setTextColor(QColor(200,200,200));
|
||
ui->wavechartCPU->setXStep(10);
|
||
|
||
|
||
ui->wavechartMemory->setPointColor(QColor(194,217,255));
|
||
ui->wavechartMemory->setTitle("内存占用");
|
||
ui->wavechartMemory->setMaxValue(100);
|
||
ui->wavechartMemory->setBgColorStart(QColor(255,255,255));
|
||
ui->wavechartMemory->setBgColorEnd(QColor(255,255,255));
|
||
ui->wavechartMemory->setTextColor(QColor(200,200,200));
|
||
ui->wavechartMemory->setXStep(10);
|
||
|
||
|
||
ui->wavechartDisk->setPointColor(QColor(194,217,255));
|
||
ui->wavechartDisk->setTitle("磁盘使用");
|
||
ui->wavechartDisk->setMaxValue(100);
|
||
ui->wavechartDisk->setBgColorStart(QColor(255,255,255));
|
||
ui->wavechartDisk->setBgColorEnd(QColor(255,255,255));
|
||
ui->wavechartDisk->setTextColor(QColor(200,200,200));
|
||
ui->wavechartDisk->setXStep(10);
|
||
|
||
QList<QAbstractButton *> btns = ui->frameSysMgr->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, btns) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnSysManage_clicked);
|
||
}
|
||
ui->btnSysMgr->setChecked(true);
|
||
ui->stackedWidgetSysMgr->setCurrentIndex(0);
|
||
|
||
//page3
|
||
QStringList header3;
|
||
header3<<"用户名"<< "类型"<< "操作";
|
||
ui->tablepagewidgetAddUser->setTableHeaders(header3);
|
||
|
||
//page5-1
|
||
ui->labMinPwd->setText(QString ("<font color = red>*</font>").append("密码长度最小值:"));
|
||
ui->labPwdHistory->setText(QString ("<font color = red>*</font>").append("强制密码历史:"));
|
||
ui->labPwdUseTime->setText(QString ("<font color = red>*</font>").append("密码最长使用期限:"));
|
||
ui->labLockedVal->setText(QString ("<font color = red>*</font>").append("帐户锁定阈值:"));
|
||
|
||
//page5-2
|
||
ui->btnRmUser->setEnabled(false);
|
||
|
||
foreach (QAbstractButton* btn, ui->frameNetDef->findChildren<QAbstractButton *>()) {
|
||
btn->setCheckable(true);
|
||
connect(btn, &QAbstractButton::clicked, this, &Dialog::on_pbtnNetDefense_clicked);
|
||
}
|
||
ui->btnDefAtt->setChecked(true);
|
||
ui->stackedWidgetNetDef->setCurrentIndex(0);
|
||
}
|
||
|
||
void Dialog::on_btnMenu_Min_clicked()
|
||
{
|
||
this->showMinimized();
|
||
}
|
||
|
||
void Dialog::on_btnMenu_Close_clicked()
|
||
{
|
||
close();
|
||
}
|
||
|
||
void Dialog::on_tbtnMenu_All_clicked()
|
||
{
|
||
//fd.getSerial();
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton *> tbtns = ui->widgetTop->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, tbtns) {
|
||
btn->setChecked(btn->objectName() == b->objectName());
|
||
}
|
||
if(objname == "btnMain")
|
||
ui->stackedWidget->setCurrentIndex(0);
|
||
else if(objname == "btnWhiteList")
|
||
ui->stackedWidget->setCurrentIndex(1);
|
||
else if(objname == "btnPerlMgr")
|
||
ui->stackedWidget->setCurrentIndex(2);
|
||
else if(objname == "btnLogMgr")
|
||
ui->stackedWidget->setCurrentIndex(3);
|
||
else if(objname == "btnPcDef")
|
||
ui->stackedWidget->setCurrentIndex(4);
|
||
else if(objname == "btnNetDef")
|
||
ui->stackedWidget->setCurrentIndex(5);
|
||
else if(objname == "btnSysMgr")
|
||
{
|
||
ui->stackedWidget->setCurrentIndex(6);
|
||
ui->btnSysMsg->setChecked(true);
|
||
ui->btnPcMsg->setChecked(true);
|
||
ui->stackedWidget_7->setCurrentIndex(0);
|
||
}
|
||
}
|
||
|
||
void Dialog::on_pbtnWhiteList_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton *> pbtns = ui->frameWhiteListMenu->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, pbtns) {
|
||
btn->setChecked(btn == b);
|
||
}
|
||
if(objname == "btnExeWhiteList")
|
||
ui->stackedWidgetWhiteList->setCurrentIndex(0);
|
||
else
|
||
ui->stackedWidgetWhiteList->setCurrentIndex(1);
|
||
}
|
||
|
||
void Dialog::on_pbtnPeripheral_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton *> pbtns = ui->framePerlMgr->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, pbtns) {
|
||
btn->setChecked(btn == b);
|
||
}
|
||
|
||
if(objname == "btnPerlManager")
|
||
ui->stackedWidgetPerlMgr->setCurrentIndex(0);
|
||
else
|
||
ui->stackedWidgetPerlMgr->setCurrentIndex(1);
|
||
}
|
||
|
||
void Dialog::on_pbtnPcDefense_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton *> btns = ui->framePcDef->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, btns) {
|
||
btn->setChecked(b == btn);
|
||
}
|
||
|
||
if(objname == "btnRegisterProtect")
|
||
ui->stackedWidgetPcDef->setCurrentIndex(0);
|
||
else if(objname == "btnFileProtect")
|
||
ui->stackedWidgetPcDef->setCurrentIndex(1);
|
||
else if(objname == "btnDiskProtect")
|
||
ui->stackedWidgetPcDef->setCurrentIndex(2);
|
||
else if(objname == "btnFactorProtect")
|
||
ui->stackedWidgetPcDef->setCurrentIndex(3);
|
||
else if(objname == "btnSysUserProtect")
|
||
ui->stackedWidgetPcDef->setCurrentIndex(4);
|
||
}
|
||
|
||
void Dialog::on_pbtnNetDefense_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton *> btns = ui->frameNetDef->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, btns) {
|
||
btn->setChecked(btn == b);
|
||
}
|
||
|
||
if(objname == "btnDefAtt")
|
||
ui->stackedWidgetNetDef->setCurrentIndex(0);
|
||
else if(objname == "btnDefensewallSkill")
|
||
ui->stackedWidgetNetDef->setCurrentIndex(1);
|
||
else if(objname == "btnUnlawConnect")
|
||
ui->stackedWidgetNetDef->setCurrentIndex(2);
|
||
}
|
||
|
||
void Dialog::on_pbtnSysManage_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
QString objname = b->objectName();
|
||
QList<QAbstractButton * > btns = ui->frameSysMgr->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, btns) {
|
||
btn->setChecked(btn == b);
|
||
}
|
||
|
||
if(objname == "btnSysMsg")
|
||
ui->stackedWidgetSysMgr->setCurrentIndex(0);
|
||
else if(objname == "btnSysMonitor")
|
||
ui->stackedWidgetSysMgr->setCurrentIndex(1);
|
||
else if(objname == "btnSysUserMgr")
|
||
ui->stackedWidgetSysMgr->setCurrentIndex(2);
|
||
else if(objname == "btnlSyssMgrLast")
|
||
ui->stackedWidgetSysMgr->setCurrentIndex(3);
|
||
}
|
||
|
||
void Dialog::on_frameWarnMsg_clicked()
|
||
{
|
||
if(!warnMsgState)
|
||
{
|
||
ui->frameWarnMsg->setStyleSheet("QFrame#frameWarnMsg{border-radius:10px;border:1px solid rgb(0,72,152);}");
|
||
ui->stackedWidgetMain->setCurrentIndex(1);
|
||
}
|
||
else
|
||
{
|
||
ui->frameWarnMsg->setStyleSheet("QFrame#frameWarnMsg{background-color: rgb(255,255,255);"
|
||
"border-radius:10px;"
|
||
"border:1px solid rgb(235,238,245);}");
|
||
ui->stackedWidgetMain->setCurrentIndex(0);
|
||
|
||
}
|
||
warnMsgState = !warnMsgState;
|
||
qDebug()<<warnMsgState;
|
||
}
|
||
|
||
void Dialog::on_pbtnWarnMsgMenu_clicked()
|
||
{
|
||
QAbstractButton *b = (QAbstractButton *)sender();
|
||
QList<QAbstractButton *> btns = ui->page_4->findChildren<QAbstractButton *>();
|
||
foreach (QAbstractButton* btn, btns) {
|
||
if(btn->objectName() == "btnWarnMsgQuery" || btn->objectName() == "btnWarnMsgExport")
|
||
continue;
|
||
btn->setChecked(b == btn);
|
||
}
|
||
|
||
QString objname = b->objectName();
|
||
if(objname == ui->btnExeWarn->objectName())
|
||
ui->stackedWidgetWarnMsg->setCurrentIndex(0);
|
||
else if(objname == ui->btnPeripheralWarn->objectName())
|
||
ui->stackedWidgetWarnMsg->setCurrentIndex(1);
|
||
else if(objname == ui->btnPcDefWarn->objectName())
|
||
ui->stackedWidgetWarnMsg->setCurrentIndex(2);
|
||
else if(objname == ui->btnNetDefWarn->objectName())
|
||
ui->stackedWidgetWarnMsg->setCurrentIndex(3);
|
||
else
|
||
ui->stackedWidgetWarnMsg->setCurrentIndex(4);
|
||
}
|
||
|
||
void Dialog::on_pbtnLogMgrMenu_clicked()
|
||
{
|
||
QAbstractButton* b = (QAbstractButton *)sender();
|
||
foreach (QAbstractButton* btn, ui->page_20->findChildren<QAbstractButton *>()) {
|
||
if(btn->text() == "查询" || btn->text() == "导出")
|
||
continue;
|
||
|
||
btn->setChecked(b == btn);
|
||
}
|
||
|
||
QString objname = b->objectName();
|
||
if(objname == "btnLogMgr1")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(0);
|
||
else if(objname == "btnLogMgr2")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(1);
|
||
else if(objname == "btnLogMgr3")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(2);
|
||
else if(objname == "btnLogMgr4")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(3);
|
||
else if(objname == "btnLogMgr5")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(4);
|
||
else if(objname == "btnLogMgr6")
|
||
ui->stackedWidgetLogMgr->setCurrentIndex(5);
|
||
}
|
||
|
||
void Dialog::on_pbtnSysMgr_clicked()
|
||
{
|
||
QAbstractButton *b = (QAbstractButton *)sender();
|
||
qDebug()<<b->objectName();
|
||
foreach (QAbstractButton *btn, ui->page_21->findChildren<QAbstractButton *>()) {
|
||
btn->setChecked(b == btn);
|
||
}
|
||
|
||
if(b->objectName() == "btnPcMsg")
|
||
ui->stackedWidget_7->setCurrentIndex(0);
|
||
else if(b->objectName() == "btnExeList")
|
||
ui->stackedWidget_7->setCurrentIndex(1);
|
||
}
|