Browse Source

Expose signal so users of app widget know about directory imports

Allows users of the widget to process the data after it
has been imported.
Steve Pieper 13 years ago
parent
commit
b1f6b10bc4

+ 5 - 0
Libs/DICOM/Widgets/ctkDICOMAppWidget.cpp

@@ -448,10 +448,15 @@ void ctkDICOMAppWidget::onImportDirectory(QString directory)
     connect(d->DICOMIndexer.data(), SIGNAL(progress(int)),
             this, SLOT(onProgress(int)));
 
+    // close the dialog
     connect(d->DICOMIndexer.data(), SIGNAL(indexingComplete()),
             progress, SLOT(close()));
+    // reset the database to show new data
     connect(d->DICOMIndexer.data(), SIGNAL(indexingComplete()),
             &d->DICOMModel, SLOT(reset()));
+    // allow users of this widget to know that the process has finished
+    connect(d->DICOMIndexer.data(), SIGNAL(indexingComplete()),
+            this, SIGNAL(directoryImported()));
 
     d->DICOMIndexer->addDirectory(*d->DICOMDatabase,directory,targetDirectory);
   }

+ 2 - 0
Libs/DICOM/Widgets/ctkDICOMAppWidget.h

@@ -70,6 +70,8 @@ Q_SIGNALS:
   void databaseDirectoryChanged(const QString&);
   /// Emited when query/retrieve operation has happened
   void queryRetrieveFinished();
+  /// Emited when the directory import operation has completed
+  void directoryImported();
 
 protected:
     QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;