|
35 | 35 | #include "BaseApp.hpp"
|
36 | 36 | #include "../openstudio_lib/OSAppBase.hpp"
|
37 | 37 | #include "../openstudio_lib/OSDocument.hpp"
|
| 38 | +#include "../openstudio_lib/MainWindow.hpp" |
38 | 39 | #include "LocalLibraryController.hpp"
|
39 | 40 | #include "WorkflowTools.hpp"
|
40 | 41 | #include "../model_editor/Utilities.hpp"
|
@@ -556,7 +557,9 @@ QWidget* MeasureStepItemDelegate::view(QSharedPointer<OSListItem> dataSource) {
|
556 | 557 | if (QSharedPointer<MeasureStepItem> measureStepItem = dataSource.objectCast<MeasureStepItem>()) {
|
557 | 558 | auto* workflowStepView = new WorkflowStepView();
|
558 | 559 |
|
559 |
| - const QString measureLangStr = toQString(measureStepItem->measureLanguage().valueName()); |
| 560 | + const MeasureLanguage measureLanguage = measureStepItem->measureLanguage(); |
| 561 | + |
| 562 | + const QString measureLangStr = toQString(measureLanguage.valueName()); |
560 | 563 | if (measureStepItem->measureType() == MeasureType::ModelMeasure) {
|
561 | 564 | workflowStepView->workflowStepButton->measureTypeBadge->setPixmap(
|
562 | 565 | QPixmap(QString(":/images/openstudio_measure_icon_%1.png").arg(measureLangStr))
|
@@ -591,13 +594,20 @@ QWidget* MeasureStepItemDelegate::view(QSharedPointer<OSListItem> dataSource) {
|
591 | 594 |
|
592 | 595 | connect(measureStepItem.data(), &MeasureStepItem::selectedChanged, workflowStepView->workflowStepButton, &WorkflowStepButton::setHasEmphasis);
|
593 | 596 |
|
594 |
| - try { |
595 |
| - // Warning Icon |
596 |
| - workflowStepView->workflowStepButton->cautionLabel->setVisible(measureStepItem->hasIncompleteArguments()); |
597 |
| - connect(measureStepItem.data(), &MeasureStepItem::argumentsChanged, workflowStepView->workflowStepButton->cautionLabel, &QLabel::setVisible); |
598 |
| - } catch (const std::exception& e) { |
599 |
| - workflowStepView->workflowStepButton->errorLabel->setToolTip(e.what()); |
| 597 | + const bool useClassicCLI = OSAppBase::instance()->currentDocument()->mainWindow()->useClassicCLI(); |
| 598 | + if (useClassicCLI && (measureLanguage == MeasureLanguage::Python)) { |
| 599 | + workflowStepView->workflowStepButton->errorLabel->setToolTip( |
| 600 | + "Python Measures are not supported in the Classic CLI.\nYou can change CLI version using 'Preferences->Use Classic CLI'."); |
600 | 601 | workflowStepView->workflowStepButton->errorLabel->setVisible(true);
|
| 602 | + } else { |
| 603 | + try { |
| 604 | + // Warning Icon |
| 605 | + workflowStepView->workflowStepButton->cautionLabel->setVisible(measureStepItem->hasIncompleteArguments()); |
| 606 | + connect(measureStepItem.data(), &MeasureStepItem::argumentsChanged, workflowStepView->workflowStepButton->cautionLabel, &QLabel::setVisible); |
| 607 | + } catch (const std::exception& e) { |
| 608 | + workflowStepView->workflowStepButton->errorLabel->setToolTip(e.what()); |
| 609 | + workflowStepView->workflowStepButton->errorLabel->setVisible(true); |
| 610 | + } |
601 | 611 | }
|
602 | 612 |
|
603 | 613 | // Up and down buttons
|
|
0 commit comments