瀏覽代碼

Conditionally enable the retrieve button only if there are results

Check the results of the query and only selectively re-enable the
retrieve button.
Steve Pieper 14 年之前
父節點
當前提交
30413719e8
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Libs/DICOM/Widgets/ctkDICOMQueryRetrieveWidget.cpp

+ 7 - 0
Libs/DICOM/Widgets/ctkDICOMQueryRetrieveWidget.cpp

@@ -74,6 +74,8 @@ void ctkDICOMQueryRetrieveWidget::setRetrieveDatabaseFileName(const QString& fil
 void ctkDICOMQueryRetrieveWidget::processQuery()
 {
   Q_D(ctkDICOMQueryRetrieveWidget);
+
+  d->RetrieveButton->setEnabled(false);
   
   ctkDICOMDatabase queryResultDatabase;
 
@@ -128,4 +130,9 @@ void ctkDICOMQueryRetrieveWidget::processQuery()
 
   d->model.setDatabase(queryResultDatabase.database());
   d->results->setModel(&d->model);
+
+  if ( d->model.rowCount() > 0 )
+  {
+    d->RetrieveButton->setEnabled(true);
+  }
 }