simplify compiler version check in about dialog (#443)

This commit is contained in:
Cyano Hao 2024-05-29 16:31:28 +08:00 committed by GitHub
parent 56488c9dbc
commit 14cf595af8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 108 deletions

View File

@ -55,40 +55,15 @@
<translation>Versão:</translation> <translation>Versão:</translation>
</message> </message>
<message> <message>
<location line="+46"/> <location line="+38"/>
<source>Non-GCC Compiler</source> <source>unknown compiler</source>
<translation>Compilador não GCC</translation> <translation>compilador desconhecido</translation>
</message> </message>
<message> <message>
<location line="+10"/> <location line="+10"/>
<source>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</source> <source>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</source>
<translation>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</translation> <translation>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</translation>
</message> </message>
<message>
<location line="-27"/>
<source>Next Generation Microsoft Visual C++</source>
<translation>Microsoft Visual C++ de Próxima Geração</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2022</source>
<translation>Microsoft Visual C++ 2022</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2019</source>
<translation>Microsoft Visual C++ 2019</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2017</source>
<translation>Microsoft Visual C++ 2017</translation>
</message>
<message>
<location line="+2"/>
<source>Legacy Microsoft Visual C++</source>
<translation>Microsoft Visual C++ Legado</translation>
</message>
<message> <message>
<location filename="../widgets/aboutdialog.ui" line="-61"/> <location filename="../widgets/aboutdialog.ui" line="-61"/>
<source>Based on Qt %1 (%2) running on %3</source> <source>Based on Qt %1 (%2) running on %3</source>
@ -498,7 +473,7 @@
<context> <context>
<name>CompetitiveCompanionThread</name> <name>CompetitiveCompanionThread</name>
<message> <message>
<location filename="../problems/competitivecompenionhandler.cpp" line="+134"/> <location filename="../problems/competitivecompenionhandler.cpp" line="+131"/>
<source>Problem Case %1</source> <source>Problem Case %1</source>
<translation type="unfinished">Caso do problema %1</translation> <translation type="unfinished">Caso do problema %1</translation>
</message> </message>
@ -563,7 +538,7 @@
<translation>[Nota] </translation> <translation>[Nota] </translation>
</message> </message>
<message> <message>
<location line="+578"/> <location line="+588"/>
<source>The compiler process for &apos;%1&apos; failed to start.</source> <source>The compiler process for &apos;%1&apos; failed to start.</source>
<translation>Falha ao iniciar a compilação para &apos;%1&apos;.</translation> <translation>Falha ao iniciar a compilação para &apos;%1&apos;.</translation>
</message> </message>
@ -598,7 +573,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-663"/> <location line="-673"/>
<source> - Command: %1</source> <source> - Command: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1814,7 +1789,7 @@
<translation>Remover ...</translation> <translation>Remover ...</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+327"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>

View File

@ -129,34 +129,9 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+29"/> <location line="+38"/>
<source>Next Generation Microsoft Visual C++</source> <source>unknown compiler</source>
<translation> Microsoft Visual C++</translation> <translation></translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2022</source>
<translation>Microsoft Visual C++ 2022</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2019</source>
<translation>Microsoft Visual C++ 2019</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2017</source>
<translation>Microsoft Visual C++ 2017</translation>
</message>
<message>
<location line="+2"/>
<source>Legacy Microsoft Visual C++</source>
<translation> Microsoft Visual C++</translation>
</message>
<message>
<location line="+9"/>
<source>Non-GCC Compiler</source>
<translation>GCC编译器</translation>
</message> </message>
<message> <message>
<location line="+10"/> <location line="+10"/>
@ -566,7 +541,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>CompetitiveCompanionThread</name> <name>CompetitiveCompanionThread</name>
<message> <message>
<location filename="../problems/competitivecompenionhandler.cpp" line="+134"/> <location filename="../problems/competitivecompenionhandler.cpp" line="+131"/>
<source>Problem Case %1</source> <source>Problem Case %1</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
@ -700,7 +675,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+550"/> <location line="+560"/>
<source>Can&apos;t open file &quot;%1&quot; for write!</source> <source>Can&apos;t open file &quot;%1&quot; for write!</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
@ -2064,7 +2039,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+327"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>

View File

@ -48,40 +48,15 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+46"/> <location line="+38"/>
<source>Non-GCC Compiler</source> <source>unknown compiler</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+10"/> <location line="+10"/>
<source>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</source> <source>Website: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location line="-27"/>
<source>Next Generation Microsoft Visual C++</source>
<translation> Microsoft Visual C++</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2022</source>
<translation>Microsoft Visual C++ 2022</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2019</source>
<translation>Microsoft Visual C++ 2019</translation>
</message>
<message>
<location line="+2"/>
<source>Microsoft Visual C++ 2017</source>
<translation>Microsoft Visual C++ 2017</translation>
</message>
<message>
<location line="+2"/>
<source>Legacy Microsoft Visual C++</source>
<translation> Microsoft Visual C++</translation>
</message>
<message> <message>
<location filename="../widgets/aboutdialog.ui" line="-37"/> <location filename="../widgets/aboutdialog.ui" line="-37"/>
<source>Copyright(C) 2021-2024 (royqh1979@gmail.com)</source> <source>Copyright(C) 2021-2024 (royqh1979@gmail.com)</source>
@ -399,7 +374,7 @@
<context> <context>
<name>CompetitiveCompanionThread</name> <name>CompetitiveCompanionThread</name>
<message> <message>
<location filename="../problems/competitivecompenionhandler.cpp" line="+134"/> <location filename="../problems/competitivecompenionhandler.cpp" line="+131"/>
<source>Problem Case %1</source> <source>Problem Case %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -464,7 +439,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+578"/> <location line="+588"/>
<source>The compiler process for &apos;%1&apos; failed to start.</source> <source>The compiler process for &apos;%1&apos; failed to start.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -499,7 +474,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="-663"/> <location line="-673"/>
<source> - Command: %1</source> <source> - Command: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -1615,7 +1590,7 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+327"/> <location filename="../settingsdialog/editorcolorschemewidget.cpp" line="+337"/>
<location line="+53"/> <location line="+53"/>
<location line="+9"/> <location line="+9"/>
<location line="+13"/> <location line="+13"/>

View File

@ -55,25 +55,17 @@ AboutDialog::AboutDialog(QWidget *parent) :
.arg(appArch())) .arg(appArch()))
.arg(osArch())); .arg(osArch()));
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# if (_MSC_VER >= 1940)
QString name = tr("Next Generation Microsoft Visual C++");
# elif (_MSC_VER >= 1930)
QString name = tr("Microsoft Visual C++ 2022");
# elif (_MSC_VER >= 1920)
QString name = tr("Microsoft Visual C++ 2019");
# elif (_MSC_VER >= 1910)
QString name = tr("Microsoft Visual C++ 2017");
# else
QString name = tr("Legacy Microsoft Visual C++");
# endif
ui->lblQt->setText(ui->lblQt->text() ui->lblQt->setText(ui->lblQt->text()
.arg(qVersion()) .arg(qVersion())
.arg(name + " " + appArch()) .arg(QStringLiteral("MSVC %1.%2 %3")
.arg(_MSC_VER / 100)
.arg(_MSC_VER % 100)
.arg(appArch()))
.arg(osArch())); .arg(osArch()));
#else #else
ui->lblQt->setText(ui->lblQt->text() ui->lblQt->setText(ui->lblQt->text()
.arg(qVersion()) .arg(qVersion())
.arg(tr("Non-GCC Compiler")) .arg(tr("unknown compiler"))
.arg(osArch())); .arg(osArch()));
#endif #endif
ui->lblCompileTime->setText(ui->lblCompileTime->text() ui->lblCompileTime->setText(ui->lblCompileTime->text()