feat: Add ErrorLabel component.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#include "ReconSettingsDialog.h"
|
||||
#include "components/ULineEdit.h"
|
||||
#include "components/ErrorLabel.h"
|
||||
#include "dialogs/DicomSettingsArea.h"
|
||||
#include "json/jsonobject.h"
|
||||
#include "recon/ReconManager.h"
|
||||
#include "log/UserOperationLog.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace
|
||||
ReconSettingsDialog::ReconSettingsDialog(QWidget* aParent, Qt::WindowFlags aWindowFlag)
|
||||
: GUIFormBaseDialog(aParent, aWindowFlag)
|
||||
, mSettingsArea(new DicomSettingsArea(this))
|
||||
, mErrorText(new QLabel(this))
|
||||
, mErrorText(new ErrorLabel(this))
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
|
||||
layout->setSpacing(10);
|
||||
@@ -33,7 +33,6 @@ ReconSettingsDialog::ReconSettingsDialog(QWidget* aParent, Qt::WindowFlags aWind
|
||||
endline->setObjectName("endline");
|
||||
layout->addWidget(endline);
|
||||
layout->addWidget(mErrorText);
|
||||
mErrorText->setObjectName("warn");
|
||||
mErrorText->hide();
|
||||
|
||||
initConfig();
|
||||
@@ -64,37 +63,37 @@ bool ReconSettingsDialog::updateReferenceData()
|
||||
|
||||
if(myAETitle.isEmpty())
|
||||
{
|
||||
mErrorText->setText(tr("AE can't be empty"));
|
||||
mErrorText->setErrorText(tr("AE can't be empty"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(serverAETitle.isEmpty())
|
||||
{
|
||||
mErrorText->setText(tr("Server AE can't be empty"));
|
||||
mErrorText->setErrorText(tr("Server AE can't be empty"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(serverIp.isEmpty())
|
||||
{
|
||||
mErrorText->setText(tr("Server Ip can't be empty"));
|
||||
mErrorText->setErrorText(tr("Server Ip can't be empty"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(serverPort.isEmpty())
|
||||
{
|
||||
mErrorText->setText(tr("Server Port can't be empty"));
|
||||
mErrorText->setErrorText(tr("Server Port can't be empty"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!mSettingsArea->isIpAddressValid())
|
||||
{
|
||||
mErrorText->setText(tr("Ip Address is not valid"));
|
||||
mErrorText->setErrorText(tr("Ip Address is not valid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!mSettingsArea->isPortValid())
|
||||
{
|
||||
mErrorText->setText(tr("Port is not valid"));
|
||||
mErrorText->setErrorText(tr("Port is not valid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user