- fix: compiler options is not translated

This commit is contained in:
royqh1979 2021-08-30 18:07:55 +08:00
parent 3bcbfa08d9
commit 74fbeffeef
5 changed files with 283 additions and 166 deletions

Binary file not shown.

View File

@ -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&quot;%2&quot;</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>asminline和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 &quot;%1&quot;:</source>
<translation>&quot;%1&quot;</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: &lt;BR /&gt;&apos;%1&apos;&lt;BR /&gt;&apos;%2&apos;? </source>
<translation>C++&lt;br /&gt;%1&lt;br /&gt;%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>asminline和typeof作为关键字(-fno-asm)</translation>
<translation type="vanished">asminline和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"/>

View File

@ -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();

View File

@ -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'? ")

View File

@ -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();
}