- fix: issue count not correctly displayed when syntax check/compile finished

update translations
This commit is contained in:
royqh1979 2021-10-23 16:18:02 +08:00
parent 15fd6aab03
commit 581e59d719
4 changed files with 106 additions and 77 deletions

View File

@ -550,44 +550,44 @@
<context>
<name>CompilerManager</name>
<message>
<location filename="compiler/compilermanager.cpp" line="44"/>
<location filename="compiler/compilermanager.cpp" line="84"/>
<location filename="compiler/compilermanager.cpp" line="113"/>
<location filename="compiler/compilermanager.cpp" line="144"/>
<location filename="compiler/compilermanager.cpp" line="163"/>
<location filename="compiler/compilermanager.cpp" line="47"/>
<location filename="compiler/compilermanager.cpp" line="88"/>
<location filename="compiler/compilermanager.cpp" line="118"/>
<location filename="compiler/compilermanager.cpp" line="150"/>
<location filename="compiler/compilermanager.cpp" line="169"/>
<source>No compiler set</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="45"/>
<location filename="compiler/compilermanager.cpp" line="85"/>
<location filename="compiler/compilermanager.cpp" line="114"/>
<location filename="compiler/compilermanager.cpp" line="145"/>
<location filename="compiler/compilermanager.cpp" line="164"/>
<location filename="compiler/compilermanager.cpp" line="48"/>
<location filename="compiler/compilermanager.cpp" line="89"/>
<location filename="compiler/compilermanager.cpp" line="119"/>
<location filename="compiler/compilermanager.cpp" line="151"/>
<location filename="compiler/compilermanager.cpp" line="170"/>
<source>No compiler set is configured.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="45"/>
<location filename="compiler/compilermanager.cpp" line="85"/>
<location filename="compiler/compilermanager.cpp" line="114"/>
<location filename="compiler/compilermanager.cpp" line="145"/>
<location filename="compiler/compilermanager.cpp" line="164"/>
<location filename="compiler/compilermanager.cpp" line="48"/>
<location filename="compiler/compilermanager.cpp" line="89"/>
<location filename="compiler/compilermanager.cpp" line="119"/>
<location filename="compiler/compilermanager.cpp" line="151"/>
<location filename="compiler/compilermanager.cpp" line="170"/>
<source>Can&apos;t start debugging.</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="55"/>
<location filename="compiler/compilermanager.cpp" line="58"/>
<source>Encoding not support</source>
<translation></translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="56"/>
<location filename="compiler/compilermanager.cpp" line="59"/>
<source>Clang only support utf-8 encoding.</source>
<translation>Clang只支持UTF-8</translation>
</message>
<message>
<location filename="compiler/compilermanager.cpp" line="58"/>
<location filename="compiler/compilermanager.cpp" line="61"/>
<source>Strings in the program might be wrongly processed.</source>
<translation></translation>
</message>
@ -1093,7 +1093,7 @@ Are you really want to continue?</source>
<translation>:</translation>
</message>
<message>
<location filename="editor.cpp" line="3772"/>
<location filename="editor.cpp" line="3774"/>
<source>Readonly</source>
<translation></translation>
</message>
@ -2802,7 +2802,10 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="359"/>
<location filename="mainwindow.cpp" line="3102"/>
<location filename="mainwindow.cpp" line="3104"/>
<location filename="mainwindow.cpp" line="3107"/>
<location filename="mainwindow.cpp" line="3111"/>
<location filename="mainwindow.cpp" line="3114"/>
<source>Issues</source>
<translation></translation>
</message>
@ -3357,13 +3360,13 @@ Are you really want to continue?</source>
<message>
<location filename="mainwindow.ui" line="1637"/>
<source>Remove Watch</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="1642"/>
<location filename="mainwindow.cpp" line="1725"/>
<source>Remove All</source>
<translation></translation>
<source>Remove All Watches</source>
<oldsource>Remove All</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.ui" line="1647"/>
@ -3457,7 +3460,7 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="1769"/>
<location filename="mainwindow.cpp" line="3918"/>
<location filename="mainwindow.cpp" line="3931"/>
<source>Clear all breakpoints</source>
<translation></translation>
</message>
@ -3558,7 +3561,7 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="1920"/>
<location filename="mainwindow.cpp" line="4432"/>
<location filename="mainwindow.cpp" line="4445"/>
<source>Rename Symbol</source>
<translation></translation>
</message>
@ -3579,13 +3582,13 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="1940"/>
<location filename="mainwindow.cpp" line="4545"/>
<location filename="mainwindow.cpp" line="4558"/>
<source>Export As RTF</source>
<translation>RTF</translation>
</message>
<message>
<location filename="mainwindow.ui" line="1945"/>
<location filename="mainwindow.cpp" line="4567"/>
<location filename="mainwindow.cpp" line="4580"/>
<source>Export As HTML</source>
<translation>HTML</translation>
</message>
@ -3631,7 +3634,7 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.ui" line="2004"/>
<location filename="mainwindow.cpp" line="4705"/>
<location filename="mainwindow.cpp" line="4718"/>
<source>Open Folder</source>
<translation></translation>
</message>
@ -3865,6 +3868,11 @@ Are you really want to continue?</source>
<source>Remove</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1725"/>
<source>Remove All Bookmarks</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1736"/>
<source>Modify Description</source>
@ -3872,15 +3880,15 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.cpp" line="1744"/>
<location filename="mainwindow.cpp" line="4625"/>
<location filename="mainwindow.cpp" line="4665"/>
<location filename="mainwindow.cpp" line="4638"/>
<location filename="mainwindow.cpp" line="4678"/>
<source>Bookmark Description</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1745"/>
<location filename="mainwindow.cpp" line="4626"/>
<location filename="mainwindow.cpp" line="4666"/>
<location filename="mainwindow.cpp" line="4639"/>
<location filename="mainwindow.cpp" line="4679"/>
<source>Description:</source>
<translation></translation>
</message>
@ -3916,8 +3924,9 @@ Are you really want to continue?</source>
</message>
<message>
<location filename="mainwindow.cpp" line="1899"/>
<source>Remove all breakpoints</source>
<translation></translation>
<source>Remove All Breakpoints</source>
<oldsource>Remove all breakpoints</oldsource>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1911"/>
@ -4028,103 +4037,103 @@ Are you really want to continue?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3919"/>
<location filename="mainwindow.cpp" line="3932"/>
<source>Do you really want to clear all breakpoints in this file?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4097"/>
<location filename="mainwindow.cpp" line="4110"/>
<source>New project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4098"/>
<location filename="mainwindow.cpp" line="4111"/>
<source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4110"/>
<location filename="mainwindow.cpp" line="4123"/>
<source>Folder not exist</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4111"/>
<location filename="mainwindow.cpp" line="4124"/>
<source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4118"/>
<location filename="mainwindow.cpp" line="4131"/>
<source>Can&apos;t create folder</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4119"/>
<location filename="mainwindow.cpp" line="4132"/>
<source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4134"/>
<location filename="mainwindow.cpp" line="4147"/>
<source>Save new project as</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4136"/>
<location filename="mainwindow.cpp" line="4149"/>
<source>Red panda Dev-C++ project file (*.dev)</source>
<translation>Dev-C++ (*.dev)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4147"/>
<location filename="mainwindow.cpp" line="4160"/>
<source>New project fail</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4148"/>
<location filename="mainwindow.cpp" line="4161"/>
<source>Can&apos;t assign project template</source>
<translation>使</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4205"/>
<location filename="mainwindow.cpp" line="4218"/>
<source>Add to project</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4418"/>
<location filename="mainwindow.cpp" line="4431"/>
<source>Rename Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4419"/>
<location filename="mainwindow.cpp" line="4432"/>
<source>Symbol &apos;%1&apos; is defined in system header.</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4433"/>
<location filename="mainwindow.cpp" line="4446"/>
<source>New Name</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4490"/>
<location filename="mainwindow.cpp" line="4500"/>
<location filename="mainwindow.cpp" line="4503"/>
<location filename="mainwindow.cpp" line="4513"/>
<source>Replace Error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4491"/>
<location filename="mainwindow.cpp" line="4504"/>
<source>Can&apos;t open file &apos;%1&apos; for replace!</source>
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4501"/>
<location filename="mainwindow.cpp" line="4514"/>
<source>Contents has changed since last search!</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4547"/>
<location filename="mainwindow.cpp" line="4560"/>
<source>Rich Text Format Files (*.rtf)</source>
<translation>RTF格式文件 (*.rtf)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="4569"/>
<location filename="mainwindow.cpp" line="4582"/>
<source>HTML Files (*.html)</source>
<translation>HTML文件 (*.html)</translation>
</message>
@ -4142,8 +4151,8 @@ Are you really want to continue?</source>
<location filename="mainwindow.cpp" line="2853"/>
<location filename="mainwindow.cpp" line="2997"/>
<location filename="mainwindow.cpp" line="3009"/>
<location filename="mainwindow.cpp" line="3346"/>
<location filename="mainwindow.cpp" line="3358"/>
<location filename="mainwindow.cpp" line="3359"/>
<location filename="mainwindow.cpp" line="3371"/>
<source>Error</source>
<translation></translation>
</message>
@ -4178,50 +4187,50 @@ Are you really want to continue?</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3178"/>
<location filename="mainwindow.cpp" line="3191"/>
<source>Compile Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3183"/>
<location filename="mainwindow.cpp" line="3196"/>
<source>Run Failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3375"/>
<location filename="mainwindow.cpp" line="3389"/>
<location filename="mainwindow.cpp" line="3388"/>
<location filename="mainwindow.cpp" line="3402"/>
<source>Confirm Convertion</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3376"/>
<location filename="mainwindow.cpp" line="3390"/>
<location filename="mainwindow.cpp" line="3389"/>
<location filename="mainwindow.cpp" line="3403"/>
<source>The editing file will be saved using %1 encoding. &lt;br /&gt;This operation can&apos;t be reverted. &lt;br /&gt;Are you sure to continue?</source>
<translation>使%1&lt;br /&gt;&lt;br /&gt;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3556"/>
<location filename="mainwindow.cpp" line="3569"/>
<source>New Watch Expression</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3557"/>
<location filename="mainwindow.cpp" line="3570"/>
<source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3613"/>
<location filename="mainwindow.cpp" line="3626"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3635"/>
<location filename="mainwindow.cpp" line="3641"/>
<location filename="mainwindow.cpp" line="3648"/>
<location filename="mainwindow.cpp" line="3654"/>
<source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="3638"/>
<location filename="mainwindow.cpp" line="3651"/>
<source>(%1 files per second)</source>
<translation>(%1</translation>
</message>

View File

@ -16,7 +16,10 @@ CompilerManager::CompilerManager(QObject *parent) : QObject(parent)
mBackgroundSyntaxChecker = nullptr;
mRunner = nullptr;
mSyntaxCheckErrorCount = 0;
mSyntaxCheckIssueCount = 0;
mCompileErrorCount = 0;
mCompileIssueCount = 0;
mSyntaxCheckErrorCount = 0;
}
bool CompilerManager::compiling()
@ -63,6 +66,7 @@ void CompilerManager::compile(const QString& filename, const QByteArray& encodin
return;
}
mCompileErrorCount = 0;
mCompileIssueCount = 0;
mCompiler = new FileCompiler(filename,encoding,silent,onlyCheckSyntax);
mCompiler->setRebuild(rebuild);
connect(mCompiler, &Compiler::finished, mCompiler, &QObject::deleteLater);
@ -91,6 +95,7 @@ void CompilerManager::compileProject(std::shared_ptr<Project> project, bool rebu
return;
}
mCompileErrorCount = 0;
mCompileIssueCount = 0;
mCompiler = new ProjectCompiler(project,silent,onlyCheckSyntax);
mCompiler->setRebuild(rebuild);
connect(mCompiler, &Compiler::finished, mCompiler, &QObject::deleteLater);
@ -120,6 +125,7 @@ void CompilerManager::cleanProject(std::shared_ptr<Project> project)
return;
}
mCompileErrorCount = 0;
mCompileIssueCount = 0;
ProjectCompiler* compiler = new ProjectCompiler(project,false,false);
compiler->setOnlyClean(true);
mCompiler->setRebuild(false);
@ -171,6 +177,7 @@ void CompilerManager::checkSyntax(const QString &filename, const QString &conten
}
mSyntaxCheckErrorCount = 0;
mSyntaxCheckIssueCount = 0;
mBackgroundSyntaxChecker = new StdinCompiler(filename,content,isAscii,true,true);
mBackgroundSyntaxChecker->setProject(project);
connect(mBackgroundSyntaxChecker, &Compiler::finished, mBackgroundSyntaxChecker, &QThread::deleteLater);

View File

@ -1722,7 +1722,7 @@ void MainWindow::buildContextMenus()
}
});
mBookmark_RemoveAll=createActionFor(
tr("Remove All"),
tr("Remove All Bookmarks"),
ui->tableBookmark);
connect(mBookmark_RemoveAll, &QAction::triggered,
[this]() {
@ -1896,7 +1896,7 @@ void MainWindow::buildContextMenus()
}
});
mBreakpointViewRemoveAllAction = createActionFor(
tr("Remove all breakpoints"),
tr("Remove All Breakpoints"),
ui->tblBreakpoints);
connect(mBreakpointViewRemoveAllAction,&QAction::triggered,
[](){
@ -3098,9 +3098,22 @@ void MainWindow::onCompileFinished(bool isCheckSyntax)
}
// Update tab caption
int i = ui->tabMessages->indexOf(ui->tabIssues);
if (i==-1) {
if (i!=-1) {
if (isCheckSyntax) {
if (mCompilerManager->syntaxCheckIssueCount()>0) {
ui->tabMessages->setTabText(i, tr("Issues") +
QString(" (%1)").arg(ui->tableIssues->model()->rowCount()));
QString(" (%1)").arg(mCompilerManager->syntaxCheckIssueCount()));
} else {
ui->tabMessages->setTabText(i, tr("Issues"));
}
} else {
if (mCompilerManager->compileIssueCount()>0) {
ui->tabMessages->setTabText(i, tr("Issues") +
QString(" (%1)").arg(mCompilerManager->compileIssueCount()));
} else {
ui->tabMessages->setTabText(i, tr("Issues"));
}
}
}
// Close it if there's nothing to show

View File

@ -341,7 +341,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>5</number>
<number>2</number>
</property>
<property name="iconSize">
<size>
@ -1639,7 +1639,7 @@
</action>
<action name="actionRemove_All_Watches">
<property name="text">
<string>Remove All</string>
<string>Remove All Watches</string>
</property>
</action>
<action name="actionModify_Watch">