Преглед на файлове

Add directory signal to ctkDICOMAppWidget

Allow users of the widget to track when the database directory
has changed.
Steve Pieper преди 14 години
родител
ревизия
5ea3f0367e
променени са 2 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 4 0
      Libs/DICOM/Widgets/ctkDICOMAppWidget.cpp
  2. 4 0
      Libs/DICOM/Widgets/ctkDICOMAppWidget.h

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

@@ -153,6 +153,10 @@ void ctkDICOMAppWidget::setDatabaseDirectory(const QString& directory)
   //pass DICOM database instance to Import widget
   // d->ImportDialog->setDICOMDatabase(d->DICOMDatabase);
   d->QueryRetrieveWidget->setRetrieveDatabase(d->DICOMDatabase);
+
+  // update the button and let any connected slots know about the change
+  d->directoryButton->setDirectory(directory);
+  emit databaseDirectoryChanged(directory);
 }
 
 //----------------------------------------------------------------------------

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

@@ -53,6 +53,10 @@ public slots:
   void openExportDialog();
   void openQueryDialog();
 
+signals:
+  /// Emited when directory is changed
+  void databaseDirectoryChanged(const QString&);
+
 protected:
     QScopedPointer<ctkDICOMAppWidgetPrivate> d_ptr;
 protected slots: