From 8b4fa1f0fc4a7cd766d85828e791cfdded294177 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Fri, 8 Oct 2021 20:01:29 +0800 Subject: [PATCH] - implement: default settings for code formatter - implement: remove all custom settings --- NEWS.md | 2 + RedPandaIDE/RedPandaIDE.pro | 3 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 87821 -> 94183 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 691 ++++++++++-------- RedPandaIDE/main.cpp | 6 + RedPandaIDE/mainwindow.cpp | 42 +- RedPandaIDE/mainwindow.h | 3 + RedPandaIDE/settings.cpp | 18 +- .../environmentfolderswidget.cpp | 57 ++ .../settingsdialog/environmentfolderswidget.h | 32 + .../environmentfolderswidget.ui | 87 +++ RedPandaIDE/settingsdialog/settingsdialog.cpp | 24 + RedPandaIDE/settingsdialog/settingsdialog.h | 4 + RedPandaIDE/toolsmanager.cpp | 4 +- 14 files changed, 626 insertions(+), 347 deletions(-) create mode 100644 RedPandaIDE/settingsdialog/environmentfolderswidget.cpp create mode 100644 RedPandaIDE/settingsdialog/environmentfolderswidget.h create mode 100644 RedPandaIDE/settingsdialog/environmentfolderswidget.ui diff --git a/NEWS.md b/NEWS.md index 5a63ef38..a4f60ece 100644 --- a/NEWS.md +++ b/NEWS.md @@ -28,6 +28,8 @@ Version 0.6.0 - fix: editor's inproject property not correctly setted (and may cause devcpp to crash when close project) - implement: print - implement: tools configuration + - implement: default settings for code formatter + - implement: remove all custom settings Version 0.5.0 - enhancement: support C++ using type alias; diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index 492cc5f3..3ecceff8 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -49,6 +49,7 @@ SOURCES += \ settingsdialog/editorsnippetwidget.cpp \ settingsdialog/editortooltipswidget.cpp \ settingsdialog/environmentfileassociationwidget.cpp \ + settingsdialog/environmentfolderswidget.cpp \ settingsdialog/environmentshortcutwidget.cpp \ settingsdialog/formattergeneralwidget.cpp \ settingsdialog/projectcompileparamaterswidget.cpp \ @@ -158,6 +159,7 @@ HEADERS += \ settingsdialog/editorsnippetwidget.h \ settingsdialog/editortooltipswidget.h \ settingsdialog/environmentfileassociationwidget.h \ + settingsdialog/environmentfolderswidget.h \ settingsdialog/environmentshortcutwidget.h \ settingsdialog/formattergeneralwidget.h \ settingsdialog/projectcompileparamaterswidget.h \ @@ -240,6 +242,7 @@ FORMS += \ settingsdialog/editorsnippetwidget.ui \ settingsdialog/editortooltipswidget.ui \ settingsdialog/environmentfileassociationwidget.ui \ + settingsdialog/environmentfolderswidget.ui \ settingsdialog/environmentshortcutwidget.ui \ settingsdialog/formattergeneralwidget.ui \ settingsdialog/projectcompileparamaterswidget.ui \ diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 02cc4b8ddc45a317ed2d857c1f30ec965b25c960..13714293b2e124ce03286419673c4e487f5cc91a 100644 GIT binary patch delta 13649 zcmbt(2UJs8*Y>{2z3D}z3YJ(~(ZT{hyl%f}`*It@SUL>&Z>-*=N^h?{k>Cp1XIQn^DzV^F9%4 zA==R%I2#xZ%m$7J&H?5EbAYFSbAfMw^N4$%;&e{X|VvG;?+(Go;}YUAj)>x16ZjuQu#c(TYs_--)_+B-(xe z*a`R;*cqBQ5cy-5pQqSxVRK+1(Uw|7Jz5aW+D+7RGtq22qOe0m`)?D47Z9CTNfcou zIuDH^C*$*i%S2K8iK*3{*qC&p;&51A8^SnZSF9jfcbeFh_ zM;nH(w_)T-8}{#K!zd>k4jO2~n9t9#qixUe4Q)6^Wkd7r=e7^`b8YzGh7BL;ZTM)v z4WF&E;p@gW{439fAO5l;Bgn8}hrTxS%P01cC(#}$vF`^GJ-b4j1ktx#C(g4gkuuea zW>PV>FBYmk<5nv&4Nlvzp}>aibAZ1P<=i2zIsEFFNnERs2wYX-I$DTnq9Lvu0$T@y zdm!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|-*X@#w+JL;+ewfyXGmt0*~Z*+P-c>6 zs6}SsmO?hBj~mk~^XAU>eKXfyG37H0Z}>|yJ?`$%&um-YhRdAuaRr;%;#;~%YyGo( qX6VnbnK2Gim>${tr!Xd>?E0z91SV$wbS5Ah!^H8~rt_In>Hh$p Print Document - + 打印文档 @@ -1670,17 +1670,61 @@ Are you really want to continue? Form - 表单 + 表单 File Types: - + 文件类型: Just check or uncheck for which file types Dev-C++ wil be registered as the default application to open them ... - + 选择想要使用Dev-C++打开的文件类型(可能需要管理员权限) + + + + EnvironmentFoldersWidget + + + Form + 表单 + + + + Configuration folder: + Confirugration folder: + 配置文件夹: + + + + Open in browser + 在文件浏览器中打开 + + + + Remove all custom settings and exit + 删除所有的自定义设置并退出程序 + + + + Confirm + 确认 + + + + Do you really want to delete all custom settings? + 你真的要删除所有自定义设置吗? + + + + Error + 错误 + + + + Failed to delete custom settings. + 删除自定义设置失败 @@ -1688,12 +1732,12 @@ Are you really want to continue? Function - 函数 + 功能 Shortcut - + 快捷键 @@ -1701,7 +1745,7 @@ Are you really want to continue? Form - 表单 + 表单 @@ -1784,18 +1828,18 @@ Are you really want to continue? Register File Association Error - + 注册文件类型关联失败 Don't have privilege to register file types! - + 没有权限进行文件类型注册! Register File Type Error - + 注册文件类型失败 @@ -2555,82 +2599,82 @@ Are you really want to continue? The default directory - + 缺省文件夹 Path to the Red Panda C++'s executable file. - + 小熊猫C++可执行文件的完整路径 Version of the Red Panda C++ - + 小熊猫C++的版本 PATH to the Red Panda C++'s installation folder. - + 小熊猫C++的安装文件夹 Current date - + 当前日期 Current date and time - + 当前时间和日期 The first include directory of the working compiler set. - + 当前编译器设置的第一个include目录 The first lib directory of the working compiler set. - + 当前编译器设置的第一个lib目录 The compiled filename - + 编译得到的文件名 Filename of the current source file - + 当前源文件名 Full path to the current source file - + 当前源文件路径 Path to the current source file's parent folder - + 当前源文件所在文件夹 Word at the cursor in the active editor - + 当前编辑器中光标处的单词 Name of the current project - + 当前项目名称 Full path to the current project file - + 项目文件完整路径 Path to the current project's folder - + 项目文件夹 @@ -2642,7 +2686,7 @@ Are you really want to continue? - + Issues 编译器 @@ -2785,7 +2829,7 @@ Are you really want to continue? 工具栏2 - + New 新建 @@ -2843,10 +2887,10 @@ Are you really want to continue? - - - - + + + + Compile 编译 @@ -2892,8 +2936,8 @@ Are you really want to continue? - - + + Copy 复制 @@ -2904,7 +2948,7 @@ Are you really want to continue? - + Paste 粘贴 @@ -2915,7 +2959,7 @@ Are you really want to continue? - + Select All 选择全部 @@ -3045,7 +3089,7 @@ Are you really want to continue? Cancel - 取消 + 取消 @@ -3081,12 +3125,12 @@ Are you really want to continue? Tab - + Tab Shift+Tab - + Shift+Tab @@ -3290,7 +3334,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -3391,7 +3435,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -3403,50 +3447,50 @@ Are you really want to continue? Print... - + 打印... Ctrl+P - + Ctrl+P - + File Encoding 文件编码 - + Recent Files 文件历史 - - - - - - + + + + + + Debugging 正在调试 - - - - - - + + + + + + Running 正在运行 - - - - - - + + + + + + Compiling 正在编译 @@ -3455,464 +3499,464 @@ 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 清除 - + Show debug logs in the debug console 在调试主控台中显示调试器输出 - + 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 跳转到定义处 - + Character sets 字符集 - + %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 添加到项目 - + 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! 内容和上次查找时不一致。 - - - - - - - - - + + + + + + + + + Error 错误 - + Recent Projects 项目历史 - + 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个文件) @@ -4746,175 +4790,175 @@ Are you really want to continue? 无法载入自动链接设置 - - - - + + + + The following %1 directories don't exist: 下列%1文件夹不存在: - - + + binary 二进制 - + No %1 directories have been specified. 未指定%1文件夹 - + C include C包含 - - + + C++ include C++包含 - - - - + + + + Cannot find the %1 "%2" 无法找到%1程序"%2" - + C options C语言选项 - + Support all ANSI standard C programs (-ansi) 支持所有ANSI标准C程序(-ansi) - + Do not recognize asm,inline or typeof as a keyword (-fno-asm) 不支持将asm、inline和typeof作为关键字(-fno-asm) - + Imitate traditional C preprocessors (-traditional-cpp) 模仿传统C预处理器行为(-traditional-cpp) - + Code Generation 代码生成 - + Optimize for the following machine (-march) 生成特定机器的专用指令(-march) - + Optimize less, while maintaining full compatibility (-tune) 完整兼容特定机器,较少优化(-tune) - + Enable use of specific instructions (-mx) 启用特定指令集(-mx) - + Optimization level (-Ox) 优化级别(-Ox) - + Compile with the following pointer size (-mx) 使用下列指针大小编译(-mx) - + Language standard (-std) 语言标准(-std) - + Profile 性能分析 - + Generate debugging information (-g3) 生成调试信息(-g3) - + Generate profiling info for analysis (-pg) 生成性能分析信息(-pg) - + Warnings 代码警告 - + Inhibit all warning messages (-w) 忽略所有警告信息(-w) - + Show most warnings (-Wall) 启用常见问题警告(-Wall) - + Show some more warnings (-Wextra) 启用更多问题警告(-Wextra) - + Check ISO C/C++/C++0x conformance (-pedantic) 检查ISO C/C++/C++0x语法一致性(-pedantic) - + Only check the code for syntax errors (-fsyntax-only) 只进行语法检查(不编译)(-fsyntax-only) - + Make all warnings into errors (-Werror) 将警告作为错误处理(-Werror) - + Abort compilation on first error (-Wfatal-errors) 遇到第一个错误后立即中止编译(-Wfatal-errors) - + Linker 链接器 - + Link an Objective C program (-lobjc) 链接Objective-C程序 (-lobjc) - + Do not use standard system libraries (-nostdlib) 不使用标准库和系统启动文件(-nostdlib) - + Do not create a console window (-mwindows) 不产生控制台窗口(-mwindows) - + Strip executable (-s) 剥除附加信息(-s) @@ -4923,43 +4967,43 @@ Are you really want to continue? 链接Ojbective C程序(-lobjc) - + Output 输出 - + Put comments in generated assembly code (-fverbose-asm) 在生成的汇编代码中加入注释(-fverbose-asm) - + Use pipes instead of temporary files during compilation (-pipe) 编译时使用管道而不是临时文件(-pipe) - + Do not assemble, compile and generate the assemble code (-S) 只生成汇编代码(-S) - - + + Confirm 确认 - + The following problems were found during validation of compiler set "%1": 在验证编译器设置"%1"时遇到了下列问题: - + Compiler set not configuared. 未配置编译器设置。 - + Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2 @@ -5656,200 +5700,206 @@ Are you really want to continue? 取消 - + Appearence 外观 - - - + + + + Environment 环境 - + File Association - + 文件关联 - + Shortcuts - + 快捷键 - - + + Folders + 文件夹 + + + + Compiler Set 编译器配置集 - - + + Compiler 编译器 - + Auto Link 自动链接 - - - - - + + + + + General 通用 - - - - - - - - - - - + + + + + + + + + + + Editor 编辑器 - + Font 字体 - + Copy & Export 复制/导出 - + Color 配色 - + Code Completion 代码补全 - + Symbol Completion 符号补全 - + Snippet 代码模板 - + Auto Syntax Checking 自动语法检查 - + Tooltips 信息提示 - + Auto save 自动保存 - + Misc 杂项 - + Program Runner 程序运行 - + Debugger 调试器 - + Code Formatter 代码排版 - + Tools - 工具 + 工具 - - - - - - - - - - + + + + + + + + + + Project 项目 - + Files 文件 - + Custom Compile options 自定义编译选项 - + Directories 文件夹 - + Precompiled Header 预编译头文件 - + Makefile Makefile - + Output 输出 - + DLL host DLL宿主 - + Version info 版本信息 - + Save Changes 保存修改 - + There are changes in the settings, do you want to save them before swtich to other page? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? @@ -5860,33 +5910,33 @@ Are you really want to continue? Read shortcut config failed - + 读取快捷键配置失败 Can't open shortcut config file '%1' for read. - + 无法读取快捷键配置文件'%1' Read shortcut config file '%1' failed:%2 - + 读取快捷键配置文件'%1'失败:%2 Save shortcut config failed - + 保存快捷键配置失败 Can't open shortcut config file '%1' for write. - + 无法写入快捷键配置文件'%1' Write to shortcut config file '%1' failed. - + 写入快捷键配置文件失败'%1'。 @@ -6017,88 +6067,88 @@ Are you really want to continue? Form - 表单 + 表单 Add - 添加 + 添加 Remove - 删除 + 删除 Browse - 浏览 + 浏览 Parameters - + 参数 Ok - 确定 + 确定 Cancel - 取消 + 取消 Title - + 名称 Pause console after the program exit - + 程序在主控台中结束运行后暂停 Program - + 程序 Working Directory - + 工作文件夹 Insert Macro - + 插入宏指令 Save Changes? - + 保存修改? Do you want to save changes to the current tool? - + 您需要保存对当前工具的修改吗? Choose Folder - 选择文件夹 + 选择文件夹 Select program - + 选择程序 Executable files (*.exe) - + 可执行文件 (*.exe) @@ -6107,37 +6157,34 @@ Are you really want to continue? 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. - - - - - Save tool config failed - + 无法写入工具配置文件'%1'。 - Write to tool config file '%1' failed. - + Write to tools config file '%1' failed. + Write to tool config file '%1' failed. + 写入工具配置文件'%1'失败。 diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index 1e56d41b..0b07db67 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -138,8 +138,14 @@ int main(int argc, char *argv[]) WindowLogoutEventFilter filter; app.installNativeEventFilter(&filter); int retCode = app.exec(); + QString configDir = pSettings->dirs().config(); + delete pSettings; // save settings // settings->compilerSets().saveSets(); + if (mainWindow.shouldRemoveAllSettings()) { + QDir dir(configDir); + dir.removeRecursively(); + } return retCode; } catch (BaseError e) { QMessageBox::critical(nullptr,QApplication::tr("Error"),e.reason()); diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index a1f03646..a852fbb3 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -46,9 +46,10 @@ MainWindow::MainWindow(QWidget *parent) ui(new Ui::MainWindow), mSearchDialog(nullptr), mQuitting(false), + mCheckSyntaxInBack(false), mOpenClosingBottomPanel(false), mOpenClosingLeftPanel(false), - mCheckSyntaxInBack(false), + mShouldRemoveAllSettings(false), mClosing(false), mSystemTurnedOff(false) { @@ -2534,18 +2535,20 @@ void MainWindow::on_actionOpen_triggered() } void MainWindow::closeEvent(QCloseEvent *event) { - Settings::UI& settings = pSettings->ui(); - settings.setMainWindowState(saveState()); - settings.setMainWindowGeometry(saveGeometry()); - settings.setBottomPanelHeight(mBottomPanelHeight); - settings.setBottomPanelIndex(ui->tabMessages->currentIndex()); - settings.setBottomPanelOpenned(mBottomPanelOpenned); - settings.setLeftPanelWidth(mLeftPanelWidth); - settings.setLeftPanelIndex(ui->tabInfos->currentIndex()); - settings.setLeftPanelOpenned(mLeftPanelOpenned); - settings.save(); + if (!mShouldRemoveAllSettings) { + Settings::UI& settings = pSettings->ui(); + settings.setMainWindowState(saveState()); + settings.setMainWindowGeometry(saveGeometry()); + settings.setBottomPanelHeight(mBottomPanelHeight); + settings.setBottomPanelIndex(ui->tabMessages->currentIndex()); + settings.setBottomPanelOpenned(mBottomPanelOpenned); + settings.setLeftPanelWidth(mLeftPanelWidth); + settings.setLeftPanelIndex(ui->tabInfos->currentIndex()); + settings.setLeftPanelOpenned(mLeftPanelOpenned); + settings.save(); + } - if (pSettings->editor().autoLoadLastFiles()) { + if (!mShouldRemoveAllSettings && pSettings->editor().autoLoadLastFiles()) { saveLastOpens(); } else { //if don't save last open files, close project before editors, to save project openned editors; @@ -2559,7 +2562,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { return ; } - if (pSettings->editor().autoLoadLastFiles()) { + if (!mShouldRemoveAllSettings && pSettings->editor().autoLoadLastFiles()) { if (mProject) { closeProject(false); } @@ -2568,7 +2571,8 @@ void MainWindow::closeEvent(QCloseEvent *event) { mCompilerManager->stopCompile(); mCompilerManager->stopRun(); - mSymbolUsageManager->save(); + if (!mShouldRemoveAllSettings) + mSymbolUsageManager->save(); event->accept(); return; } @@ -2653,6 +2657,11 @@ void MainWindow::on_actionOptions_triggered() bool oldCodeCompletion = pSettings->codeCompletion().enabled(); PSettingsDialog settingsDialog = SettingsDialog::optionDialog(); settingsDialog->exec(); + if (settingsDialog->appShouldQuit()) { + mShouldRemoveAllSettings = true; + close(); + return; + } bool newCodeCompletion = pSettings->codeCompletion().enabled(); if (!oldCodeCompletion && newCodeCompletion) { @@ -4137,6 +4146,11 @@ void MainWindow::on_actionPrint_triggered() editor->print(); } +bool MainWindow::shouldRemoveAllSettings() const +{ + return mShouldRemoveAllSettings; +} + const PToolsManager &MainWindow::toolsManager() const { return mToolsManager; diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 58397d74..0b4c34ef 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -133,6 +133,8 @@ public: const PToolsManager &toolsManager() const; + bool shouldRemoveAllSettings() const; + public slots: void onCompileLog(const QString& msg); void onCompileIssue(PCompileIssue issue); @@ -434,6 +436,7 @@ private: bool mOpenClosingLeftPanel; int mLeftPanelWidth; bool mLeftPanelOpenned; + bool mShouldRemoveAllSettings; PCompileSuccessionTask mCompileSuccessionTask; QTimer mAutoSaveTimer; diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 9bfdd745..936c21f8 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3888,7 +3888,7 @@ void Settings::CodeFormatter::doSave() void Settings::CodeFormatter::doLoad() { - mBraceStyle = intValue("brace_style", FormatterBraceStyle::fbsDefault); + mBraceStyle = intValue("brace_style", FormatterBraceStyle::fbsJava); mIndentStyle = intValue("indent_style",FormatterIndentType::fitTab); // 0 isspaces, 1 is tab mTabWidth = intValue("tab_width",4); mAttachNamespaces = boolValue("attach_namespaces",false); @@ -3896,15 +3896,15 @@ void Settings::CodeFormatter::doLoad() mAttachInlines = boolValue("attach_inlines",false); mAttachExternC = boolValue("attach_extern_c",false); mAttachClosingWhile = boolValue("attach_closing_while",false); - mIndentClasses = boolValue("indent_classes",false); + mIndentClasses = boolValue("indent_classes",true); mIndentModifiers = boolValue("indent_modifiers",false); - mIndentSwitches = boolValue("indent_switches",false); + mIndentSwitches = boolValue("indent_switches",true); mIndentCases = boolValue("indent_cases",false); - mIndentNamespaces = boolValue("indent_namespaces",false); + mIndentNamespaces = boolValue("indent_namespaces",true); mIndentAfterParens = boolValue("indent_after_parents",false); mIndentContinuation = boolValue("indent_continuation",false); mIndentLabels = boolValue("indent_labels",false); - mIndentPreprocBlock = boolValue("indent_preproc_block",false); + mIndentPreprocBlock = boolValue("indent_preproc_block",true); mIndentPreprocCond = boolValue("indent_preproc_cond",false); mIndentPreprocDefine = boolValue("indent_preproc_define",false); mIndentCol1Comments = boolValue("indent_col1_comments",false); @@ -3912,13 +3912,13 @@ void Settings::CodeFormatter::doLoad() mMaxContinuationIndent = intValue("max_continuation_indent",40); mBreakBlocks = boolValue("break_blocks",false); mBreakBlocksAll = boolValue("break_blocks_all",false); - mPadOper = boolValue("pad_oper",false); - mPadComma = boolValue("pad_comma",false); + mPadOper = boolValue("pad_oper",true); + mPadComma = boolValue("pad_comma",true); mPadParen = boolValue("pad_paren",false); mPadParenOut = boolValue("pad_paren_out",false); mPadFirstParenOut = boolValue("pad_first_paren_out",false); mPadParenIn = boolValue("pad_parent_in",false); - mPadHeader = boolValue("pad_header",false); + mPadHeader = boolValue("pad_header",true); mUnpadParen = boolValue("unpad_paren",false); mDeleteEmptyLines = boolValue("delete_empty_lines",false); mDeleteMultipleEmptyLines = boolValue("delete_multiple_empty_lines",false); @@ -3941,7 +3941,7 @@ void Settings::CodeFormatter::doLoad() mCloseTemplates = boolValue("close_templates",false); mRemoveCommentPrefix = boolValue("remove_comment_prefix",false); mBreakMaxCodeLength = boolValue("break_max_code_length",false); - mMaxCodeLength = intValue("max_code_length",200); + mMaxCodeLength = intValue("max_code_length",80); mBreakAfterLogical = boolValue("break_after_logical",false); } diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp new file mode 100644 index 00000000..7a27b712 --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.cpp @@ -0,0 +1,57 @@ +#include "environmentfolderswidget.h" +#include "ui_environmentfolderswidget.h" +#include "../settings.h" +#include "../mainwindow.h" + +#include +#include +#include +#include + +EnvironmentFoldersWidget::EnvironmentFoldersWidget(const QString& name, const QString& group, QWidget *parent) : + SettingsWidget(name,group,parent), + ui(new Ui::EnvironmentFoldersWidget) +{ + ui->setupUi(this); +} + +EnvironmentFoldersWidget::~EnvironmentFoldersWidget() +{ + delete ui; +} + +void EnvironmentFoldersWidget::doLoad() +{ + ui->txtConfigFolder->setText(pSettings->dirs().config()); +} + +void EnvironmentFoldersWidget::doSave() +{ + +} + +void EnvironmentFoldersWidget::on_btnOpenConfigFolderInBrowser_clicked() +{ + QDesktopServices::openUrl( + QUrl("file:///"+ + includeTrailingPathDelimiter(pSettings->dirs().config()),QUrl::TolerantMode)); + +} + + +void EnvironmentFoldersWidget::on_btnResetDefault_clicked() +{ + if (QMessageBox::question(this,tr("Confirm"), + tr("Do you really want to delete all custom settings?"), + QMessageBox::Yes|QMessageBox::No, + QMessageBox::No)!=QMessageBox::Yes) + return; + QDir dir(pSettings->dirs().config()); + if (!dir.removeRecursively()) { + QMessageBox::critical(this,tr("Error"), + tr("Failed to delete custom settings.")); + return; + } + emit shouldQuitApp(); +} + diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.h b/RedPandaIDE/settingsdialog/environmentfolderswidget.h new file mode 100644 index 00000000..0902e4e3 --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.h @@ -0,0 +1,32 @@ +#ifndef ENVIRONMENTFOLDERSWIDGET_H +#define ENVIRONMENTFOLDERSWIDGET_H + +#include +#include "settingswidget.h" + +namespace Ui { +class EnvironmentFoldersWidget; +} + +class EnvironmentFoldersWidget : public SettingsWidget +{ + Q_OBJECT + +public: + explicit EnvironmentFoldersWidget(const QString& name, const QString& group, QWidget *parent = nullptr); + ~EnvironmentFoldersWidget(); +signals: + void shouldQuitApp(); +private: + Ui::EnvironmentFoldersWidget *ui; + + // SettingsWidget interface +protected: + void doLoad() override; + void doSave() override; +private slots: + void on_btnOpenConfigFolderInBrowser_clicked(); + void on_btnResetDefault_clicked(); +}; + +#endif // ENVIRONMENTFOLDERSWIDGET_H diff --git a/RedPandaIDE/settingsdialog/environmentfolderswidget.ui b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui new file mode 100644 index 00000000..b105490a --- /dev/null +++ b/RedPandaIDE/settingsdialog/environmentfolderswidget.ui @@ -0,0 +1,87 @@ + + + EnvironmentFoldersWidget + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + true + + + + + + + Configuration folder: + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Open in browser + + + + :/icons/images/newlook24/053-open.png:/icons/images/newlook24/053-open.png + + + + + + + Remove all custom settings and exit + + + + + + + + + + + + + diff --git a/RedPandaIDE/settingsdialog/settingsdialog.cpp b/RedPandaIDE/settingsdialog/settingsdialog.cpp index 4e3fbb15..3b5592c7 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.cpp +++ b/RedPandaIDE/settingsdialog/settingsdialog.cpp @@ -17,6 +17,7 @@ #include "environmentappearencewidget.h" #include "environmentshortcutwidget.h" #include "environmentfileassociationwidget.h" +#include "environmentfolderswidget.h" #include "executorgeneralwidget.h" #include "debuggeneralwidget.h" #include "formattergeneralwidget.h" @@ -47,6 +48,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : ui->btnApply->setEnabled(false); + mAppShouldQuit = false; + } SettingsDialog::~SettingsDialog() @@ -106,6 +109,16 @@ PSettingsDialog SettingsDialog::optionDialog() widget->init(); dialog->addWidget(widget); + widget = new EnvironmentFoldersWidget(tr("Folders"),tr("Environment")); + widget->init(); + dialog->addWidget(widget); + + connect((EnvironmentFoldersWidget*)widget, + &EnvironmentFoldersWidget::shouldQuitApp, + dialog.get(), + &SettingsDialog::closeAndQuit, + Qt::QueuedConnection); + widget = new CompilerSetOptionWidget(tr("Compiler Set"),tr("Compiler")); widget->init(); dialog->addWidget(widget); @@ -289,3 +302,14 @@ void SettingsDialog::saveCurrentPageSettings(bool confirm) } pWidget->save(); } + +bool SettingsDialog::appShouldQuit() const +{ + return mAppShouldQuit; +} + +void SettingsDialog::closeAndQuit() +{ + mAppShouldQuit = true; + close(); +} diff --git a/RedPandaIDE/settingsdialog/settingsdialog.h b/RedPandaIDE/settingsdialog/settingsdialog.h index 1a4afa05..f08d026c 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.h +++ b/RedPandaIDE/settingsdialog/settingsdialog.h @@ -30,7 +30,10 @@ public: static PSettingsDialog optionDialog(); static PSettingsDialog projectOptionDialog(); + bool appShouldQuit() const; + private slots: + void closeAndQuit(); void widget_settings_changed(bool value); void on_widgetsView_clicked(const QModelIndex &index); @@ -45,6 +48,7 @@ private: Ui::SettingsDialog *ui; QList mSettingWidgets; QStandardItemModel model; + bool mAppShouldQuit; // CompilerSetOptionWidget *pCompilerSetOptionWidget; // CompilerAutolinkWidget *pCompilerAutolinkWidget; diff --git a/RedPandaIDE/toolsmanager.cpp b/RedPandaIDE/toolsmanager.cpp index 5b3c130d..2c356676 100644 --- a/RedPandaIDE/toolsmanager.cpp +++ b/RedPandaIDE/toolsmanager.cpp @@ -81,8 +81,8 @@ void ToolsManager::save() doc.setArray(array); if (file.write(doc.toJson())<0) { QMessageBox::critical(nullptr, - tr("Save tool config failed"), - tr("Write to tool config file '%1' failed.") + tr("Save tools config failed"), + tr("Write to tools config file '%1' failed.") .arg(filename)); return; }