From d204ace16807f540eed64aae565ee958ce429ac1 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 3 Mar 2021 18:33:09 +0100 Subject: [PATCH 1/2] Theses lines were deleted inadvertently by a previous commit. Just restored what should not have been deleted... --- sdk/viewers/actionviewer/ActionViewer.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sdk/viewers/actionviewer/ActionViewer.cpp b/sdk/viewers/actionviewer/ActionViewer.cpp index 6885b92a..6511ed0a 100644 --- a/sdk/viewers/actionviewer/ActionViewer.cpp +++ b/sdk/viewers/actionviewer/ActionViewer.cpp @@ -80,13 +80,13 @@ QWidget* ActionViewer::getWidget() { searchFramePanel->setLineWidth(3); auto* searchFrameLayout = new QGridLayout(); - searchFrameLayout->addWidget(new QLabel("Family:"), 0, 0); + searchFrameLayout->addWidget(new QLabel("Family"), 0, 0); familyComboBox = new QComboBox(); searchFrameLayout->addWidget(familyComboBox, 0, 1); - searchFrameLayout->addWidget(new QLabel("Action:"), 1, 0); + searchFrameLayout->addWidget(new QLabel("Action"), 1, 0); nameComboBox = new QComboBox(); searchFrameLayout->addWidget(nameComboBox, 1, 1); - searchFrameLayout->addWidget(new QLabel("Tag:"), 2, 0); + searchFrameLayout->addWidget(new QLabel("Tag"), 2, 0); tagLineEdit = new QLineEdit(); searchFrameLayout->addWidget(tagLineEdit, 2, 1); @@ -120,6 +120,19 @@ QWidget* ActionViewer::getWidget() { void ActionViewer::setSearchPanelVisible(bool visibility) { if (searchFramePanel != nullptr) { searchFramePanel->setVisible(visibility); + + if (visibility) { + // Connect buttons + QObject::connect(familyComboBox, SIGNAL(activated(int)), this, SLOT(changeFamily())); + QObject::connect(nameComboBox, SIGNAL(activated(int)), this, SLOT(changeName())); + QObject::connect(tagLineEdit, SIGNAL(editingFinished()), this, SLOT(changeTag())); + } + else { + // disconnect buttons + QObject::disconnect(familyComboBox, SIGNAL(activated(int)), this, SLOT(changeFamily())); + QObject::disconnect(nameComboBox, SIGNAL(activated(int)), this, SLOT(changeName())); + QObject::disconnect(tagLineEdit, SIGNAL(editingFinished()), this, SLOT(changeTag())); + } } } -- GitLab From 3d2ce88ec3187348c34075610b8425458b64c903 Mon Sep 17 00:00:00 2001 From: Emmanuel Promayon Date: Wed, 3 Mar 2021 18:34:31 +0100 Subject: [PATCH 2/2] Optimize MainWindow refresh When an action is triggered, only the viewers interested in viewing action (e.g. the ActionViewer) should be the only one that are refreshed. --- sdk/libraries/core/application/MainWindow.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/libraries/core/application/MainWindow.cpp b/sdk/libraries/core/application/MainWindow.cpp index 03332849..c5cf3dfb 100644 --- a/sdk/libraries/core/application/MainWindow.cpp +++ b/sdk/libraries/core/application/MainWindow.cpp @@ -335,7 +335,19 @@ void MainWindow::refresh() { foreach (Viewer* v, viewers) { if (v != whoIsAsking) { - v->refresh(); + // When an action is triggered, only the viewer that are interested in viewing + // action should be refreshed, the other viewers should not be involved. + if (Application::getTriggeredAction()!=nullptr) { + if (v->getComponents().isEmpty()) { + // action viewer(s) + v->refresh(); + } + } + else { + // the refresh was not triggered by the modification of the selected action + // this is a normal case + v->refresh(); + } } } -- GitLab