10#ifndef LUA_DEBUGGER_DIALOG_H
11#define LUA_DEBUGGER_DIALOG_H
19#include <QPlainTextEdit>
26#include "epan/wslua/wslua_debugger.h"
126 void onDebuggerToggled(
bool checked);
128 void onClearBreakpoints();
130 void onBreakpointItemChanged(QTreeWidgetItem *item,
int column);
133 void onBreakpointItemClicked(QTreeWidgetItem *item,
int column);
135 void onBreakpointItemDoubleClicked(QTreeWidgetItem *item,
int column);
139 void onVariableItemExpanded(QTreeWidgetItem *item);
141 void onVariablesContextMenuRequested(
const QPoint &pos);
147 void onCodeTabCloseRequested(
int index);
149 void onReloadLuaPlugins();
151 void onStackItemDoubleClicked(QTreeWidgetItem *item,
int column);
153 void onStackCurrentItemChanged(QTreeWidgetItem *current,
154 QTreeWidgetItem *previous);
156 void onMonospaceFontUpdated(
const QFont &font);
158 void onMainAppInitialized();
160 void onPreferencesChanged();
166 void evaluateSelection(
const QString &text);
168 void onThemeChanged(
int idx);
172 void onEditorGoToLine();
175 Ui::LuaDebuggerDialog *ui;
177 static int32_t currentTheme_;
185 static void onLuaReloadCallback();
193 static void onLuaPostReloadCallback();
201 static void onScriptLoadedCallback(
const char *file_path);
203 QEventLoop *eventLoop;
204 QCheckBox *enabledCheckBox;
205 QString lastOpenDirectory;
206 bool breakpointTabsPrimed;
212 int stackSelectionLevel;
223 QTreeWidget *variablesTree;
224 QTreeWidget *stackTree;
225 QTreeWidget *fileTree;
226 QTreeWidget *breakpointsTree;
229 QPlainTextEdit *evalInputEdit;
230 QPlainTextEdit *evalOutputEdit;
231 QPushButton *evalButton;
232 QPushButton *evalClearButton;
235 QComboBox *themeComboBox;
251 void updateVariables(QTreeWidgetItem *parent =
nullptr,
252 const QString &path = QString());
254 void updateBreakpoints();
264 bool hasUnsavedChanges()
const;
266 qint32 unsavedOpenScriptTabCount()
const;
273 bool ensureUnsavedChangesHandled(
const QString &title);
275 void clearAllDocumentModified();
279 bool saveAllModified();
283 void updateSaveActionState();
285 void updateWindowModifiedState();
287 void showAccordionFrame(
AccordionFrame *frame,
bool toggle =
false);
293 void installDescendantShortcutFilters();
295 void applyCodeEditorFonts(
const QFont &monoFont);
297 void applyMonospacePanelFonts();
299 void refreshAvailableScripts();
305 void scanScriptDirectory(
const QString &dir_path);
314 void syncDebuggerToggleWithCore();
316 void updateEnabledCheckboxIcon();
325 QTreeWidgetItem *findChildItemByPath(QTreeWidgetItem *parent,
326 const QString &path)
const;
334 appendPathComponents(
const QString &file_path,
335 QVector<QPair<QString, QString>> &components)
const;
340 void openInitialBreakpointFiles(
const QVector<QString> &files);
342 void updateStatusLabel();
346 void configureVariablesTreeColumns();
348 void configureStackTreeColumns();
352 void clearAllCodeHighlights();
354 void applyMonospaceFonts();
356 void applyCodeViewThemes();
359 void reloadAllScriptFiles();
361 QFont effectiveMonospaceFont(
bool zoomed)
const;
363 QFont effectiveRegularFont()
const;
366 void resumeDebuggerAndExitLoop();
371 void runDebuggerStep(
void (*step_fn)(
void));
374 void updateEvalPanelState();
378 void createCollapsibleSections();
382 QVariantMap settings_;
385 void loadSettingsFile();
388 void saveSettingsFile();
390 void applyDialogSettings();
392 void storeDialogSettings();
A QFrame that shows and hides itself with a slide animation.
Definition accordion_frame.h:21
A collapsible section widget for use in a QSplitter.
Definition collapsible_section.h:31
A dialog that remembers its geometry and splitter state.
Definition geometry_state_dialog.h:20
Editable code editor supporting gutter breakpoints and highlighting.
Definition lua_debugger_code_editor.h:136
Top-level dialog hosting the Lua debugger UI components.
Definition lua_debugger_dialog.h:189
static LuaDebuggerDialog * instance(QWidget *parent=nullptr)
Retrieve the singleton instance, creating it if needed.
void childEvent(QChildEvent *event) override
Handle child widget events.
Definition lua_debugger_dialog.cpp:1046
void updateWidgets()
Update all widgets based on the current debugger state.
Definition lua_debugger_dialog.cpp:1648
void handleEscapeKey()
Escape: hide inline find/go accordions if shown, else close dialog. Invoked from the script editor be...
void handlePause(const char *file_path, int64_t line)
React to the debugger pausing execution at a breakpoint.
void ensureDebuggerEnabledForActiveBreakpoints()
Enable the debugger if any active breakpoint requires it.
Definition lua_debugger_dialog.cpp:1664
void updateLuaEditorAuxFrames()
Point find / goto bars at the active code tab.
Definition lua_debugger_dialog.cpp:1125
void clearPausedStateUi()
Remove paused-state UI artifacts like stacks and highlights.
Definition lua_debugger_dialog.cpp:1428
void onCodeViewContextMenu(const QPoint &pos)
Build and show the editor context menu (right-click in a code tab). Routed through Qt's signal/slot m...
Definition lua_debugger_dialog.cpp:1212
void refreshVariablesForCurrentStackFrame()
Rebuild the variables tree after the stack frame for inspection changed.
Definition lua_debugger_variables.cpp:405
static int32_t currentTheme()
Get the current theme setting.
~LuaDebuggerDialog()
Destroy the dialog and disconnect debugger callbacks.
bool event(QEvent *event) override
Handle general events.
Definition lua_debugger_dialog.cpp:985
bool eventFilter(QObject *obj, QEvent *event) override
Filter events for child objects to intercept shortcuts.
Definition lua_debugger_dialog.cpp:1062
QString normalizedFilePath(const QString &file_path) const
Normalize a path by trimming prefixes and resolving symbolic components. Public so controllers and th...
Definition lua_debugger_dialog.cpp:1399
void updateContinueActionState()
Enable or disable the Continue action based on debugger state.
Definition lua_debugger_dialog.cpp:1618
void reject() override
Close from Esc or programmatic reject(); queues close() so closeEvent() runs (unsaved-scripts prompt ...
LuaDebuggerDialog(QWidget *parent=nullptr)
Construct the dialog and initialize all child widgets.
void closeEvent(QCloseEvent *event) override
Flush state and resume execution when the dialog closes.
bool ensureFileTreeEntry(const QString &file_path)
Ensure the hierarchical file tree contains the supplied script path.