Stale data indicator in memory inspection pane
This commit is contained in:
@@ -117,11 +117,12 @@ qt_add_resources(
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetRegistersPane/Images/search-registers.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/memory-inspection-icon.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/memory-inspection-icon-disabled.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-focused-regions.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/stale-data-icon.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-stack-memory.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-stack-memory-disabled.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-focused-memory.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-focused-memory-disabled.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-focused-regions.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns-disabled.svg"
|
||||
"./UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg"
|
||||
|
||||
@@ -337,6 +337,15 @@ QScrollBar::sub-line:vertical {
|
||||
color: #8a8a8d;
|
||||
}
|
||||
|
||||
#target-memory-inspection-pane #stale-data-label QLabel {
|
||||
margin-top: 1px;
|
||||
color: #9a9a9d;
|
||||
}
|
||||
|
||||
#target-memory-inspection-pane #stale-data-label #icon {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
#hex-viewer-container #tool-bar,
|
||||
#hex-viewer-container #search-bar {
|
||||
border-bottom: 1px solid #41423f;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="14"
|
||||
height="13"
|
||||
viewBox="0 0 3.7041667 3.4395833"
|
||||
version="1.1"
|
||||
id="svg974"
|
||||
sodipodi:docname="stale-data-icon.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs968" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#343532"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="32"
|
||||
inkscape:cx="0.9375"
|
||||
inkscape:cy="5.1875"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
inkscape:document-rotation="0"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:snap-page="true"
|
||||
inkscape:window-width="3440"
|
||||
inkscape:window-height="1353"
|
||||
inkscape:window-x="2560"
|
||||
inkscape:window-y="34"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-smooth-nodes="true"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:pagecheckerboard="0" />
|
||||
<metadata
|
||||
id="metadata971">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Main"
|
||||
style="display:inline">
|
||||
<path
|
||||
id="rect1537-3-6"
|
||||
style="fill:#a04355;fill-opacity:0.5;stroke-width:0.72994"
|
||||
d="M 2 1 L 2 12 L 12 12 L 12 1 L 2 1 z M 6 3 L 8 3 L 8 7 L 6 7 L 6 3 z M 6 8 L 8 8 L 8 10 L 6 10 L 6 8 z "
|
||||
transform="scale(0.26458333)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -78,6 +78,8 @@ namespace Bloom::Widgets
|
||||
auto* memoryCapacityLabel = this->container->findChild<Label*>("memory-capacity-label");
|
||||
memoryCapacityLabel->setText(QString::number(this->targetMemoryDescriptor.size()) + " Bytes");
|
||||
|
||||
this->staleDataLabelContainer = this->container->findChild<QWidget*>("stale-data-label");
|
||||
|
||||
this->hexViewerWidget = new HexViewerWidget(
|
||||
this->targetMemoryDescriptor,
|
||||
this->settings.hexViewerWidgetSettings,
|
||||
@@ -190,6 +192,13 @@ namespace Bloom::Widgets
|
||||
&TargetMemoryInspectionPane::onTargetStateChanged
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
insightSignals,
|
||||
&InsightSignals::targetReset,
|
||||
this,
|
||||
&TargetMemoryInspectionPane::onTargetReset
|
||||
);
|
||||
|
||||
QObject::connect(
|
||||
insightSignals,
|
||||
&InsightSignals::programmingModeEnabled,
|
||||
@@ -431,6 +440,7 @@ namespace Bloom::Widgets
|
||||
} else if (newState == TargetState::RUNNING) {
|
||||
this->hexViewerWidget->setDisabled(true);
|
||||
this->refreshButton->setDisabled(true);
|
||||
this->setStaleData(this->data.has_value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,6 +459,7 @@ namespace Bloom::Widgets
|
||||
|
||||
this->data = data;
|
||||
this->hexViewerWidget->updateValues(this->data.value());
|
||||
this->setStaleData(false);
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::openMemoryRegionManagerWindow() {
|
||||
@@ -482,9 +493,14 @@ namespace Bloom::Widgets
|
||||
this->hexViewerWidget->refreshRegions();
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::onTargetReset() {
|
||||
this->setStaleData(this->data.has_value());
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::onProgrammingModeEnabled() {
|
||||
this->hexViewerWidget->setDisabled(true);
|
||||
this->refreshButton->setDisabled(true);
|
||||
this->setStaleData(this->data.has_value());
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::onProgrammingModeDisabled() {
|
||||
@@ -492,4 +508,9 @@ namespace Bloom::Widgets
|
||||
this->hexViewerWidget->setDisabled(disabled);
|
||||
this->refreshButton->setDisabled(disabled);
|
||||
}
|
||||
|
||||
void TargetMemoryInspectionPane::setStaleData(bool staleData) {
|
||||
this->staleData = staleData;
|
||||
this->staleDataLabelContainer->setVisible(this->staleData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,10 +62,14 @@ namespace Bloom::Widgets
|
||||
SvgToolButton* attachPaneButton = nullptr;
|
||||
HexViewerWidget* hexViewerWidget = nullptr;
|
||||
|
||||
QWidget* staleDataLabelContainer = nullptr;
|
||||
|
||||
Targets::TargetState targetState = Targets::TargetState::UNKNOWN;
|
||||
|
||||
MemoryRegionManagerWindow* memoryRegionManagerWindow = nullptr;
|
||||
|
||||
bool staleData = false;
|
||||
|
||||
void sanitiseSettings();
|
||||
void onTargetStateChanged(Targets::TargetState newState);
|
||||
void setRefreshOnTargetStopEnabled(bool enabled);
|
||||
@@ -73,7 +77,9 @@ namespace Bloom::Widgets
|
||||
void onMemoryRead(const Targets::TargetMemoryBuffer& data);
|
||||
void openMemoryRegionManagerWindow();
|
||||
void onMemoryRegionsChange();
|
||||
void onTargetReset();
|
||||
void onProgrammingModeEnabled();
|
||||
void onProgrammingModeDisabled();
|
||||
void setStaleData(bool staleData);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -317,11 +317,49 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="stale-data-label">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="SvgWidget" name="icon">
|
||||
<property name="containerHeight">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="containerWidth">
|
||||
<number>14</number>
|
||||
</property>
|
||||
<property name="svgFilePath">
|
||||
<string>:/compiled/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/stale-data-icon.svg</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Label">
|
||||
<property name="text">
|
||||
<string>Stale data</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Data may be stale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontal-spacer">
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>5</width>
|
||||
<width>10</width>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
|
||||
Reference in New Issue
Block a user