diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index f051de9a..f90f5b77 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -432,7 +432,7 @@ void CompilerSetOptionWidget::on_btnChooseCCompiler_clicked() this, tr("Locate C Compiler"), getBinDir(), - tr("Executable files (*.exe)")); + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtCCompiler->setText(fileName); } @@ -444,7 +444,7 @@ void CompilerSetOptionWidget::on_btnChooseCppCompiler_clicked() this, tr("Locate C++ Compiler"), getBinDir(), - tr("Executable files (*.exe)")); + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtCppCompiler->setText(fileName); } @@ -456,7 +456,7 @@ void CompilerSetOptionWidget::on_btnChooseMake_clicked() this, tr("Locate Make"), getBinDir(), - tr("Executable files (*.exe)")); + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtMake->setText(fileName); } @@ -468,7 +468,7 @@ void CompilerSetOptionWidget::on_btnChooseGDB_clicked() this, tr("Locate GDB"), getBinDir(), - tr("Executable files (*.exe)")); + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtDebugger->setText(fileName); } @@ -480,7 +480,7 @@ void CompilerSetOptionWidget::on_btnChooseGDBServer_clicked() this, tr("Locate GDB Server"), getBinDir(), - tr("Executable files (*.exe)")); + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtGDBServer->setText(fileName); } @@ -489,10 +489,10 @@ void CompilerSetOptionWidget::on_btnChooseGDBServer_clicked() void CompilerSetOptionWidget::on_btnChooseResourceCompiler_clicked() { QString fileName = QFileDialog::getOpenFileName( - this, - tr("Locate windres"), - getBinDir(), - tr("Executable files (*.exe)")); + this, + tr("Locate windres"), + getBinDir(), + pSystemConsts->executableFileFilter()); if (fileExists(fileName)) ui->txtResourceCompiler->setText(fileName); } diff --git a/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp b/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp index 24293e0c..4aa16754 100644 --- a/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/toolsgeneralwidget.cpp @@ -22,6 +22,7 @@ #include "utils.h" #include "utils/escape.h" #include "utils/parsearg.h" +#include "../systemconsts.h" #include #include @@ -269,10 +270,10 @@ void ToolsGeneralWidget::on_btnBrowseWorkingDirectory_clicked() void ToolsGeneralWidget::on_btnBrowseProgram_clicked() { QString fileName = QFileDialog::getOpenFileName( - this, - tr("Select program"), - pSettings->dirs().appDir(), - tr("Executable files (*.exe)")); + this, + tr("Select program"), + pSettings->dirs().appDir(), + pSystemConsts->executableFileFilter()); if (!fileName.isEmpty() ) { ui->txtProgram->setText(fileName); } diff --git a/RedPandaIDE/systemconsts.cpp b/RedPandaIDE/systemconsts.cpp index 1daadfc0..9aaa983a 100644 --- a/RedPandaIDE/systemconsts.cpp +++ b/RedPandaIDE/systemconsts.cpp @@ -110,6 +110,15 @@ const QString &SystemConsts::defaultAllFileFilter() const noexcept return mDefaultFileFilters[0]; } +const QString &SystemConsts::executableFileFilter() const noexcept +{ +#ifdef Q_OS_WIN + return QObject::tr("Executable files (*.exe)"); +#else + return QObject::tr("All files (*.*)"); +#endif +} + QString SystemConsts::fileFilterFor(const QString &suffix) { QString t="*."+suffix; diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index 63e76e03..7ccf129c 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -133,6 +133,7 @@ public: const QString& defaultCFileFilter() const noexcept; const QString& defaultCPPFileFilter() const noexcept; const QString& defaultAllFileFilter() const noexcept; + const QString& executableFileFilter() const noexcept; QString fileFilterFor(const QString& suffix); void addDefaultFileFilter(const QString& name, const QString& fileExtensions); const QStringList &iconFileFilters() const; diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index 98d5eca5..ae473919 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -555,7 +555,7 @@ [Nota] - + The compiler process for '%1' failed to start. Falha ao iniciar a compilação para '%1'. @@ -590,7 +590,7 @@ - + - Command: %1 @@ -752,6 +752,11 @@ Find Compiler in the Folder Procurar compilador na pasta + + + Add Compiler + + @@ -937,11 +942,20 @@ - Compiler Set Folder - Nome da pasta do compilador + Compiler Folder + - + + Compiler + Compilador + + + Compiler Set Folder + Nome da pasta do compilador + + + New name Novo nome @@ -986,22 +1000,16 @@ - + Locate C Compiler - - - - - - Executable files (*.exe) - Arquivos executáveis (*.exe) + Arquivos executáveis (*.exe) - + Locate C++ Compiler @@ -1034,7 +1042,7 @@ MB - + Searching for compilers... @@ -1379,10 +1387,10 @@ sem nome - + - + @@ -1390,7 +1398,7 @@ Erro - + Save As Salvar como @@ -1400,7 +1408,7 @@ Arquivo %1 já aberto! - + The text to be copied exceeds count limit! O texto a ser copiado excede o limite do contador! @@ -1420,7 +1428,7 @@ O texto a ser removido excede o limite de caracteres! - + Print Document Imprimir documento @@ -1432,7 +1440,7 @@ Ctrl+clik para mais informações - + astyle not found astyle não encontrado @@ -1457,13 +1465,13 @@ Apenas leitura - + Error Load File Erro ao carregar arquivo - + hex: %1 @@ -2907,18 +2915,18 @@ - + Can't delete the old executable file "%1". Impossível remover o antigo arquivo executável "%1". - + Can't find the compiler for file %1 Impossível encontrar o compilador para o arquivo %1 - + The Compiler '%1' doesn't exists! O compilador '%1' é inexistente! @@ -2942,7 +2950,7 @@ - + Checking single file... @@ -2952,7 +2960,7 @@ - + Command: %1 Comando: %1 @@ -7479,7 +7487,7 @@ Arquivo '%1' existente no projeto - + Project Updated Projeto atualizado @@ -7544,7 +7552,7 @@ Desenvolvido com uso da IDE Red Panda C++ - + Error Erro @@ -7659,7 +7667,7 @@ ProjectCompiler - + Building makefile... Montando makefile ... @@ -7674,12 +7682,12 @@ Impossível abrir '%1' para gravar! - + - Resource File: %1 - Arquivo de recursos: %1 - + Compiling project changes... Compilando alterações em projeto ... @@ -8086,7 +8094,7 @@ ProjectModel - + File exists Arquivo existente @@ -8379,7 +8387,7 @@ - + Can't open file '%1' for read. @@ -8667,7 +8675,7 @@ sem nome - + Save Salvar @@ -8972,12 +8980,22 @@ Icon files Arquivos de ícones + + + Executable files (*.exe) + Arquivos executáveis (*.exe) + + + + All files (*.*) + Todos os arquivos (*.*) + Index %1 out of range Índice %1 fora dos limites - + bytes bytes @@ -9076,7 +9094,7 @@ - + GAS files @@ -10711,7 +10729,7 @@ Inserir macro - + Save Changes? Salvar alterações? @@ -10730,12 +10748,11 @@ Selecionar programa - Executable files (*.exe) - Arquivos executáveis (*.exe) + Arquivos executáveis (*.exe) - + Do you want to save changes to "%1"? diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index b1ab035a..0e28e030 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -692,7 +692,7 @@ p, li { white-space: pre-wrap; } 警告: - + Can't open file "%1" for write! 无法写入文件“%1”。 @@ -873,7 +873,7 @@ p, li { white-space: pre-wrap; } 当变量占用栈空间大于此值时报错 - + @@ -902,7 +902,7 @@ p, li { white-space: pre-wrap; } 编译时自动加入字符编码选项 - + Auto Find Compilers 自动搜索编译器 @@ -913,6 +913,11 @@ p, li { white-space: pre-wrap; } Find Compiler in the Folder 在指定文件夹中搜索编译器 + + + Add Compiler + 添加编译器 + @@ -1163,31 +1168,34 @@ p, li { white-space: pre-wrap; } - Compiler Set Folder - 编译器所在文件夹 + Compiler Folder + 编译器文件夹 - + + Compiler + 编译器 + + + Compiler Set Folder + 编译器所在文件夹 + + + New name 新名称 - + Locate C Compiler 定位C编译器 - - - - - - Executable files (*.exe) - 可执行文件 (*.exe) + 可执行文件 (*.exe) - + Locate C++ Compiler 定位C++编译器 @@ -1593,10 +1601,10 @@ p, li { white-space: pre-wrap; } 失败 - + - + @@ -1608,7 +1616,7 @@ p, li { white-space: pre-wrap; } 无法写入文件"%1" - + Error Load File 载入文件错误 @@ -1648,7 +1656,7 @@ p, li { white-space: pre-wrap; } 文件%1已经被打开! - + The text to be copied exceeds count limit! 要复制的内容超过了行数限制! @@ -1678,7 +1686,7 @@ p, li { white-space: pre-wrap; } 十进制: %1 - + Print Document 打印文档 @@ -1694,7 +1702,7 @@ p, li { white-space: pre-wrap; } 未找到符号'%1'! - + astyle not found 找不到astyle程序 @@ -3222,13 +3230,13 @@ p, li { white-space: pre-wrap; } - + Can't delete the old executable file "%1". 无法删除旧的可执行文件"%1". - + GNU Assembler GNU汇编 @@ -3239,7 +3247,7 @@ p, li { white-space: pre-wrap; } 找不到适合文件%1的编译器 - + The Compiler '%1' doesn't exists! 编译器程序"%1"不存在! @@ -7932,7 +7940,7 @@ p, li { white-space: pre-wrap; } --- stderr from %1 --- - --- 来自“%1”的stderr --- + --- 来自“%1”的stderr --- @@ -8132,7 +8140,7 @@ p, li { white-space: pre-wrap; } 文件'%1'已在项目中 - + Project Updated 项目已升级 @@ -8297,7 +8305,7 @@ p, li { white-space: pre-wrap; } ProjectCompiler - + Building makefile... 正在构建makefile... @@ -8312,12 +8320,12 @@ p, li { white-space: pre-wrap; } 无法写入文件'%1'! - + - Resource File: %1 - 资源文件: %1 - + Compiling project changes... 正在编译项目修改... @@ -9052,7 +9060,7 @@ p, li { white-space: pre-wrap; } QObject - + Save 保存 @@ -9092,12 +9100,22 @@ p, li { white-space: pre-wrap; } GAS files GAS文件 + + + Executable files (*.exe) + 可执行文件 (*.exe) + + + + All files (*.*) + 所有文件 (*.*) + ASM files ASM文件 - + Lua files Lua文件 @@ -9239,7 +9257,7 @@ p, li { white-space: pre-wrap; } 生成调试信息(-g3) - + Would you like Red Panda C++ to search for compilers in PATH? 您同意小熊猫C++在PATH路径中寻找gcc编译器吗? @@ -9482,7 +9500,7 @@ p, li { white-space: pre-wrap; } 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2 - + Binaries 二进制文件 @@ -9528,7 +9546,7 @@ p, li { white-space: pre-wrap; } 下标"%1"越界 - + bytes 字节 @@ -11607,7 +11625,7 @@ p, li { white-space: pre-wrap; } 插入宏指令 - + Save Changes? 保存修改? @@ -11646,9 +11664,8 @@ p, li { white-space: pre-wrap; } 选择程序 - Executable files (*.exe) - 可执行文件 (*.exe) + 可执行文件 (*.exe) diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index d6e5c091..64f34308 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -456,7 +456,7 @@ - + The compiler process for '%1' failed to start. @@ -491,7 +491,7 @@ - + - Command: %1 @@ -653,6 +653,11 @@ Find Compiler in the Folder + + + Add Compiler + + @@ -826,11 +831,16 @@ - Compiler Set Folder + Compiler Folder - + + Compiler + + + + New name @@ -875,22 +885,12 @@ - + Locate C Compiler - - - - - - Executable files (*.exe) - - - - Locate C++ Compiler @@ -915,7 +915,7 @@ - + Searching for compilers... @@ -1224,10 +1224,10 @@ Editor - + - + @@ -1235,7 +1235,7 @@ - + Save As @@ -1245,7 +1245,7 @@ - + The text to be copied exceeds count limit! @@ -1265,7 +1265,7 @@ - + Print Document @@ -1277,7 +1277,7 @@ - + astyle not found @@ -1302,13 +1302,13 @@ - + Error Load File - + hex: %1 @@ -2716,18 +2716,18 @@ - + Can't delete the old executable file "%1". - + Can't find the compiler for file %1 - + The Compiler '%1' doesn't exists! @@ -2747,7 +2747,7 @@ - + Checking single file... @@ -2757,7 +2757,7 @@ - + Command: %1 @@ -7152,7 +7152,7 @@ - + Project Updated @@ -7217,7 +7217,7 @@ - + Error @@ -7320,7 +7320,7 @@ ProjectCompiler - + Building makefile... @@ -7335,12 +7335,12 @@ - + - Resource File: %1 - + Compiling project changes... @@ -7739,7 +7739,7 @@ ProjectModel - + File exists @@ -8007,7 +8007,7 @@ - + Can't open file '%1' for read. @@ -8288,7 +8288,7 @@ - + Save @@ -8488,7 +8488,17 @@ - + + Executable files (*.exe) + + + + + All files (*.*) + + + + bytes @@ -8564,7 +8574,7 @@ - + GAS files @@ -9970,7 +9980,7 @@ - + Save Changes? @@ -9985,12 +9995,7 @@ - - Executable files (*.exe) - - - - + Do you want to save changes to "%1"?