diff --git a/NEWS.md b/NEWS.md index 101f8e67..9accc884 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ Version 0.2.2 - enhancement: support C++ using type alias; + - fix: when press shift, completion popu window will hide + - enhancement: options in debugger setting widget, to skip system/project/custom header&project files when step into Version 0.2.1 - fix: crash when load last opens diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 65ad7f82..0cc1490e 100644 Binary files a/RedPandaIDE/RedPandaIDE_zh_CN.qm and b/RedPandaIDE/RedPandaIDE_zh_CN.qm differ diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index 3443e15f..c18325be 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -487,31 +487,46 @@ Are you really want to continue? + Skip system header and library files when step into + 单步进入时,跳过系统头文件和库文件 + + + + Skip project header and library files when step into + 单步进入时,跳过项目头文件和库文件 + + + + Skip custom header and library files when step into + 单步进入时,跳过自定义头文件和库文件 + + + Debug Console 调试主控台 - + Font: 字体: - + Show only monospaced fonts 只显示等宽字体 - + Size: 大小: - + Show debug logs in the debug console 在调试主控台中显示调试器输出 - + Show full gdb annotations 在调试主控台中显示gdb输出注解 @@ -520,27 +535,27 @@ Are you really want to continue? 反汇编代码样式 - + CPU Window CPU信息窗口 - + Disassembly Coding Style: 反汇编代码样式 - + Intel Intel - + AT&&T AT&&T - + Show disassembly code in blend mode 以混合模式显示反汇编代码 @@ -615,71 +630,71 @@ 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! 要剪切的内容超过了字符数限制! - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 - - + + Symbol '%1' not found! 未找到符号'%1'! - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -2175,7 +2190,7 @@ Are you really want to continue? - + Issues 编译器 @@ -2377,10 +2392,10 @@ Are you really want to continue? - - - - + + + + Compile 编译 @@ -2426,7 +2441,7 @@ Are you really want to continue? - + Copy 复制 @@ -2780,7 +2795,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -2885,32 +2900,32 @@ Are you really want to continue? 文件历史 - - + - + + Debugging 正在调试 - - + - + + Running 正在运行 - - + - + + Compiling 正在编译 @@ -2919,317 +2934,343 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%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 清除 - + 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 跳转到定义处 - + %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 添加到项目 - - - - - - - - + + + + + + + + Error 错误 @@ -3239,75 +3280,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个文件) @@ -3364,87 +3405,87 @@ Are you really want to continue? Project - + File Not Found 未找到文件 - + Project file '%1' can't be found! 找不到项目文件'%1'! - + untitled 无标题 - + Can't save file 无法保存文件 - + Can't save file '%1' 无法保存文件'%1'. - + 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++编辑器开发 @@ -3811,24 +3852,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' @@ -4047,7 +4088,7 @@ Are you really want to continue? QApplication - + Error 错误 @@ -4378,27 +4419,27 @@ Are you really want to continue? 无标题 - + Index %1 out of range 下标"%1"越界 - + bytes 字节 - + KB KB - + MB MB - + GB GB @@ -5256,12 +5297,12 @@ Are you really want to continue? SynEditStringList - + Can't open file '%1' for read! 无法读取文件'%1'! - + Can't open file '%1' for save! 无法写入文件'%2'! diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index c554fca9..01951774 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2011,6 +2011,9 @@ bool Editor::onCompletionKeyPressed(QKeyEvent *event) QString phrase; BufferCoord pBeginPos,pEndPos; switch (event->key()) { + case Qt::Key_Shift: + //ignore it + return true; case Qt::Key_Backspace: ExecuteCommand( SynEditorCommand::ecDeleteLastChar, diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index e2169f43..4332d36e 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1109,18 +1109,12 @@ void MainWindow::debug() for (int i=0;iunits().count();i++) { QString file = mProject->units()[i]->fileName(); file.replace('\\','/'); - mDebugger->sendCommand("dir", '"'+file+ '"'); - } - for (int i=0;ioptions().includes.count();i++) { - QString file = mProject->options().includes[i]; - file.replace('\\','/'); - mDebugger->sendCommand("dir", '"'+file+ '"'); - } - for (int i=0;ioptions().libs.count();i++) { - QString file = mProject->options().libs[i]; - file.replace('\\','/'); - mDebugger->sendCommand("dir", '"'+file+ '"'); + mDebugger->sendCommand("file", '"'+file+ '"'); } + includeOrSkipDirs(mProject->options().includes, + pSettings->debugger().skipProjectLibraries()); + includeOrSkipDirs(mProject->options().libs, + pSettings->debugger().skipProjectLibraries()); break; case CompileTarget::File: // Check if we enabled proper options @@ -1183,7 +1177,6 @@ void MainWindow::debug() } } - prepareDebugger(); mDebugger->setUseUTF8(e->fileEncoding() == ENCODING_UTF8 || e->fileEncoding() == ENCODING_UTF8_BOM); @@ -1197,32 +1190,16 @@ void MainWindow::debug() updateEditorActions(); // Add library folders - foreach (QString dir,compilerSet->libDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } - foreach (QString dir,compilerSet->defaultLibDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } - // Add include folders - foreach (QString dir,compilerSet->CIncludeDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } - foreach (QString dir,compilerSet->CppIncludeDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } - foreach (QString dir,compilerSet->defaultCIncludeDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } - foreach (QString dir,compilerSet->defaultCppIncludeDirs()) { - mDebugger->sendCommand("dir", - QString("\"%1\"").arg(dir.replace('\\','/'))); - } + includeOrSkipDirs(compilerSet->libDirs(), pSettings->debugger().skipCustomLibraries()); + includeOrSkipDirs(compilerSet->CIncludeDirs(), pSettings->debugger().skipCustomLibraries()); + includeOrSkipDirs(compilerSet->CppIncludeDirs(), pSettings->debugger().skipCustomLibraries()); + //gcc system libraries is auto loaded by gdb + if (pSettings->debugger().skipSystemLibraries()) { + includeOrSkipDirs(compilerSet->defaultCIncludeDirs(),true); + includeOrSkipDirs(compilerSet->defaultCIncludeDirs(),true); + includeOrSkipDirs(compilerSet->defaultCppIncludeDirs(),true); + } // Add breakpoints and watch vars // for i := 0 to fDebugger.WatchVarList.Count - 1 do @@ -1376,7 +1353,6 @@ void MainWindow::prepareDebugger() openCloseBottomPanel(true); openCloseLeftPanel(true); - // Reset watch vars // mDebugger->deleteWatchVars(false); } @@ -1446,6 +1422,24 @@ void MainWindow::scanActiveProject(bool parse) }; } +void MainWindow::includeOrSkipDirs(const QStringList &dirs, bool skip) +{ + Q_ASSERT(mDebugger); + foreach (QString dir,dirs) { + QString dirName = dir.replace('\\','/'); + if (skip) { + mDebugger->sendCommand( + "skip", + QString("-gfi \"%1/%2\"") + .arg(dirName,"*.*")); + } else { + mDebugger->sendCommand( + "dir", + QString("\"%1\"").arg(dirName)); + } + } +} + void MainWindow::saveLastOpens() { QString filename = includeTrailingPathDelimiter(pSettings->dirs().config()) + DEV_LASTOPENS_FILE; diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 65eac368..4028fcbd 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -155,7 +155,7 @@ private: QWidget* parent, QKeySequence shortcut=QKeySequence()); void scanActiveProject(bool parse=false); - + void includeOrSkipDirs(const QStringList& dirs, bool skip); private slots: void onAutoSaveTimeout(); void onFileChanged(const QString& path); diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index f0ec9212..4ed38a30 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2726,6 +2726,36 @@ void Settings::Debugger::setBlendMode(bool blendMode) mBlendMode = blendMode; } +bool Settings::Debugger::skipSystemLibraries() const +{ + return mSkipSystemLibraries; +} + +void Settings::Debugger::setSkipSystemLibraries(bool newSkipSystemLibraries) +{ + mSkipSystemLibraries = newSkipSystemLibraries; +} + +bool Settings::Debugger::skipProjectLibraries() const +{ + return mSkipProjectLibraries; +} + +void Settings::Debugger::setSkipProjectLibraries(bool newSkipProjectLibraries) +{ + mSkipProjectLibraries = newSkipProjectLibraries; +} + +bool Settings::Debugger::skipCustomLibraries() const +{ + return mSkipCustomLibraries; +} + +void Settings::Debugger::setSkipCustomLibraries(bool newSkipCustomLibraries) +{ + mSkipCustomLibraries = newSkipCustomLibraries; +} + bool Settings::Debugger::useIntelStyle() const { return mUseIntelStyle; @@ -2765,6 +2795,10 @@ void Settings::Debugger::doSave() saveValue("font_size",mFontSize); saveValue("use_intel_style",mUseIntelStyle); saveValue("blend_mode",mBlendMode); + saveValue("skip_system_lib", mSkipSystemLibraries); + saveValue("skip_project_lib", mSkipProjectLibraries); + saveValue("skip_custom_lib", mSkipCustomLibraries); + } void Settings::Debugger::doLoad() @@ -2776,6 +2810,9 @@ void Settings::Debugger::doLoad() mFontSize = intValue("font_size",10); mUseIntelStyle = boolValue("use_intel_style",true); mBlendMode = boolValue("blend_mode",true); + mSkipSystemLibraries = boolValue("skip_system_lib",true); + mSkipProjectLibraries = boolValue("skip_project_lib",true); + mSkipCustomLibraries = boolValue("skip_custom_lib",false); } Settings::History::History(Settings *settings):_Base(settings, SETTING_HISTORY) diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index bd553091..97b27437 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -828,6 +828,13 @@ public: bool blendMode() const; void setBlendMode(bool blendMode); + bool skipSystemLibraries() const; + void setSkipSystemLibraries(bool newSkipSystemLibraries); + bool skipProjectLibraries() const; + void setSkipProjectLibraries(bool newSkipProjectLibraries); + bool skipCustomLibraries() const; + void setSkipCustomLibraries(bool newSkipCustomLibraries); + private: bool mShowCommandLog; bool mShowAnnotations; @@ -836,6 +843,9 @@ public: int mFontSize; bool mUseIntelStyle; bool mBlendMode; + bool mSkipSystemLibraries; + bool mSkipProjectLibraries; + bool mSkipCustomLibraries; // _Base interface protected: diff --git a/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp b/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp index 379f7794..016bf1f2 100644 --- a/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/debuggeneralwidget.cpp @@ -28,6 +28,9 @@ void DebugGeneralWidget::doLoad() ui->rbATT->setChecked(true); } ui->chkBlendMode->setChecked(pSettings->debugger().blendMode()); + ui->chkSkipSystemLib->setChecked(pSettings->debugger().skipSystemLibraries()); + ui->chkSkipProjectLib->setChecked(pSettings->debugger().skipProjectLibraries()); + ui->chkSkipCustomLib->setChecked(pSettings->debugger().skipCustomLibraries()); } void DebugGeneralWidget::doSave() @@ -39,7 +42,9 @@ void DebugGeneralWidget::doSave() pSettings->debugger().setShowAnnotations(ui->chkShowFullAnnotation->isChecked()); pSettings->debugger().setUseIntelStyle(ui->rbIntel->isChecked()); pSettings->debugger().setBlendMode(ui->chkBlendMode->isChecked()); - + pSettings->debugger().setSkipSystemLibraries(ui->chkSkipSystemLib->isChecked()); + pSettings->debugger().setSkipProjectLibraries(ui->chkSkipProjectLib->isChecked()); + pSettings->debugger().setSkipCustomLibraries(ui->chkSkipCustomLib->isChecked()); pSettings->debugger().save(); pMainWindow->updateDebuggerSettings(); } diff --git a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui index 5256f55f..94296979 100644 --- a/RedPandaIDE/settingsdialog/debuggeneralwidget.ui +++ b/RedPandaIDE/settingsdialog/debuggeneralwidget.ui @@ -14,6 +14,27 @@ Form + + + + Skip system header and library files when step into + + + + + + + Skip project header and library files when step into + + + + + + + Skip custom header and library files when step into + + +