GUI: improve selection behavior when deleting the last breakpoint
This commit is contained in:
parent
6587cbc564
commit
d5619a57e0
|
@ -36,9 +36,9 @@ BreakpointsView::BreakpointsView(QWidget* parent)
|
||||||
|
|
||||||
void BreakpointsView::setupContextMenu()
|
void BreakpointsView::setupContextMenu()
|
||||||
{
|
{
|
||||||
mMenuBuilder = new MenuBuilder(this, [](QMenu*)
|
mMenuBuilder = new MenuBuilder(this, [this](QMenu*)
|
||||||
{
|
{
|
||||||
return DbgIsDebugging();
|
return DbgIsDebugging() && isValidIndex(getInitialSelection(), ColType);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto validBp = [this](QMenu*)
|
auto validBp = [this](QMenu*)
|
||||||
|
@ -494,7 +494,14 @@ void BreakpointsView::updateBreakpointsSlot()
|
||||||
mRich.push_back(std::make_pair(std::move(richDisasm), std::move(richSummary)));
|
mRich.push_back(std::make_pair(std::move(richDisasm), std::move(richSummary)));
|
||||||
}
|
}
|
||||||
if(bpmap.count)
|
if(bpmap.count)
|
||||||
|
{
|
||||||
BridgeFree(bpmap.bp);
|
BridgeFree(bpmap.bp);
|
||||||
|
|
||||||
|
auto sel = getInitialSelection();
|
||||||
|
auto rows = getRowCount();
|
||||||
|
if(sel >= rows)
|
||||||
|
setSingleSelection(rows - 1);
|
||||||
|
}
|
||||||
reloadData();
|
reloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,11 @@ private:
|
||||||
|
|
||||||
bool isValidBp()
|
bool isValidBp()
|
||||||
{
|
{
|
||||||
auto & bp = selectedBp();
|
auto sel = getInitialSelection();
|
||||||
return DbgIsDebugging() && !mBps.empty() && (bp.addr != 0 || bp.active);
|
if(!DbgIsDebugging() || mBps.empty() || !isValidIndex(sel, ColType))
|
||||||
|
return false;
|
||||||
|
auto & bp = mBps.at(bpIndex(sel));
|
||||||
|
return bp.addr != 0 || bp.active;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString bpTypeName(BPXTYPE type)
|
QString bpTypeName(BPXTYPE type)
|
||||||
|
|
Loading…
Reference in New Issue