diff --git a/NEWS.md b/NEWS.md index ff191d4c..c0d9fffa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +Red Panda C++ Version 1.0.10 + - fix: modify watch doesn't work + Red Panda C++ Version 1.0.9 - fix: selection in column mode not correctly drawn when has wide chars in it - fix: delete & insert in column mode not correctly handled diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index df4cc165..6bd20429 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -10,7 +10,7 @@ isEmpty(APP_NAME) { } isEmpty(APP_VERSION) { - APP_VERSION=1.0.9 + APP_VERSION=1.1.0 } diff --git a/RedPandaIDE/RedPandaIDE_pt.ts b/RedPandaIDE/RedPandaIDE_pt.ts index 60187b5a..2a15c638 100644 --- a/RedPandaIDE/RedPandaIDE_pt.ts +++ b/RedPandaIDE/RedPandaIDE_pt.ts @@ -4480,6 +4480,14 @@ Ctrl+F10 + + Modify Watch + + + + Watch Expression + + NewClassDialog diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index 91d012ea..74f0b58f 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -183,17 +183,17 @@ p, li { white-space: pre-wrap; } BacktraceModel - + Function 函数 - + Filename 文件名 - + Line @@ -239,37 +239,37 @@ p, li { white-space: pre-wrap; } 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'. @@ -1228,22 +1228,22 @@ Are you really want to continue? 不在当前语境中 - + Compile 编译 - + Source file is more recent than executable. 源文件比程序文件新。 - + Recompile? 重新编译? - + Signal "%1" Received: 收到信号"%1": @@ -1309,14 +1309,14 @@ Are you really want to continue? 要剪切的内容超过了字符数限制! - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 @@ -1325,27 +1325,27 @@ Are you really want to continue? 未找到符号'%1'! - + astyle not found 找不到astyle程序 - + Can't find astyle in "%1". 找不到astyle程序"%1". - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -3841,7 +3841,7 @@ Are you really want to continue? - + Issues 编译器 @@ -4274,7 +4274,7 @@ Are you really want to continue? - + New Problem Set 新建试题集 @@ -4293,14 +4293,14 @@ Are you really want to continue? - + Save Problem Set 保存试题集 - + Load Problem Set 载入试题集 @@ -4649,7 +4649,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -4826,7 +4826,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -4847,13 +4847,13 @@ Are you really want to continue? - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -5362,7 +5362,7 @@ Are you really want to continue? - + Problem Set %1 试题集%1 @@ -5436,15 +5436,15 @@ Are you really want to continue? - - + + Bookmark Description 书签描述 - - + + Description: 描述: @@ -5569,7 +5569,7 @@ Are you really want to continue? - + Delete 删除 @@ -5665,7 +5665,7 @@ Are you really want to continue? - + Do you want to save it? 需要保存吗? @@ -5689,7 +5689,7 @@ Are you really want to continue? - + Save Error 保存失败 @@ -5724,161 +5724,171 @@ Are you really want to continue? 输入数据文件 (*.in) - + + Modify Watch + 修改监视表达式 + + + + Watch Expression + 监视表达式 + + + 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 - + Folder %1 is not empty. 文件夹%1不是空的。 - + Do you really want to delete it? 你真的要删除它吗? - + Change working folder 改变工作文件夹 - + File '%1' is not in the current working folder. File '%1' is not in the current working folder 文件'%1'不在当前工作文件夹中。 - + Do you want to change working folder to '%1'? 是否将工作文件夹改设为'%1'? - + Can't Commit 无法提交 - + Git needs user info to commit. Git需要用信息进行提交。 - + Choose Input Data File 选择输入数据文件 - - + + All files (*.*) 所有文件 (*.*) - + Choose Expected Output Data File Choose Expected Input Data File 选择期望输出文件 - - - + + + Line %1 第%1行 - + Choose Working Folder 选择工作文件夹 - - + + Header Exists 头文件已存在 - - + + Header file "%1" already exists! 头文件"%1"已存在! - + Source Exists 源文件已存在! - + Source file "%1" already exists! 源文件"%1"已存在! - + Can't commit! 无法提交! - + The following files are in conflicting: 下列文件处于冲突状态,请解决后重新添加和提交: - + Commit Message 提交信息 - + Commit Message: 提交信息: - + Commit Failed 提交失败 - + Commit message shouldn't be empty! 提交信息不能为空! @@ -5887,52 +5897,52 @@ Are you really want to continue? 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Remove file 删除文件 - + Remove the file from disk? 同时从硬盘上删除文件? - + untitled 无标题 - + New Project File Name 新的项目文件名 - + File Name: 文件名: - + File Already Exists! 文件已存在! - + File '%1' already exists! 文件'%1'已经存在! - + Add to project 添加到项目 @@ -5947,75 +5957,75 @@ Are you really want to continue? 本操作会删除此试题的所有案例。 - + Red Panda C++ project file (*.dev) 小熊猫C++项目文件(*.dev) - + 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) - + The current problem set is not empty. 当前的试题集不是空的。 - + Problem %1 试题%1 - - + + Problem Set Files (*.pbs) 试题集文件 (*.pbs) - + Load Error 载入失败 - + Problem Case %1 试题案例%1 @@ -6035,7 +6045,7 @@ Are you really want to continue? - + Error 错误 @@ -6100,7 +6110,7 @@ Are you really want to continue? - + Confirm Convertion 确认转换 @@ -6108,7 +6118,7 @@ Are you really want to continue? - + 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 />你确定要继续吗? @@ -7919,12 +7929,12 @@ Are you really want to continue? RegisterModel - + Register 寄存器 - + Value @@ -8352,14 +8362,14 @@ Are you really want to continue? 性能 - + Compiler Set 编译器配置集 - + Compiler @@ -8371,7 +8381,7 @@ Are you really want to continue? 自动链接 - + @@ -8447,15 +8457,15 @@ Are you really want to continue? 杂项 - - + + Program Runner 程序运行 - + Problem Set 试题集 @@ -8937,49 +8947,49 @@ 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 执行以求值 - - + + Not Valid 在当前作用域中无效 - + Can't open file '%1' for read. 无法读取文件'%1'. - + Expression 表达式 - + Type 类型 - + Value diff --git a/RedPandaIDE/RedPandaIDE_zh_TW.ts b/RedPandaIDE/RedPandaIDE_zh_TW.ts index 9c817fe4..f3b35bff 100644 --- a/RedPandaIDE/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/RedPandaIDE_zh_TW.ts @@ -4480,6 +4480,14 @@ Ctrl+F10 + + Modify Watch + + + + Watch Expression + + NewClassDialog diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index f4a93013..e5ce1c42 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -480,6 +480,11 @@ PWatchVar Debugger::findWatchVar(const QString &expression) return mWatchModel->findWatchVar(expression); } +PWatchVar Debugger::watchVarAt(const QModelIndex &index) +{ + return mWatchModel->findWatchVar(index); +} + //void Debugger::notifyWatchVarUpdated(PWatchVar var) //{ // mWatchModel->notifyUpdated(var); diff --git a/RedPandaIDE/debugger.h b/RedPandaIDE/debugger.h index 681d9ee3..e7460545 100644 --- a/RedPandaIDE/debugger.h +++ b/RedPandaIDE/debugger.h @@ -288,6 +288,7 @@ public: void removeWatchVar(const QModelIndex& index); void sendAllWatchVarsToDebugger(); PWatchVar findWatchVar(const QString& expression); + PWatchVar watchVarAt(const QModelIndex& index); // void notifyWatchVarUpdated(PWatchVar var); BacktraceModel* backtraceModel(); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 2478a95b..fac394d2 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -5282,7 +5282,27 @@ void MainWindow::on_actionRemove_All_Watches_triggered() void MainWindow::on_actionModify_Watch_triggered() { - + QModelIndexList lst=ui->watchView->selectionModel()->selectedRows(); + if (lst.count()<=1) { + QModelIndex index =ui->watchView->currentIndex(); + QModelIndex parent; + parent = ui->watchView->model()->parent(index); + if (parent.isValid()) + return; + PWatchVar var = mDebugger->watchVarAt(index); + if (!var) + return; + bool isOk; + QString newExpr = QInputDialog::getText( + this,tr("Modify Watch"), + tr("Watch Expression"), + QLineEdit::Normal, + var->expression, + &isOk); + if (isOk) { + mDebugger->modifyWatchVarExpression(var->expression,newExpr); + } + } } diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro index 01797353..69d942f4 100644 --- a/Red_Panda_CPP.pro +++ b/Red_Panda_CPP.pro @@ -17,7 +17,7 @@ SUBDIRS += \ APP_NAME = RedPandaCPP -APP_VERSION = 1.0.9 +APP_VERSION = 1.1.0 linux: {