- change: rename all "ansi" encoding to "system default".

This commit is contained in:
Roy Qu 2024-06-03 15:54:44 +08:00
parent 986cce66d0
commit 082a5f516f
9 changed files with 109 additions and 52 deletions

View File

@ -16,6 +16,7 @@ Red Panda C++ Version 3.1
- fix: All color scheme names are incorrectly displayed as bold, if the current one is a customed one. - fix: All color scheme names are incorrectly displayed as bold, if the current one is a customed one.
- fix: Variables defined by using alias can't show completion info. - fix: Variables defined by using alias can't show completion info.
- enhancement: Support operator() overload. - enhancement: Support operator() overload.
- change: rename all "ansi" encoding to "system default".
Red Panda C++ Version 3.0 Red Panda C++ Version 3.0

View File

@ -65,7 +65,7 @@ void CompilerSetOptionWidget::init()
{ {
ui->cbEncodingDetails->setVisible(false); ui->cbEncodingDetails->setVisible(false);
ui->cbEncoding->clear(); ui->cbEncoding->clear();
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT); ui->cbEncoding->addItem(tr("System Default(%1)").arg(QString(pCharsetInfoManager->getDefaultSystemEncoding())),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8); ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) { foreach (const QString& langName, pCharsetInfoManager->languageNames()) {
ui->cbEncoding->addItem(langName,langName); ui->cbEncoding->addItem(langName,langName);

View File

@ -99,7 +99,7 @@ void EditorMiscWidget::init()
{ {
ui->cbEncodingDetail->setVisible(false); ui->cbEncodingDetail->setVisible(false);
ui->cbEncoding->clear(); ui->cbEncoding->clear();
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT); ui->cbEncoding->addItem(tr("System Default(%1)").arg(QString(pCharsetInfoManager->getDefaultSystemEncoding())),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8); ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
ui->cbEncoding->addItem(tr("UTF-8 BOM"),ENCODING_UTF8_BOM); ui->cbEncoding->addItem(tr("UTF-8 BOM"),ENCODING_UTF8_BOM);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) { foreach (const QString& langName, pCharsetInfoManager->languageNames()) {

View File

@ -117,7 +117,7 @@ void ProjectCompilerWidget::init()
ui->cbCompilerSet->blockSignals(false); ui->cbCompilerSet->blockSignals(false);
ui->cbEncodingDetails->setVisible(false); ui->cbEncodingDetails->setVisible(false);
ui->cbEncoding->clear(); ui->cbEncoding->clear();
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT); ui->cbEncoding->addItem(tr("System Default(%1)").arg(QString(pCharsetInfoManager->getDefaultSystemEncoding())),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8); ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) { foreach (const QString& langName, pCharsetInfoManager->languageNames()) {
ui->cbEncoding->addItem(langName,langName); ui->cbEncoding->addItem(langName,langName);

View File

@ -36,7 +36,7 @@ void ProjectFilesWidget::doLoad()
{ {
if (ui->cbEncoding->count()>0) { if (ui->cbEncoding->count()>0) {
if (pMainWindow->project()->options().encoding==ENCODING_SYSTEM_DEFAULT) { if (pMainWindow->project()->options().encoding==ENCODING_SYSTEM_DEFAULT) {
ui->cbEncoding->setItemText(0,tr("Project(%1)").arg(tr("ANSI"))); ui->cbEncoding->setItemText(0,tr("Project(%1)").arg(tr("System Default")));
} else { } else {
ui->cbEncoding->setItemText(0,tr("Project(%1)").arg(QString(pMainWindow->project()->options().encoding))); ui->cbEncoding->setItemText(0,tr("Project(%1)").arg(QString(pMainWindow->project()->options().encoding)));
} }
@ -269,7 +269,7 @@ void ProjectFilesWidget::init()
} else { } else {
ui->cbEncoding->addItem(tr("Project(%1)").arg(QString(project->options().encoding)),ENCODING_PROJECT); ui->cbEncoding->addItem(tr("Project(%1)").arg(QString(project->options().encoding)),ENCODING_PROJECT);
} }
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT); ui->cbEncoding->addItem(tr("System Default(%1)").arg(QString(pCharsetInfoManager->getDefaultSystemEncoding())),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8); ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) { foreach (const QString& langName, pCharsetInfoManager->languageNames()) {
ui->cbEncoding->addItem(langName,langName); ui->cbEncoding->addItem(langName,langName);

View File

@ -221,7 +221,7 @@ void ProjectGeneralWidget::init()
{ {
ui->cbEncodingDetail->setVisible(false); ui->cbEncodingDetail->setVisible(false);
ui->cbEncoding->clear(); ui->cbEncoding->clear();
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT); ui->cbEncoding->addItem(tr("System Default(%1)").arg(QString(pCharsetInfoManager->getDefaultSystemEncoding())),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8); ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
ui->cbEncoding->addItem(tr("UTF-8 BOM"),ENCODING_UTF8_BOM); ui->cbEncoding->addItem(tr("UTF-8 BOM"),ENCODING_UTF8_BOM);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) { foreach (const QString& langName, pCharsetInfoManager->languageNames()) {

View File

@ -876,9 +876,13 @@
<translation>Compilador de recursos (windres)</translation> <translation>Compilador de recursos (windres)</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/compilersetoptionwidget.cpp" line="+68"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message>
<message>
<location filename="../settingsdialog/compilersetoptionwidget.cpp" line="+68"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -1426,7 +1430,7 @@
<translation>Impossível encontrar astyle em &quot;%1&quot;</translation> <translation>Impossível encontrar astyle em &quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location line="+161"/> <location line="+163"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation>Condição de parada</translation> <translation>Condição de parada</translation>
</message> </message>
@ -1441,7 +1445,7 @@
<translation>Apenas leitura</translation> <translation>Apenas leitura</translation>
</message> </message>
<message> <message>
<location line="-5414"/> <location line="-5416"/>
<location line="+505"/> <location line="+505"/>
<source>Error Load File</source> <source>Error Load File</source>
<translation type="unfinished">Erro ao carregar arquivo</translation> <translation type="unfinished">Erro ao carregar arquivo</translation>
@ -1789,7 +1793,7 @@
<translation>Remover ...</translation> <translation>Remover ...</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+343"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>
@ -2104,9 +2108,13 @@
<translation>Arquivos C</translation> <translation>Arquivos C</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message>
<message>
<location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -7779,12 +7787,11 @@
<translation>Aplicar link às bibliotecas estáticas</translation> <translation>Aplicar link às bibliotecas estáticas</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+120"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location filename="../settingsdialog/projectcompilerwidget.cpp" line="+121"/>
<source>UTF-8</source> <source>UTF-8</source>
<translation>UTF-8</translation> <translation>UTF-8</translation>
</message> </message>
@ -7794,7 +7801,12 @@
<translation>Definir codificação para o executável:</translation> <translation>Definir codificação para o executável:</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+26"/> <location filename="../settingsdialog/projectcompilerwidget.cpp" line="-1"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<location line="+9"/> <location line="+9"/>
<source>Wrong Compiler Type</source> <source>Wrong Compiler Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -7930,11 +7942,19 @@
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectfileswidget.cpp" line="+39"/> <location filename="../settingsdialog/projectfileswidget.cpp" line="+39"/>
<source>System Default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+229"/> <location line="+229"/>
<location line="+4"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation>ANSI</translation>
</message> </message>
<message>
<location line="+4"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location line="+1"/> <location line="+1"/>
<source>UTF-8</source> <source>UTF-8</source>
@ -8063,8 +8083,12 @@
</message> </message>
<message> <message>
<location line="+41"/> <location line="+41"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ANSI</source> <source>ANSI</source>
<translation type="unfinished">ANSI</translation> <translation type="obsolete">ANSI</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -9028,7 +9052,7 @@
<translation type="vanished">Índice %1 fora dos limites</translation> <translation type="vanished">Índice %1 fora dos limites</translation>
</message> </message>
<message> <message>
<location filename="../utils.cpp" line="+524"/> <location filename="../utils.cpp" line="+525"/>
<source>bytes</source> <source>bytes</source>
<translation>bytes</translation> <translation>bytes</translation>
</message> </message>

View File

@ -1097,9 +1097,13 @@ p, li { white-space: pre-wrap; }
<translation>C++ :&lt;br/&gt; &apos;%1&apos;&lt;br/&gt; &apos;%2&apos;&lt;br /&gt;</translation> <translation>C++ :&lt;br/&gt; &apos;%1&apos;&lt;br/&gt; &apos;%2&apos;&lt;br /&gt;</translation>
</message> </message>
<message> <message>
<location line="-234"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message>
<message>
<location line="-234"/>
<source>System Default(%1)</source>
<translation>(%1)</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -1688,7 +1692,7 @@ p, li { white-space: pre-wrap; }
<translation>astyle程序&quot;%1&quot;.</translation> <translation>astyle程序&quot;%1&quot;.</translation>
</message> </message>
<message> <message>
<location line="+161"/> <location line="+163"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2039,7 +2043,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+343"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>
@ -2428,9 +2432,13 @@ p, li { white-space: pre-wrap; }
<translation>C语言文件</translation> <translation>C语言文件</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message>
<message>
<location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/>
<source>System Default(%1)</source>
<translation>(%1)</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -8471,9 +8479,13 @@ p, li { white-space: pre-wrap; }
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+120"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message>
<message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+120"/>
<source>System Default(%1)</source>
<translation>(%1)</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -8629,11 +8641,19 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="-231"/> <location line="-231"/>
<source>System Default</source>
<translation></translation>
</message>
<message>
<location line="+229"/> <location line="+229"/>
<location line="+4"/>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation>ANSI</translation>
</message> </message>
<message>
<location line="+4"/>
<source>System Default(%1)</source>
<translation>(%1)</translation>
</message>
<message> <message>
<source>ANSI(System default)</source> <source>ANSI(System default)</source>
<translation type="vanished">ANSI</translation> <translation type="vanished">ANSI</translation>
@ -8758,8 +8778,12 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+41"/> <location line="+41"/>
<source>System Default(%1)</source>
<translation>(%1)</translation>
</message>
<message>
<source>ANSI</source> <source>ANSI</source>
<translation>ANSI</translation> <translation type="vanished">ANSI</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
@ -9620,7 +9644,7 @@ p, li { white-space: pre-wrap; }
<translation type="vanished">&quot;%1&quot;</translation> <translation type="vanished">&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="../utils.cpp" line="+524"/> <location filename="../utils.cpp" line="+525"/>
<source>bytes</source> <source>bytes</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -765,12 +765,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/compilersetoptionwidget.cpp" line="+68"/> <location filename="../settingsdialog/compilersetoptionwidget.cpp" line="+69"/>
<source>ANSI</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>UTF-8</source> <source>UTF-8</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -903,7 +898,12 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="-246"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+247"/>
<source>Abort</source> <source>Abort</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1247,7 +1247,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+161"/> <location line="+163"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1262,7 +1262,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-5414"/> <location line="-5416"/>
<location line="+505"/> <location line="+505"/>
<source>Error Load File</source> <source>Error Load File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1590,7 +1590,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+343"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>
@ -1890,7 +1890,7 @@
</message> </message>
<message> <message>
<location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/> <location filename="../settingsdialog/editormiscwidget.cpp" line="+102"/>
<source>ANSI</source> <source>System Default(%1)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@ -7308,12 +7308,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+120"/> <location filename="../settingsdialog/projectcompilerwidget.cpp" line="+121"/>
<source>ANSI</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>UTF-8</source> <source>UTF-8</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -7323,7 +7318,12 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectcompilerwidget.cpp" line="+26"/> <location filename="../settingsdialog/projectcompilerwidget.cpp" line="-1"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<location line="+9"/> <location line="+9"/>
<source>Wrong Compiler Type</source> <source>Wrong Compiler Type</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -7455,11 +7455,19 @@
</message> </message>
<message> <message>
<location filename="../settingsdialog/projectfileswidget.cpp" line="+39"/> <location filename="../settingsdialog/projectfileswidget.cpp" line="+39"/>
<source>System Default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+229"/> <location line="+229"/>
<location line="+4"/>
<source>ANSI</source> <source>ANSI</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location line="+4"/>
<source>System Default(%1)</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location line="+1"/> <location line="+1"/>
<source>UTF-8</source> <source>UTF-8</source>
@ -7568,7 +7576,7 @@
</message> </message>
<message> <message>
<location line="+41"/> <location line="+41"/>
<source>ANSI</source> <source>System Default(%1)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@ -8387,7 +8395,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../utils.cpp" line="+524"/> <location filename="../utils.cpp" line="+525"/>
<source>bytes</source> <source>bytes</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>