From 80b9f2b9e917df636a2da7deb566f3970a83c6a6 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Wed, 27 Oct 2021 16:58:30 +0800 Subject: [PATCH] - fix: when remove all breakpoints in the debug breakpoint view, debug tags in the opened editors are not correctly updated. - change: when start debuging, show local view instead of the debug console. --- NEWS.md | 2 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 99859 -> 99927 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 239 ++++++++++++++++--------------- RedPandaIDE/editor.h | 2 +- RedPandaIDE/mainwindow.cpp | 31 +++- RedPandaIDE/mainwindow.h | 1 + RedPandaIDE/mainwindow.ui | 4 +- 7 files changed, 157 insertions(+), 122 deletions(-) diff --git a/NEWS.md b/NEWS.md index f8a7272e..54320856 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ Version 0.7.4 - fix: when debug a project, and have breakpoints that not in opened editors, dev-cpp will crash - fix: when a file is parsing in background, exit dev-cpp will crash - fix: "tab to spaces" option in the editor general options widget doesn't work + - fix: when remove all breakpoints in the debug breakpoint view, debug tags in the opened editors are not correctly updated. + - change: when start debuging, show local view instead of the debug console. Version 0.7.3 - enhancement: icons in project view diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index c14595d9061a36f1995823e6bd68d7f4485dcb93..5fd850f705914d22a9819b2d755d1fc60618b463 100644 GIT binary patch delta 4925 zcmXAtd0bR=_s7ro&b@Q*omJLhSZ3Gr zHUT(y0DEl~kWd{hCc77G$EVK$o~N1lV(72<{4&?f*FT#`NVS>LF=mQK%v8NJ)9O<* zW8=+C#?2r20-SpR?29xYq@7kW{uWul`Gx~|`wKH;D80w%$wA6X{O4Q*Zc8)3tjlKJ z?l6(~v;nu90+eP0SB=-PIRV_sY#@@mz@4rE=*a_qybXY{0Qh&p0m`O>vim9!`+iW* zbq9Djl9o&S#T*#*^#UNNN9c8lo|MpM5<|!i`jC~&nn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&@BK1&N_+!lJ*3tk+J()!(IO@%YsNCNN`P-!`52g|A z_W)hw7)`d*7Dt25MV0#K7J$Pb)x_U&016^iY3;adq7#+$TEbF;-qAMVlxYai|eV%zpJ`dnA>D;-y#&=rh7_pFM`Gxz|3_WEpc?b(JN3Gw2>@3{s@I=Fx)-X{KiY1^ zL=mX2T8GlB{;#_Bo--ze>9oaJPt^3GvoBFly^GfDpaxoRV?bM_k=39Gg+v$y~4bUPR#>9Hd#Y25XZv zmioF{dxyN!RBy-!P+MuXcP9V|ZPC=s!g_Pnnx7k70ls$8{Bj9xJ8UG)bJgNk@gi6M z@XkLpZ)eEy3zF5mOGma1Jz>JGFC|sMK6Gst$;sh6{HWg`xozsg30x)(9*#HpX{Y3O zX$ns29@^*X!C2p?2Dec0E2+4t5}R>==DFz$K9fpazD9rABvtgH9+K8e>x3@>zJDmK z^TZ-ND3&&C#4QvhQYGC2u=IqqbumhCr>#^q42Kl+hqS$^4!8V3I#}3_Zuy&Zc)&bd z{ecn5M?0iO?`9NKgw)j2fa7bu)Vhq~tTdO-hgt%R`VS{v9$$)g3zDv9U>7=br28M? zT{3P+z3mcub(i$)Q5B|+&!v|?+hNvSA-$fcL&6HuyG*QaW`8t|Nhf9aFD)CIYVfKn Obg#W$|0zT67yTdUQOhI% diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index d597ce23..96e86334 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -2807,11 +2807,11 @@ Are you really want to continue? - - - - - + + + + + Issues 编译器 @@ -3015,8 +3015,8 @@ Are you really want to continue? - - + + Compile 编译 @@ -3466,7 +3466,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -3567,7 +3567,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -3588,13 +3588,13 @@ Are you really want to continue? - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -3640,7 +3640,7 @@ Are you really want to continue? - + Open Folder 打开文件夹 @@ -3650,7 +3650,7 @@ Are you really want to continue? 运行参数... - + File Encoding 文件编码 @@ -3891,15 +3891,15 @@ Are you really want to continue? - - + + Bookmark Description 书签描述 - - + + Description: 描述: @@ -3940,251 +3940,256 @@ Are you really want to continue? 删除所有断点 - + + Remove Breakpoint + 删除当前断点 + + + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + Open in Editor 在编辑器中打开 - + Open in External Program 使用外部程序打开 - + Open in Terminal 在终端中打开 - + Open in Windows Explorer 在Windows浏览器中打开 - + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - + Do you want to save it? 需要保存吗? - - - + + + Save Error 保存失败 - + Change Project Compiler Set 改变项目编译器配置集 - + Change the project's compiler set will lose all custom compiler set options. 改变项目的编译器配置集会导致所有的自定义编译器选项被重置。 - + Do you really want to do that? 你真的想要做那些吗? - + 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 无法使用模板创建项目 - + untitled 无标题 - + New Project File Name 新的项目文件名 - + File Name: 文件名: - + File Already Exists! 文件已存在! - + File '%1' already exists! 文件'%1'已经存在! - + 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) @@ -4197,13 +4202,13 @@ Are you really want to continue? - - - - - - - + + + + + + + Error 错误 @@ -4213,75 +4218,75 @@ Are you really want to continue? 项目历史 - + 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个文件) @@ -4363,67 +4368,67 @@ Are you really want to continue? 无法保存文件'%1'. - + Error Load File 载入文件错误 - + File Exists 文件已存在 - + File '%1' is already in the project 文件'%1'已在项目中 - + Project Updated 项目已升级 - + Your project was succesfully updated to a newer file format! 已成功将项目升级到新的格式 - + If something has gone wrong, we kept a backup-file: '%1'... 旧项目文件备份在'%1'。 - + Settings need update 设置需要更新 - + The compiler settings format of Dev-C++ has changed. Dev-C++的编译器设置格式已发生改变。 - + Please update your settings at Project >> Project Options >> Compiler and save your project. 请在项目 >> 项目属性 >> 编译器设置中修改您的设置并保存您的项目 - + Compiler not found 未找到编译器 - + The compiler set you have selected for this project, no longer exists. 您为该项目设置的编译器不存在。 - + It will be substituted by the global compiler set. 它将会被全局编译器设置代替。 - + Developed using the Red Panda Dev-C++ IDE 使用小熊猫Dev-C++编辑器开发 @@ -4814,24 +4819,24 @@ Are you really want to continue? ProjectModel - + File exists 文件已存在 - + File '%1' already exists. Delete it now? 文件'%1'已存在。是否删除? - - + + Remove failed 删除失败 - - + + Failed to remove file '%1' 无法删除文件'%1' @@ -5672,12 +5677,12 @@ Are you really want to continue? 无标题 - + constructor 构造函数 - + destructor 析构函数 @@ -6090,7 +6095,7 @@ Are you really want to continue? 自动链接 - + @@ -6166,7 +6171,7 @@ Are you really want to continue? 杂项 - + Program Runner 程序运行 diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h index 147d24e0..e02583f3 100644 --- a/RedPandaIDE/editor.h +++ b/RedPandaIDE/editor.h @@ -166,6 +166,7 @@ public: void print(); void exportAsRTF(const QString& rtfFilename); void exportAsHTML(const QString& htmlFilename); + void resetBreakpoints(); const PCppParser &parser(); @@ -182,7 +183,6 @@ private slots: private: bool isBraceChar(QChar ch); void resetBookmarks(); - void resetBreakpoints(); QChar getCurrentChar(); bool handleSymbolCompletion(QChar key); bool handleParentheseCompletion(); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 982fc43f..2a525b86 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1479,7 +1479,7 @@ void MainWindow::prepareDebugger() // Focus on the debugging buttons ui->tabInfos->setCurrentWidget(ui->tabWatch); ui->tabMessages->setCurrentWidget(ui->tabDebug); - ui->debugViews->setCurrentWidget(ui->tabDebugConsole); + ui->debugViews->setCurrentWidget(ui->tabLocals); openCloseBottomPanel(true); openCloseLeftPanel(true); @@ -1926,8 +1926,32 @@ void MainWindow::buildContextMenus() tr("Remove All Breakpoints"), ui->tblBreakpoints); connect(mBreakpointViewRemoveAllAction,&QAction::triggered, - [](){ + [this](){ pMainWindow->debugger()->deleteBreakpoints(); + for (int i=0;ipageCount();i++) { + Editor * e = (*(mEditorList))[i]; + if (e) { + e->resetBreakpoints(); + } + } + }); + mBreakpointViewRemoveAction = createActionFor( + tr("Remove Breakpoint"), + ui->tblBreakpoints); + connect(mBreakpointViewRemoveAction,&QAction::triggered, + [this](){ + int index =ui->tblBreakpoints->selectionModel()->currentIndex().row(); + + PBreakpoint breakpoint = debugger()->breakpointModel()->breakpoint(index); + if (breakpoint) { + Editor * e = mEditorList->getOpenedEditorByFilename(breakpoint->filename); + if (e) { + if (e->hasBreakpoint(breakpoint->line)) + e->toggleBreakpoint(breakpoint->line); + } else { + debugger()->breakpointModel()->removeBreakpoint(index); + } + } }); //context menu signal for project view @@ -2354,6 +2378,9 @@ void MainWindow::onBreakpointsViewContextMenu(const QPoint &pos) QMenu menu(this); menu.addAction(mBreakpointViewPropertyAction); menu.addAction(mBreakpointViewRemoveAllAction); + menu.addAction(mBreakpointViewRemoveAction); + mBreakpointViewPropertyAction->setEnabled(ui->tblBreakpoints->currentIndex().isValid()); + mBreakpointViewRemoveAction->setEnabled(ui->tblBreakpoints->currentIndex().isValid()); menu.exec(ui->tblBreakpoints->mapToGlobal(pos)); } diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 3a3606ab..aa94e255 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -504,6 +504,7 @@ private: //actions for breakpoint view QAction * mBreakpointViewPropertyAction; QAction * mBreakpointViewRemoveAllAction; + QAction * mBreakpointViewRemoveAction; //actions for project view QAction * mProject_Add_Folder; diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index ca74d761..39aa6801 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -549,7 +549,7 @@ QTabWidget::North - 1 + 2 @@ -955,7 +955,7 @@ 0 0 946 - 22 + 25