From 63e1b44fa518e588c01447645d0c679eaca9eadf Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 27 Dec 2021 22:46:54 +0800 Subject: [PATCH] - fix: can't reformat code - enhancement: add option for setting astyle path - fix: wrong file wildcard (*.*) in linux --- NEWS.md | 3 + RedPandaIDE/RedPandaIDE.pro | 3 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 108507 -> 109907 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 323 +++++++++++------- RedPandaIDE/editor.cpp | 15 + RedPandaIDE/settings.cpp | 12 + RedPandaIDE/settings.h | 4 + .../environmentprogramswidget.cpp | 3 +- .../environmentprogramswidget.h | 6 +- .../settingsdialog/executorgeneralwidget.cpp | 3 +- .../settingsdialog/formatterpathwidget.cpp | 46 +++ .../settingsdialog/formatterpathwidget.h | 31 ++ .../settingsdialog/formatterpathwidget.ui | 57 ++++ .../settingsdialog/projectdllhostwidget.cpp | 3 +- .../settingsdialog/projectmakefilewidget.cpp | 3 +- .../settingsdialog/projectoutputwidget.cpp | 3 +- RedPandaIDE/settingsdialog/settingsdialog.cpp | 7 + RedPandaIDE/systemconsts.h | 2 + RedPandaIDE/version.h | 2 +- 19 files changed, 393 insertions(+), 133 deletions(-) create mode 100644 RedPandaIDE/settingsdialog/formatterpathwidget.cpp create mode 100644 RedPandaIDE/settingsdialog/formatterpathwidget.h create mode 100644 RedPandaIDE/settingsdialog/formatterpathwidget.ui diff --git a/NEWS.md b/NEWS.md index 5212ff5d..5ce0cd5a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ Version 0.12.5 For Dev-C++ 7 Beta - fix: compile error in linux - fix: can't receive gdb async output for commands + - fix: can't reformat code + - enhancement: add option for setting astyle path + - fix: wrong file wildcard (*.*) in linux Version 0.12.4 For Dev-C++ 7 Beta - change: add copyright infos to each source file diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index ae5aaf17..4668c23e 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -322,12 +322,15 @@ win32: { unix { HEADERS += \ + settingsdialog/formatterpathwidget.h \ settingsdialog/environmentprogramswidget.h SOURCES += \ + settingsdialog/formatterpathwidget.cpp \ settingsdialog/environmentprogramswidget.cpp FORMS += \ + settingsdialog/formatterpathwidget.ui \ settingsdialog/environmentprogramswidget.ui } diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 40a9def03bb2c68af88de03f1943d82833f35f87..2cb506147225c4ff8a0745e9a02263f30c859bc6 100644 GIT binary patch delta 12820 zcmc(lcU%jqL_(B5HS!0R7{`}LiWlSD;&qF(JxM0wwcdhaCK(3dFS z4AB#RqM$;ej|Yf?M zJ{KpAC+=ndv54m2uS7Og-$C1DBJEm>bS)I=XDza~QDnbhk%K#m41FRpe1OP^i^Q3# z7K~08FT`#W8P`r^yo1Puy&{v7MUE^Hnc7*Tv609z5|QHsk#j;tu4!N zzGSL85wrRsUa+1fvd$xs4bF*d>?gA61(B^SL^|e(Ox24_he%(-pzlKhU&4qr_(Hq_ z_OPKI@s3_Znr9+)GeuULWD-B@==m4lnaPGE{>2p{M-BsF*;^VB-xjK>cZB#3uX6&)hpryY@9F7dtI6O}zAJ{mR@wF7C&ZxHLKAl#naM`B zrPlKf6YX6_cB|ruP25R#?;8-UdrtP1VMGOU$o`XosPqguok1Mvw4XXT@WhR{Yx>BztxWUU;fLS%vF?@B+c1vEb+*XR0+A!$i%h#t{<97eS=OXJmZqf$6s6R6 z5JXdQpZW$LBC5VuWG62gz~KSC*V6$0EUb7E4VV-G(b`i0U&Y}RkU5i>EKX#@3>r8y zkLX1Zh~PEpHVxcd6-O3Ru*FOww-+MAiYYi|A+bKEDA;6lB3A1n1sk2=hKzz|D2Ua4 zOu>ie6Z3vWA!=Jo4*g#v6<6LRT%*Di{9VpfsD)H(@aeIr1 zIa<(g6(VJz4JC9y^gJ0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&J!D)&xXtKz8=vtuwry>i**e&{wjSf=I>xPgVoYqf&G?wOh>kY4 z?QCov|MR{3=rKtNF;UUu(@r@wRJe{w8`iEgZ=)mUlJ_IdO1aX*o>}K5jGfiIRn5?@ zQDVd#@2@8DHpdE^lO5bN5zL4T-C|>HB4c7B#@RG$Zr?o5W^JPKzkKAx2DcV@uP<#H yZ~tGt%5LSUZmj-F?HX3=(EF~eO!MEp_E2RX*5SXL>Y - <html><head/><body><p>Based on Qt %1 (%2)</p><p>Build time: %3 %4</p><p>Copyright 2020-2021 royqh1979@gmail.com</p><p>Homepage: <a href="https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#007af4;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html> - <html><head/><body><p>基于 Qt %1 (%2)</p><p>构建时间: %3 %4</p><p>Copyright 2020-2021 royqh1979@gmail.com</p><p>主页: <a href="https://royqh.net/devcpp/"><span style=" text-decoration: underline; color:#007af4;">https://royqh.net/devcpp/</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Based on Qt %1 (%2)</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Build time: %3 %4</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (C) 2021-2022 royqh1979@gmail.com</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Old Delphi Version:</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2004 Bloodshed Software</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2011-2015 orwell devcpp </p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2020-2021 royqh1979@gmail.com</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Homepage: <a href="https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#007af4;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html> + - + <html><head/><body><p>Based on Qt %1 (%2)</p><p>Build time: %3 %4</p><p>Copyright 2020-2021 royqh1979@gmail.com</p><p>Homepage: <a href="https://sourceforge.net/projects/dev-cpp-2020/"><span style=" text-decoration: underline; color:#007af4;">https://sourceforge.net/projects/dev-cpp-2020/</span></a></p></body></html> + <html><head/><body><p>基于 Qt %1 (%2)</p><p>构建时间: %3 %4</p><p>Copyright 2020-2021 royqh1979@gmail.com</p><p>主页: <a href="https://royqh.net/devcpp/"><span style=" text-decoration: underline; color:#007af4;">https://royqh.net/devcpp/</span></a></p></body></html> + + + GNU General Public License GNU通用公共许可 - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -93,17 +108,17 @@ BacktraceModel - + Function 函数 - + Filename 文件名 - + Line @@ -149,37 +164,37 @@ 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'. @@ -1082,7 +1097,7 @@ Are you really want to continue? 无法在"%1"找到gdb server - + Execute to evaluate 执行以求值 @@ -1091,22 +1106,22 @@ Are you really want to continue? 不在当前语境中 - + Compile 编译 - + Source file is more recent than executable. 源文件比程序文件新。 - + Recompile? 重新编译? - + Signal "%1" Received: 收到信号"%1": @@ -1184,17 +1199,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 只读 @@ -2001,14 +2026,18 @@ Are you really want to continue? 终端 - + Choose Terminal Program 选择终端程序 - + + All files (%1) + 所有文件 (%1) + + All files (*.*) - 所有文件 (*.*) + 所有文件 (*.*) @@ -2103,14 +2132,18 @@ Are you really want to continue? 注意:由于gdb的bug,调试时不支持该功能 - + Choose input file 选择输入文件 - + + All files (%1) + 所有文件 (%1) + + All files (*.*) - 所有文件 (*.*) + 所有文件 (*.*) @@ -2693,6 +2726,30 @@ Are you really want to continue? 字符 + + FormatterPathWidget + + + Form + 表单 + + + + + Path to astyle + astyle程序 + + + + ... + ... + + + + All files (%1) + 所有文件 (%1) + + FormatterStyleModel @@ -5225,14 +5282,18 @@ Are you really want to continue? DLL文件的宿主程序: - + Choose host application 选择宿主程序 - + + All files (%1) + 所有文件 (%1) + + All files (*.*) - 所有文件 (*.*) + 所有文件 (*.*) @@ -5462,14 +5523,18 @@ Are you really want to continue? 在Makefile中包含下列文件: - + Custom makefile 自定义Makefile - + + All files (%1) + 所有文件 (%1) + + All files (*.*) - 所有文件 (*.*) + 所有文件 (*.*) @@ -5506,7 +5571,7 @@ Are you really want to continue? - + Executable output directory 可执行文件输出文件夹 @@ -5533,19 +5598,23 @@ Are you really want to continue? 自定义可执行文件名 - + Object files output directory 目标文件输出文件夹 - + Log file 日志文件 - + + All files (%1) + 所有文件 (%1) + + All files (*.*) - 所有文件 (*.*) + 所有文件 (*.*) @@ -6394,12 +6463,12 @@ Are you really want to continue? RegisterModel - + Register 寄存器 - + Value @@ -6730,7 +6799,7 @@ Are you really want to continue? SettingsDialog - + Options 选项 @@ -6756,233 +6825,239 @@ Are you really want to continue? 取消 - + Appearence 外观 - - - - - - + + + + + + Environment 环境 - + File Association 文件关联 - + Shortcuts 快捷键 - + Folders 文件夹 - + Terminal 终端程序 - + Performance 性能 - - + + 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 程序运行 - + Problem Set 试题集 - + Debugger 调试器 - + + Code Formatter 代码排版 - + + Program + 程序 + + + Tools 工具 - + Project Options 项目选项 - - - - - - - - - - + + + + + + + + + + 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? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? @@ -7309,49 +7384,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/editor.cpp b/RedPandaIDE/editor.cpp index 69da7cb3..b65e6d6e 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -3864,14 +3864,29 @@ void Editor::reformat() { if (readOnly()) return; +#ifndef Q_OS_WIN + if (!fileExists(pSettings->environment().AStylePath())) { + QMessageBox::critical(this, + tr("astyle not found"), + tr("Can't find astyle in \"%1\".").arg(pSettings->environment().AStylePath())); + return; + } +#endif //we must remove all breakpoints and syntax issues onLinesDeleted(1,lines()->count()); QByteArray content = text().toUtf8(); QStringList args = pSettings->codeFormatter().getArguments(); +#ifdef Q_OS_WIN QByteArray newContent = runAndGetOutput("astyle.exe", pSettings->dirs().appDir(), args, content); +#else + QByteArray newContent = runAndGetOutput(pSettings->environment().AStylePath(), + extractFileDir(pSettings->environment().AStylePath()), + args, + content); +#endif int oldTopLine = topLine(); BufferCoord mOldCaret = caretXY(); diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 27abeb49..17475a71 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2833,6 +2833,7 @@ void Settings::Environment::doLoad() #ifdef Q_OS_LINUX mTerminalPath = stringValue("terminal_path","/usr/bin/x-terminal-emulator"); + mAStylePath = stringValue("asyle_path","/usr/bin/astyle"); #endif } @@ -2896,6 +2897,16 @@ void Settings::Environment::setTerminalPath(const QString &terminalPath) mTerminalPath = terminalPath; } +QString Settings::Environment::AStylePath() const +{ + return mAStylePath; +} + +void Settings::Environment::setAStylePath(const QString &aStylePath) +{ + mAStylePath = aStylePath; +} + void Settings::Environment::doSave() { //Appearence @@ -2909,6 +2920,7 @@ void Settings::Environment::doSave() saveValue("default_open_folder",mDefaultOpenFolder); #ifndef Q_OS_WIN saveValue("terminal_path",mTerminalPath); + saveValue("asyle_path",mAStylePath); #endif } diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h index 1fb5ed6f..c0a2931f 100644 --- a/RedPandaIDE/settings.h +++ b/RedPandaIDE/settings.h @@ -507,6 +507,9 @@ public: QString terminalPath() const; void setTerminalPath(const QString &terminalPath); + QString AStylePath() const; + void setAStylePath(const QString &aStylePath); + private: //Appearence @@ -519,6 +522,7 @@ public: QString mDefaultOpenFolder; QString mTerminalPath; + QString mAStylePath; // _Base interface protected: void doSave() override; diff --git a/RedPandaIDE/settingsdialog/environmentprogramswidget.cpp b/RedPandaIDE/settingsdialog/environmentprogramswidget.cpp index 9af46eaf..a336a240 100644 --- a/RedPandaIDE/settingsdialog/environmentprogramswidget.cpp +++ b/RedPandaIDE/settingsdialog/environmentprogramswidget.cpp @@ -18,6 +18,7 @@ #include "ui_environmentprogramswidget.h" #include "../settings.h" #include "../iconsmanager.h" +#include "../systemconsts.h" #include @@ -55,7 +56,7 @@ void EnvironmentProgramsWidget::on_btnChooseTerminal_clicked() this, tr("Choose Terminal Program"), QString(), - tr("All files (*.*)")); + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); if (!filename.isEmpty() && fileExists(filename) ) { ui->txtTerminal->setText(filename); } diff --git a/RedPandaIDE/settingsdialog/environmentprogramswidget.h b/RedPandaIDE/settingsdialog/environmentprogramswidget.h index 2ed00e7b..50337757 100644 --- a/RedPandaIDE/settingsdialog/environmentprogramswidget.h +++ b/RedPandaIDE/settingsdialog/environmentprogramswidget.h @@ -36,9 +36,9 @@ private: // SettingsWidget interface protected: - void doLoad(); - void doSave(); - void updateIcons(const QSize &size); + void doLoad() override; + void doSave() override; + void updateIcons(const QSize &size) override; private slots: void on_btnChooseTerminal_clicked(); }; diff --git a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp index 5f9f68e4..07ee93b9 100644 --- a/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/executorgeneralwidget.cpp @@ -18,6 +18,7 @@ #include "ui_executorgeneralwidget.h" #include "../settings.h" #include "../iconsmanager.h" +#include "../systemconsts.h" #include @@ -61,7 +62,7 @@ void ExecutorGeneralWidget::on_btnBrowse_clicked() this, tr("Choose input file"), QString(), - tr("All files (*.*)")); + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); if (!filename.isEmpty() && fileExists(filename)) { ui->txtRedirectInputFile->setText(filename); } diff --git a/RedPandaIDE/settingsdialog/formatterpathwidget.cpp b/RedPandaIDE/settingsdialog/formatterpathwidget.cpp new file mode 100644 index 00000000..a8997440 --- /dev/null +++ b/RedPandaIDE/settingsdialog/formatterpathwidget.cpp @@ -0,0 +1,46 @@ +#include "formatterpathwidget.h" +#include "ui_formatterpathwidget.h" +#include "../iconsmanager.h" +#include "../settings.h" +#include "../systemconsts.h" + +#include + +FormatterPathWidget::FormatterPathWidget(const QString &name, const QString &group, QWidget *parent) : + SettingsWidget(name,group,parent), + ui(new Ui::FormatterPathWidget) +{ + ui->setupUi(this); +} + +FormatterPathWidget::~FormatterPathWidget() +{ + delete ui; +} + +void FormatterPathWidget::doLoad() +{ + ui->txtAstyle->setText(pSettings->environment().AStylePath()); +} + +void FormatterPathWidget::doSave() +{ + pSettings->environment().setAStylePath(ui->txtAstyle->text()); +} + +void FormatterPathWidget::updateIcons(const QSize &size) +{ + pIconsManager->setIcon(ui->btnChooseAstyle, IconsManager::ACTION_FILE_OPEN_FOLDER); +} + +void FormatterPathWidget::on_btnChooseAstyle_triggered(QAction *arg1) +{ + QString fileName = QFileDialog::getOpenFileName( + this, + tr("Path to astyle"), + QString(), + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); + if (!fileName.isEmpty() ) { + ui->txtAstyle->setText(fileName); + } +} diff --git a/RedPandaIDE/settingsdialog/formatterpathwidget.h b/RedPandaIDE/settingsdialog/formatterpathwidget.h new file mode 100644 index 00000000..93c54f4d --- /dev/null +++ b/RedPandaIDE/settingsdialog/formatterpathwidget.h @@ -0,0 +1,31 @@ +#ifndef FORMATTERPATHWIDGET_H +#define FORMATTERPATHWIDGET_H + +#include "settingswidget.h" +#include + +namespace Ui { +class FormatterPathWidget; +} + +class FormatterPathWidget : public SettingsWidget +{ + Q_OBJECT + +public: + explicit FormatterPathWidget(const QString& name, const QString& group, QWidget *parent = nullptr); + ~FormatterPathWidget(); + +private: + Ui::FormatterPathWidget *ui; + + // SettingsWidget interface +protected: + void doLoad() override; + void doSave() override; + void updateIcons(const QSize &size) override; +private slots: + void on_btnChooseAstyle_triggered(QAction *arg1); +}; + +#endif // FORMATTERPATHWIDGET_H diff --git a/RedPandaIDE/settingsdialog/formatterpathwidget.ui b/RedPandaIDE/settingsdialog/formatterpathwidget.ui new file mode 100644 index 00000000..e02e4751 --- /dev/null +++ b/RedPandaIDE/settingsdialog/formatterpathwidget.ui @@ -0,0 +1,57 @@ + + + FormatterPathWidget + + + + 0 + 0 + 834 + 520 + + + + Form + + + + + + Path to astyle + + + + + + + ... + + + + :/icons/images/newlook/actions/01File-09Open_Folder.svg:/icons/images/newlook/actions/01File-09Open_Folder.svg + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp b/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp index 0032cf76..39aec518 100644 --- a/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectdllhostwidget.cpp @@ -19,6 +19,7 @@ #include "../project.h" #include "../mainwindow.h" #include "../iconsmanager.h" +#include "../systemconsts.h" #include @@ -50,7 +51,7 @@ void ProjectDLLHostWidget::on_btnBrowse_clicked() this, tr("Choose host application"), pMainWindow->project()->directory(), - tr("All files (*.*)")); + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); if (!filename.isEmpty() && fileExists(filename)) { ui->txtHost->setText(filename); } diff --git a/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp b/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp index d4413f9f..be7866a4 100644 --- a/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp +++ b/RedPandaIDE/settingsdialog/projectmakefilewidget.cpp @@ -21,6 +21,7 @@ #include "../project.h" #include "../widgets/custommakefileinfodialog.h" #include "../iconsmanager.h" +#include "../systemconsts.h" #include @@ -61,7 +62,7 @@ void ProjectMakefileWidget::on_btnBrowse_clicked() this, tr("Custom makefile"), pMainWindow->project()->directory(), - tr("All files (*.*)")); + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); if (!fileName.isEmpty() && QFileInfo(fileName).exists()) { ui->txtCustomMakefile->setText(fileName); } diff --git a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp index c8d1da6b..36c0fc08 100644 --- a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp @@ -19,6 +19,7 @@ #include "../mainwindow.h" #include "../project.h" #include "../iconsmanager.h" +#include "../systemconsts.h" #include @@ -84,7 +85,7 @@ void ProjectOutputWidget::on_btnCompileLog_triggered(QAction *) this, tr("Log file"), pMainWindow->project()->directory(), - tr("All files (*.*)")); + tr("All files (%1)").arg(ALL_FILE_WILDCARD)); if (!fileName.isEmpty() ) { ui->txtCompileLog->setText(fileName); } diff --git a/RedPandaIDE/settingsdialog/settingsdialog.cpp b/RedPandaIDE/settingsdialog/settingsdialog.cpp index b0384c77..b90941f2 100644 --- a/RedPandaIDE/settingsdialog/settingsdialog.cpp +++ b/RedPandaIDE/settingsdialog/settingsdialog.cpp @@ -54,6 +54,7 @@ #endif #ifdef Q_OS_LINUX #include "environmentprogramswidget.h" +#include "formatterpathwidget.h" #endif #include #include @@ -232,6 +233,12 @@ PSettingsDialog SettingsDialog::optionDialog() widget->init(); dialog->addWidget(widget); +#ifdef Q_OS_LINUX + widget = new FormatterPathWidget(tr("Program"),tr("Code Formatter")); + widget->init(); + dialog->addWidget(widget); +#endif + widget = new ToolsGeneralWidget(tr("General"),tr("Tools")); widget->init(); dialog->addWidget(widget); diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 36e4e5d4..756761c9 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -81,6 +81,7 @@ # define STATIC_LIB_EXT "a" # define DYNAMIC_LIB_EXT "dll" # define MAKEFILE_NAME "makefile.win" +# define ALL_FILE_WILDCARD "*.*" #elif defined(Q_OS_LINUX) # define PATH_SENSITIVITY Qt::CaseSensitive # define PATH_SEPARATOR ":" @@ -90,6 +91,7 @@ # define STATIC_LIB_EXT "a" # define DYNAMIC_LIB_EXT "d" # define MAKEFILE_NAME "makefile" +# define ALL_FILE_WILDCARD "*" #else #error "Only support windows and linux now!" #endif diff --git a/RedPandaIDE/version.h b/RedPandaIDE/version.h index 43e54985..7a5a8d52 100644 --- a/RedPandaIDE/version.h +++ b/RedPandaIDE/version.h @@ -19,6 +19,6 @@ #include -#define DEVCPP_VERSION "beta.0.12.4" +#define DEVCPP_VERSION "beta.0.12.5" #endif // VERSION_H