Replaced InsightWorker signals with InsightSignals singleton
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
|
||||
namespace Bloom::Widgets
|
||||
{
|
||||
using Bloom::Targets::TargetMemoryDescriptor;
|
||||
@@ -54,8 +56,8 @@ namespace Bloom::Widgets
|
||||
}
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
InsightSignals::instance(),
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&ByteItemGraphicsScene::onTargetStateChanged
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "HexViewerWidget.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
@@ -156,8 +157,8 @@ namespace Bloom::Widgets
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
InsightSignals::instance(),
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&HexViewerWidget::onTargetStateChanged
|
||||
);
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <QToolButton>
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp"
|
||||
@@ -169,23 +171,25 @@ namespace Bloom::Widgets
|
||||
&TargetMemoryInspectionPane::attach
|
||||
);
|
||||
|
||||
auto* insightSignals = InsightSignals::instance();
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
insightSignals,
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&TargetMemoryInspectionPane::onTargetStateChanged
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::programmingModeEnabled,
|
||||
insightSignals,
|
||||
&InsightSignals::programmingModeEnabled,
|
||||
this,
|
||||
&TargetMemoryInspectionPane::onProgrammingModeEnabled
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::programmingModeDisabled,
|
||||
insightSignals,
|
||||
&InsightSignals::programmingModeDisabled,
|
||||
this,
|
||||
&TargetMemoryInspectionPane::onProgrammingModeDisabled
|
||||
);
|
||||
@@ -268,7 +272,7 @@ namespace Bloom::Widgets
|
||||
);
|
||||
}
|
||||
|
||||
this->insightWorker.queueTask(readStackPointerTask);
|
||||
InsightWorker::queueTask(readStackPointerTask);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -312,7 +316,7 @@ namespace Bloom::Widgets
|
||||
);
|
||||
}
|
||||
|
||||
this->insightWorker.queueTask(readMemoryTask);
|
||||
InsightWorker::queueTask(readMemoryTask);
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::resizeEvent(QResizeEvent* event) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <set>
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
@@ -60,16 +61,18 @@ namespace Bloom::Widgets
|
||||
titleBar->setContentsMargins(0, 0, 0, 0);
|
||||
title->setFixedHeight(titleBar->height());
|
||||
|
||||
auto* insightSignals = InsightSignals::instance();
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
insightSignals,
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&RegisterHistoryWidget::onTargetStateChanged
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetRegistersWritten,
|
||||
insightSignals,
|
||||
&InsightSignals::targetRegistersWritten,
|
||||
this,
|
||||
&RegisterHistoryWidget::onRegistersWritten
|
||||
);
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.hpp"
|
||||
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
@@ -200,8 +202,8 @@ namespace Bloom::Widgets
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
InsightSignals::instance(),
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&TargetRegisterInspectorWindow::onTargetStateChanged
|
||||
);
|
||||
@@ -345,7 +347,7 @@ namespace Bloom::Widgets
|
||||
}
|
||||
);
|
||||
|
||||
this->insightWorker.queueTask(readTargetRegisterTask);
|
||||
InsightWorker::queueTask(readTargetRegisterTask);
|
||||
}
|
||||
|
||||
void TargetRegisterInspectorWindow::applyChanges() {
|
||||
@@ -374,7 +376,7 @@ namespace Bloom::Widgets
|
||||
errorDialogue->show();
|
||||
});
|
||||
|
||||
this->insightWorker.queueTask(writeRegisterTask);
|
||||
InsightWorker::queueTask(writeRegisterTask);
|
||||
}
|
||||
|
||||
void TargetRegisterInspectorWindow::openHelpPage() {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Insight/InsightWorker/Tasks/ReadTargetRegisters.hpp"
|
||||
|
||||
namespace Bloom::Widgets
|
||||
@@ -60,8 +62,8 @@ namespace Bloom::Widgets
|
||||
QObject::connect(this->copyValueBinaryAction, &QAction::triggered, this, &RegisterWidget::copyValueBinary);
|
||||
|
||||
QObject::connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::targetStateUpdated,
|
||||
InsightSignals::instance(),
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&RegisterWidget::onTargetStateChange
|
||||
);
|
||||
@@ -174,7 +176,7 @@ namespace Bloom::Widgets
|
||||
}
|
||||
);
|
||||
|
||||
this->insightWorker.queueTask(readRegisterTask);
|
||||
InsightWorker::queueTask(readRegisterTask);
|
||||
}
|
||||
|
||||
void RegisterWidget::copyName() {
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <set>
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "RegisterGroupWidget.hpp"
|
||||
#include "RegisterWidget.hpp"
|
||||
|
||||
@@ -115,16 +117,18 @@ namespace Bloom::Widgets
|
||||
|
||||
itemLayout->addStretch(1);
|
||||
|
||||
auto* insightSignals = InsightSignals::instance();
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetStateUpdated,
|
||||
insightSignals,
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&TargetRegistersPaneWidget::onTargetStateChanged
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&insightWorker,
|
||||
&InsightWorker::targetRegistersWritten,
|
||||
insightSignals,
|
||||
&InsightSignals::targetRegistersWritten,
|
||||
this,
|
||||
&TargetRegistersPaneWidget::onRegistersRead
|
||||
);
|
||||
@@ -197,7 +201,7 @@ namespace Bloom::Widgets
|
||||
);
|
||||
}
|
||||
|
||||
this->insightWorker.queueTask(readRegisterTask);
|
||||
InsightWorker::queueTask(readRegisterTask);
|
||||
}
|
||||
|
||||
void TargetRegistersPaneWidget::onItemSelectionChange(ItemWidget* newlySelectedWidget) {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <QEvent>
|
||||
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp"
|
||||
|
||||
namespace Bloom::Widgets::InsightTargetWidgets
|
||||
@@ -17,30 +19,32 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
, targetVariant(std::move(targetVariant))
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
auto* insightSignals = InsightSignals::instance();
|
||||
|
||||
QObject::connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::targetStateUpdated,
|
||||
insightSignals,
|
||||
&InsightSignals::targetStateUpdated,
|
||||
this,
|
||||
&TargetPackageWidget::onTargetStateChanged
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::targetRegistersWritten,
|
||||
insightSignals,
|
||||
&InsightSignals::targetRegistersWritten,
|
||||
this,
|
||||
&TargetPackageWidget::onRegistersWritten
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::programmingModeEnabled,
|
||||
insightSignals,
|
||||
&InsightSignals::programmingModeEnabled,
|
||||
this,
|
||||
&TargetPackageWidget::onProgrammingModeEnabled
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::programmingModeDisabled,
|
||||
insightSignals,
|
||||
&InsightSignals::programmingModeDisabled,
|
||||
this,
|
||||
&TargetPackageWidget::onProgrammingModeDisabled
|
||||
);
|
||||
@@ -66,7 +70,7 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
);
|
||||
}
|
||||
|
||||
this->insightWorker.queueTask(refreshTask);
|
||||
InsightWorker::queueTask(refreshTask);
|
||||
}
|
||||
|
||||
void TargetPackageWidget::updatePinStates(const Targets::TargetPinStateMappingType& pinStatesByNumber) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "TargetPinWidget.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Insight/InsightWorker/Tasks/SetTargetPinState.hpp"
|
||||
|
||||
namespace Bloom::Widgets::InsightTargetWidgets
|
||||
@@ -46,7 +47,7 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
this->setDisabled(false);
|
||||
});
|
||||
|
||||
this->insightWorker.queueTask(setPinStateTask);
|
||||
InsightWorker::queueTask(setPinStateTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user