2024-04-25 14:37:38 +08:00
|
|
|
#include "PacsSettingsDialog.h"
|
|
|
|
|
#include "dialogs/DicomSettingsArea.h"
|
|
|
|
|
#include "json/jsonobject.h"
|
feat: Add UserOperationLog : Ip Settings, Mpps Settings, Worklist Settings, Recon Settings, Pacs Settings, Rest Password, Add Account, Set Lock Screen, Set Anonymousmode, Set Screen Saver, Set Default Protocol,
2024-06-11 15:21:00 +08:00
|
|
|
#include "log/UserOperationLog.h"
|
2024-04-25 14:37:38 +08:00
|
|
|
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
const int ENDLINE_SPACE = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PacsSettingsDialog::PacsSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
|
|
|
|
|
: GUIFormBaseDialog(aParent, aWindowFlag)
|
|
|
|
|
, mSettingsArea(new DicomSettingsArea(this))
|
|
|
|
|
, mErrorText(new QLabel(this))
|
|
|
|
|
{
|
|
|
|
|
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
|
|
|
|
|
layout->setSpacing(10);
|
|
|
|
|
//Title
|
|
|
|
|
QLabel* title = new QLabel(this);
|
|
|
|
|
title->setAlignment(Qt::AlignCenter);
|
|
|
|
|
title->setText(tr("PACS Settings"));
|
|
|
|
|
title->setObjectName("title");
|
|
|
|
|
layout->addWidget(title);
|
|
|
|
|
layout->addWidget(mSettingsArea);
|
|
|
|
|
|
|
|
|
|
QLabel* endline = new QLabel(this);
|
|
|
|
|
endline->setFixedHeight(ENDLINE_SPACE);
|
|
|
|
|
endline->setObjectName("endline");
|
|
|
|
|
layout->addWidget(endline);
|
|
|
|
|
layout->addWidget(mErrorText);
|
|
|
|
|
mErrorText->setObjectName("warn");
|
|
|
|
|
mErrorText->hide();
|
|
|
|
|
|
|
|
|
|
initConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PacsSettingsDialog::~PacsSettingsDialog()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PacsSettingsDialog::initConfig()
|
|
|
|
|
{
|
|
|
|
|
host serverInfo;
|
|
|
|
|
serverInfo = JsonObject::Instance()->getServer(JsonObject::PACS);
|
|
|
|
|
mSettingsArea->setServerAETitle(serverInfo.ae);
|
|
|
|
|
mSettingsArea->setServerIpAddress(serverInfo.ip);
|
2024-06-03 17:02:50 +08:00
|
|
|
mSettingsArea->setMyAETitle(serverInfo.localAE);
|
2024-04-25 14:37:38 +08:00
|
|
|
mSettingsArea->setServerPort(serverInfo.port);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool PacsSettingsDialog::updateReferenceData()
|
|
|
|
|
{
|
|
|
|
|
QString myAETitle = mSettingsArea->getMyAETitle();
|
|
|
|
|
QString serverIp = mSettingsArea->getServerIpAddress();
|
|
|
|
|
QString serverPort = mSettingsArea->getServerPort();
|
|
|
|
|
QString serverAETitle = mSettingsArea->getServerAETitle();
|
|
|
|
|
mErrorText->show();
|
|
|
|
|
|
|
|
|
|
if(myAETitle.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("AE can't be empty"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(serverAETitle.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("Server AE can't be empty"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(serverIp.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("Server Ip can't be empty"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(serverPort.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("Server Port can't be empty"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!mSettingsArea->isIpAddressValid())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("Ip Address is not valid"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!mSettingsArea->isPortValid())
|
|
|
|
|
{
|
|
|
|
|
mErrorText->setText(tr("Port is not valid"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
host serverInfo;
|
|
|
|
|
serverInfo.ip = serverIp;
|
|
|
|
|
serverInfo.ae = serverAETitle;
|
2024-06-03 17:02:50 +08:00
|
|
|
serverInfo.localAE = myAETitle;
|
2024-04-25 14:37:38 +08:00
|
|
|
serverInfo.port = serverPort;
|
|
|
|
|
JsonObject::Instance()->setServer(JsonObject::PACS, serverInfo);
|
feat: Add UserOperationLog : Ip Settings, Mpps Settings, Worklist Settings, Recon Settings, Pacs Settings, Rest Password, Add Account, Set Lock Screen, Set Anonymousmode, Set Screen Saver, Set Default Protocol,
2024-06-11 15:21:00 +08:00
|
|
|
LOG_USER_OPERATION("Set PACS Settings");
|
2024-04-25 14:37:38 +08:00
|
|
|
return true;
|
|
|
|
|
}
|