Преглед изворни кода

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);
+  }
 }