From 3e442b08607c5a795ee042d31c8dce7d81d9c456 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Thu, 21 Oct 2021 19:33:11 +0800 Subject: [PATCH] - enhancement: autosave/load bookmarks - enhancement: autosave/load breakpoints - enhancement: autosave/load watches --- NEWS.md | 3 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 97036 -> 97880 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 774 ++++++++++-------- RedPandaIDE/debugger.cpp | 120 +++ RedPandaIDE/debugger.h | 5 + RedPandaIDE/editor.cpp | 10 + RedPandaIDE/editor.h | 1 + RedPandaIDE/mainwindow.cpp | 38 +- RedPandaIDE/qsynedit/SynEdit.cpp | 14 +- .../qsynedit/exporter/synhtmlexporter.cpp | 2 +- RedPandaIDE/settings.cpp | 24 + RedPandaIDE/settings.h | 8 + .../settingsdialog/debuggeneralwidget.cpp | 4 + .../settingsdialog/debuggeneralwidget.ui | 23 + .../settingsdialog/executorgeneralwidget.cpp | 2 +- .../settingsdialog/executorgeneralwidget.h | 2 +- RedPandaIDE/systemconsts.h | 2 + RedPandaIDE/utils.cpp | 6 + RedPandaIDE/utils.h | 1 + RedPandaIDE/widgets/bookmarkmodel.cpp | 10 + RedPandaIDE/widgets/bookmarkmodel.h | 1 + RedPandaIDE/widgets/qconsole.cpp | 12 +- 22 files changed, 689 insertions(+), 373 deletions(-) diff --git a/NEWS.md b/NEWS.md index 7ed65eda..57cf32f6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,9 @@ Version 0.7.0 - fix: don't highlight '#' with spaces preceeding it as error - fix: correctly handle integer with 'L' suffix in #if directives ( so can be correctly parsed ) - enhancement: bookmark view + - enhancement: autosave/load bookmarks + - enhancement: autosave/load breakpoints + - enhancement: autosave/load watches Version 0.6.8 - enhancement: add link to cppreference in the help menu diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 0119b85ba8fdda413c2298d09ff7eb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ywA1lpct^eUo&?-|uHLqG1_WrI-g)+2 zn9N+?YcM7l`Z;>{URlr!(tGV%fDL}s4|#))jcB6}?2Sevb&Y=PgL3@95TFmrdxPHv z7U_dCuMz9gTR-($G2*{eKfO1?HhF=5`XFq)x1cx9E`%@)x7RNniV^CUJpD2u1SMI# ze&rV2wO5dSLlJhGy-L4hcp5Z*j(%5_0+SDeK6z&(bi+b_pagln+Y5c#?E6H&PU(+j z!J_jQ=>L9T2VWVbKY0ZkYM7%xe;Nn68m7Or(++ck#`=2$dZAc-ZPY(`e+{kGM14`w zWN5gkf34G^>%FZ1qWTNz)>{AdYG3$Bef_V=N}?wnLCkKSOwd;c;(-qFGM_v$NJdo6 zjqD9gtp7qaon~mU8&|NR+|bzt7EM+fx;_X&ll#@swFv9AT5oVJUxI4eXm4;!4#k~) zFnE8v3KRb@3~dL~{@K+qy8bXUB+-U33HcZ>o;OU2!ih(2Fibi!9OF37F!S{`d@jMT zAj1O_j=6@Ya(|Ru&kd_DBq9o84C@v6-nJ^khR#`#_LYW>%@7^!AIki(#6)IvK4#cj z2BGmfY}l>|$Kb);u)Q@*RdUg=a~Dpe*lkFR-HVf08}_Y0p>ZJ0kkk`S_Pxk(-~ya# z#ZtrRsOPA99~#cK$HpIKo5(t!HJopQFv~w>xKN7z!qe4IuqGDGXLG~d-gPjT9Bp_w zY$LhQlLW)lG1HOHZy4V7fa!e84LAgv$N`4W6-gK#MH#*wYXD)|W%x0wKHBlIhUy^r u$e3tUAtN58FKRKsEH=Drr&x1`QPJlePM&vQNzR*(%wZi)+J>_Z!v6rVrw)Vw diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index 11ab5320..b6f68db0 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -95,17 +95,17 @@ BacktraceModel - + Function 函数 - + Filename 文件名 - + Line @@ -113,37 +113,37 @@ BookmarkModel - + Save file '%1' failed. 保存文件'%1'失败。 - + Can't open file '%1' for write. 无法写入文件'%1'. - + Error in json file '%1':%2 : %3 JSON文件'%1':%2中存在错误:%3 - + Can't open file '%1' for read. 无法读取文件'%1'. - + Description 描述 - + Line - + Filename 文件名 @@ -151,20 +151,40 @@ BreakpointModel - + Filename 文件名 - + Line - + Condition 条件 + + + Save file '%1' failed. + 保存文件'%1'失败。 + + + + Can't open file '%1' for write. + 无法写入文件'%1'. + + + + Error in json file '%1':%2 : %3 + JSON文件'%1':%2中存在错误:%3 + + + + Can't open file '%1' for read. + 无法读取文件'%1'. + CPUDialog @@ -874,32 +894,47 @@ Are you really want to continue? Show full gdb annotations 在调试主控台中显示gdb输出注解 + + + Autosave + 自动保存 + + + + Autosave breakpoints + 自动保存断点 + + + + Autosave watches + 自动保存监视 + Disassembly Coding Style 反汇编代码样式 - + CPU Window CPU信息窗口 - + Disassembly Coding Style: 反汇编代码样式 - + Intel Intel - + AT&&T AT&&T - + Show disassembly code in blend mode 以混合模式显示反汇编代码 @@ -907,68 +942,68 @@ Are you really want to continue? Debugger - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - + Debugger path error 调试路径错误 - + Debugger's path "%1" contains non-ascii characters. 调试路径"%1"中包含非ASCII字符(如,中文字符) - + This prevents it from executing. 这会导致调试器无法启动。 - + Debugger not exists 找不到调试器 - + Can''t find debugger in : "%1" 找不到调试器程序"%1" - - + + Execute to evaluate 执行以求值 - + Not found in current context 不在当前语境中 - + Compile 编译 - + Source file is more recent than executable. 源文件比程序文件新。 - + Recompile? 重新编译? @@ -989,76 +1024,76 @@ Are you really want to continue? 失败 - - - - - - - + + + + + + + Error 错误 - + File %1 is not writable! 无法写入文件"%1" - + Save As 另存为 - + The text to be copied exceeds count limit! 要复制的内容超过了行数限制! - + The text to be copied exceeds character limit! 要复制的内容超过了字符数限制! - + The text to be cut exceeds count limit! 要剪切的内容超过了行数限制! - + The text to be cut exceeds character limit! 要剪切的内容超过了字符数限制! - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 - - + + Symbol '%1' not found! 未找到符号'%1'! - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -2767,7 +2802,7 @@ Are you really want to continue? - + Issues 编译器 @@ -2787,8 +2822,8 @@ Are you really want to continue? 工具 - - + + Run 运行 @@ -2799,7 +2834,7 @@ Are you really want to continue? - + Project 项目 @@ -2823,9 +2858,9 @@ Are you really want to continue? - - - + + + Debug 调试 @@ -2881,7 +2916,7 @@ Are you really want to continue? 替换 - + Close 关闭 @@ -2892,12 +2927,12 @@ Are you really want to continue? - + Code 代码 - + Window 窗口 @@ -2910,249 +2945,249 @@ Are you really want to continue? 工具栏2 - + New 新建 - + Ctrl+N Ctrl+N - + Open... 打开... - + Ctrl+O Ctrl+O - + Save 保存 - + Ctrl+S Ctrl+S - + Save As... 另存为... - + Save As 另存为 - + Save All 全部保存 - + Ctrl+Shift+S Ctrl+Shift+S - + Options 选项 - - - - - - - + + + + + + + Compile 编译 - + F9 F9 - + F10 F10 - + Undo 恢复 - + Ctrl+Z Ctrl+Z - + Redo 重做 - + Ctrl+Y Ctrl+Y - + Cut 剪切 - + Ctrl+X Ctrl+X - - - + + + Copy 复制 - + Ctrl+C Ctrl+C - - + + Paste 粘贴 - + Ctrl+V Ctrl+V - - + + Select All 选择全部 - + Ctrl+A Ctrl+A - + Indent 缩进 - + UnIndent 取消缩进 - + Toggle Comment 切换注释 - + Ctrl+/ Ctrl+/ - + Collapse All 全部收起 - + Uncollapse All 全部展开 - + Encode in ANSI 使用ANSI编码 - + Encode in UTF-8 使用UTF-8编码 - + Auto Detect 自动检测 - + Convert to ANSI 转换为ANSI编码 - + Convert to UTF-8 转换为UTF-8编码 - - + + Compile & Run 编译运行 - + F11 F11 - - + + Rebuild All 全部重编译 - + F12 F12 - + Stop Execution 停止执行 - + F6 F6 - + F5 F5 - + Step Over 单步跳过 - + F7 F7 - + Step Into 单步进入 @@ -3183,448 +3218,448 @@ Are you really want to continue? 书签 - + Help 帮助 - + Refactor 重构 - + Main 主工具栏 - + Compiler Set 编译器配置集 - - + + New Source File 新建源代码文件 - + Tab Tab - + Shift+Tab Shift+Tab - + F8 F8 - + Step Out 单步跳出 - + Ctrl+F8 Ctrl+F8 - + Run To Cursor 执行到光标处 - + Ctrl+F5 Ctrl+F5 - + Continue 继续执行 - + F4 F4 - + Add Watch... 添加监视 - + View CPU Window... 打开CPU信息窗口... - + Exit 退出 - + Find... 查找... - + Ctrl+F Ctrl+F - + Find in Files... 在文件中查找... - + Ctrl+Shift+F Ctrl+Shift+F - + Replace... 替换 - + Ctrl+R Ctrl+R - + Find Next 查找下一个 - + F3 F3 - + Find Previous 查找前一个 - + Shift+F3 Shift+F3 - + Remove Watch 删除监视 - - + + Remove All 清除全部监视 - + Modify Watch... 修改监视值 - + Reformat Code 对代码重新排版 - + Ctrl+Shift+A Ctrl+Shift+A - + Go back 前一次编辑位置 - + Ctrl+Alt+Left Ctrl+Alt+Left - + Forward 后一次编辑位置 - + Ctrl+Alt+Right Ctrl+Alt+Right - + Ctrl+W Ctrl+W - + Close All 全部关闭 - + Ctrl+Shift+W Ctrl+Shift+W - + Maximize Editor 最大化编辑器 - + Ctrl+F11 Ctrl+F11 - + Next 下一窗口 - + Ctrl+Tab Ctrl+Tab - + Previous 前一窗口 - + Ctrl+Shift+Tab Ctrl+Shift+Tab - + Toggle breakpoint 切换断点 - + Ctrl+F4 Ctrl+F4 - - + + Clear all breakpoints 删除所有断点 - + Breakpoint property... 设置断点条件... - + Goto Declaration 跳转到声明处 - + Goto Definition 跳转到定义处 - + Find references 查找符号的引用 - + Open containing folder 打开所在的文件夹 - + Ctrl+B Ctrl+B - + Open a terminal here 打开命令行窗口 - + File Properties... 文件属性... - + Close Project 关闭项目 - + Project options 项目属性 - + New Project... 新建项目... - + New File 新建项目文件 - + Add to project... 添加到项目... - + Remove from project 从项目删除 - + View Makefile 查看Makefile - + Clean 清理构建文件 - + Open Folder in Explorer 在浏览器中打开 - + Open In Terminal 在终端中打开 - + About 关于 - - + + Rename Symbol 重命名符号 - + Shift+F6 Shift+F6 - + Print... 打印... - + Ctrl+P Ctrl+P - - + + Export As RTF 导出为RTF - - + + Export As HTML 导出为HTML - + Move To Other View 移动到其他视图 - + Ctrl+M Ctrl+M - + C/C++ Reference C/C++参考 - + EGE Manual EGE图形库手册 - + Add Bookmark 添加书签 - + Remove Bookmark 删除书签 - + Modify Bookmark Description 修改书签说明 - + File Encoding 文件编码 - + Recent Files 文件历史 - - - - - - + + + + + + Debugging 正在调试 - - - - - - + + + + + + Running 正在运行 - - - - - - + + + + + + Compiling 正在编译 @@ -3633,510 +3668,510 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5 Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5 行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 - + Close project 关闭项目 - + Are you sure you want to close %1? 你确定要关闭'%1'吗? - - + + Confirm 确认 - - - + + + Source file is not compiled. 源文件尚未编译。 - - + + Compile now? 现在编译? - - - + + + Source file is more recent than executable. 源文件比可执行程序新。 - + Recompile now? 重新编译? - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - - + + Enable debugging 启用调试参数 - - + + You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now? 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题? - + Project not built 项目尚未构建 - + Project hasn't been built. Build it now? 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - + Recompile? 重新编译? - - + + Save last open info error 保存上次打开信息失败 - + Can't remove old last open information file '%1' 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - + Load last open info error 载入上次打开信息失败 - + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Copy all 全部复制 - - + + Clear 清除 - + Export 导出 - + Insert Snippet 插入代码段 - + Remove 删除 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: - + Show debug logs in the debug console 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove all breakpoints 清除所有断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - + Do you want to save it? 需要保存吗? - + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as - + Red panda Dev-C++ project file (*.dev) 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Add to project 添加到项目 - + Rename Error 重命名出错 - + Symbol '%1' is defined in system header. 符号'%1'在系统头文件中定义,无法修改。 - + New Name 新名称 - - + + Replace Error 替换出错 - + Can't open file '%1' for replace! 无法打开文件'%1'进行替换! - + Contents has changed since last search! 内容和上次查找时不一致。 - + Rich Text Format Files (*.rtf) RTF格式文件 (*.rtf) - + HTML Files (*.html) HTML文件 (*.html) - - - - - - - - - + + + + + + + + + Error 错误 - + Recent Projects 项目历史 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - + Compile Failed 编译失败 - + Run Failed 运行失败 - - + + Confirm Convertion 确认转换 - - + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -5542,17 +5577,17 @@ Are you really want to continue? RegisterModel - + Register 寄存器 - + Value(Hex) 值(HEX) - + Value(Dec) 值(DEC) @@ -6380,12 +6415,37 @@ Are you really want to continue? WatchModel - + + Save file '%1' failed. + 保存文件'%1'失败。 + + + + Can't open file '%1' for write. + 无法写入文件'%1'. + + + + Error in json file '%1':%2 : %3 + JSON文件'%1':%2中存在错误:%3 + + + + Execute to evaluate + 执行以求值 + + + + Can't open file '%1' for read. + 无法读取文件'%1'. + + + Expression 表达式 - + Value diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index ee803d5a..744aa542 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -12,6 +12,9 @@ #include #include #include +#include +#include +#include Debugger::Debugger(QObject *parent) : QObject(parent) { @@ -149,6 +152,7 @@ void Debugger::addBreakpoint(int line, const QString &filename) bp->line = line; bp->filename = filename; bp->condition = ""; + bp->enabled = true; mBreakpointModel->addBreakpoint(bp); if (mExecuting) { sendBreakpointCommand(bp); @@ -1810,6 +1814,65 @@ PBreakpoint BreakpointModel::breakpoint(int index) const return mList[index]; } +void BreakpointModel::save(const QString &filename) +{ + QFile file(filename); + if (file.open(QFile::WriteOnly | QFile::Truncate)) { + QJsonArray array; + foreach (const PBreakpoint& breakpoint, mList) { + QJsonObject obj; + obj["filename"]=breakpoint->filename; + obj["line"]=breakpoint->line; + obj["condition"]=breakpoint->condition; + obj["enabled"]=breakpoint->enabled; + array.append(obj); + } + QJsonDocument doc; + doc.setArray(array); + if (file.write(doc.toJson())<0) { + throw FileError(tr("Save file '%1' failed.") + .arg(filename)); + } + } else { + throw FileError(tr("Can't open file '%1' for write.") + .arg(filename)); + } +} + +void BreakpointModel::load(const QString &filename) +{ + clear(); + QFile file(filename); + if (!file.exists()) + return; + if (file.open(QFile::ReadOnly)) { + QByteArray content = file.readAll(); + QJsonParseError error; + QJsonDocument doc(QJsonDocument::fromJson(content,&error)); + if (error.error != QJsonParseError::NoError) { + throw FileError(tr("Error in json file '%1':%2 : %3") + .arg(filename) + .arg(error.offset) + .arg(error.errorString())); + } + QJsonArray array = doc.array(); + for (int i=0;i(); + breakpoint->filename = obj["filename"].toString(); + breakpoint->line = obj["line"].toInt(); + breakpoint->condition = obj["condition"].toString(); + breakpoint->enabled = obj["enabled"].toBool(); + + addBreakpoint(breakpoint); + } + } else { + throw FileError(tr("Can't open file '%1' for read.") + .arg(filename)); + } +} + void BreakpointModel::onFileDeleteLines(const QString &filename, int startLine, int count) { for (int i = mList.count()-1;i>=0;i--){ @@ -2135,6 +2198,63 @@ void WatchModel::notifyUpdated(PWatchVar var) emit dataChanged(createIndex(row,0,var.get()),createIndex(row,0,var.get())); } +void WatchModel::save(const QString &filename) +{ + QFile file(filename); + if (file.open(QFile::WriteOnly | QFile::Truncate)) { + QJsonArray array; + foreach (const PWatchVar& watchVar, mWatchVars) { + QJsonObject obj; + obj["name"]=watchVar->name; + array.append(obj); + } + QJsonDocument doc; + doc.setArray(array); + if (file.write(doc.toJson())<0) { + throw FileError(tr("Save file '%1' failed.") + .arg(filename)); + } + } else { + throw FileError(tr("Can't open file '%1' for write.") + .arg(filename)); + } +} + +void WatchModel::load(const QString &filename) +{ + clear(); + QFile file(filename); + if (!file.exists()) + return; + if (file.open(QFile::ReadOnly)) { + QByteArray content = file.readAll(); + QJsonParseError error; + QJsonDocument doc(QJsonDocument::fromJson(content,&error)); + if (error.error != QJsonParseError::NoError) { + throw FileError(tr("Error in json file '%1':%2 : %3") + .arg(filename) + .arg(error.offset) + .arg(error.errorString())); + } + QJsonArray array = doc.array(); + for (int i=0;i(); + var->parent= nullptr; + var->name = obj["name"].toString(); + var->value = tr("Execute to evaluate"); + var->gdbIndex = -1; + + addWatchVar(var); + } + } else { + throw FileError(tr("Can't open file '%1' for read.") + .arg(filename)); + } +} + + QVariant WatchModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { diff --git a/RedPandaIDE/debugger.h b/RedPandaIDE/debugger.h index 687a414f..5e88a14a 100644 --- a/RedPandaIDE/debugger.h +++ b/RedPandaIDE/debugger.h @@ -63,6 +63,7 @@ struct Breakpoint { int line; QString filename; QString condition; + bool enabled; }; using PBreakpoint = std::shared_ptr; @@ -112,6 +113,8 @@ public: PBreakpoint setBreakPointCondition(int index, const QString& condition); const QList& breakpoints() const; PBreakpoint breakpoint(int index) const; + void save(const QString& filename); + void load(const QString& filename); public slots: void onFileDeleteLines(const QString& filename, int startLine, int count); void onFileInsertLines(const QString& filename, int startLine, int count); @@ -160,6 +163,8 @@ public: void beginUpdate(); void endUpdate(); void notifyUpdated(PWatchVar var); + void save(const QString& filename); + void load(const QString& filename); private: QList mWatchVars; int mUpdateCount; diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 3cb29d6e..c9b50505 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -151,6 +151,9 @@ Editor::Editor(QWidget *parent, const QString& filename, setContextMenuPolicy(Qt::CustomContextMenu); connect(this, &QWidget::customContextMenuRequested, pMainWindow, &MainWindow::onEditorContextMenu); + + resetBookmarks(); + resetBreakpoints(); } Editor::~Editor() { @@ -3555,6 +3558,13 @@ bool Editor::hasBookmark(int line) return mBookmarkLines.contains(line); } +void Editor::clearBookmarks() +{ + mBookmarkLines.clear(); + pMainWindow->bookmarkModel()->removeBookmarks(mFilename); + invalidateGutter(); +} + void Editor::removeBreakpointFocus() { if (mActiveBreakpointLine!=-1) { diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index 160fcafd..18266e03 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -150,6 +150,7 @@ public: void addBookmark(int line,const QString& description); void removeBookmark(int line); bool hasBookmark(int line); + void clearBookmarks(); void removeBreakpointFocus(); void modifyBreakpointProperty(int line); void setActiveBreakpointFocus(int Line, bool setFocus=true); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 9525a2be..d26b7837 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -90,6 +90,11 @@ MainWindow::MainWindow(QWidget *parent) ui->tblStackTrace->setModel(mDebugger->backtraceModel()); ui->watchView->setModel(mDebugger->watchModel()); + mDebugger->breakpointModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_BREAKPOINTS_FILE); + mDebugger->watchModel()->load(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_WATCH_FILE); + // ui->actionIndent->setShortcut(Qt::Key_Tab); // ui->actionUnIndent->setShortcut(Qt::Key_Tab | Qt::ShiftModifier); @@ -1655,7 +1660,15 @@ void MainWindow::buildContextMenus() [this]() { QModelIndex index = ui->tableBookmark->currentIndex(); if (index.isValid()) { - mBookmarkModel->removeBookmarkAt(index.row()); + PBookmark bookmark = mBookmarkModel->bookmark(index.row()); + if (bookmark) { + Editor * editor = mEditorList->getOpenedEditorByFilename(bookmark->filename); + if (editor) { + editor->removeBookmark(bookmark->line); + } else { + mBookmarkModel->removeBookmarkAt(index.row()); + } + } } }); mBookmark_RemoveAll=createActionFor( @@ -1664,6 +1677,10 @@ void MainWindow::buildContextMenus() connect(mBookmark_RemoveAll, &QAction::triggered, [this]() { mBookmarkModel->clear(); + for (int i=0;ipageCount();i++) { + Editor * editor = (*mEditorList)[i]; + editor->clearBookmarks(); + } }); mBookmark_Modify=createActionFor( tr("Modify Description"), @@ -1677,10 +1694,10 @@ void MainWindow::buildContextMenus() QString desc = QInputDialog::getText(ui->tableBookmark,tr("Bookmark Description"), tr("Description:"),QLineEdit::Normal, bookmark->description); - desc = desc.trimmed(); - mBookmarkModel->updateDescription(bookmark->filename,bookmark->line,desc); + desc = desc.trimmed(); + mBookmarkModel->updateDescription(bookmark->filename,bookmark->line,desc); + } } - mBookmarkModel->clear(); }); //context menu signal for the watch view @@ -2695,6 +2712,19 @@ void MainWindow::closeEvent(QCloseEvent *event) { settings.save(); mBookmarkModel->save(includeTrailingPathDelimiter(pSettings->dirs().config()) +DEV_BOOKMARK_FILE); + if (pSettings->debugger().autosaveBreakpoints()) + mDebugger->breakpointModel()->save(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_BREAKPOINTS_FILE); + else + removeFile(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_BREAKPOINTS_FILE); + if (pSettings->debugger().autosaveWatches()) + mDebugger->watchModel()->save(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_WATCH_FILE); + else + removeFile(includeTrailingPathDelimiter(pSettings->dirs().config()) + +DEV_WATCH_FILE); + } if (!mShouldRemoveAllSettings && pSettings->editor().autoLoadLastFiles()) { diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 8bbd4662..39e09353 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -3518,7 +3518,7 @@ SynEditorOptions SynEdit::getOptions() const void SynEdit::setOptions(const SynEditorOptions &Value) { if (Value != mOptions) { - bool bSetDrag = mOptions.testFlag(eoDropFiles) != Value.testFlag(eoDropFiles); + //bool bSetDrag = mOptions.testFlag(eoDropFiles) != Value.testFlag(eoDropFiles); //if (!mOptions.testFlag(eoScrollPastEol)) setLeftChar(mLeftChar); //if (!mOptions.testFlag(eoScrollPastEof)) @@ -3795,6 +3795,8 @@ void SynEdit::doUndoItem() Item->changeStr(), Item->changeSelMode()); break; + default: + break; } } } @@ -4013,6 +4015,8 @@ void SynEdit::doRedoItem() Item->changeEndPos(), Item->changeStr(), Item->changeSelMode()); break; } + default: + break; } } } @@ -5099,6 +5103,8 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData) case SynEditorCommand::ecToggleComment: doToggleComment(); break; + default: + break; } // procedure ForceCaretX(aCaretX: integer); @@ -5461,6 +5467,8 @@ bool SynEdit::event(QEvent *event) updateMouseCursor(); break; } + default: + break; } return QAbstractScrollArea::event(event); } @@ -5498,8 +5506,8 @@ void SynEdit::mousePressEvent(QMouseEvent *event) bool bWasSel = false; bool bStartDrag = false; mMouseMoved = false; - BufferCoord TmpBegin = mBlockBegin; - BufferCoord TmpEnd = mBlockEnd; +// BufferCoord TmpBegin = mBlockBegin; +// BufferCoord TmpEnd = mBlockEnd; Qt::MouseButton button = event->button(); int X=event->pos().x(); int Y=event->pos().y(); diff --git a/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp b/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp index 6e0e38e8..24248908 100644 --- a/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp +++ b/RedPandaIDE/qsynedit/exporter/synhtmlexporter.cpp @@ -85,7 +85,7 @@ QString SynHTMLExporter::MakeValidName(const QString &Name) return Result; } -bool SynHTMLExporter::StyleNameCallback(PSynHighlighter Highlighter, PSynHighlighterAttribute Attri, const QString& UniqueAttriName, QList params) +bool SynHTMLExporter::StyleNameCallback(PSynHighlighter /*Highlighter*/, PSynHighlighterAttribute Attri, const QString& UniqueAttriName, QList params) { PSynHighlighterAttribute& AttriToFind = *static_cast(params[0]); QString& StyleName = *static_cast(params[1]); diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 7f182a71..2191a5ed 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2831,6 +2831,26 @@ void Settings::Debugger::setSkipCustomLibraries(bool newSkipCustomLibraries) mSkipCustomLibraries = newSkipCustomLibraries; } +bool Settings::Debugger::autosaveWatches() const +{ + return mAutosaveWatches; +} + +void Settings::Debugger::setAutosaveWatches(bool newAutosaveWatches) +{ + mAutosaveWatches = newAutosaveWatches; +} + +bool Settings::Debugger::autosaveBreakpoints() const +{ + return mAutosaveBreakpoints; +} + +void Settings::Debugger::setAutosaveBreakpoints(bool newAutosaveBreakpoints) +{ + mAutosaveBreakpoints = newAutosaveBreakpoints; +} + bool Settings::Debugger::useIntelStyle() const { return mUseIntelStyle; @@ -2873,6 +2893,8 @@ void Settings::Debugger::doSave() saveValue("skip_system_lib", mSkipSystemLibraries); saveValue("skip_project_lib", mSkipProjectLibraries); saveValue("skip_custom_lib", mSkipCustomLibraries); + saveValue("autosave_breakpoints",mAutosaveBreakpoints); + saveValue("autosave_watches",mAutosaveWatches); } @@ -2888,6 +2910,8 @@ void Settings::Debugger::doLoad() mSkipSystemLibraries = boolValue("skip_system_lib",true); mSkipProjectLibraries = boolValue("skip_project_lib",true); mSkipCustomLibraries = boolValue("skip_custom_lib",false); + mAutosaveBreakpoints = boolValue("autosave_breakpoints",true); + mAutosaveWatches = boolValue("autosave_watches",true); } Settings::History::History(Settings *settings):_Base(settings, SETTING_HISTORY) diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index 5914b5a0..102a1332 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -844,6 +844,12 @@ public: bool skipCustomLibraries() const; void setSkipCustomLibraries(bool newSkipCustomLibraries); + bool autosaveBreakpoints() const; + void setAutosaveBreakpoints(bool newAutosaveBreakpoints); + + bool autosaveWatches() const; + void setAutosaveWatches(bool newAutosaveWatches); + private: bool mShowCommandLog; bool mShowAnnotations; @@ -855,6 +861,8 @@ public: bool mSkipSystemLibraries; bool mSkipProjectLibraries; bool mSkipCustomLibraries; + bool mAutosaveBreakpoints; + bool mAutosaveWatches; // _Base interface protected: diff --git a/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp b/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp index 016bf1f2..b4255ed7 100644 --- a/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp @@ -31,6 +31,8 @@ void DebugGeneralWidget::doLoad() ui->chkSkipSystemLib->setChecked(pSettings->debugger().skipSystemLibraries()); ui->chkSkipProjectLib->setChecked(pSettings->debugger().skipProjectLibraries()); ui->chkSkipCustomLib->setChecked(pSettings->debugger().skipCustomLibraries()); + ui->chkAutosaveBreakpoints->setChecked(pSettings->debugger().autosaveBreakpoints()); + ui->chkAutosaveWatches->setChecked(pSettings->debugger().autosaveWatches()); } void DebugGeneralWidget::doSave() @@ -45,6 +47,8 @@ void DebugGeneralWidget::doSave() pSettings->debugger().setSkipSystemLibraries(ui->chkSkipSystemLib->isChecked()); pSettings->debugger().setSkipProjectLibraries(ui->chkSkipProjectLib->isChecked()); pSettings->debugger().setSkipCustomLibraries(ui->chkSkipCustomLib->isChecked()); + pSettings->debugger().setAutosaveBreakpoints(ui->chkAutosaveBreakpoints->isChecked()); + pSettings->debugger().setAutosaveWatches(ui->chkAutosaveWatches->isChecked()); pSettings->debugger().save(); pMainWindow->updateDebuggerSettings(); } diff --git a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui index 94296979..00be2fab 100644 --- a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui +++ b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui @@ -159,6 +159,29 @@ + + + + Autosave + + + + + + Autosave breakpoints + + + + + + + Autosave watches + + + + + + diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp index 326e58e8..50c0d9a5 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp @@ -38,7 +38,7 @@ void ExecutorGeneralWidget::doSave() pSettings->executor().save(); } -void ExecutorGeneralWidget::on_btnBrowse_triggered(QAction *arg1) +void ExecutorGeneralWidget::on_btnBrowse_clicked() { QString filename = QFileDialog::getOpenFileName( this, diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.h b/RedPandaIDE/settingsdialog/executorgeneralwidget.h index 25ccba8e..7303b8d3 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.h +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.h @@ -24,7 +24,7 @@ protected: void doLoad() override; void doSave() override; private slots: - void on_btnBrowse_triggered(QAction *arg1); + void on_btnBrowse_clicked(); }; #endif // EXECUTORGENERALWIDGET_H diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 6e35b577..903a5f7f 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -48,6 +48,8 @@ #define DEV_SHORTCUT_FILE "shortcuts.json" #define DEV_TOOLS_FILE "tools.json" #define DEV_BOOKMARK_FILE "bookmarks.json" +#define DEV_BREAKPOINTS_FILE "breakpoints.json" +#define DEV_WATCH_FILE "watch.json" #ifdef Q_OS_WIN # define PATH_SENSITIVITY Qt::CaseInsensitive diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index a40548bc..7c0b4238 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -829,3 +829,9 @@ void StringToFile(const QString &str, const QString &fileName) stream<=0;i--) { + PBookmark bookmark = mBookmarks[i]; + if (bookmark->filename.compare(filename, PATH_SENSITIVITY) == 0) { + removeBookmarkAt(i); + } + } +} + void BookmarkModel::clear() { beginResetModel(); diff --git a/RedPandaIDE/widgets/bookmarkmodel.h b/RedPandaIDE/widgets/bookmarkmodel.h index 949a52d5..39bacfa0 100644 --- a/RedPandaIDE/widgets/bookmarkmodel.h +++ b/RedPandaIDE/widgets/bookmarkmodel.h @@ -23,6 +23,7 @@ public: PBookmark bookmark(int i); PBookmark bookmark(const QString&filename, int line); bool removeBookmark(const QString&filename, int line); + void removeBookmarks(const QString& filename); void clear(); bool updateDescription(const QString&filename, int line, const QString& description); void save(const QString& filename); diff --git a/RedPandaIDE/widgets/qconsole.cpp b/RedPandaIDE/widgets/qconsole.cpp index e2af3976..bc7b860d 100644 --- a/RedPandaIDE/widgets/qconsole.cpp +++ b/RedPandaIDE/widgets/qconsole.cpp @@ -444,13 +444,13 @@ void QConsole::contentsLayouted() updateScrollbars(); } -void QConsole::contentsRowsAdded(int rowCount) +void QConsole::contentsRowsAdded(int ) { ensureCaretVisible(); updateScrollbars(); } -void QConsole::contentsLastRowsRemoved(int rowCount) +void QConsole::contentsLastRowsRemoved(int ) { ensureCaretVisible(); updateScrollbars(); @@ -466,7 +466,6 @@ void QConsole::scrollTimerHandler() { QPoint iMousePos; - int X, Y; iMousePos = QCursor::pos(); iMousePos = mapFromGlobal(iMousePos); @@ -834,7 +833,7 @@ bool QConsole::caretInSelection() { if (!hasSelection()) return false; - LineChar selBegin = selectionBegin(); + //LineChar selBegin = selectionBegin(); LineChar selEnd = selectionEnd(); QString lastline = mContents.getLastLine(); int editBeginChar = lastline.length() - mCurrentEditableLine.length(); @@ -930,6 +929,8 @@ bool QConsole::event(QEvent *event) mInactiveSelectionBackground = palette().color(QPalette::Inactive,QPalette::Highlight); mInactiveSelectionForeground = palette().color(QPalette::Inactive,QPalette::HighlightedText); break; + default: + break; } return QAbstractScrollArea::event(event); } @@ -940,8 +941,7 @@ void QConsole::resizeEvent(QResizeEvent *) std::shared_ptr image = std::make_shared(clientWidth(),clientHeight(), QImage::Format_ARGB32); if (mContentImage) { - QRect newRect = image->rect().intersected(mContentImage->rect()); - + //QRect newRect = image->rect().intersected(mContentImage->rect()); QPainter painter(image.get()); painter.fillRect(viewport()->rect(),mBackground); // painter.drawImage(newRect,*mContentImage);