- fix: when running problem cases, the output textbox might be wrongly cleared.

This commit is contained in:
Roy Qu 2022-02-04 18:51:46 +08:00
parent a95475190c
commit 79aecde9a5
4 changed files with 529 additions and 511 deletions

View File

@ -14,6 +14,7 @@ Red Panda C++ Version 0.14.1
- fix: editor's font size set by ctrl+mouse wheel will be reset by open the option dialog
- fix: actions not correctly disabled when compile
- fix: can't differentiate disabled and enabled buttons, when using contrast icon set
- fix: when running problem cases, the output textbox might be wrongly cleared.
Red Panda C++ Version 0.14.0
- enhancement: custom icon set ( in the configuration folder)

File diff suppressed because it is too large Load Diff

View File

@ -4069,7 +4069,12 @@ void MainWindow::onOJProblemCaseStarted(const QString& id,int current, int total
POJProblemCase problemCase = mOJProblemModel.getCase(row);
problemCase->testState = ProblemCaseTestState::Testing;
mOJProblemModel.update(row);
ui->txtProblemCaseOutput->clear();
QModelIndex idx = ui->lstProblemCases->currentIndex();
if (idx.isValid()) {
if (row == idx.row()) {
ui->txtProblemCaseOutput->clear();
}
}
}
}
@ -4084,18 +4089,17 @@ void MainWindow::onOJProblemCaseFinished(const QString& id, int current, int tot
ProblemCaseTestState::Failed;
mOJProblemModel.update(row);
QModelIndex idx = ui->lstProblemCases->currentIndex();
if (idx.isValid()) {
if (row == idx.row()) {
updateProblemCaseOutput(problemCase);
}
if (!idx.isValid() || row != idx.row()) {
ui->lstProblemCases->setCurrentIndex(mOJProblemModel.index(row,0));
}
updateProblemCaseOutput(problemCase);
}
ui->pbProblemCases->setMaximum(total);
ui->pbProblemCases->setValue(current);
updateProblemTitle();
}
void MainWindow::onOJProblemCaseNewOutputGetted(const QString &, const QString &line)
void MainWindow::onOJProblemCaseNewOutputGetted(const QString &id, const QString &line)
{
ui->txtProblemCaseOutput->appendPlainText(line);
}
@ -5869,6 +5873,10 @@ void MainWindow::on_btnSaveProblemSet_clicked()
QDir().absolutePath(),
tr("Problem Set Files (*.pbs)"));
if (!fileName.isEmpty()) {
QFileInfo fileInfo(fileName);
if (fileInfo.suffix().isEmpty()) {
fileName.append(".pbs");
}
QDir::setCurrent(extractFileDir(fileName));
try {
applyCurrentProblemCaseChanges();

View File

@ -543,6 +543,7 @@
<widget class="IssuesTable" name="tableIssues">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@ -1388,7 +1389,7 @@
<x>0</x>
<y>0</y>
<width>1114</width>
<height>25</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -1542,7 +1543,7 @@
</property>
<widget class="QMenu" name="menuTool_Windows">
<property name="title">
<string>Tool Windows</string>
<string>Tool Panels</string>
</property>
<addaction name="actionProject"/>
<addaction name="actionWatch"/>
@ -2521,7 +2522,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>Tool Window Bars</string>
<string>Show Tool Panels</string>
</property>
</action>
<action name="actionStatus_Bar">