Skip to content

Commit

Permalink
swiot: info button added options for tutorial and documentation
Browse files Browse the repository at this point in the history
Signed-off-by: IonutMuthi <[email protected]>
  • Loading branch information
IonutMuthi committed Nov 21, 2024
1 parent 0092d2e commit d7c9d79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions plugins/swiot/src/ad74413r/ad74413r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void Ad74413r::setupToolTemplate()
setupDeviceBtn();
m_tool->addWidgetToCentralContainerHelper(m_plot);

m_infoBtn = new InfoBtn(this);
m_infoBtn = new InfoBtn(this, true);
m_infoBtn->installEventFilter(this);
m_settingsBtn = new GearBtn(this);
m_runBtn = new RunBtn(this);
Expand All @@ -620,7 +620,8 @@ void Ad74413r::setupToolTemplate()
m_singleBtn->setChecked(false);
m_configBtn = createConfigBtn();

connect(m_infoBtn, &QAbstractButton::clicked, this, [=, this]() {
connect(m_infoBtn->getTutorialButton(), &QPushButton::clicked, this, [=]() { this->startTutorial(); });
connect(m_infoBtn->getDocumentationButton(), &QAbstractButton::clicked, this, [=, this]() {
QDesktopServices::openUrl(
QUrl("https://analogdevicesinc.github.io/scopy/plugins/swiot1l/ad74413r.html"));
});
Expand Down
5 changes: 3 additions & 2 deletions plugins/swiot/src/faults/faults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ Faults::Faults(QString uri, ToolMenuEntry *tme, QWidget *parent)

layout->addWidget(m_tool);

InfoBtn *infoBtn = new InfoBtn(this);
InfoBtn *infoBtn = new InfoBtn(this, true);
m_tool->addWidgetToTopContainerHelper(infoBtn, TTA_LEFT);
connect(infoBtn, &QAbstractButton::clicked, this, [=, this]() {
connect(infoBtn->getTutorialButton(), &QPushButton::clicked, this, [=]() { this->startTutorial(); });
connect(infoBtn->getDocumentationButton(), &QAbstractButton::clicked, this, [=, this]() {
QDesktopServices::openUrl(QUrl("https://analogdevicesinc.github.io/scopy/plugins/swiot1l/faults.html"));
});

Expand Down
6 changes: 4 additions & 2 deletions plugins/swiot/src/max14906/max14906.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ Max14906::Max14906(QString uri, ToolMenuEntry *tme, QWidget *parent)

layout->addWidget(m_tool);

InfoBtn *infoBtn = new InfoBtn(this);
InfoBtn *infoBtn = new InfoBtn(this, true);
m_tool->addWidgetToTopContainerHelper(infoBtn, TTA_LEFT);
connect(infoBtn, &QAbstractButton::clicked, this, [=, this]() {
connect(infoBtn->getTutorialButton(), &QPushButton::clicked, this, [=]() { this->startTutorial(); });

connect(infoBtn->getDocumentationButton(), &QAbstractButton::clicked, this, [=, this]() {
QDesktopServices::openUrl(
QUrl("https://analogdevicesinc.github.io/scopy/plugins/swiot1l/max14906.html"));
});
Expand Down

0 comments on commit d7c9d79

Please sign in to comment.