diff --git a/NEWS.md b/NEWS.md index bfc90d18..65e69c57 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,12 @@ Version 0.11.0 For Dev-C++ 7 Beta - - enhancement: use token list instead of single string to do code completion ( intial version) - - fix: language options in the project wizard don't work + - enhancement: redesign the expression parser for code completion + - fix: "make as default language" option in the project wizard doesn't work - fix: "ake as default language" option in the project wizard doesn't work - fix: typo errors in settings dialog - enhancement: console pauser clears STDIN buffer before show "press any key to continue..." - fix: path in macros should use system's path separator - fix: custom tools doesn't work + - enhancement: add a demo for custom tool Version 0.10.4 For Dev-C++ 7 Beta - fix: can't correctly undo/redo indent diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 5c51ed73..901344c8 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 6c614be1..32fd2989 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -7074,34 +7074,39 @@ Are you really want to continue? ToolsManager - - + + Remove Compiled + 删除编译文件 + + + + Read tools config failed 读取工具配置失败 - + Can't open tools config file '%1' for read. 无法读取工具配置文件'%1' - + Read tools config file '%1' failed:%2 读取工具配置文件'%1'失败:%2 - - + + Save tools config failed 保存工具配置失败 - + Can't open tools config file '%1' for write. 无法写入工具配置文件'%1'。 - + Write to tools config file '%1' failed. Write to tool config file '%1' failed. 写入工具配置文件'%1'失败。 diff --git a/RedPandaIDE/codesnippetsmanager.cpp b/RedPandaIDE/codesnippetsmanager.cpp index eecaecdc..c6a1f6e5 100644 --- a/RedPandaIDE/codesnippetsmanager.cpp +++ b/RedPandaIDE/codesnippetsmanager.cpp @@ -194,9 +194,9 @@ void CodeSnippetsModel::remove(int index) void CodeSnippetsModel::clear() { - beginRemoveRows(QModelIndex(),0,mSnippets.count()-1); + beginResetModel(); mSnippets.clear(); - endRemoveRows(); + endResetModel(); } QModelIndex CodeSnippetsModel::lastSnippetCaption() diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index f4018667..9d11f60e 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -1434,9 +1434,9 @@ void BreakpointModel::addBreakpoint(PBreakpoint p) void BreakpointModel::clear() { - beginRemoveRows(QModelIndex(),0,mList.size()-1); + beginResetModel(); mList.clear(); - endRemoveRows(); + endResetModel(); } void BreakpointModel::removeBreakpoint(int row) @@ -1640,9 +1640,9 @@ void BacktraceModel::addTrace(PTrace p) void BacktraceModel::clear() { - beginRemoveRows(QModelIndex(),0,mList.size()-1); + beginResetModel(); mList.clear(); - endRemoveRows(); + endResetModel(); } void BacktraceModel::removeTrace(int row) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index eb2e4469..ce663847 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1801,7 +1801,7 @@ void MainWindow::updateTools() if (!mToolsManager->tools().isEmpty()) { ui->menuTools->addSeparator(); foreach (const PToolItem& item, mToolsManager->tools()) { - QAction* action = new QAction(tr(item->title.toUtf8()),ui->menuTools); + QAction* action = new QAction(item->title,ui->menuTools); connect(action, &QAction::triggered, [item] (){ QString program = parseMacros(item->program); diff --git a/RedPandaIDE/toolsmanager.cpp b/RedPandaIDE/toolsmanager.cpp index 2c356676..7c577f3c 100644 --- a/RedPandaIDE/toolsmanager.cpp +++ b/RedPandaIDE/toolsmanager.cpp @@ -17,8 +17,17 @@ void ToolsManager::load() { //if config file not exists, copy it from data QString filename = includeTrailingPathDelimiter(pSettings->dirs().config()) + DEV_TOOLS_FILE; - if (!fileExists(filename)) + if (!fileExists(filename)) { + mTools.clear(); + PToolItem item = std::make_shared(); + item->title = tr("Remove Compiled"); + item->program = "del"; + item->workingDirectory = ""; + item->parameters = ""; + item->pauseAfterExit = false; + mTools.append(item); return; + } //read config file QFile file(filename); if (!file.open(QFile::ReadOnly)) { @@ -36,8 +45,7 @@ void ToolsManager::load() QMessageBox::critical(nullptr, tr("Read tools config failed"), tr("Read tools config file '%1' failed:%2") - .arg(filename) - .arg(error.errorString())); + .arg(filename,error.errorString())); return; } mTools.clear(); diff --git a/RedPandaIDE/widgets/ojproblemsetmodel.cpp b/RedPandaIDE/widgets/ojproblemsetmodel.cpp index 8aeb999b..186bc4cd 100644 --- a/RedPandaIDE/widgets/ojproblemsetmodel.cpp +++ b/RedPandaIDE/widgets/ojproblemsetmodel.cpp @@ -15,9 +15,9 @@ OJProblemSetModel::OJProblemSetModel(QObject *parent) : QAbstractListModel(paren void OJProblemSetModel::clear() { - beginRemoveRows(QModelIndex(),0,mProblemSet.problems.count()-1); + beginResetModel(); mProblemSet.problems.clear(); - endRemoveRows(); + endResetModel(); } int OJProblemSetModel::count() @@ -261,9 +261,9 @@ void OJProblemModel::clear() { if (mProblem==nullptr) return; - beginRemoveRows(QModelIndex(),0,mProblem->cases.count()-1); + beginResetModel(); mProblem->cases.clear(); - endRemoveRows(); + endResetModel(); } int OJProblemModel::count()