From 284a8ed695cad93b8f93d52526026be83d6ece2d Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 15 Nov 2021 22:08:35 +0800 Subject: [PATCH] - fix: add unit to project not correctly set new unit file's encoding - fix: correctly set encoding for the new added project unit file - fix: if there's a project openned, new file should ask user if he want to add the new file to the project - fix: when adding a file openned in the editor to the project, properties of it are not correctly setted. - enhancement: when remove a file from the project, also ask if user want to remove it from disk - fix: double click a project's .dev file in the Files panel should load the project --- NEWS.md | 5 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 104937 -> 105123 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 222 +++++++++++++++++-------------- RedPandaIDE/mainwindow.cpp | 108 +++++++++------ RedPandaIDE/mainwindow.h | 1 + RedPandaIDE/mainwindow.ui | 2 +- RedPandaIDE/project.cpp | 21 ++- RedPandaIDE/project.h | 2 +- 8 files changed, 209 insertions(+), 152 deletions(-) diff --git a/NEWS.md b/NEWS.md index b9300a12..e67be16f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,11 @@ Version 0.8.10 For Dev-C++ 7 Beta - fix: Shouldn't update auto link settings, if the header name to be modified is unchanged - fix: add unit to project not correctly set new unit file's encoding + - fix: correctly set encoding for the new added project unit file + - fix: if there's a project openned, new file should ask user if he want to add the new file to the project + - fix: when adding a file openned in the editor to the project, properties of it are not correctly setted. + - enhancement: when remove a file from the project, also ask if user want to remove it from disk + - fix: double click a project's .dev file in the Files panel should load the project Version 0.8.9 For Dev-C++ 7 Beta - fix: text color of labels in statusbar not correctly updated when change theme diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 0587e6c1a74433895334352184b9b04dd5d60750..a8bb9e703161aafbdea085697440192573bdadef 100644 GIT binary patch delta 6860 zcmYkAc|cA1`^TTpxo5ri+*yP`08)SxZHcqD^~A(=rHy(H%0AwQxwu@*P{Y z!Dwihh%CiWBKy9D?6NcYJ?{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44TJpve;qt<5N z$D5j1I?PFLI;~KxOAiA0d6(Mq%eMMiPg9*N%%J0wdhlFyokSP)&~bQsr^9rklZU}U zJ*E5{5^#n(<=i7Q&7SI+!+HV~)~RQX#fMJHQO~`J6rKg@Wuc#OypYsCi&L?mTve~k z!HOh%sMp=Yr=8!Z&U=rXymvvpIjjg^Q?)w3mBG1xt$ODc`(D_QF5a;n7q N#Q@WipF3>x{tpr@^g93m diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index 875cf2d7..0103efed 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -82,12 +82,12 @@ 链接参数 - + Header exists 头文件已存在 - + Header already exists. 头文件已存在。 @@ -2857,11 +2857,11 @@ Are you really want to continue? - - - - - + + + + + Issues 编译器 @@ -3269,7 +3269,7 @@ Are you really want to continue? - + New Problem Set 新建试题集 @@ -3288,14 +3288,14 @@ Are you really want to continue? - + Save Problem Set 保存试题集 - + Load Problem Set 载入试题集 @@ -3630,7 +3630,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -3731,7 +3731,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -3752,13 +3752,13 @@ Are you really want to continue? - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -3824,7 +3824,7 @@ Are you really want to continue? - + Open Folder 打开文件夹 @@ -4055,7 +4055,7 @@ Are you really want to continue? - + Problem Set %1 试题集%1 @@ -4122,15 +4122,15 @@ Are you really want to continue? - - + + Bookmark Description 书签描述 - - + + Description: 描述: @@ -4294,183 +4294,203 @@ Are you really want to continue? - + Do you want to save it? 需要保存吗? - - - - + + New Project File? + 新建项目文件? + + + + Do you want to add the new file to the project? + 您是否要将新建的文件加入项目? + + + + + + 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 无法使用模板创建项目 - + + 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 添加到项目 - + 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 @@ -4485,11 +4505,11 @@ Are you really want to continue? - - - - - + + + + + Error 错误 @@ -4519,55 +4539,55 @@ Are you really want to continue? 是否保持它在小熊猫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个文件) @@ -4695,77 +4715,77 @@ Are you really want to continue? 无标题 - + Can't save file 无法保存文件 - + Can't save file '%1' 无法保存文件'%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++编辑器开发 @@ -5156,24 +5176,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' @@ -6483,7 +6503,7 @@ Are you really want to continue? 自动链接 - + @@ -6559,7 +6579,7 @@ Are you really want to continue? 杂项 - + Program Runner diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index abbce54d..58eb48a6 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -3211,6 +3211,15 @@ CPUDialog *MainWindow::cpuDialog() const void MainWindow::on_actionNew_triggered() { + if (mProject) { + if (QMessageBox::question(this, + tr("New Project File?"), + tr("Do you want to add the new file to the project?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + newProjectUnitFile(); + return; + } + } newEditor(); } @@ -4654,46 +4663,7 @@ void MainWindow::on_actionSaveAll_triggered() void MainWindow::on_actionProject_New_File_triggered() { - int idx = -1; - if (!mProject) - return; - QModelIndex current = ui->projectView->currentIndex(); - FolderNode * node = nullptr; - if (current.isValid()) { - node = static_cast(current.internalPointer()); - } - QString newFileName; - do { - newFileName = tr("untitled")+QString("%1").arg(getNewFileNumber()); - if (mProject->options().useGPP) { - newFileName+=".cpp"; - } else { - newFileName+=".c"; - } - } while (fileExists(QDir(mProject->directory()).absoluteFilePath(newFileName))); - - newFileName = QInputDialog::getText( - this, - tr("New Project File Name"), - tr("File Name:"), - QLineEdit::Normal, - newFileName); - if (newFileName.isEmpty()) - return; - if (fileExists(QDir(mProject->directory()).absoluteFilePath(newFileName))) { - QMessageBox::critical(this,tr("File Already Exists!"), - tr("File '%1' already exists!").arg(newFileName)); - return; - } - PProjectUnit newUnit = mProject->newUnit( - mProject->pointerToNode(node),newFileName); - idx = mProject->units().count()-1; - mProject->saveUnits(); - updateProjectView(); - Editor * editor = mProject->openUnit(idx); - //editor->setUseCppSyntax(mProject->options().useGPP); - //editor->setModified(true); - editor->activate(); + newProjectUnitFile(); } @@ -4742,9 +4712,14 @@ void MainWindow::on_actionRemove_from_project_triggered() continue; selected.insert(folderNode->unitIndex); }; + + bool removeFile = (QMessageBox::question(this,tr("Remove file"), + tr("Remove the file from disk?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes); + for (int i=mProject->units().count()-1;i>=0;i--) { if (selected.contains(i)) { - mProject->removeEditor(i,true); + mProject->removeUnit(i,true,removeFile); } } @@ -4952,6 +4927,50 @@ void MainWindow::prepareTabMessagesData() mTabMessagesData[widget]=info; } } + +void MainWindow::newProjectUnitFile() +{ + if (!mProject) + return; + int idx = -1; + QModelIndex current = ui->projectView->currentIndex(); + FolderNode * node = nullptr; + if (current.isValid()) { + node = static_cast(current.internalPointer()); + } + QString newFileName; + do { + newFileName = tr("untitled")+QString("%1").arg(getNewFileNumber()); + if (mProject->options().useGPP) { + newFileName+=".cpp"; + } else { + newFileName+=".c"; + } + } while (fileExists(QDir(mProject->directory()).absoluteFilePath(newFileName))); + + newFileName = QInputDialog::getText( + this, + tr("New Project File Name"), + tr("File Name:"), + QLineEdit::Normal, + newFileName); + if (newFileName.isEmpty()) + return; + if (fileExists(QDir(mProject->directory()).absoluteFilePath(newFileName))) { + QMessageBox::critical(this,tr("File Already Exists!"), + tr("File '%1' already exists!").arg(newFileName)); + return; + } + PProjectUnit newUnit = mProject->newUnit( + mProject->pointerToNode(node),newFileName); + idx = mProject->units().count()-1; + mProject->saveUnits(); + updateProjectView(); + Editor * editor = mProject->openUnit(idx); + //editor->setUseCppSyntax(mProject->options().useGPP); + //editor->setModified(true); + editor->activate(); +} void MainWindow::on_EditorTabsLeft_currentChanged(int) { Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsLeft); @@ -5383,9 +5402,10 @@ void MainWindow::on_treeFiles_doubleClicked(const QModelIndex &index) QString filepath = mFileSystemModel.filePath(index); QFileInfo file(filepath); if (file.isFile()) { - Editor * editor = mEditorList->getEditorByFilename(filepath); - if (editor) { - editor->activate(); + if (getFileType(filepath)==FileType::Project) { + openProject(filepath); + } else { + openFile(filepath); } } } diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 03a9b403..c11f45b7 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -226,6 +226,7 @@ private: void showHideMessagesTab(QWidget *widget, bool show); void prepareTabInfosData(); void prepareTabMessagesData(); + void newProjectUnitFile(); private slots: void onAutoSaveTimeout(); diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index 507115f3..70747547 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -85,7 +85,7 @@ QTabWidget::West - 1 + 3 true diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index fc228a73..3e55b7a3 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -340,7 +340,7 @@ void Project::rebuildNodes() emit nodesChanged(); } -bool Project::removeEditor(int index, bool doClose) +bool Project::removeUnit(int index, bool doClose , bool removeFile) { mModel.beginUpdate(); auto action = finally([this]{ @@ -357,6 +357,10 @@ bool Project::removeEditor(int index, bool doClose) return false; } + if (removeFile) { + QFile::remove(unit->fileName()); + } + //if not fUnits.GetItem(index).fNew then PFolderNode node = unit->node(); PFolderNode parent = node->parent.lock(); @@ -788,10 +792,17 @@ PProjectUnit Project::addUnit(const QString &inFileName, PFolderNode parentNode, newUnit = std::make_shared(this); // Set all properties - newUnit->setEncoding(toByteArray(mOptions.encoding)); newUnit->setFileName(QDir(directory()).filePath(inFileName)); newUnit->setNew(false); - newUnit->setEditor(nullptr); + Editor * e= pMainWindow->editorList()->getOpenedEditorByFilename(newUnit->fileName()); + if (e) { + newUnit->setEditor(e); + newUnit->setEncoding(e->encodingOption()); + e->setInProject(true); + } else { + newUnit->setEditor(nullptr); + newUnit->setEncoding(ENCODING_AUTO_DETECT); + } newUnit->setFolder(getFolderPath(parentNode)); newUnit->setNode(makeNewFileNode(extractFileName(newUnit->fileName()), false, parentNode)); newUnit->node()->unitIndex = mUnits.count(); @@ -1515,7 +1526,7 @@ void Project::removeFolderRecurse(PFolderNode node) } else if (childNode->unitIndex >= 0 && childNode->level > 0) { // Remove editor in folder from project int editorIndex = childNode->unitIndex; - if (!removeEditor(editorIndex,true)) + if (!removeUnit(editorIndex,true)) return; } } @@ -1920,7 +1931,7 @@ bool ProjectModel::setData(const QModelIndex &index, const QVariant &value, int // Remove it from the current project... int projindex = mProject->indexInUnits(newName); if (projindex>=0) { - mProject->removeEditor(projindex,false); + mProject->removeUnit(projindex,false); } // All references to the file are removed. Delete the file from disk diff --git a/RedPandaIDE/project.h b/RedPandaIDE/project.h index 3c37f000..e5f6f392 100644 --- a/RedPandaIDE/project.h +++ b/RedPandaIDE/project.h @@ -148,7 +148,7 @@ public: const QString& customFileName=""); Editor* openUnit(int index); void rebuildNodes(); - bool removeEditor(int index, bool doClose); + bool removeUnit(int index, bool doClose, bool removeFile = false); bool removeFolder(PFolderNode node); void resetParserProjectFiles(); void saveAll(); // save [Project] and all [UnitX]