- fix: the problem & problem set panel can't be correctly , if problem set is enabled

This commit is contained in:
Roy Qu 2022-03-22 15:44:27 +08:00
parent da0be0af98
commit 7b4aa764d3
2 changed files with 8 additions and 15 deletions

View File

@ -648,10 +648,6 @@ void MainWindow::applySettings()
ui->txtProblemCaseExpected->setFont(caseEditorFont);
mTcpServer.close();
int idxProblem = ui->tabMessages->indexOf(ui->tabProblem);
ui->tabMessages->setTabEnabled(idxProblem,pSettings->executor().enableProblemSet());
int idxProblemSet = ui->tabInfos->indexOf(ui->tabProblemSet);
ui->tabInfos->setTabEnabled(idxProblemSet,pSettings->executor().enableProblemSet());
if (pSettings->executor().enableProblemSet()) {
if (pSettings->executor().enableCompetitiveCompanion()) {
if (!mTcpServer.listen(QHostAddress::LocalHost,pSettings->executor().competivieCompanionPort())) {
@ -664,16 +660,13 @@ void MainWindow::applySettings()
// +tr("Or You can choose a different port number and try again."));
}
}
if (idxProblem<0)
ui->tabMessages->addTab(ui->tabProblem,tr("Problem"));
if (idxProblemSet<0)
ui->tabInfos->addTab(ui->tabProblemSet, tr("Problem Set"));
} else {
if (idxProblem>=0)
ui->tabMessages->removeTab(idxProblem);
if (idxProblemSet>=0)
ui->tabInfos->removeTab(idxProblemSet);
}
showHideInfosTab(ui->tabProblemSet,pSettings->ui().showProblemSet()
&& pSettings->executor().enableProblemSet());
showHideMessagesTab(ui->tabProblem, pSettings->ui().showProblem()
&& pSettings->executor().enableProblemSet());
ui->actionInterrupt->setVisible(pSettings->debugger().useGDBServer());
//icon sets for editors
updateEditorSettings();

View File

@ -542,7 +542,7 @@
<enum>QTabWidget::South</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>6</number>
</property>
<property name="iconSize">
<size>
@ -1422,7 +1422,7 @@
<x>0</x>
<y>0</y>
<width>1114</width>
<height>26</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">