diff --git a/Libs/Core/ctkAbstractJob.cpp b/Libs/Core/ctkAbstractJob.cpp index feff3ab5cc..1e1e6115b7 100644 --- a/Libs/Core/ctkAbstractJob.cpp +++ b/Libs/Core/ctkAbstractJob.cpp @@ -213,20 +213,15 @@ void ctkAbstractJob::setRunningThreadID(QString runningThreadID) } //---------------------------------------------------------------------------- -QString ctkAbstractJob::loggedText() const +QString ctkAbstractJob::log() const { - return this->LoggedText; + return this->Log; } //---------------------------------------------------------------------------- -void ctkAbstractJob::addLoggedText(QString loggedText) +void ctkAbstractJob::addLog(QString log) { - if (loggedText.isEmpty()) - { - return; - } - - this->LoggedText += loggedText; + this->Log += log; } //---------------------------------------------------------------------------- diff --git a/Libs/Core/ctkAbstractJob.h b/Libs/Core/ctkAbstractJob.h index 7ce7b70a79..7354716be7 100644 --- a/Libs/Core/ctkAbstractJob.h +++ b/Libs/Core/ctkAbstractJob.h @@ -55,7 +55,7 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject Q_PROPERTY(QDateTime startDateTime READ startDateTime); Q_PROPERTY(QDateTime completionDateTime READ completionDateTime); Q_PROPERTY(QString runningThreadID READ runningThreadID WRITE setRunningThreadID); - Q_PROPERTY(QString loggedText READ loggedText WRITE addLoggedText); + Q_PROPERTY(QString log READ log); Q_PROPERTY(bool destroyAfterUse READ destroyAfterUse WRITE setDestroyAfterUse); public: @@ -158,8 +158,8 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject ///@{ /// Logged Text - QString loggedText() const; - void addLoggedText(QString loggedText); + QString log() const; + void addLog(QString log); ///@} /// Generate worker for job @@ -179,10 +179,10 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject Q_INVOKABLE virtual QVariant toVariant(); /// Free used resources from job after worker is done - Q_INVOKABLE virtual void freeUsedResources() = 0; + Q_INVOKABLE virtual void releaseResources() = 0; ///@{ - /// Destroy job pointer after worker is done + /// Destroy job object after worker is done /// default: false bool destroyAfterUse() const; void setDestroyAfterUse(bool destroyAfterUse); @@ -208,7 +208,7 @@ class CTK_CORE_EXPORT ctkAbstractJob : public QObject QDateTime StartDateTime; QDateTime CompletionDateTime; QString RunningThreadID; - QString LoggedText; + QString Log; bool DestroyAfterUse; private: @@ -227,7 +227,7 @@ struct CTK_CORE_EXPORT ctkJobDetail { this->StartDateTime = job.startDateTime().toString("HH:mm:ss.zzz ddd dd MMM yyyy"); this->CompletionDateTime = job.completionDateTime().toString("HH:mm:ss.zzz ddd dd MMM yyyy"); this->RunningThreadID = job.runningThreadID(); - this->Logging = job.loggedText(); + this->Logging = job.log(); } virtual ~ctkJobDetail() = default; diff --git a/Libs/Core/ctkCorePythonQtDecorators.h b/Libs/Core/ctkCorePythonQtDecorators.h index 94224dc5d6..d22363477f 100644 --- a/Libs/Core/ctkCorePythonQtDecorators.h +++ b/Libs/Core/ctkCorePythonQtDecorators.h @@ -27,8 +27,9 @@ // CTK includes #include // For ctkJobDetail #include -#include #include +#include +#include #include #include @@ -39,6 +40,8 @@ // for non-static methods. // +static ctkLogger logger("org.commontk.core.ctkCorePythonQtDecorators"); + /// \ingroup Core class ctkCorePythonQtDecorators : public QObject { @@ -245,64 +248,147 @@ public Q_SLOTS: void setJobClass(ctkJobDetail* td, const QString& jobClass) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setJobClass - Invalid ctkJobDetail"); + return; + } + td->JobClass = jobClass; } QString jobClass(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::jobClass - Invalid ctkJobDetail"); + return ""; + } + return td->JobClass; } void setJobUID(ctkJobDetail* td, const QString& jobUID) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setJobUID - Invalid ctkJobDetail"); + return; + } + td->JobUID = jobUID; } QString JobUID(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::JobUID - Invalid ctkJobDetail"); + return ""; + } + return td->JobUID; } - void setCreationDateTime(ctkJobDetail* td, QString creationDateTime) + + void setCreationDateTime(ctkJobDetail* td, QString creationDateTime) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setCreationDateTime - Invalid ctkJobDetail"); + return; + } + td->CreationDateTime = creationDateTime; } - QString creationDateTime(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::creationDateTime - Invalid ctkJobDetail"); + return ""; + } + return td->CreationDateTime; } void setStartDateTime(ctkJobDetail* td, QString startDateTime) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setStartDateTime - Invalid ctkJobDetail"); + return; + } + td->StartDateTime = startDateTime; } QString startDateTime(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::startDateTime - Invalid ctkJobDetail"); + return ""; + } + return td->StartDateTime; } void setCompletionDateTime(ctkJobDetail* td, QString completionDateTime) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setCompletionDateTime - Invalid ctkJobDetail"); + return; + } + td->CompletionDateTime = completionDateTime; } QString completionDateTime(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::completionDateTime - Invalid ctkJobDetail"); + return ""; + } + return td->CompletionDateTime; } void setRunningThreadID(ctkJobDetail* td, QString runningThreadID) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setRunningThreadID - Invalid ctkJobDetail"); + return; + } + td->RunningThreadID = runningThreadID; } QString runningThreadID(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::runningThreadID - Invalid ctkJobDetail"); + return ""; + } + return td->RunningThreadID; } void setLogging(ctkJobDetail* td, QString logging) { + if (td == nullptr) + { + logger.error("ctkJobDetail::setLogging - Invalid ctkJobDetail"); + return; + } td->Logging = logging; } QString logging(ctkJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkJobDetail::logging - Invalid ctkJobDetail"); + return ""; + } + return td->Logging; } }; diff --git a/Libs/Core/ctkJobScheduler.cpp b/Libs/Core/ctkJobScheduler.cpp index 7ecdbdb3c9..3495b7516a 100644 --- a/Libs/Core/ctkJobScheduler.cpp +++ b/Libs/Core/ctkJobScheduler.cpp @@ -65,7 +65,7 @@ void ctkJobSchedulerPrivate::init() } //------------------------------------------------------------------------------ -void ctkJobSchedulerPrivate::onQueueJobsInThreadPool() +void ctkJobSchedulerPrivate::queueJobsInThreadPool() { Q_Q(ctkJobScheduler); @@ -74,6 +74,9 @@ void ctkJobSchedulerPrivate::onQueueJobsInThreadPool() return; } + // No need to queue jobs with a signal/slot mechanism, since the mutex makes + // sure that concurrent threads append/clean/delete the jobs map. + { // The QMutexLocker is enclosed within brackets to restrict its scope and // prevent conflicts with other QMutexLockers within the scheduler's methods. @@ -190,7 +193,7 @@ bool ctkJobSchedulerPrivate::insertJob(QSharedPointer job) } emit q->jobInitialized(job->toVariant()); - this->onQueueJobsInThreadPool(); + this->queueJobsInThreadPool(); return true; } @@ -211,10 +214,10 @@ bool ctkJobSchedulerPrivate::cleanJob(const QString &jobUID) return false; } - job->freeUsedResources(); + job->releaseResources(); } - this->onQueueJobsInThreadPool(); + this->queueJobsInThreadPool(); return true; } @@ -223,7 +226,7 @@ void ctkJobSchedulerPrivate::cleanJobs(const QStringList &jobUIDs) { Q_Q(ctkJobScheduler); - QList datas; + QList dataObjects; { // The QMutexLocker is enclosed within brackets to restrict its scope and // prevent conflicts with other QMutexLockers within the scheduler's methods. @@ -237,12 +240,12 @@ void ctkJobSchedulerPrivate::cleanJobs(const QStringList &jobUIDs) continue; } - datas.append(job->toVariant()); - job->freeUsedResources(); + dataObjects.append(job->toVariant()); + job->releaseResources(); } } - emit q->jobUserStopped(datas); + emit q->jobUserStopped(dataObjects); } //------------------------------------------------------------------------------ @@ -274,14 +277,14 @@ bool ctkJobSchedulerPrivate::removeJob(const QString& jobUID) this->JobsQueue.remove(jobUID); } - this->onQueueJobsInThreadPool(); + this->queueJobsInThreadPool(); return true; } //------------------------------------------------------------------------------ void ctkJobSchedulerPrivate::removeJobs(const QStringList &jobUIDs) { - QList datas; + QList dataObjects; { // The QMutexLocker is enclosed within brackets to restrict its scope and // prevent conflicts with other QMutexLockers within the scheduler's methods. @@ -295,7 +298,7 @@ void ctkJobSchedulerPrivate::removeJobs(const QStringList &jobUIDs) continue; } - datas.append(job->toVariant()); + dataObjects.append(job->toVariant()); QMap connections = this->JobsConnections.value(jobUID); QObject::disconnect(connections.value("started")); @@ -720,7 +723,7 @@ bool ctkJobScheduler::retryJob(const QString &jobUID) job->setStatus(ctkAbstractJob::JobStatus::Initialized); emit this->jobInitialized(job->toVariant()); - d->onQueueJobsInThreadPool(); + d->queueJobsInThreadPool(); return true; } diff --git a/Libs/Core/ctkJobScheduler_p.h b/Libs/Core/ctkJobScheduler_p.h index 66fe453d53..d6313f2f0c 100644 --- a/Libs/Core/ctkJobScheduler_p.h +++ b/Libs/Core/ctkJobScheduler_p.h @@ -44,9 +44,6 @@ class CTK_CORE_EXPORT ctkJobSchedulerPrivate : public QObject protected: ctkJobScheduler* const q_ptr; -public Q_SLOTS: - virtual void onQueueJobsInThreadPool(); - public: ctkJobSchedulerPrivate(ctkJobScheduler& object); virtual ~ctkJobSchedulerPrivate(); @@ -59,9 +56,10 @@ public Q_SLOTS: virtual void cleanJobs(const QStringList& jobUIDs); virtual bool removeJob(const QString& jobUID); virtual void removeJobs(const QStringList& jobUIDs); - int getSameTypeJobsInThreadPoolQueueOrRunning(QSharedPointer job); - QString generateUniqueJobUID(); - void clearBactchedJobsLists(); + virtual int getSameTypeJobsInThreadPoolQueueOrRunning(QSharedPointer job); + virtual QString generateUniqueJobUID(); + virtual void queueJobsInThreadPool(); + virtual void clearBactchedJobsLists(); QMutex QueueMutex; diff --git a/Libs/DICOM/Core/ctkDICOMCorePythonQtDecorators.h b/Libs/DICOM/Core/ctkDICOMCorePythonQtDecorators.h index b32ff144d1..03f9b81045 100644 --- a/Libs/DICOM/Core/ctkDICOMCorePythonQtDecorators.h +++ b/Libs/DICOM/Core/ctkDICOMCorePythonQtDecorators.h @@ -24,6 +24,9 @@ // PythonQt includes #include +// CTK Core includes +#include + // CTK includes #include #include @@ -37,6 +40,8 @@ // for non-static methods. // +static ctkLogger logger("org.commontk.core.ctkDICOMCorePythonQtDecorators"); + /// \ingroup DICOM_Core class ctkDICOMCorePythonQtDecorators : public QObject { @@ -60,138 +65,276 @@ public slots: return new ctkDICOMJobDetail(); } - void setJobClass(ctkDICOMJobDetail* td, QString jobClass) - { - td->JobClass = jobClass; - } - QString jobClass(ctkDICOMJobDetail* td) - { - return td->JobClass; - } - - void setJobUID(ctkDICOMJobDetail* td, QString jobUID) - { - td->JobUID = jobUID; - } - QString jobUID(ctkDICOMJobDetail* td) - { - return td->JobUID; - } - void setPatientID(ctkDICOMJobDetail* td, const QString& patientID) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setPatientID - Invalid ctkJobDetail"); + return; + } + td->PatientID = patientID; } QString patientID(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::patientID - Invalid ctkJobDetail"); + return ""; + } + return td->PatientID; } void setStudyInstanceUID(ctkDICOMJobDetail* td, const QString& studyInstanceUID) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setStudyInstanceUID - Invalid ctkJobDetail"); + return; + } + td->StudyInstanceUID = studyInstanceUID; } QString studyInstanceUID(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::studyInstanceUID - Invalid ctkJobDetail"); + return ""; + } + return td->StudyInstanceUID; } void setSeriesInstanceUID(ctkDICOMJobDetail* td, const QString& seriesInstanceUID) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setSeriesInstanceUID - Invalid ctkJobDetail"); + return; + } + td->SeriesInstanceUID = seriesInstanceUID; } QString seriesInstanceUID(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::seriesInstanceUID - Invalid ctkJobDetail"); + return ""; + } + return td->SeriesInstanceUID; } void setSOPInstanceUID(ctkDICOMJobDetail* td, const QString& sopInstanceUID) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setSOPInstanceUID - Invalid ctkJobDetail"); + return; + } + td->SOPInstanceUID = sopInstanceUID; } QString sopInstanceUID(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::sopInstanceUID - Invalid ctkJobDetail"); + return ""; + } + return td->SOPInstanceUID; } void setReferenceInserterJobUID(ctkDICOMJobDetail* td, const QString& referenceInserterJobUID) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setReferenceInserterJobUID - Invalid ctkJobDetail"); + return; + } + td->ReferenceInserterJobUID = referenceInserterJobUID; } QString referenceInserterJobUID(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::referenceInserterJobUID - Invalid ctkJobDetail"); + return ""; + } + return td->ReferenceInserterJobUID; } void setQueriedPatientIDs(ctkDICOMJobDetail* td, const QStringList& queriedPatientIDs) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setQueriedPatientIDs - Invalid ctkJobDetail"); + return; + } + td->QueriedPatientIDs = queriedPatientIDs; } QStringList queriedPatientIDs(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::queriedPatientIDs - Invalid ctkJobDetail"); + return QStringList(); + } + return td->QueriedPatientIDs; } void setQueriedStudyInstanceUIDs(ctkDICOMJobDetail* td, const QStringList& queriedStudyInstanceUIDs) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setQueriedStudyInstanceUIDs - Invalid ctkJobDetail"); + return; + } + td->QueriedStudyInstanceUIDs = queriedStudyInstanceUIDs; } QStringList queriedStudyInstanceUIDs(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::queriedStudyInstanceUIDs - Invalid ctkJobDetail"); + return QStringList(); + } + return td->QueriedStudyInstanceUIDs; } void setQueriedSeriesInstanceUIDs(ctkDICOMJobDetail* td, const QStringList& queriedSeriesInstanceUIDs) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setQueriedSeriesInstanceUIDs - Invalid ctkJobDetail"); + return; + } + td->QueriedSeriesInstanceUIDs = queriedSeriesInstanceUIDs; } QStringList queriedSeriesInstanceUIDs(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::queriedSeriesInstanceUIDs - Invalid ctkJobDetail"); + return QStringList(); + } + return td->QueriedSeriesInstanceUIDs; } void setQueriedSOPInstanceUIDs(ctkDICOMJobDetail* td, const QStringList& queriedSOPInstanceUIDs) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setQueriedSOPInstanceUIDs - Invalid ctkJobDetail"); + return; + } + td->QueriedSOPInstanceUIDs = queriedSOPInstanceUIDs; } QStringList queriedSOPInstanceUIDs(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::queriedSOPInstanceUIDs - Invalid ctkJobDetail"); + return QStringList(); + } + return td->QueriedSOPInstanceUIDs; } void setConnectionName(ctkDICOMJobDetail* td, const QString& connectionName) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setConnectionName - Invalid ctkJobDetail"); + return; + } + td->ConnectionName = connectionName; } QString connectionName(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::connectionName - Invalid ctkJobDetail"); + return ""; + } + return td->ConnectionName; } void setDICOMLevel(ctkDICOMJobDetail* td, ctkDICOMJob::DICOMLevels level) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setDICOMLevel - Invalid ctkJobDetail"); + return; + } + td->DICOMLevel = level; } ctkDICOMJob::DICOMLevels DICOMLevel(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::DICOMLevel - Invalid ctkJobDetail"); + return ctkDICOMJob::DICOMLevels::None; + } + return td->DICOMLevel; } void setJobType(ctkDICOMJobDetail* td, ctkDICOMJobResponseSet::JobType jobType) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setJobType - Invalid ctkJobDetail"); + return; + } + td->JobType = jobType; } ctkDICOMJobResponseSet::JobType jobType(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::jobType - Invalid ctkJobDetail"); + return ctkDICOMJobResponseSet::JobType::None; + } + return td->JobType; } void setNumberOfDataSets(ctkDICOMJobDetail* td, int numberOfDataSets) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::setNumberOfDataSets - Invalid ctkJobDetail"); + return; + } + td->NumberOfDataSets = numberOfDataSets; } int numberOfDataSets(ctkDICOMJobDetail* td) { + if (td == nullptr) + { + logger.error("ctkDICOMJobDetail::numberOfDataSets - Invalid ctkJobDetail"); + return -1; + } + return td->NumberOfDataSets; } diff --git a/Libs/DICOM/Core/ctkDICOMEcho.cpp b/Libs/DICOM/Core/ctkDICOMEcho.cpp index 14ba5081c9..e9bd798fc6 100644 --- a/Libs/DICOM/Core/ctkDICOMEcho.cpp +++ b/Libs/DICOM/Core/ctkDICOMEcho.cpp @@ -33,6 +33,9 @@ #include /* for class OFStandard */ #include +//------------------------------------------------------------------------------ +// Using dcmtk root log4cplus logger instead of ctkLogger because with ctkDICOMJobsAppender (dcmtk::log4cplus::Appender), +// logging is filtered by threadID and reported in the GUI per job. dcmtk::log4cplus::Logger rootLogEcho = dcmtk::log4cplus::Logger::getRoot(); //------------------------------------------------------------------------------ @@ -66,11 +69,6 @@ class ctkDICOMEchoPrivate //------------------------------------------------------------------------------ ctkDICOMEchoPrivate::ctkDICOMEchoPrivate() { - this->ConnectionName = ""; - this->CallingAETitle = ""; - this->CalledAETitle = ""; - this->Host = ""; - this->JobUID = ""; this->Port = 80; OFList transferSyntaxes; @@ -188,17 +186,17 @@ bool ctkDICOMEcho::echo() if (!d->SCU->initNetwork().good()) { - QString error = ctkDICOMEcho::tr("Error initializing the network"); + QString error = "Error initializing the network"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogEcho, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMEcho::tr("Negotiating Association"); + QString debug = "Negotiating Association"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogEcho, debug.toStdString().c_str()); OFCondition result = d->SCU->negotiateAssociation(); if (result.bad()) { - QString error = ctkDICOMEcho::tr("Error negotiating the association: ") + QString(result.text()); + QString error = "Error negotiating the association: " + QString(result.text()); DCMTK_LOG4CPLUS_ERROR_STR(rootLogEcho, error.toStdString().c_str()); return false; } @@ -208,19 +206,19 @@ bool ctkDICOMEcho::echo() "" /* don't care about transfer syntax */); if (d->PresentationContext == 0) { - QString error = ctkDICOMEcho::tr("ECHO Request failed: No valid verification Presentation Context available"); + QString error = "ECHO Request failed: No valid verification Presentation Context available"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogEcho, error.toStdString().c_str()); d->releaseAssociation(); return false; } - QString info = ctkDICOMEcho::tr("Seding Echo"); + QString info = "Seding Echo"; DCMTK_LOG4CPLUS_INFO_STR(rootLogEcho, info.toStdString().c_str()); // Issue ECHO request and let scu find presentation context itself (0) OFCondition status = d->SCU->sendECHORequest(d->PresentationContext); if (!status.good()) { - QString error = ctkDICOMEcho::tr("Echo failed"); + QString error = "Echo failed"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogEcho, error.toStdString().c_str()); d->releaseAssociation(); return false; diff --git a/Libs/DICOM/Core/ctkDICOMEchoJob.cpp b/Libs/DICOM/Core/ctkDICOMEchoJob.cpp index ec0d48282a..7d9550225d 100644 --- a/Libs/DICOM/Core/ctkDICOMEchoJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMEchoJob.cpp @@ -93,8 +93,8 @@ QString ctkDICOMEchoJob::loggerReport(const QString& status) .arg(status); QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } //------------------------------------------------------------------------------ diff --git a/Libs/DICOM/Core/ctkDICOMInserterJob.cpp b/Libs/DICOM/Core/ctkDICOMInserterJob.cpp index 8bfdac7919..61dc97e3c4 100644 --- a/Libs/DICOM/Core/ctkDICOMInserterJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMInserterJob.cpp @@ -34,7 +34,6 @@ static ctkLogger logger ("org.commontk.dicom.DICOMInserterJob"); //------------------------------------------------------------------------------ ctkDICOMInserterJob::ctkDICOMInserterJob() { - this->DatabaseFilename = ""; this->MaximumConcurrentJobsPerType = 1; } @@ -66,8 +65,8 @@ QString ctkDICOMInserterJob::loggerReport(const QString& status) } QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } diff --git a/Libs/DICOM/Core/ctkDICOMJob.cpp b/Libs/DICOM/Core/ctkDICOMJob.cpp index f97fe73988..6b8b78b7b3 100644 --- a/Libs/DICOM/Core/ctkDICOMJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMJob.cpp @@ -37,11 +37,6 @@ static ctkLogger logger ("org.commontk.dicom.DICOMJob"); ctkDICOMJob::ctkDICOMJob() { this->DICOMLevel = DICOMLevels::None; - this->PatientID = ""; - this->StudyInstanceUID = ""; - this->SeriesInstanceUID = ""; - this->SOPInstanceUID = ""; - this->ReferenceInserterJobUID = ""; } //------------------------------------------------------------------------------ @@ -186,7 +181,7 @@ QVariant ctkDICOMJob::toVariant() } //------------------------------------------------------------------------------ -void ctkDICOMJob::freeUsedResources() +void ctkDICOMJob::releaseResources() { this->JobResponseSets.clear(); } diff --git a/Libs/DICOM/Core/ctkDICOMJob.h b/Libs/DICOM/Core/ctkDICOMJob.h index 9d2014380c..ade12b6aa7 100644 --- a/Libs/DICOM/Core/ctkDICOMJob.h +++ b/Libs/DICOM/Core/ctkDICOMJob.h @@ -118,8 +118,8 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMJob : public ctkAbstractJob Q_INVOKABLE virtual QVariant toVariant() override; /// Free used resources from job - /// \sa ctkAbstractJob::freeUsedResources - Q_INVOKABLE virtual void freeUsedResources() override; + /// \sa ctkAbstractJob::releaseResources + Q_INVOKABLE virtual void releaseResources() override; Q_SIGNALS: void progressJobDetail(QVariant); diff --git a/Libs/DICOM/Core/ctkDICOMJobResponseSet.cpp b/Libs/DICOM/Core/ctkDICOMJobResponseSet.cpp index 554cce0b12..390c2b714b 100644 --- a/Libs/DICOM/Core/ctkDICOMJobResponseSet.cpp +++ b/Libs/DICOM/Core/ctkDICOMJobResponseSet.cpp @@ -69,15 +69,8 @@ ctkDICOMJobResponseSetPrivate::ctkDICOMJobResponseSetPrivate(ctkDICOMJobResponse : q_ptr(&obj) { this->JobType = ctkDICOMJobResponseSet::JobType::None; - this->JobUID = ""; - this->PatientID = ""; - this->StudyInstanceUID = ""; - this->SeriesInstanceUID = ""; - this->SOPInstanceUID = ""; - this->ConnectionName = ""; this->CopyFile = false; this->OverwriteExistingDataset = false; - this->FilePath = ""; } //------------------------------------------------------------------------------ diff --git a/Libs/DICOM/Core/ctkDICOMQuery.cpp b/Libs/DICOM/Core/ctkDICOMQuery.cpp index 3ee5bb2f64..bf87641ca8 100644 --- a/Libs/DICOM/Core/ctkDICOMQuery.cpp +++ b/Libs/DICOM/Core/ctkDICOMQuery.cpp @@ -51,6 +51,9 @@ #include /* for class OFStandard */ #include /* for class DicomDirInterface */ +//------------------------------------------------------------------------------ +// Using dcmtk root log4cplus logger instead of ctkLogger because with ctkDICOMJobsAppender (dcmtk::log4cplus::Appender), +// logging is filtered by threadID and reported in the GUI per job. dcmtk::log4cplus::Logger rootLogQuery = dcmtk::log4cplus::Logger::getRoot(); //------------------------------------------------------------------------------ @@ -82,7 +85,7 @@ class ctkDICOMQuerySCUPrivate : public DcmSCU return EC_IllegalCall; } - QString debug = ctkDICOMQuery::tr("FIND RESPONSE"); + QString debug = "FIND RESPONSE"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit this->query->debug(/*no tr*/"Got a find response!"); return this->DcmSCU::handleFINDResponse(presID, response, waitForNextResponse); @@ -300,13 +303,13 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) // message is updated but only if the progress value is (e.g. QProgressDialog) if (database.database().isOpen()) { - QString debug = ctkDICOMQuery::tr("DB open in Query"); + QString debug = "DB open in Query"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } else { - QString warn = ctkDICOMQuery::tr("DB not open in Query"); + QString warn = "DB not open in Query"; DCMTK_LOG4CPLUS_WARN_STR(rootLogQuery, warn.toStdString().c_str()); emit progress(warn); } @@ -359,13 +362,13 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) presentationContext = d->SCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, ""); if (presentationContext == 0) { - QString error = ctkDICOMQuery::tr("Failed to find acceptable presentation context"); + QString error = "Failed to find acceptable presentation context"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } else { - QString debug = ctkDICOMQuery::tr("Found useful presentation context"); + QString debug = "Found useful presentation context"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -378,7 +381,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) OFCondition status = d->SCU->sendFINDRequest(presentationContext, d->QueryDcmDataset.data(), &responses); if (!status.good()) { - QString error = ctkDICOMQuery::tr("Find failed"); + QString error = "Find failed"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); d->releaseAssociation(); @@ -386,7 +389,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) return false; } - QString debug = ctkDICOMQuery::tr("Find succeeded"); + QString debug = "Find succeeded"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50); @@ -440,7 +443,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) studyDataset->findAndGetElement(DCM_PatientName, patientName); studyDataset->findAndGetElement(DCM_PatientID, patientID); - QString debug = ctkDICOMQuery::tr("Starting Series C-FIND for Study: ") + studyInstanceUID; + QString debug = "Starting Series C-FIND for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50 + (progressRatio * i++)); @@ -470,7 +473,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) } } - QString debug = ctkDICOMQuery::tr("Find succeeded on Series level for Study: ") + studyInstanceUID; + QString debug = "Find succeeded on Series level for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50 + (progressRatio * i++)); @@ -481,7 +484,7 @@ bool ctkDICOMQuery::query(ctkDICOMDatabase& database) } else { - QString error = ctkDICOMQuery::tr("Find on Series level failed for Study: ") + studyInstanceUID; + QString error = "Find on Series level failed for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } @@ -544,13 +547,13 @@ bool ctkDICOMQuery::queryPatients() presentationContext = d->SCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, ""); if (presentationContext == 0) { - QString error = ctkDICOMQuery::tr("Failed to find acceptable presentation context"); + QString error = "Failed to find acceptable presentation context"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } else { - QString debug = ctkDICOMQuery::tr("Found useful presentation context"); + QString debug = "Found useful presentation context"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -560,7 +563,7 @@ bool ctkDICOMQuery::queryPatients() return false; } - QString debug = ctkDICOMQuery::tr("Starting Patients C-FIND"); + QString debug = "Starting Patients C-FIND"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50); @@ -586,8 +589,8 @@ bool ctkDICOMQuery::queryPatients() contResponses++; if (contResponses > d->MaximumPatientsQuery) { - QString warn = ctkDICOMQuery::tr("The number of responses of the query task at patients level " - "surpassed the maximum value of permitted results (i.e. %1).").arg(d->MaximumPatientsQuery); + QString warn = QString("The number of responses of the query task at patients level " + "surpassed the maximum value of permitted results (i.e. %1).").arg(d->MaximumPatientsQuery); DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, warn.toStdString().c_str()); emit progress(warn); break; @@ -603,7 +606,7 @@ bool ctkDICOMQuery::queryPatients() if (contResponses == 0) { - QString warn = ctkDICOMQuery::tr("The patients query provided no results. Please refine your filters."); + QString warn = "The patients query provided no results. Please refine your filters."; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, warn.toStdString().c_str()); emit progress(warn); } @@ -611,13 +614,13 @@ bool ctkDICOMQuery::queryPatients() JobResponseSet->setDatasets(datasetsMap); d->JobResponseSets.append(JobResponseSet); - QString debug = ctkDICOMQuery::tr("Find succeeded on Patient level"); + QString debug = "Find succeeded on Patient level"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } else { - QString error = ctkDICOMQuery::tr("Find on Patient level failed"); + QString error = "Find on Patient level failed"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } @@ -692,13 +695,13 @@ bool ctkDICOMQuery::queryStudies(const QString& patientID) presentationContext = d->SCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, ""); if (presentationContext == 0) { - QString error = ctkDICOMQuery::tr("Failed to find acceptable presentation context"); + QString error = "Failed to find acceptable presentation context"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } else { - QString debug = ctkDICOMQuery::tr("Found useful presentation context"); + QString debug = "Found useful presentation context"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -708,7 +711,7 @@ bool ctkDICOMQuery::queryStudies(const QString& patientID) return false; } - QString debug = ctkDICOMQuery::tr("Starting Studies C-FIND for Patient: ") + patientID; + QString debug = "Starting Studies C-FIND for Patient: " + patientID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50); @@ -746,13 +749,13 @@ bool ctkDICOMQuery::queryStudies(const QString& patientID) JobResponseSet->setDatasets(datasetsMap); d->JobResponseSets.append(JobResponseSet); - QString debug = ctkDICOMQuery::tr("Find succeeded on Study level for Patient: ") + patientID; + QString debug = "Find succeeded on Study level for Patient: " + patientID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } else { - QString error = ctkDICOMQuery::tr("Find on Study level failed for Patient: ") + patientID; + QString error = "Find on Study level failed for Patient: " + patientID; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } @@ -823,13 +826,13 @@ bool ctkDICOMQuery::querySeries(const QString& patientID, presentationContext = d->SCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, ""); if (presentationContext == 0) { - QString error = ctkDICOMQuery::tr("Failed to find acceptable presentation context"); + QString error = "Failed to find acceptable presentation context"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } else { - QString debug = ctkDICOMQuery::tr("Found useful presentation context"); + QString debug = "Found useful presentation context"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -839,7 +842,7 @@ bool ctkDICOMQuery::querySeries(const QString& patientID, return false; } - QString debug = ctkDICOMQuery::tr("Starting Series C-FIND for Study: ") + studyInstanceUID; + QString debug = "Starting Series C-FIND for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50); @@ -879,13 +882,13 @@ bool ctkDICOMQuery::querySeries(const QString& patientID, JobResponseSet->setDatasets(datasetsMap); d->JobResponseSets.append(JobResponseSet); - QString debug = ctkDICOMQuery::tr("Find succeeded on Series level for Study: ") + studyInstanceUID; + QString debug = "Find succeeded on Series level for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } else { - QString error = ctkDICOMQuery::tr("Find on Series level failed for Study: ") + studyInstanceUID; + QString error = "Find on Series level failed for Study: " + studyInstanceUID; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } @@ -953,13 +956,13 @@ bool ctkDICOMQuery::queryInstances(const QString& patientID, d->PresentationContext = d->SCU->findPresentationContextID(UID_FINDStudyRootQueryRetrieveInformationModel, ""); if (d->PresentationContext == 0) { - QString error = ctkDICOMQuery::tr("Failed to find acceptable presentation context"); + QString error = "Failed to find acceptable presentation context"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } else { - QString debug = ctkDICOMQuery::tr("Found useful presentation context"); + QString debug = "Found useful presentation context"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -969,7 +972,7 @@ bool ctkDICOMQuery::queryInstances(const QString& patientID, return false; } - QString debug = ctkDICOMQuery::tr("Starting Instances C-FIND for Series: ") + seriesInstanceUID; + QString debug = "Starting Instances C-FIND for Series: " + seriesInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(50); @@ -1008,13 +1011,13 @@ bool ctkDICOMQuery::queryInstances(const QString& patientID, } } - QString debug = ctkDICOMQuery::tr("Find succeeded on Series level for Series: ") + seriesInstanceUID; + QString debug = "Find succeeded on Series level for Series: " + seriesInstanceUID; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } else { - QString error = ctkDICOMQuery::tr("Find on Series level failed for Series: ") + seriesInstanceUID; + QString error = "Find on Series level failed for Series: " + seriesInstanceUID; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); } @@ -1062,7 +1065,7 @@ bool ctkDICOMQuery::initializeSCU() d->SCU->setPeerHostName(OFString(this->host().toStdString().c_str())); d->SCU->setPeerPort(this->port()); - QString debug = ctkDICOMQuery::tr("Setting Transfer Syntaxes"); + QString debug = "Setting Transfer Syntaxes"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(10); @@ -1079,14 +1082,14 @@ bool ctkDICOMQuery::initializeSCU() d->SCU->addPresentationContext(UID_FINDStudyRootQueryRetrieveInformationModel, transferSyntaxes); if (!d->SCU->initNetwork().good()) { - QString error = ctkDICOMQuery::tr("Error initializing the network"); + QString error = "Error initializing the network"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); emit progress(100); return false; } - debug = ctkDICOMQuery::tr("Negotiating Association"); + debug = "Negotiating Association"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); emit progress(20); @@ -1098,7 +1101,7 @@ bool ctkDICOMQuery::initializeSCU() OFCondition result = d->SCU->negotiateAssociation(); if (result.bad()) { - QString error = ctkDICOMQuery::tr("Error negotiating the association: ") + QString(result.text()); + QString error = "Error negotiating the association: " + QString(result.text()); DCMTK_LOG4CPLUS_ERROR_STR(rootLogQuery, error.toStdString().c_str()); emit progress(error); emit progress(100); @@ -1154,7 +1157,7 @@ QString ctkDICOMQuery::applyFilters(QMap filters) } modalitySearch.chop(1); // remove final backslash - QString debug = ctkDICOMQuery::tr("modalityInStudySearch ") + modalitySearch; + QString debug = "modalityInStudySearch " + modalitySearch; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); @@ -1168,7 +1171,7 @@ QString ctkDICOMQuery::applyFilters(QMap filters) } else { - QString debug = ctkDICOMQuery::tr("Ignoring unknown search key: ") + key; + QString debug = "Ignoring unknown search key: " + key; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } @@ -1182,7 +1185,7 @@ QString ctkDICOMQuery::applyFilters(QMap filters) filters["EndDate"].toString(); d->QueryDcmDataset->putAndInsertString (DCM_StudyDate, dateRange.toLatin1().data()); - QString debug = ctkDICOMQuery::tr("Query on study date ") + dateRange; + QString debug = "Query on study date " + dateRange; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogQuery, debug.toStdString().c_str()); emit progress(debug); } diff --git a/Libs/DICOM/Core/ctkDICOMQueryJob.cpp b/Libs/DICOM/Core/ctkDICOMQueryJob.cpp index e6e668373c..7fd9bf77b0 100644 --- a/Libs/DICOM/Core/ctkDICOMQueryJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMQueryJob.cpp @@ -170,8 +170,8 @@ QString ctkDICOMQueryJob::loggerReport(const QString& status) QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } diff --git a/Libs/DICOM/Core/ctkDICOMRetrieve.cpp b/Libs/DICOM/Core/ctkDICOMRetrieve.cpp index 5f91e1edf5..7962a93762 100644 --- a/Libs/DICOM/Core/ctkDICOMRetrieve.cpp +++ b/Libs/DICOM/Core/ctkDICOMRetrieve.cpp @@ -47,6 +47,9 @@ #include /* for DcmRLEDecoderRegistration */ #include /* for DcmRLEEncoderRegistration */ +//------------------------------------------------------------------------------ +// Using dcmtk root log4cplus logger instead of ctkLogger because with ctkDICOMJobsAppender (dcmtk::log4cplus::Appender), +// logging is filtered by threadID and reported in the GUI per job. dcmtk::log4cplus::Logger rootLogRetrieve = dcmtk::log4cplus::Logger::getRoot(); //------------------------------------------------------------------------------ @@ -258,12 +261,6 @@ ctkDICOMRetrievePrivate::ctkDICOMRetrievePrivate(ctkDICOMRetrieve& obj) this->AssociationClosing = false; this->LastRetrieveType = ctkDICOMRetrieve::RetrieveNone; - this->PatientID = ""; - this->StudyInstanceUID = ""; - this->SeriesInstanceUID = ""; - this->ConnectionName = ""; - this->JobUID = ""; - // Register the JPEG libraries in case we need them // (registration only happens once, so it's okay to call repeatedly) // register global JPEG decompression codecs @@ -353,27 +350,27 @@ bool ctkDICOMRetrievePrivate::initializeSCU(const QString& patientID, if (!this->SCU->isConnected()) { // Check and initialize networking parameters in DCMTK - if ( !this->SCU->initNetwork().good() ) + if (!this->SCU->initNetwork().good()) { - QString error = ctkDICOMRetrieve::tr("Error initializing the network"); + QString error = "Error initializing the network"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } // Negotiate (i.e. start the) association - QString debug = ctkDICOMRetrieve::tr("Negotiating Association"); + QString debug = "Negotiating Association"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); - if ( !this->SCU->negotiateAssociation().good() ) + if (!this->SCU->negotiateAssociation().good()) { - QString error = ctkDICOMRetrieve::tr("Error negotiating association"); + QString error = "Error negotiating association"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); - return false;; + return false; } } this->ConnectionParamsChanged = false; // Setup query about what to be received from the PACS - QString debug = ctkDICOMRetrieve::tr("Setting Retrieve Parameters"); + QString debug = "Setting Retrieve Parameters"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); if (retrieveType == ctkDICOMRetrieve::RetrieveSOPInstance) { @@ -450,13 +447,13 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, retrieveParameters)) { delete retrieveParameters; - QString error = ctkDICOMRetrieve::tr("MOVE Request failed: SCU initialization failed"); + QString error = "MOVE Request failed: SCU initialization failed"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } // Issue request - QString debug = ctkDICOMRetrieve::tr("Sending Move Request"); + QString debug = "Sending Move Request"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); OFList responses; this->PresentationContext = this->SCU->findPresentationContextID( @@ -464,7 +461,7 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, "" /* don't care about transfer syntax */); if (this->PresentationContext == 0) { - QString error = ctkDICOMRetrieve::tr("MOVE Request failed: No valid Study Root MOVE Presentation Context available"); + QString error = "MOVE Request failed: No valid Study Root MOVE Presentation Context available"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); if (!this->KeepAssociationOpen) { @@ -495,7 +492,7 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, // If we do not receive a single response, something is fishy if ( responses.begin() == responses.end() ) { - QString error = ctkDICOMRetrieve::tr("No responses received at all! (at least one empty response always expected)"); + QString error = "No responses received at all! (at least one empty response always expected)"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } @@ -516,7 +513,7 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, if ( responses.size() == 1 ) { RetrieveResponse* rsp = *responses.begin(); - QString debug = ctkDICOMRetrieve::tr("MOVE response receveid with status: ")+ + QString debug = QString("MOVE response receveid with status: ") + QString(DU_cmoveStatusString(rsp->m_status)); DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); @@ -525,7 +522,7 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, { if (rsp->m_numberOfCompletedSubops == 0) { - QString error = ctkDICOMRetrieve::tr("No images transferred by PACS!"); + QString error = "No images transferred by PACS!"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; @@ -533,17 +530,17 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, } else { - QString debug = ctkDICOMRetrieve::tr("MOVE request failed, server does report error"); + QString debug = "MOVE request failed, server does report error"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); - QString statusDetail(ctkDICOMRetrieve::tr("No details")); + QString statusDetail("No details"); if (rsp->m_statusDetail != NULL) { std::ostringstream out; rsp->m_statusDetail->print(out); - statusDetail = ctkDICOMRetrieve::tr("Status Detail: ") + statusDetail.fromStdString(out.str()); + statusDetail = "Status Detail: " + statusDetail.fromStdString(out.str()); } - statusDetail.prepend(ctkDICOMRetrieve::tr("MOVE request failed: ")); + statusDetail.prepend("MOVE request failed: "); DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, statusDetail.toStdString().c_str()); return false; } @@ -557,7 +554,7 @@ bool ctkDICOMRetrievePrivate::move(const QString& patientID, it++; } - debug = ctkDICOMRetrieve::tr("MOVE responses report for study: %1\n" + debug = QString("MOVE responses report for study: %1\n" "%2 images transferred, and\n" "%3 images transferred with warning, and\n" "%4 images transfers failed") @@ -625,7 +622,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, retrieveParameters)) { delete retrieveParameters; - QString error = ctkDICOMRetrieve::tr("MOVE Request failed: SCU initialization failed"); + QString error = "MOVE Request failed: SCU initialization failed"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } @@ -636,7 +633,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, } // Issue request - QString debug = ctkDICOMRetrieve::tr( "Sending Get Request"); + QString debug = "Sending Get Request"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); emit q->progress(debug); emit q->progress(0); @@ -646,7 +643,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, "" /* don't care about transfer syntax */ ); if (this->PresentationContext == 0) { - QString error = ctkDICOMRetrieve::tr("GET Request failed: No valid Study Root GET Presentation Context available"); + QString error = "GET Request failed: No valid Study Root GET Presentation Context available"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); if (!this->KeepAssociationOpen) { @@ -681,7 +678,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, // If we do not receive a single response, something is fishy if ( responses.begin() == responses.end() ) { - QString error = ctkDICOMRetrieve::tr("No responses received at all! (at least one empty response always expected)"); + QString error = "No responses received at all! (at least one empty response always expected)"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); emit q->progress(error); return false; @@ -706,7 +703,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, if ( responses.size() == 1 ) { RetrieveResponse* rsp = *responses.begin(); - QString debug = ctkDICOMRetrieve::tr("GET response receveid with status: ") + + QString debug = QString("GET response receveid with status: ") + QString(DU_cmoveStatusString(rsp->m_status)); DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); @@ -715,25 +712,25 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, { if (rsp->m_numberOfCompletedSubops == 0) { - QString error = ctkDICOMRetrieve::tr("No images transferred by PACS!"); + QString error = "No images transferred by PACS!"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } } else { - QString debug = ctkDICOMRetrieve::tr("GET request failed, server does report error"); + QString debug = "GET request failed, server does report error"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); - QString statusDetail(ctkDICOMRetrieve::tr("No details")); + QString statusDetail("No details"); if (rsp->m_statusDetail != NULL) { std::ostringstream out; rsp->m_statusDetail->print(out); - statusDetail = ctkDICOMRetrieve::tr("Status Detail: ") + statusDetail.fromStdString(out.str()); + statusDetail = "Status Detail: " + statusDetail.fromStdString(out.str()); } - statusDetail.prepend(ctkDICOMRetrieve::tr("GET request failed: ")); + statusDetail.prepend("GET request failed: "); DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, statusDetail.toStdString().c_str()); return false; } @@ -746,7 +743,7 @@ bool ctkDICOMRetrievePrivate::get(const QString& patientID, it++; } - debug = ctkDICOMRetrieve::tr("GET responses report for study: %1\n" + debug = QString("GET responses report for study: %1\n" "%2 images transferred, and\n" "%3 images transferred with warning, and\n" "%4 images transfers failed") @@ -990,12 +987,12 @@ bool ctkDICOMRetrieve::moveStudy(const QString& studyInstanceUID, if (studyInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive series: Study Instance UID empty."); + QString error = "Cannot receive series: Study Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr("Starting moveStudy"); + QString debug = "Starting moveStudy"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->move(patientID, studyInstanceUID, "", "", ctkDICOMRetrieve::RetrieveStudy); } @@ -1008,12 +1005,12 @@ bool ctkDICOMRetrieve::getStudy(const QString& studyInstanceUID, if (studyInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive study: Study Instance UID empty."); + QString error = "Cannot receive study: Study Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr(("Starting getStudy")); + QString debug = "Starting getStudy"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->get(patientID, studyInstanceUID, "", "", ctkDICOMRetrieve::RetrieveStudy); } @@ -1028,12 +1025,12 @@ bool ctkDICOMRetrieve::moveSeries(const QString& studyInstanceUID, if (studyInstanceUID.isEmpty() || seriesInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive series: Study or Series Instance UID empty."); + QString error = "Cannot receive series: Study or Series Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr("Starting moveSeries"); + QString debug = "Starting moveSeries"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->move(patientID, studyInstanceUID, seriesInstanceUID, "", ctkDICOMRetrieve::RetrieveSeries); } @@ -1048,12 +1045,12 @@ bool ctkDICOMRetrieve::getSeries(const QString& studyInstanceUID, if (studyInstanceUID.isEmpty() || seriesInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive series: Study or Series Instance UID empty."); + QString error = "Cannot receive series: Study or Series Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr("Starting getSeries"); + QString debug = "Starting getSeries"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->get(patientID, studyInstanceUID, seriesInstanceUID, "", ctkDICOMRetrieve::RetrieveSeries); } @@ -1070,12 +1067,12 @@ bool ctkDICOMRetrieve::moveSOPInstance(const QString& studyInstanceUID, seriesInstanceUID.isEmpty() || SOPInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive SOPInstance: Study, Series or SOP Instance UID empty."); + QString error = "Cannot receive SOPInstance: Study, Series or SOP Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr("Starting moveSOPInstance"); + QString debug = "Starting moveSOPInstance"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->move(patientID, studyInstanceUID, seriesInstanceUID, SOPInstanceUID, ctkDICOMRetrieve::RetrieveSOPInstance); } @@ -1092,12 +1089,12 @@ bool ctkDICOMRetrieve::getSOPInstance(const QString& studyInstanceUID, seriesInstanceUID.isEmpty() || SOPInstanceUID.isEmpty()) { - QString error = ctkDICOMRetrieve::tr("Cannot receive SOPInstance: Study, Series or SOP Instance UID empty."); + QString error = "Cannot receive SOPInstance: Study, Series or SOP Instance UID empty."; DCMTK_LOG4CPLUS_ERROR_STR(rootLogRetrieve, error.toStdString().c_str()); return false; } - QString debug = ctkDICOMRetrieve::tr("Starting getSOPInstance"); + QString debug = "Starting getSOPInstance"; DCMTK_LOG4CPLUS_DEBUG_STR(rootLogRetrieve, debug.toStdString().c_str()); return d->get(patientID, studyInstanceUID, seriesInstanceUID, SOPInstanceUID, ctkDICOMRetrieve::RetrieveSOPInstance); } diff --git a/Libs/DICOM/Core/ctkDICOMRetrieveJob.cpp b/Libs/DICOM/Core/ctkDICOMRetrieveJob.cpp index eb5deaafd4..02497be58d 100644 --- a/Libs/DICOM/Core/ctkDICOMRetrieveJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMRetrieveJob.cpp @@ -163,8 +163,8 @@ QString ctkDICOMRetrieveJob::loggerReport(const QString& status) QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } //------------------------------------------------------------------------------ diff --git a/Libs/DICOM/Core/ctkDICOMScheduler.cpp b/Libs/DICOM/Core/ctkDICOMScheduler.cpp index b3bc2fcbb9..a671f255c5 100644 --- a/Libs/DICOM/Core/ctkDICOMScheduler.cpp +++ b/Libs/DICOM/Core/ctkDICOMScheduler.cpp @@ -1115,8 +1115,7 @@ void ctkDICOMScheduler::onJobStarted(ctkAbstractJob* job) ctkDICOMJobsAppender* appender = dynamic_cast(d->Appender.get()); if (appender) { - QString loggedText = appender->messageByThreadID(job->runningThreadID()); - job->addLoggedText(loggedText); + job->addLog(appender->messageByThreadID(job->runningThreadID())); } ctkJobScheduler::onJobStarted(job); @@ -1134,8 +1133,7 @@ void ctkDICOMScheduler::onJobUserStopped(ctkAbstractJob* job) ctkDICOMJobsAppender* appender = dynamic_cast(d->Appender.get()); if (appender) { - QString loggedText = appender->messageByThreadID(job->runningThreadID()); - job->addLoggedText(loggedText); + job->addLog(appender->messageByThreadID(job->runningThreadID())); } ctkJobScheduler::onJobUserStopped(job); @@ -1153,8 +1151,7 @@ void ctkDICOMScheduler::onJobFinished(ctkAbstractJob* job) ctkDICOMJobsAppender* appender = dynamic_cast(d->Appender.get()); if (appender) { - QString loggedText = appender->messageByThreadID(job->runningThreadID()); - job->addLoggedText(loggedText); + job->addLog(appender->messageByThreadID(job->runningThreadID())); } ctkJobScheduler::onJobFinished(job); @@ -1172,8 +1169,7 @@ void ctkDICOMScheduler::onJobAttemptFailed(ctkAbstractJob* job) ctkDICOMJobsAppender* appender = dynamic_cast(d->Appender.get()); if (appender) { - QString loggedText = appender->messageByThreadID(job->runningThreadID()); - job->addLoggedText(loggedText); + job->addLog(appender->messageByThreadID(job->runningThreadID())); } ctkJobScheduler::onJobAttemptFailed(job); @@ -1191,8 +1187,7 @@ void ctkDICOMScheduler::onJobFailed(ctkAbstractJob* job) ctkDICOMJobsAppender* appender = dynamic_cast(d->Appender.get()); if (appender) { - QString loggedText = appender->messageByThreadID(job->runningThreadID()); - job->addLoggedText(loggedText); + job->addLog(appender->messageByThreadID(job->runningThreadID())); } ctkJobScheduler::onJobFailed(job); diff --git a/Libs/DICOM/Core/ctkDICOMServer.cpp b/Libs/DICOM/Core/ctkDICOMServer.cpp index a238eb67f0..6a79be2115 100644 --- a/Libs/DICOM/Core/ctkDICOMServer.cpp +++ b/Libs/DICOM/Core/ctkDICOMServer.cpp @@ -67,11 +67,6 @@ class ctkDICOMServerPrivate : public QObject ctkDICOMServerPrivate::ctkDICOMServerPrivate(ctkDICOMServer& obj) : q_ptr(&obj) { - this->ConnectionName = ""; - this->CallingAETitle = ""; - this->CalledAETitle = ""; - this->Host = ""; - this->MoveDestinationAETitle = ""; this->QueryRetrieveEnabled = true; this->StorageEnabled = true; this->TrustedEnabled = true; diff --git a/Libs/DICOM/Core/ctkDICOMStorageListener.cpp b/Libs/DICOM/Core/ctkDICOMStorageListener.cpp index 98e2fdaae3..0a3a2d0de6 100644 --- a/Libs/DICOM/Core/ctkDICOMStorageListener.cpp +++ b/Libs/DICOM/Core/ctkDICOMStorageListener.cpp @@ -31,6 +31,9 @@ // DCMTK includes #include /* for DcmStorageSCP */ +//------------------------------------------------------------------------------ +// Using dcmtk root log4cplus logger instead of ctkLogger because with ctkDICOMJobsAppender (dcmtk::log4cplus::Appender), +// logging is filtered by threadID and reported in the GUI per job. dcmtk::log4cplus::Logger rootLogStorageListener = dcmtk::log4cplus::Logger::getRoot(); //------------------------------------------------------------------------------ @@ -223,7 +226,7 @@ QString ctkDICOMStorageListenerPrivate::defaultConfigFile() const } else { - QString error = ctkDICOMStorageListener::tr("Failed to find listener configuration file"); + QString error = "Failed to find listener configuration file"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogStorageListener, error.toStdString().c_str()); return ""; } @@ -241,7 +244,7 @@ QString ctkDICOMStorageListenerPrivate::defaultConfigFile() const } else { - QString error = ctkDICOMStorageListener::tr("Failed to find listener configuration file"); + QString error = "Failed to find listener configuration file"; DCMTK_LOG4CPLUS_ERROR_STR(rootLogStorageListener, error.toStdString().c_str()); return ""; } @@ -289,9 +292,9 @@ bool ctkDICOMStorageListener::listen() OFCondition status = d->SCU.listen(); if (status.bad() || d->Canceled) { - QString error = ctkDICOMStorageListener::tr("SCP stopped, it was listening on port %1 : %2 ") - .arg(QString::number(d->Port)) - .arg(status.text()); + QString error = QString("SCP stopped, it was listening on port %1 : %2 ") + .arg(QString::number(d->Port)) + .arg(status.text()); DCMTK_LOG4CPLUS_ERROR_STR(rootLogStorageListener, error.toStdString().c_str()); return false; } @@ -324,7 +327,7 @@ bool ctkDICOMStorageListener::initializeSCU() OFString(d->defaultConfigFile().toStdString().c_str()), "alldicom"); if (status.bad()) { - QString error = ctkDICOMStorageListener::tr("Cannot load association configuration: %1").arg(status.text()); + QString error = QString("Cannot load association configuration: %1").arg(status.text()); DCMTK_LOG4CPLUS_ERROR_STR(rootLogStorageListener, error.toStdString().c_str()); return false; } diff --git a/Libs/DICOM/Core/ctkDICOMStorageListenerJob.cpp b/Libs/DICOM/Core/ctkDICOMStorageListenerJob.cpp index d3df92083d..4f6ee52b16 100644 --- a/Libs/DICOM/Core/ctkDICOMStorageListenerJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMStorageListenerJob.cpp @@ -83,8 +83,8 @@ QString ctkDICOMStorageListenerJob::loggerReport(const QString& status) .arg(status); QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } //------------------------------------------------------------------------------ diff --git a/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp b/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp index 579254f581..e076c9255e 100644 --- a/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp +++ b/Libs/DICOM/Core/ctkDICOMThumbnailGenerator.cpp @@ -32,6 +32,9 @@ // DCMTK includes #include "dcmtk/dcmimgle/dcmimage.h" +//------------------------------------------------------------------------------ +// Using dcmtk root log4cplus logger instead of ctkLogger because with ctkDICOMJobsAppender (dcmtk::log4cplus::Appender), +// logging is filtered by threadID and reported in the GUI per job. dcmtk::log4cplus::Logger rootLogThumbnailGenerator = dcmtk::log4cplus::Logger::getRoot(); //------------------------------------------------------------------------------ @@ -132,7 +135,7 @@ bool ctkDICOMThumbnailGenerator::generateThumbnail(DicomImage *dcmImage, QImage& EI_Status result = dcmImage->getStatus(); if (result != EIS_Normal) { - QString warn = ctkDICOMThumbnailGenerator::tr("Rendering of DICOM image failed for thumbnail failed: ") + DicomImage::getString(result); + QString warn = QString("Rendering of DICOM image failed for thumbnail failed: ") + DicomImage::getString(result); DCMTK_LOG4CPLUS_WARN_STR(rootLogThumbnailGenerator, warn.toStdString().c_str()); return false; } diff --git a/Libs/DICOM/Core/ctkDICOMThumbnailGeneratorJob.cpp b/Libs/DICOM/Core/ctkDICOMThumbnailGeneratorJob.cpp index 269db0fa2d..5804237a53 100644 --- a/Libs/DICOM/Core/ctkDICOMThumbnailGeneratorJob.cpp +++ b/Libs/DICOM/Core/ctkDICOMThumbnailGeneratorJob.cpp @@ -38,9 +38,6 @@ static ctkLogger logger ( "org.commontk.dicom.DICOMThumbnailGeneratorJob" ); ctkDICOMThumbnailGeneratorJobPrivate::ctkDICOMThumbnailGeneratorJobPrivate(ctkDICOMThumbnailGeneratorJob* object) : q_ptr(object) { - this->DatabaseFilename = ""; - this->DicomFilePath = ""; - this->Modality = ""; this->BackgroundColor = Qt::darkGray; } @@ -86,8 +83,8 @@ QString ctkDICOMThumbnailGeneratorJob::loggerReport(const QString& status) .arg(status); QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz"); QString logHeader = currentDateTime + " INFO: "; - this->LoggedText += logHeader; - this->LoggedText += logMsg; + this->Log += logHeader; + this->Log += logMsg; return fullLogMsg; } //------------------------------------------------------------------------------ diff --git a/Libs/DICOM/Widgets/ctkDICOMPatientItemWidget.cpp b/Libs/DICOM/Widgets/ctkDICOMPatientItemWidget.cpp index 680f7590ad..a6a6529bc9 100644 --- a/Libs/DICOM/Widgets/ctkDICOMPatientItemWidget.cpp +++ b/Libs/DICOM/Widgets/ctkDICOMPatientItemWidget.cpp @@ -117,14 +117,6 @@ ctkDICOMPatientItemWidgetPrivate::ctkDICOMPatientItemWidgetPrivate(ctkDICOMPatie this->FilteringDate = ctkDICOMPatientItemWidget::DateType::Any; this->NumberOfOpenedStudiesPerPatient = 2; this->ThumbnailSize = ctkDICOMStudyItemWidget::ThumbnailSizeOption::Medium; - this->PatientItem = ""; - this->PatientID = ""; - this->PatientName = ""; - this->PatientBirthDate = ""; - this->PatientSex = ""; - - this->FilteringStudyDescription = ""; - this->FilteringSeriesDescription = ""; this->DicomDatabase = nullptr; this->Scheduler = nullptr; @@ -134,7 +126,6 @@ ctkDICOMPatientItemWidgetPrivate::ctkDICOMPatientItemWidgetPrivate(ctkDICOMPatie this->AllowedServers = QStringList(); this->Status = ctkDICOMPatientItemWidget::NoOperation; - this->StoppedJobUID = ""; this->IsGUIUpdating = false; this->QueryOn = true; diff --git a/Libs/DICOM/Widgets/ctkDICOMSeriesItemWidget.cpp b/Libs/DICOM/Widgets/ctkDICOMSeriesItemWidget.cpp index 2c78bc3acb..cb3c97b9d5 100644 --- a/Libs/DICOM/Widgets/ctkDICOMSeriesItemWidget.cpp +++ b/Libs/DICOM/Widgets/ctkDICOMSeriesItemWidget.cpp @@ -129,18 +129,6 @@ class ctkDICOMSeriesItemWidgetPrivate : public Ui_ctkDICOMSeriesItemWidget ctkDICOMSeriesItemWidgetPrivate::ctkDICOMSeriesItemWidgetPrivate(ctkDICOMSeriesItemWidget& obj) : q_ptr(&obj) { - this->PatientID = ""; - this->SeriesItem = ""; - this->StudyInstanceUID = ""; - this->SeriesInstanceUID = ""; - this->CentralFrameSOPInstanceUID = ""; - this->SeriesNumber = ""; - this->Modality = ""; - this->ReferenceSeriesInserterJobUID = ""; - this->ReferenceInstanceInserterJobUID = ""; - - this->StoppedJobUID = ""; - this->IsCloud = false; this->RetrieveFailed = false; this->RetrieveSeries = false; @@ -706,14 +694,23 @@ void ctkDICOMSeriesItemWidgetPrivate::updateRetrieveUIOnFinished() filesList.removeAll(QString("")); int numberOfFiles = filesList.count(); - if (numberOfFrames > 1 && numberOfFiles < numberOfFrames) + if (numberOfFrames > 1 && numberOfFiles == 1) + { + // Thumbnail frame has been retrieved, but series has more than 1 frame, continue processing... + this->IsCloud = true; + this->SeriesThumbnail->operationProgressBar()->show(); + return; + } + else if (numberOfFrames > 0 && numberOfFiles < numberOfFrames) { + // Failed to retrieve all frames, warn the user this->RetrieveFailed = true; this->IsCloud = false; this->SeriesThumbnail->operationProgressBar()->hide(); } else if (numberOfFrames > 0 && numberOfFiles == numberOfFrames) { + // All frames have been retrieved successfully this->IsCloud = false; this->SeriesThumbnail->operationProgressBar()->hide(); } @@ -1055,22 +1052,20 @@ void ctkDICOMSeriesItemWidget::onJobFinished(const QVariant &data) } } } - else if (td.JobType == ctkDICOMJobResponseSet::JobType::Inserter && - (d->ReferenceSeriesInserterJobUID == td.JobUID || - d->ReferenceSeriesInserterJobUID == "StorageListener")) + else if (td.JobType == ctkDICOMJobResponseSet::JobType::Inserter) { - QStringList instancesList = d->DicomDatabase->instancesForSeries(d->SeriesInstanceUID); - if (instancesList.count() == 1) + if (d->ReferenceSeriesInserterJobUID == td.JobUID || + d->ReferenceSeriesInserterJobUID == "StorageListener") { - d->SeriesThumbnail->setOperationStatus(ctkThumbnailLabel::Completed); - d->SeriesThumbnail->setStatusIcon(QIcon(":/Icons/accept.svg")); - d->updateRetrieveUIOnFinished(); + d->ReferenceSeriesInserterJobUID = ""; } - else + else if (d->ReferenceInstanceInserterJobUID == td.JobUID || + d->ReferenceInstanceInserterJobUID == "StorageListener") { - d->ReferenceSeriesInserterJobUID = ""; - d->updateRetrieveUIOnFinished(); + d->ReferenceInstanceInserterJobUID = ""; } + + d->updateRetrieveUIOnFinished(); } } diff --git a/Libs/DICOM/Widgets/ctkDICOMStudyItemWidget.cpp b/Libs/DICOM/Widgets/ctkDICOMStudyItemWidget.cpp index 546655fed8..9aab6b9da8 100644 --- a/Libs/DICOM/Widgets/ctkDICOMStudyItemWidget.cpp +++ b/Libs/DICOM/Widgets/ctkDICOMStudyItemWidget.cpp @@ -106,14 +106,9 @@ ctkDICOMStudyItemWidgetPrivate::ctkDICOMStudyItemWidgetPrivate(ctkDICOMStudyItem { this->ThumbnailSize = ctkDICOMStudyItemWidget::ThumbnailSizeOption::Medium; this->ThumbnailSizePixel = 200; - this->FilteringSeriesDescription = ""; - this->PatientID = ""; - this->StudyInstanceUID = ""; - this->StudyItem = ""; this->AllowedServers = QStringList(); this->Status = ctkDICOMStudyItemWidget::NoOperation; - this->StoppedJobUID = ""; this->DicomDatabase = nullptr; this->Scheduler = nullptr; diff --git a/Libs/DICOM/Widgets/ctkDICOMVisualBrowserWidget.cpp b/Libs/DICOM/Widgets/ctkDICOMVisualBrowserWidget.cpp index 6b29f160ca..f7d801fe6a 100644 --- a/Libs/DICOM/Widgets/ctkDICOMVisualBrowserWidget.cpp +++ b/Libs/DICOM/Widgets/ctkDICOMVisualBrowserWidget.cpp @@ -280,20 +280,11 @@ ctkDICOMVisualBrowserWidgetPrivate::ctkDICOMVisualBrowserWidgetPrivate(ctkDICOMV this->MetadataDialog->setObjectName("DICOMMetadata"); this->MetadataDialog->setWindowTitle(ctkDICOMVisualBrowserWidget::tr("DICOM File Metadata")); - this->DatabaseDirectorySettingsKey = ""; - this->DatabaseDirectoryBase = ""; - this->DefaultDatabaseDirectory = ""; - this->DatabaseDirectory = ""; - this->NumberOfOpenedStudiesPerPatient = 2; this->ThumbnailSize = ctkDICOMStudyItemWidget::ThumbnailSizeOption::Medium; this->SendActionVisible = false; this->DeleteActionVisible = true; - this->FilteringPatientID = ""; - this->FilteringPatientName = ""; - this->FilteringStudyDescription = ""; - this->FilteringSeriesDescription = ""; this->FilteringDate = ctkDICOMPatientItemWidget::DateType::Any; this->FilteringModalities.append("Any"); @@ -2330,11 +2321,11 @@ void ctkDICOMVisualBrowserWidget::setDatabaseDirectory(const QString& directory) if (!QDir(absDirectory).exists() || (!ctk::isDirEmpty(QDir(absDirectory)) && !QFile(databaseFileName).exists())) { - logger.warn(ctkDICOMVisualBrowserWidget::tr("Database folder does not contain ctkDICOM.sql file: ") + absDirectory + "\n"); + logger.warn("Database folder does not contain ctkDICOM.sql file: " + absDirectory + "\n"); d->DatabaseDirectoryProblemFrame->show(); d->DatabaseDirectoryProblemLabel->setText( //: %1 is the folder path - ctkDICOMVisualBrowserWidget::tr("No valid DICOM database found in folder %1.").arg(absDirectory) + tr("No valid DICOM database found in folder %1.").arg(absDirectory) ); d->UpdateDatabaseButton->hide(); d->CreateNewDatabaseButton->show(); @@ -2357,12 +2348,12 @@ void ctkDICOMVisualBrowserWidget::setDatabaseDirectory(const QString& directory) } if (!databaseOpenSuccess || d->DicomDatabase->schemaVersionLoaded().isEmpty()) { - logger.warn(ctkDICOMVisualBrowserWidget::tr("Database error: %1 \n").arg(d->DicomDatabase->lastError())); + logger.warn(tr("Database error: %1 \n").arg(d->DicomDatabase->lastError())); d->DicomDatabase->closeDatabase(); d->DatabaseDirectoryProblemFrame->show(); d->DatabaseDirectoryProblemLabel->setText( //: %1 is the folder path - ctkDICOMVisualBrowserWidget::tr("No valid DICOM database found in folder %1.").arg(absDirectory) + tr("No valid DICOM database found in folder %1.").arg(absDirectory) ); d->UpdateDatabaseButton->hide(); d->CreateNewDatabaseButton->show(); @@ -2375,13 +2366,13 @@ void ctkDICOMVisualBrowserWidget::setDatabaseDirectory(const QString& directory) { if (d->DicomDatabase->schemaVersionLoaded() != d->DicomDatabase->schemaVersion()) { - logger.warn(ctkDICOMVisualBrowserWidget::tr("Database version mismatch: version of selected database = %1, version required = %2 \n") + logger.warn(QString("Database version mismatch: version of selected database = %1, version required = %2 \n") .arg(d->DicomDatabase->schemaVersionLoaded()).arg(d->DicomDatabase->schemaVersion())); d->DicomDatabase->closeDatabase(); d->DatabaseDirectoryProblemFrame->show(); d->DatabaseDirectoryProblemLabel->setText( //: %1 is the folder path - ctkDICOMVisualBrowserWidget::tr("Incompatible DICOM database version found in folder %1.").arg(absDirectory) + tr("Incompatible DICOM database version found in folder %1.").arg(absDirectory) ); d->UpdateDatabaseButton->show(); d->CreateNewDatabaseButton->show(); @@ -2598,7 +2589,7 @@ void ctkDICOMVisualBrowserWidget::createNewDatabaseDirectory() d->DatabaseDirectoryProblemFrame->show(); d->DatabaseDirectoryProblemLabel->setText( //: %1 is the folder path - ctkDICOMVisualBrowserWidget::tr("Failed to create new database in folder %1.").arg(QDir(baseFolder).absolutePath()) + tr("Failed to create new database in folder %1.").arg(QDir(baseFolder).absolutePath()) ); d->UpdateDatabaseButton->hide(); d->CreateNewDatabaseButton->show(); @@ -2939,7 +2930,7 @@ void ctkDICOMVisualBrowserWidget::onShowPatients() { d->setBackgroundColorToFilterWidgets(true); - d->WarningPushButton->setText(ctkDICOMVisualBrowserWidget::tr("No patients have been found in the local database.")); + d->WarningPushButton->setText(tr("No patients have been found in the local database.")); d->WarningPushButton->show(); d->patientsTabMenuToolButton->hide(); return; @@ -3004,10 +2995,10 @@ void ctkDICOMVisualBrowserWidget::onQueryPatients() { d->setBackgroundColorToFilterWidgets(true); - d->WarningPushButton->setText(ctkDICOMVisualBrowserWidget::tr("No filters or query/retrieve servers have been set and" - " no patients have been found in the local database." - "\nPlease set at least one filter to query the servers and " - "check that at least one server has the Query/Retrieve property toggled.")); + d->WarningPushButton->setText(tr("No filters or query/retrieve servers have been set and" + " no patients have been found in the local database." + "\nPlease set at least one filter to query the servers and " + "check that at least one server has the Query/Retrieve property toggled.")); d->WarningPushButton->show(); d->patientsTabMenuToolButton->hide(); return; @@ -3106,7 +3097,7 @@ void ctkDICOMVisualBrowserWidget::updateGUIFromScheduler(QList datas) d->updateFiltersWarnings(); if (td.NumberOfDataSets == 0) { - d->WarningPushButton->setText(ctkDICOMVisualBrowserWidget::tr("The patients query provided no results. Please refine your filters.")); + d->WarningPushButton->setText(tr("The patients query provided no results. Please refine your filters.")); d->WarningPushButton->show(); d->SearchMenuButton->setIcon(QIcon(":/Icons/query_failed.svg")); } @@ -3231,7 +3222,7 @@ void ctkDICOMVisualBrowserWidget::onJobFailed(QList datas) { d->updateFiltersWarnings(); d->SearchMenuButton->setIcon(QIcon(":/Icons/query_failed.svg")); - d->WarningPushButton->setText(ctkDICOMVisualBrowserWidget::tr("The patients query failed. Please check the servers settings.")); + d->WarningPushButton->setText(tr("The patients query failed. Please check the servers settings.")); d->WarningPushButton->show(); } else if (td.JobType == ctkDICOMJobResponseSet::JobType::QueryStudies) @@ -3408,24 +3399,24 @@ void ctkDICOMVisualBrowserWidget::showPatientContextMenu(const QPoint& point) QPoint globalPos = patientItemWidget->mapToGlobal(point); QMenu* patientMenu = new QMenu(); - QString loadString = ctkDICOMVisualBrowserWidget::tr("Load patient files"); + QString loadString = tr("Load patient files"); QAction* loadAction = new QAction(loadString, patientMenu); patientMenu->addAction(loadAction); - QString metadataString = ctkDICOMVisualBrowserWidget::tr("View patient DICOM metadata"); + QString metadataString = tr("View patient DICOM metadata"); QAction* metadataAction = new QAction(metadataString, patientMenu); patientMenu->addAction(metadataAction); - QString deleteString = ctkDICOMVisualBrowserWidget::tr("Delete patient from local database"); + QString deleteString = tr("Delete patient from local database"); QAction* deleteAction = new QAction(deleteString, patientMenu); patientMenu->addAction(deleteAction); deleteAction->setVisible(this->isDeleteActionVisible()); - QString exportString = ctkDICOMVisualBrowserWidget::tr("Export patient to file system"); + QString exportString = tr("Export patient to file system"); QAction* exportAction = new QAction(exportString, patientMenu); patientMenu->addAction(exportAction); - QString sendString = ctkDICOMVisualBrowserWidget::tr("Send patient to DICOM server"); + QString sendString = tr("Send patient to DICOM server"); QAction* sendAction = new QAction(sendString, patientMenu); sendAction->setVisible(this->isSendActionVisible()); patientMenu->addAction(sendAction); @@ -3499,34 +3490,34 @@ void ctkDICOMVisualBrowserWidget::showStudyContextMenu(const QPoint& point) QPoint globalPos = studyItemWidget->mapToGlobal(point); QMenu* studyMenu = new QMenu(); - QString loadString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("Load study") : - ctkDICOMVisualBrowserWidget::tr("Load %1 studies").arg(numberOfSelectedStudies); + QString loadString = numberOfSelectedStudies == 1 ? tr("Load study") : + tr("Load %1 studies").arg(numberOfSelectedStudies); QAction* loadAction = new QAction(loadString, studyMenu); studyMenu->addAction(loadAction); - QString metadataString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("View study DICOM metadata") : - ctkDICOMVisualBrowserWidget::tr("View %1 studies DICOM metadata").arg(numberOfSelectedStudies); + QString metadataString = numberOfSelectedStudies == 1 ? tr("View study DICOM metadata") : + tr("View %1 studies DICOM metadata").arg(numberOfSelectedStudies); QAction* metadataAction = new QAction(metadataString, studyMenu); studyMenu->addAction(metadataAction); - QString forceRetrieveString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("Force retrieve series") : - ctkDICOMVisualBrowserWidget::tr("Force retrieve series for %1 studies").arg(numberOfSelectedStudies); + QString forceRetrieveString = numberOfSelectedStudies == 1 ? tr("Force retrieve series") : + tr("Force retrieve series for %1 studies").arg(numberOfSelectedStudies); QAction *forceRetrieveAction = new QAction(forceRetrieveString, studyMenu); studyMenu->addAction(forceRetrieveAction); - QString deleteString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("Delete study from local database") : - ctkDICOMVisualBrowserWidget::tr("Delete %1 studies from local database").arg(numberOfSelectedStudies); + QString deleteString = numberOfSelectedStudies == 1 ? tr("Delete study from local database") : + tr("Delete %1 studies from local database").arg(numberOfSelectedStudies); QAction* deleteAction = new QAction(deleteString, studyMenu); studyMenu->addAction(deleteAction); deleteAction->setVisible(this->isDeleteActionVisible()); - QString exportString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("Export study to file system") : - ctkDICOMVisualBrowserWidget::tr("Export %1 studies to file system").arg(numberOfSelectedStudies); + QString exportString = numberOfSelectedStudies == 1 ? tr("Export study to file system") : + tr("Export %1 studies to file system").arg(numberOfSelectedStudies); QAction* exportAction = new QAction(exportString, studyMenu); studyMenu->addAction(exportAction); - QString sendString = numberOfSelectedStudies == 1 ? ctkDICOMVisualBrowserWidget::tr("Send study to DICOM server") : - ctkDICOMVisualBrowserWidget::tr("Send %1 studies to DICOM server").arg(numberOfSelectedStudies); + QString sendString = numberOfSelectedStudies == 1 ? tr("Send study to DICOM server") : + tr("Send %1 studies to DICOM server").arg(numberOfSelectedStudies); QAction* sendAction = new QAction(sendString, studyMenu); sendAction->setVisible(this->isSendActionVisible()); studyMenu->addAction(sendAction); @@ -3609,34 +3600,34 @@ void ctkDICOMVisualBrowserWidget::showSeriesContextMenu(const QPoint& point) QPoint globalPos = selectedSeriesItemWidget->mapToGlobal(point); QMenu* seriesMenu = new QMenu(); - QString loadString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("Load series") : - ctkDICOMVisualBrowserWidget::tr("Load %1 series").arg(numberOfSelectedSeries); + QString loadString = numberOfSelectedSeries == 1 ? tr("Load series") : + tr("Load %1 series").arg(numberOfSelectedSeries); QAction *loadAction = new QAction(loadString, seriesMenu); seriesMenu->addAction(loadAction); - QString metadataString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("View series DICOM metadata") : - ctkDICOMVisualBrowserWidget::tr("View %1 series DICOM metadata").arg(numberOfSelectedSeries); + QString metadataString = numberOfSelectedSeries == 1 ? tr("View series DICOM metadata") : + tr("View %1 series DICOM metadata").arg(numberOfSelectedSeries); QAction *metadataAction = new QAction(metadataString, seriesMenu); seriesMenu->addAction(metadataAction); - QString forceRetrieveString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("Force retrieve series") : - ctkDICOMVisualBrowserWidget::tr("Force retrieve for %1 series").arg(numberOfSelectedSeries); + QString forceRetrieveString = numberOfSelectedSeries == 1 ? tr("Force retrieve series") : + tr("Force retrieve for %1 series").arg(numberOfSelectedSeries); QAction *forceRetrieveAction = new QAction(forceRetrieveString, seriesMenu); seriesMenu->addAction(forceRetrieveAction); - QString deleteString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("Delete series from local database") : - ctkDICOMVisualBrowserWidget::tr("Delete %1 series from local database").arg(numberOfSelectedSeries); + QString deleteString = numberOfSelectedSeries == 1 ? tr("Delete series from local database") : + tr("Delete %1 series from local database").arg(numberOfSelectedSeries); QAction *deleteAction = new QAction(deleteString, seriesMenu); seriesMenu->addAction(deleteAction); deleteAction->setVisible(this->isDeleteActionVisible()); - QString exportString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("Export series to file system") : - ctkDICOMVisualBrowserWidget::tr("Export %1 series to file system").arg(numberOfSelectedSeries); + QString exportString = numberOfSelectedSeries == 1 ? tr("Export series to file system") : + tr("Export %1 series to file system").arg(numberOfSelectedSeries); QAction *exportAction = new QAction(exportString, seriesMenu); seriesMenu->addAction(exportAction); - QString sendString = numberOfSelectedSeries == 1 ? ctkDICOMVisualBrowserWidget::tr("Send series to DICOM server") : - ctkDICOMVisualBrowserWidget::tr("Send %1 series to DICOM server").arg(numberOfSelectedSeries); + QString sendString = numberOfSelectedSeries == 1 ? tr("Send series to DICOM server") : + tr("Send %1 series to DICOM server").arg(numberOfSelectedSeries); QAction* sendAction = new QAction(sendString, seriesMenu); sendAction->setVisible(this->isSendActionVisible()); seriesMenu->addAction(sendAction); @@ -3706,7 +3697,7 @@ void ctkDICOMVisualBrowserWidget::onPatientsTabMenuToolButtonClicked() } patientMenu->addSeparator(); - QString deleteString = ctkDICOMVisualBrowserWidget::tr("Delete all Patients from local database"); + QString deleteString = tr("Delete all Patients from local database"); QAction* deleteAction = new QAction(deleteString, patientMenu); deleteAction->setIcon(QIcon(":Icons/delete.svg")); patientMenu->addAction(deleteAction); @@ -3827,7 +3818,7 @@ void ctkDICOMVisualBrowserWidget::exportSeries(const QString& dirPath, const QSt if (!QDir().mkpath(destinationDir)) { //: %1 is the destination directory - QString errorString = ctkDICOMVisualBrowserWidget::tr("Unable to create export destination directory:\n\n%1" + QString errorString = tr("Unable to create export destination directory:\n\n%1" "\n\nHalting export.") .arg(destinationDir); ctkMessageBox createDirectoryErrorMessageBox(this); @@ -3841,14 +3832,13 @@ void ctkDICOMVisualBrowserWidget::exportSeries(const QString& dirPath, const QSt // show progress if (d->ExportProgress == 0) { - d->ExportProgress = new QProgressDialog(ctkDICOMVisualBrowserWidget::tr("DICOM Export"), - ctkDICOMVisualBrowserWidget::tr("Close"), 0, 100, this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint); + d->ExportProgress = new QProgressDialog(tr("DICOM Export"), tr("Close"), 0, 100, this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint); d->ExportProgress->setWindowModality(Qt::ApplicationModal); d->ExportProgress->setMinimumDuration(0); } QLabel* exportLabel = new QLabel( //: %1 is the series number - ctkDICOMVisualBrowserWidget::tr("Exporting series %1").arg(seriesNumber) + tr("Exporting series %1").arg(seriesNumber) ); d->ExportProgress->setLabel(exportLabel); d->ExportProgress->setValue(0); @@ -3865,7 +3855,7 @@ void ctkDICOMVisualBrowserWidget::exportSeries(const QString& dirPath, const QSt { d->ExportProgress->setValue(numFiles); //: %1 is the file path - QString errorString = ctkDICOMVisualBrowserWidget::tr("Export source file not found:\n\n%1" + QString errorString = tr("Export source file not found:\n\n%1" "\n\nHalting export.\n\nError may be fixed via Repair.") .arg(filePath); ctkMessageBox copyErrorMessageBox; @@ -3878,7 +3868,7 @@ void ctkDICOMVisualBrowserWidget::exportSeries(const QString& dirPath, const QSt { d->ExportProgress->setValue(numFiles); //: %1 is the destination file name - QString errorString = ctkDICOMVisualBrowserWidget::tr("Export destination file already exists:\n\n%1" + QString errorString = tr("Export destination file already exists:\n\n%1" "\n\nHalting export.") .arg(destinationFileName); ctkMessageBox copyErrorMessageBox(this); @@ -3893,7 +3883,7 @@ void ctkDICOMVisualBrowserWidget::exportSeries(const QString& dirPath, const QSt { d->ExportProgress->setValue(numFiles); //: %1 and %2 refers to source and destination file paths - QString errorString = ctkDICOMVisualBrowserWidget::tr("Failed to copy\n\n%1\n\nto\n\n%2" + QString errorString = tr("Failed to copy\n\n%1\n\nto\n\n%2" "\n\nHalting export.") .arg(filePath) .arg(destinationFileName); @@ -4031,8 +4021,8 @@ bool ctkDICOMVisualBrowserWidget::confirmDeleteSelectedUIDs(const QStringList& u } ctkMessageBox confirmDeleteDialog(this); - QString message = ctkDICOMVisualBrowserWidget::tr("Do you want to delete the following selected items from the LOCAL database? \n" - "The data will not be deleted from the PACs server. \n"); + QString message = tr("Do you want to delete the following selected items from the LOCAL database? \n" + "The data will not be deleted from the PACs server. \n"); // add the information about the selected UIDs int numUIDs = uids.size(); @@ -4066,8 +4056,8 @@ bool ctkDICOMVisualBrowserWidget::confirmDeleteSelectedUIDs(const QStringList& u confirmDeleteDialog.setText(message); confirmDeleteDialog.setIcon(QMessageBox::Question); - confirmDeleteDialog.addButton(ctkDICOMVisualBrowserWidget::tr("Delete"), QMessageBox::AcceptRole); - confirmDeleteDialog.addButton(ctkDICOMVisualBrowserWidget::tr("Cancel"), QMessageBox::RejectRole); + confirmDeleteDialog.addButton(tr("Delete"), QMessageBox::AcceptRole); + confirmDeleteDialog.addButton(tr("Cancel"), QMessageBox::RejectRole); confirmDeleteDialog.setDontShowAgainSettingsKey("VisualDICOMBrowser/DontConfirmDeleteSelected"); int response = confirmDeleteDialog.exec();