#include "DogCheck.h" #include "ui_DogCheck.h" #include "sys_dog_auth_api/DogAuthInterface.h" using namespace iot_sys; DogCheck::DogCheck(QWidget *parent) : QDialog(parent), ui(new Ui::DogCheck) { ui->setupUi(this); this->setWindowTitle(tr("加密狗检测")); this->setWindowFlags(windowFlags()&~Qt::WindowContextHelpButtonHint); slot_recheckBtn(); ui->recheckBtn->setText(tr("重新检测")); connect(ui->recheckBtn, &QPushButton::clicked, this, &DogCheck::slot_recheckBtn); } DogCheck::~DogCheck() { delete ui; } void DogCheck::slot_recheckBtn() { CDogAuthInterfacePtr ptrDogAuth = getDogAuthInstance(); int nRet = ptrDogAuth->checkAuthStatus(); if (nRet == AUTH_STATUS_OK) { ui->statusLab->setText(tr("正常")); } else if(nRet == AUTH_STATUS_EXPIRED) { ui->statusLab->setText(tr("授权过期,错误码[%1]").arg(nRet)); } else { ui->statusLab->setText(tr("异常,错误码[%1]").arg(nRet)); } }