Add MppsSettingsDialog mpps open mode.
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
#include "ui_DicomSettingsArea.h"
|
||||
|
||||
#include "utilities/InputFormatValidator.h"
|
||||
#include "components/ImageSwitch.h"
|
||||
#include "json/jsonobject.h"
|
||||
|
||||
DicomSettingsArea::DicomSettingsArea(QWidget *aParent)
|
||||
: QWidget(aParent)
|
||||
, mUI(new Ui::DicomSettingsArea)
|
||||
, mMppsOpen(nullptr)
|
||||
{
|
||||
mUI->setupUi(this);
|
||||
mUI->mServerPort->setObjectName("DicomSettingsLabel");
|
||||
@@ -67,3 +70,46 @@ QString DicomSettingsArea::getServerAETitle()
|
||||
return mUI->mServerAETitleEdit->text();
|
||||
}
|
||||
|
||||
void DicomSettingsArea::setEnable(bool aIsEnable)
|
||||
{
|
||||
mUI->mMyAETitleEdit->setEnabled(aIsEnable);
|
||||
mUI->mServerAETitleEdit->setEnabled(aIsEnable);
|
||||
mUI->mServerIpAddressEdit->setEnabled(aIsEnable);
|
||||
mUI->mServerPortEdit->setEnabled(aIsEnable);
|
||||
}
|
||||
|
||||
void DicomSettingsArea::setMppsMode()
|
||||
{
|
||||
for (int i = mUI->gridLayout->count() - 1; i >= 0; --i)
|
||||
{
|
||||
int r, c, rs, cs;
|
||||
mUI->gridLayout->getItemPosition(i, &r, &c, &rs, &cs);
|
||||
mUI->gridLayout->addWidget(mUI->gridLayout->itemAt(i)->widget(), r + 1, c, rs, cs);
|
||||
}
|
||||
QLabel* mppsLabel = new QLabel(this);
|
||||
mppsLabel->setText("MPPS");
|
||||
mMppsOpen = new ImageSwitch(this);
|
||||
mUI->gridLayout->addWidget(mppsLabel, 0 , 0);
|
||||
mUI->gridLayout->addWidget(mMppsOpen, 0 , 1);
|
||||
bool isMppsOpen = JsonObject::Instance()->getMppsOpen();
|
||||
if(isMppsOpen)
|
||||
{
|
||||
mMppsOpen->setChecked(true);
|
||||
setEnable(false);
|
||||
}
|
||||
connect(mMppsOpen, &ImageSwitch::clicked, [this]()
|
||||
{
|
||||
bool isMppsOpen = mMppsOpen->getChecked();
|
||||
setEnable(!isMppsOpen);
|
||||
});
|
||||
}
|
||||
|
||||
bool DicomSettingsArea::getMppsIsOpen()
|
||||
{
|
||||
if(nullptr != mMppsOpen)
|
||||
{
|
||||
return mMppsOpen->getChecked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user