Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | List of all members
LuaDebuggerBreakpointsController Class Reference

Owns the breakpoints panel: tree wiring, model rebuild from the engine, inline edit dispatch, header strip controls, gutter menu, and persistence. More...

#include <lua_debugger_breakpoints.h>

Inheritance diagram for LuaDebuggerBreakpointsController:

Public Slots

void onItemDoubleClicked (const QModelIndex &index)
 
void showContextMenu (const QPoint &pos)
 
void onItemChanged (QStandardItem *item)
 Active-checkbox toggle from the model.
 
void onModelDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
 Role-based dispatch for delegate-driven inline edits.
 
void showGutterMenu (const QString &filename, qint32 line, const QPoint &globalPos)
 Show Edit/Disable/Remove popup for a click in an editor gutter.
 

Public Member Functions

 LuaDebuggerBreakpointsController (LuaDebuggerDialog *host)
 
void attach (QTreeView *tree, QStandardItemModel *model)
 Bind the tree + model and wire their signals.
 
void attachHeaderButtons (QToolButton *toggleAll, QToolButton *remove, QToolButton *removeAll, QToolButton *edit, QAction *removeAllAction)
 Bind the section-header strip and its shortcut action. Wires button clicks; safe to call before or after attach.
 
void configureColumns () const
 
void startInlineEdit (int row)
 Focus column 2 and open the delegate editor when editable.
 
void serializeTo (QVariantMap &settingsMap) const
 Snapshot the engine breakpoint list (file/line/active + condition / hit-count / log-message) into settingsMap under the Breakpoints key. Every per-breakpoint field is written so the JSON is fully self-describing.
 
void restoreFrom (const QVariantMap &settingsMap)
 Apply the Breakpoints array from settingsMap to the engine. Missing keys fall back to the engine's defaults; an unknown hit-count mode collapses to the default FROM.
 
void refreshFromEngine ()
 Rebuild tree rows from the engine; refreshes header chrome.
 
void clearAll ()
 Confirm-and-clear all breakpoints (header / shortcut).
 
void toggleAtLine (const QString &file, qint32 line)
 Add the breakpoint at file:@p line if absent, otherwise remove it. Drives F9 in the editor, the editor right-click "Add Breakpoint" / "Remove Breakpoint" actions, and the gutter plain-click. Adding auto-enables the debugger via LuaDebuggerDialog::ensureDebuggerEnabledForActiveBreakpoints (so a fresh row is immediately effective); removing refreshes the chrome to reflect the (possibly empty) breakpoint set. Always rebuilds the breakpoint table and gutter markers.
 
void toggleOnCodeViewLine (LuaDebuggerCodeView *codeView, qint32 line)
 Convenience overload that resolves the file path from a LuaDebuggerCodeView. Silently ignores null views or sub-1 line numbers; otherwise behaves exactly like toggleAtLine.
 
void shiftToggleAtLine (const QString &file, qint32 line)
 Pre-arm a breakpoint at file:@p line — the Shift+click gutter gesture. If absent, creates the breakpoint inactive so the user can arm a line without paying the line-hook cost until they activate it; if present, flips the active flag. Does NOT auto-enable the debugger (that pairs with the F9 active-add path; pre-arm should never silently turn debugging back on). Always rebuilds the breakpoint table and gutter markers.
 
void setActiveFromUser (const QString &file, qint32 line, bool active)
 Set the active flag of an existing breakpoint at file:@p line. Used by the gutter context menu's Enable/Disable action; auto-enables the debugger when transitioning to active so the re-armed breakpoint is immediately effective. The breakpoint table's checkbox uses a different code path (onItemChanged) on purpose — it must NOT touch the core enable state because that path is reachable during a live capture. Always rebuilds the breakpoint table and gutter markers.
 
void removeAtLine (const QString &file, qint32 line)
 Remove the breakpoint at file:@p line and refresh chrome. Drives the gutter context menu's Remove action. Always rebuilds the breakpoint table and gutter markers.
 
void toggleAllActive ()
 Activate-all / deactivate-all toggle (header).
 
void updateHeaderButtonState ()
 Refresh header dot icon + button enable states.
 
bool removeRows (const QList< int > &rows)
 Remove the breakpoints in the given (deduped) model rows.
 
bool removeSelected ()
 Remove every selected breakpoint row.

 

Detailed Description

Owns the breakpoints panel: tree wiring, model rebuild from the engine, inline edit dispatch, header strip controls, gutter menu, and persistence.

The dialog only constructs the underlying widgets (model, tree, header buttons, action) and hands them to this controller via attach and attachHeaderButtons; from there every breakpoint-related slot, mutation, and chrome update lives here.


The documentation for this class was generated from the following files: