- fix: compiler options is not translated
This commit is contained in:
parent
3bcbfa08d9
commit
74fbeffeef
Binary file not shown.
|
@ -683,7 +683,7 @@ Are you really want to continue?</source>
|
|||
<message>
|
||||
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="62"/>
|
||||
<source>Show keywords in suggestions</source>
|
||||
<translation type="unfinished">提示C/C++关键字</translation>
|
||||
<translation>提示C/C++关键字</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="69"/>
|
||||
|
@ -718,7 +718,7 @@ Are you really want to continue?</source>
|
|||
<message>
|
||||
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="151"/>
|
||||
<source>Completion suggestion window width:</source>
|
||||
<translation type="unfinished">补全提示窗口宽度:</translation>
|
||||
<translation>补全提示窗口宽度:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editorcodecompletionwidget.ui" line="181"/>
|
||||
|
@ -965,6 +965,39 @@ Are you really want to continue?</source>
|
|||
<translation>方块</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditorMiscWidget</name>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="14"/>
|
||||
<source>Form</source>
|
||||
<translation>表单</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="20"/>
|
||||
<source>Open system header files in read only mode</source>
|
||||
<translation>以只读方式打开系统头文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="27"/>
|
||||
<source>Auto load files being open when Red Panda C++ last exited.</source>
|
||||
<translation>自动打开上次退出时打开的文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="34"/>
|
||||
<source>Default file type</source>
|
||||
<translation>缺省文件类型</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="40"/>
|
||||
<source>C++ files</source>
|
||||
<translation>C++语言文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/editormiscwidget.ui" line="47"/>
|
||||
<source>C files</source>
|
||||
<translation>C语言文件</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditorSymbolCompletionWidget</name>
|
||||
<message>
|
||||
|
@ -1877,7 +1910,7 @@ Are you really want to continue?</source>
|
|||
<context>
|
||||
<name>QApplication</name>
|
||||
<message>
|
||||
<location filename="main.cpp" line="90"/>
|
||||
<location filename="main.cpp" line="94"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
|
@ -1979,27 +2012,178 @@ Are you really want to continue?</source>
|
|||
<translation>无法找到%1程序"%2"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1666"/>
|
||||
<location filename="settings.cpp" line="1662"/>
|
||||
<source>C options</source>
|
||||
<translation>C语言选项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1672"/>
|
||||
<location filename="settings.cpp" line="1663"/>
|
||||
<source>Support all ANSI standard C programs (-ansi)</source>
|
||||
<translation>支持所有ANSI标准C程序(-ansi)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1664"/>
|
||||
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
|
||||
<translation>不支持将asm、inline和typeof作为关键字(-fno-asm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1665"/>
|
||||
<source>Imitate traditional C preprocessors (-traditional-cpp)</source>
|
||||
<translation>模仿传统C预处理器行为(-traditional-cpp)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1668"/>
|
||||
<source>Code Generation</source>
|
||||
<translation>代码生成</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1983"/>
|
||||
<location filename="settings.cpp" line="1697"/>
|
||||
<source>Optimize for the following machine (-march)</source>
|
||||
<translation>生成特定机器的专用指令(-march)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1698"/>
|
||||
<source>Optimize less, while maintaining full compatibility (-tune)</source>
|
||||
<translation>完整兼容特定机器,较少优化(-tune)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1718"/>
|
||||
<source>Enable use of specific instructions (-mx)</source>
|
||||
<translation>启用特定指令集(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1729"/>
|
||||
<source>Optimization level (-Ox)</source>
|
||||
<translation>优化级别(-Ox)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1736"/>
|
||||
<source>Compile with the following pointer size (-mx)</source>
|
||||
<translation>使用下列指针大小编译(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1759"/>
|
||||
<source>Language standard (-std)</source>
|
||||
<translation>语言标准(-std)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1760"/>
|
||||
<source>Generate debugging information (-g3)</source>
|
||||
<translation>生成调试信息(-g3)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1761"/>
|
||||
<source>Generate profiling info for analysis (-pg)</source>
|
||||
<translation>生成性能分析信息(-pg)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1764"/>
|
||||
<source>Warnings</source>
|
||||
<translation>代码警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1765"/>
|
||||
<source>Inhibit all warning messages (-w)</source>
|
||||
<translation>忽略所有警告信息(-w)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1766"/>
|
||||
<source>Show most warnings (-Wall)</source>
|
||||
<translation>启用常见问题警告(-Wall)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1767"/>
|
||||
<source>Show some more warnings (-Wextra)</source>
|
||||
<translation>启用更多问题警告(-Wextra)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1768"/>
|
||||
<source>Check ISO C/C++/C++0x conformance (-pedantic)</source>
|
||||
<translation>检查ISO C/C++/C++0x语法一致性(-pedantic)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1769"/>
|
||||
<source>Only check the code for syntax errors (-fsyntax-only)</source>
|
||||
<translation>只进行语法检查(不编译)(-fsyntax-only)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1770"/>
|
||||
<source>Make all warnings into errors (-Werror)</source>
|
||||
<translation>将警告作为错误处理(-Werror)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1771"/>
|
||||
<source>Abort compilation on first error (-Wfatal-errors)</source>
|
||||
<translation>遇到第一个错误后立即中止编译(-Wfatal-errors)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1774"/>
|
||||
<source>Linker</source>
|
||||
<translation>链接器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1775"/>
|
||||
<source>Link an Objective C program (-lobjc)</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1776"/>
|
||||
<source>Do not use standard system libraries (-nostdlib)</source>
|
||||
<translation>不使用标准库和系统启动文件(-nostdlib)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1777"/>
|
||||
<source>Do not create a console window (-mwindows)</source>
|
||||
<translation>不产生控制台窗口(-mwindows)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1778"/>
|
||||
<source>Strip executable (-s)</source>
|
||||
<translation>剥除附加信息(-s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1779"/>
|
||||
<source>Link libraries statically (-static)</source>
|
||||
<translation>链接Ojbective C程序(-lobjc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1782"/>
|
||||
<source>Output</source>
|
||||
<translation>输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1783"/>
|
||||
<source>Put comments in generated assembly code (-fverbose-asm)</source>
|
||||
<translation>在生成的汇编代码中加入注释(-fverbose-asm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1784"/>
|
||||
<source>Use pipes instead of temporary files during compilation (-pipe)</source>
|
||||
<translation>编译时使用管道而不是临时文件(-pipe)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1785"/>
|
||||
<source>Do not assemble, compile and generate the assemble code (-S)</source>
|
||||
<translation>只生成汇编代码(-S)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1978"/>
|
||||
<location filename="settings.cpp" line="2003"/>
|
||||
<source>Confirm</source>
|
||||
<translation>确认</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1979"/>
|
||||
<source>The following problems were found during validation of compiler set "%1":</source>
|
||||
<translation>在验证编译器设置"%1"时遇到了下列问题:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="2008"/>
|
||||
<location filename="settings.cpp" line="2004"/>
|
||||
<source>Compiler set not configuared.</source>
|
||||
<translation>未配置编译器设置。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="2010"/>
|
||||
<location filename="settings.cpp" line="2006"/>
|
||||
<source>Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? </source>
|
||||
<translation>您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2</translation>
|
||||
</message>
|
||||
|
@ -2504,158 +2688,124 @@ Are you really want to continue?</source>
|
|||
<context>
|
||||
<name>Settings::CompilerSet</name>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1667"/>
|
||||
<source>Support all ANSI standard C programs (-ansi)</source>
|
||||
<translation>支持所有ANSI标准C程序(-ansi)</translation>
|
||||
<translation type="vanished">支持所有ANSI标准C程序(-ansi)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1668"/>
|
||||
<source>Do not recognize asm,inline or typeof as a keyword (-fno-asm)</source>
|
||||
<translation>不支持将asm、inline和typeof作为关键字(-fno-asm)</translation>
|
||||
<translation type="vanished">不支持将asm、inline和typeof作为关键字(-fno-asm)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1669"/>
|
||||
<source>Imitate traditional C preprocessors (-traditional-cpp)</source>
|
||||
<translation>模仿传统C预处理器行为(-traditional-cpp)</translation>
|
||||
<translation type="vanished">模仿传统C预处理器行为(-traditional-cpp)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1701"/>
|
||||
<source>Optimize for the following machine (-march)</source>
|
||||
<translation>生成特定机器的专用指令(-march)</translation>
|
||||
<translation type="vanished">生成特定机器的专用指令(-march)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1702"/>
|
||||
<source>Optimize less, while maintaining full compatibility (-tune)</source>
|
||||
<translation>完整兼容特定机器,较少优化(-tune)</translation>
|
||||
<translation type="vanished">完整兼容特定机器,较少优化(-tune)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1722"/>
|
||||
<source>Enable use of specific instructions (-mx)</source>
|
||||
<translation>启用特定指令集(-mx)</translation>
|
||||
<translation type="vanished">启用特定指令集(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1733"/>
|
||||
<source>Optimization level (-Ox)</source>
|
||||
<translation>优化级别(-Ox)</translation>
|
||||
<translation type="vanished">优化级别(-Ox)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1740"/>
|
||||
<source>Compile with the following pointer size (-mx)</source>
|
||||
<translation>使用下列指针大小编译(-mx)</translation>
|
||||
<translation type="vanished">使用下列指针大小编译(-mx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1763"/>
|
||||
<source>Language standard (-std)</source>
|
||||
<translation>语言标准(-std)</translation>
|
||||
<translation type="vanished">语言标准(-std)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1764"/>
|
||||
<source>Generate debugging information (-g3)</source>
|
||||
<translation>生成调试信息(-g3)</translation>
|
||||
<translation type="vanished">生成调试信息(-g3)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1765"/>
|
||||
<source>Generate profiling info for analysis (-pg)</source>
|
||||
<translation>生成性能分析信息(-pg)</translation>
|
||||
<translation type="vanished">生成性能分析信息(-pg)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1768"/>
|
||||
<source>Warnings</source>
|
||||
<translation>代码警告</translation>
|
||||
<translation type="vanished">代码警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1769"/>
|
||||
<source>Inhibit all warning messages (-w)</source>
|
||||
<translation>忽略所有警告信息(-w)</translation>
|
||||
<translation type="vanished">忽略所有警告信息(-w)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1770"/>
|
||||
<source>Show most warnings (-Wall)</source>
|
||||
<translation>启用常见问题警告(-Wall)</translation>
|
||||
<translation type="vanished">启用常见问题警告(-Wall)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1771"/>
|
||||
<source>Show some more warnings (-Wextra)</source>
|
||||
<translation>启用更多问题警告(-Wextra)</translation>
|
||||
<translation type="vanished">启用更多问题警告(-Wextra)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1772"/>
|
||||
<source>Check ISO C/C++/C++0x conformance (-pedantic)</source>
|
||||
<translation>检查ISO C/C++/C++0x语法一致性(-pedantic)</translation>
|
||||
<translation type="vanished">检查ISO C/C++/C++0x语法一致性(-pedantic)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1773"/>
|
||||
<source>Only check the code for syntax errors (-fsyntax-only)</source>
|
||||
<translation>只进行语法检查(不编译)(-fsyntax-only)</translation>
|
||||
<translation type="vanished">只进行语法检查(不编译)(-fsyntax-only)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1774"/>
|
||||
<source>Make all warnings into errors (-Werror)</source>
|
||||
<translation>将警告作为错误处理(-Werror)</translation>
|
||||
<translation type="vanished">将警告作为错误处理(-Werror)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1775"/>
|
||||
<source>Abort compilation on first error (-Wfatal-errors)</source>
|
||||
<translation>遇到第一个错误后立即中止编译(-Wfatal-errors)</translation>
|
||||
<translation type="vanished">遇到第一个错误后立即中止编译(-Wfatal-errors)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1778"/>
|
||||
<source>Linker</source>
|
||||
<translation>链接器</translation>
|
||||
<translation type="vanished">链接器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1779"/>
|
||||
<source>Link an Objective C program (-lobjc)</source>
|
||||
<translation>链接Ojbective C程序(-lobjc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1780"/>
|
||||
<source>Do not use standard system libraries (-nostdlib)</source>
|
||||
<translation>不使用标准库和系统启动文件(-nostdlib)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1781"/>
|
||||
<source>Do not create a console window (-mwindows)</source>
|
||||
<translation>不产生控制台窗口(-mwindows)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1782"/>
|
||||
<source>Strip executable (-s)</source>
|
||||
<translation>剥除附加信息(-s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1783"/>
|
||||
<source>Link libraries statically (-static)</source>
|
||||
<translation>静态链接二进制库(-static)</translation>
|
||||
<oldsource>Link an Objective C program (-lobjc)</oldsource>
|
||||
<translation type="vanished">链接Ojbective C程序(-lobjc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do not use standard system libraries (-nostdlib)</source>
|
||||
<translation type="vanished">不使用标准库和系统启动文件(-nostdlib)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do not create a console window (-mwindows)</source>
|
||||
<translation type="vanished">不产生控制台窗口(-mwindows)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Strip executable (-s)</source>
|
||||
<translation type="vanished">剥除附加信息(-s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1786"/>
|
||||
<source>Output</source>
|
||||
<translation>输出</translation>
|
||||
<translation type="vanished">输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1787"/>
|
||||
<source>-fverbose-asm</source>
|
||||
<translation></translation>
|
||||
<translation type="obsolete">-fverbose-asm</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1788"/>
|
||||
<source>Use pipes instead of temporary files during compilation (-pipe)</source>
|
||||
<translation>编译时使用管道而不是临时文件(-pipe)</translation>
|
||||
<translation type="vanished">编译时使用管道而不是临时文件(-pipe)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1789"/>
|
||||
<source>Do not assemble, compile and generate the assemble code (-S)</source>
|
||||
<translation>只生成汇编代码(-S)</translation>
|
||||
<translation type="vanished">只生成汇编代码(-S)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings::CompilerSets</name>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="1982"/>
|
||||
<location filename="settings.cpp" line="2007"/>
|
||||
<source>Confirm</source>
|
||||
<translation>确认</translation>
|
||||
<translation type="vanished">确认</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -2746,7 +2896,7 @@ Are you really want to continue?</source>
|
|||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="59"/>
|
||||
<source>Symbol Completion</source>
|
||||
<translation type="unfinished">符号补全</translation>
|
||||
<translation>符号补全</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settingsdialog/settingsdialog.cpp" line="63"/>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "iconsmanager.h"
|
||||
#include "parser/parserutils.h"
|
||||
|
||||
Settings* createAppSettings(const QString& filepath = QString()) {
|
||||
QString getSettingFilename(const QString& filepath = QString()) {
|
||||
QString filename;
|
||||
if (filepath.isEmpty()) {
|
||||
if (isGreenEdition()) {
|
||||
|
@ -34,7 +34,7 @@ Settings* createAppSettings(const QString& filepath = QString()) {
|
|||
if (!dir.mkpath(dir.absolutePath())) {
|
||||
QMessageBox::critical(nullptr, QObject::tr("Error"),
|
||||
QString(QObject::tr("Can't create configuration folder %1")).arg(dir.absolutePath()));
|
||||
return nullptr;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,15 +42,28 @@ Settings* createAppSettings(const QString& filepath = QString()) {
|
|||
QMessageBox::critical(nullptr, QObject::tr("Error"),
|
||||
QString(QObject::tr("Can't write to configuration file %1")).arg(filename));
|
||||
|
||||
return nullptr;
|
||||
return "";
|
||||
}
|
||||
return new Settings(filename);
|
||||
return filename;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
//Translation must be loaded first
|
||||
QTranslator trans;
|
||||
QString settingFilename = getSettingFilename();
|
||||
if (settingFilename.isEmpty())
|
||||
return -1;
|
||||
{
|
||||
// QSettings languageSetting(settingFilename,QSettings::IniFormat);
|
||||
// languageSetting.beginGroup(SETTING_ENVIRONMENT);
|
||||
// QString language = languageSetting.value("language",QLocale::system().name()).toString();
|
||||
// trans.load("RedPandaIDE_"+language,":/translations");
|
||||
// app.installTranslator(&trans);
|
||||
}
|
||||
|
||||
qRegisterMetaType<PCompileIssue>("PCompileIssue");
|
||||
qRegisterMetaType<PCompileIssue>("PCompileIssue&");
|
||||
qRegisterMetaType<QVector<int>>("QVector<int>");
|
||||
|
@ -63,21 +76,9 @@ int main(int argc, char *argv[])
|
|||
pSystemConsts = &systemConsts;
|
||||
|
||||
//load settings
|
||||
pSettings = createAppSettings();
|
||||
if (pSettings == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
pSettings = new Settings(settingFilename);
|
||||
auto settings = std::unique_ptr<Settings>(pSettings);
|
||||
|
||||
|
||||
//Translation must be loaded after language setting is loaded
|
||||
QTranslator trans;
|
||||
trans.load("RedPandaIDE_"+pSettings->environment().language(),":/translations");
|
||||
app.installTranslator(&trans);
|
||||
|
||||
//must do it after translation is loaded
|
||||
pSettings->compilerSets().loadSets();
|
||||
|
||||
//Color scheme settings must be loaded after translation
|
||||
pColorManager = new ColorManager();
|
||||
pIconsManager = new IconsManager();
|
||||
|
|
|
@ -74,7 +74,7 @@ QVariant Settings::value(const QString &key, const QVariant &defaultValue)
|
|||
void Settings::load()
|
||||
{
|
||||
|
||||
//mCompilerSets.loadSets();
|
||||
mCompilerSets.loadSets();
|
||||
mEnvironment.load();
|
||||
mEditor.load();
|
||||
mExecutor.load();
|
||||
|
@ -1656,17 +1656,13 @@ void Settings::CompilerSet::setUserInput()
|
|||
mAutoAddCharsetParams = true;
|
||||
}
|
||||
|
||||
inline QString tr(const char* str) {
|
||||
return QObject::tr(str);
|
||||
}
|
||||
|
||||
void Settings::CompilerSet::setOptions()
|
||||
{
|
||||
// C options
|
||||
QString groupName = QObject::tr("C options");
|
||||
addOption(tr("Support all ANSI standard C programs (-ansi)"), groupName, true, true, false, 0, "-ansi");
|
||||
addOption(tr("Do not recognize asm,inline or typeof as a keyword (-fno-asm)"), groupName, true, true, false, 0, "-fno-asm");
|
||||
addOption(tr("Imitate traditional C preprocessors (-traditional-cpp)"), groupName, true, true, false, 0, "-traditional-cpp");
|
||||
addOption(QObject::tr("Support all ANSI standard C programs (-ansi)"), groupName, true, true, false, 0, "-ansi");
|
||||
addOption(QObject::tr("Do not recognize asm,inline or typeof as a keyword (-fno-asm)"), groupName, true, true, false, 0, "-fno-asm");
|
||||
addOption(QObject::tr("Imitate traditional C preprocessors (-traditional-cpp)"), groupName, true, true, false, 0, "-traditional-cpp");
|
||||
|
||||
// Optimization for cpu type
|
||||
groupName = QObject::tr("Code Generation");
|
||||
|
@ -1698,8 +1694,8 @@ void Settings::CompilerSet::setOptions()
|
|||
sl.append("K8 Rev.E=k8-sse3");
|
||||
sl.append("K10=barcelona");
|
||||
sl.append("Bulldozer=bdver1");
|
||||
addOption(tr("Optimize for the following machine (-march)"), groupName, true, true, false, 0, "-march=", sl);
|
||||
addOption(tr("Optimize less, while maintaining full compatibility (-tune)"), groupName, true, true, false, 0, "-mtune=", sl);
|
||||
addOption(QObject::tr("Optimize for the following machine (-march)"), groupName, true, true, false, 0, "-march=", sl);
|
||||
addOption(QObject::tr("Optimize less, while maintaining full compatibility (-tune)"), groupName, true, true, false, 0, "-mtune=", sl);
|
||||
|
||||
// Enable use of the specific instructions
|
||||
sl.clear();
|
||||
|
@ -1719,7 +1715,7 @@ void Settings::CompilerSet::setOptions()
|
|||
sl.append("FMA4=fma4");
|
||||
sl.append("XOP=xop");
|
||||
sl.append("AES=aes");
|
||||
addOption(tr("Enable use of specific instructions (-mx)"), groupName, true, true, false, 0, "-m", sl);
|
||||
addOption(QObject::tr("Enable use of specific instructions (-mx)"), groupName, true, true, false, 0, "-m", sl);
|
||||
|
||||
// Optimization
|
||||
sl.clear();
|
||||
|
@ -1730,14 +1726,14 @@ void Settings::CompilerSet::setOptions()
|
|||
sl.append("Highest (fast)=fast");
|
||||
sl.append("Size (s)=s");
|
||||
sl.append("Debug (g)=g");
|
||||
addOption(tr("Optimization level (-Ox)"), groupName, true, true, false, 0, "-O", sl);
|
||||
addOption(QObject::tr("Optimization level (-Ox)"), groupName, true, true, false, 0, "-O", sl);
|
||||
|
||||
// 32bit/64bit
|
||||
sl.clear();
|
||||
sl.append("");
|
||||
sl.append("32bit=m32");
|
||||
sl.append("64bit=m64");
|
||||
addOption(tr("Compile with the following pointer size (-mx)"), groupName, true, true, true, 0, "-", sl);
|
||||
addOption(QObject::tr("Compile with the following pointer size (-mx)"), groupName, true, true, true, 0, "-", sl);
|
||||
|
||||
// Language Standards
|
||||
sl.clear();
|
||||
|
@ -1760,33 +1756,33 @@ void Settings::CompilerSet::setOptions()
|
|||
sl.append("GNU C++14=gnu++14");
|
||||
sl.append("GNU C++17=gnu++17");
|
||||
sl.append("GNU C++20=gnu++20");
|
||||
addOption(tr("Language standard (-std)"), groupName, true, true, false, 0, "-std=", sl);
|
||||
addOption(tr("Generate debugging information (-g3)"), groupName, true, true, false, 0, "-g3");
|
||||
addOption(tr("Generate profiling info for analysis (-pg)"), groupName, true, true, true, 0, "-pg");
|
||||
addOption(QObject::tr("Language standard (-std)"), groupName, true, true, false, 0, "-std=", sl);
|
||||
addOption(QObject::tr("Generate debugging information (-g3)"), groupName, true, true, false, 0, "-g3");
|
||||
addOption(QObject::tr("Generate profiling info for analysis (-pg)"), groupName, true, true, true, 0, "-pg");
|
||||
|
||||
// Warnings
|
||||
groupName = tr("Warnings");
|
||||
addOption(tr("Inhibit all warning messages (-w)"), groupName, true, true, false, 0, "-w");
|
||||
addOption(tr("Show most warnings (-Wall)"), groupName, true, true, false, 0, "-Wall");
|
||||
addOption(tr("Show some more warnings (-Wextra)"), groupName, true, true, false, 0, "-Wextra");
|
||||
addOption(tr("Check ISO C/C++/C++0x conformance (-pedantic)"), groupName, true, true, false, 0, "-pedantic");
|
||||
addOption(tr("Only check the code for syntax errors (-fsyntax-only)"), groupName, true, true, false, 0, "-fsyntax-only");
|
||||
addOption(tr("Make all warnings into errors (-Werror)"), groupName, true, true, false, 0, "-Werror");
|
||||
addOption(tr("Abort compilation on first error (-Wfatal-errors)"), groupName, true, true, false, 0, "-Wfatal-errors");
|
||||
groupName = QObject::tr("Warnings");
|
||||
addOption(QObject::tr("Inhibit all warning messages (-w)"), groupName, true, true, false, 0, "-w");
|
||||
addOption(QObject::tr("Show most warnings (-Wall)"), groupName, true, true, false, 0, "-Wall");
|
||||
addOption(QObject::tr("Show some more warnings (-Wextra)"), groupName, true, true, false, 0, "-Wextra");
|
||||
addOption(QObject::tr("Check ISO C/C++/C++0x conformance (-pedantic)"), groupName, true, true, false, 0, "-pedantic");
|
||||
addOption(QObject::tr("Only check the code for syntax errors (-fsyntax-only)"), groupName, true, true, false, 0, "-fsyntax-only");
|
||||
addOption(QObject::tr("Make all warnings into errors (-Werror)"), groupName, true, true, false, 0, "-Werror");
|
||||
addOption(QObject::tr("Abort compilation on first error (-Wfatal-errors)"), groupName, true, true, false, 0, "-Wfatal-errors");
|
||||
|
||||
// Linker
|
||||
groupName = tr("Linker");
|
||||
addOption(tr("Link an Objective C program (-lobjc)"), groupName, false, false, true, 0, "-lobjc");
|
||||
addOption(tr("Do not use standard system libraries (-nostdlib)"), groupName, false, false, true, 0, "-nostdlib");
|
||||
addOption(tr("Do not create a console window (-mwindows)"), groupName,false, false, true, 0, "-mwindows");
|
||||
addOption(tr("Strip executable (-s)"), groupName, false, false, true, 0, "-s");
|
||||
addOption(tr("Link libraries statically (-static)"), groupName, false, false, true, 0, "-static");
|
||||
groupName = QObject::tr("Linker");
|
||||
addOption(QObject::tr("Link an Objective C program (-lobjc)"), groupName, false, false, true, 0, "-lobjc");
|
||||
addOption(QObject::tr("Do not use standard system libraries (-nostdlib)"), groupName, false, false, true, 0, "-nostdlib");
|
||||
addOption(QObject::tr("Do not create a console window (-mwindows)"), groupName,false, false, true, 0, "-mwindows");
|
||||
addOption(QObject::tr("Strip executable (-s)"), groupName, false, false, true, 0, "-s");
|
||||
addOption(QObject::tr("Link libraries statically (-static)"), groupName, false, false, true, 0, "-static");
|
||||
|
||||
// Output
|
||||
groupName = tr("Output");
|
||||
addOption(tr("-fverbose-asm"), groupName, true, true, false, 0, "-fverbose-asm");
|
||||
addOption(tr("Use pipes instead of temporary files during compilation (-pipe)"), groupName, true, true, false, 0, "-pipe");
|
||||
addOption(tr("Do not assemble, compile and generate the assemble code (-S)"), groupName, true, true, false, 0, "-S");
|
||||
groupName = QObject::tr("Output");
|
||||
addOption(QObject::tr("Put comments in generated assembly code (-fverbose-asm)"), groupName, true, true, false, 0, "-fverbose-asm");
|
||||
addOption(QObject::tr("Use pipes instead of temporary files during compilation (-pipe)"), groupName, true, true, false, 0, "-pipe");
|
||||
addOption(QObject::tr("Do not assemble, compile and generate the assemble code (-S)"), groupName, true, true, false, 0, "-S");
|
||||
}
|
||||
|
||||
QString Settings::CompilerSet::findProgramInBinDirs(const QString name)
|
||||
|
@ -1979,7 +1975,7 @@ void Settings::CompilerSets::loadSets()
|
|||
if (pCurrentSet) {
|
||||
QString msg;
|
||||
if (!pCurrentSet->dirsValid(msg) || !pCurrentSet->validateExes(msg)) {
|
||||
if (QMessageBox::warning(nullptr,tr("Confirm"),
|
||||
if (QMessageBox::warning(nullptr,QObject::tr("Confirm"),
|
||||
QObject::tr("The following problems were found during validation of compiler set \"%1\":")
|
||||
.arg(pCurrentSet->name())
|
||||
+"<br /><br />"
|
||||
|
@ -2004,7 +2000,7 @@ void Settings::CompilerSets::loadSets()
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
if (QMessageBox::warning(nullptr,tr("Confirm"),
|
||||
if (QMessageBox::warning(nullptr,QObject::tr("Confirm"),
|
||||
QObject::tr("Compiler set not configuared.")
|
||||
+"<br /><br />"
|
||||
+QObject::tr("Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? ")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "editormiscwidget.h"
|
||||
#include "ui_editormiscwidget.h"
|
||||
#include "../settings.h"
|
||||
|
||||
EditorMiscWidget::EditorMiscWidget(const QString& name, const QString& group,
|
||||
QWidget *parent) :
|
||||
|
@ -16,41 +17,10 @@ EditorMiscWidget::~EditorMiscWidget()
|
|||
|
||||
void EditorMiscWidget::doLoad()
|
||||
{
|
||||
ui->grpEnabled->setChecked(pSettings->codeCompletion().enabled());
|
||||
|
||||
ui->chkParseLocalFiles->setChecked(pSettings->codeCompletion().parseLocalHeaders());
|
||||
ui->chkParseSystemFiles->setChecked(pSettings->codeCompletion().parseGlobalHeaders());
|
||||
|
||||
ui->spinWidth->setValue(pSettings->codeCompletion().width());
|
||||
ui->spinHeight->setValue(pSettings->codeCompletion().height());
|
||||
|
||||
ui->chkShowSuggestionWhileTyping->setChecked(pSettings->codeCompletion().showCompletionWhileInput());
|
||||
ui->chkRecordUsage->setChecked(pSettings->codeCompletion().recordUsage());
|
||||
ui->chkSortByScope->setChecked(pSettings->codeCompletion().sortByScope());
|
||||
ui->chkShowKeywords->setChecked(pSettings->codeCompletion().showKeywords());
|
||||
ui->chkIgnoreCases->setChecked(pSettings->codeCompletion().ignoreCase());
|
||||
ui->chkAppendFunc->setChecked(pSettings->codeCompletion().appendFunc());
|
||||
ui->chkShowCodeIns->setChecked(pSettings->codeCompletion().showCodeIns());
|
||||
}
|
||||
|
||||
void EditorMiscWidget::doSave()
|
||||
{
|
||||
//font
|
||||
pSettings->codeCompletion().setEnabled(ui->grpEnabled->isChecked());
|
||||
|
||||
pSettings->codeCompletion().setParseLocalHeaders(ui->chkParseLocalFiles->isChecked());
|
||||
pSettings->codeCompletion().setParseGlobalHeaders(ui->chkParseSystemFiles->isChecked());
|
||||
|
||||
pSettings->codeCompletion().setWidth(ui->spinWidth->value());
|
||||
pSettings->codeCompletion().setHeight(ui->spinHeight->value());
|
||||
|
||||
pSettings->codeCompletion().setShowCompletionWhileInput(ui->chkShowSuggestionWhileTyping->isChecked());
|
||||
pSettings->codeCompletion().setRecordUsage(ui->chkRecordUsage->isChecked());
|
||||
pSettings->codeCompletion().setSortByScope(ui->chkSortByScope->isChecked());
|
||||
pSettings->codeCompletion().setShowKeywords(ui->chkShowKeywords->isChecked());
|
||||
pSettings->codeCompletion().setIgnoreCase(ui->chkIgnoreCases->isChecked());
|
||||
pSettings->codeCompletion().setAppendFunc(ui->chkAppendFunc->isChecked());
|
||||
pSettings->codeCompletion().setShowCodeIns(ui->chkShowCodeIns->isChecked());
|
||||
|
||||
pSettings->editor().save();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue