diff --git a/NEWS.md b/NEWS.md index 169456a4..e833e427 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ Red Panda C++ Version 0.12.6 - fix: heartbeat for gdb server async command shouldn't disable actions + - fix: problem cases doesn't use svg icons + - fix: problem's title info not updated after running cases Red Panda C++ Version 0.12.5 - fix: compile error in linux diff --git a/RedPandaIDE/icons.qrc b/RedPandaIDE/icons.qrc index 44c24de5..557b8613 100644 --- a/RedPandaIDE/icons.qrc +++ b/RedPandaIDE/icons.qrc @@ -108,6 +108,11 @@ images/associations/rc.ico images/associations/template.ico images/dark-close.svg + images/newlook/editor/bookmark.svg + images/newlook/editor/breakpoint.svg + images/newlook/editor/currentline.svg + images/newlook/editor/syntaxerror.svg + images/newlook/editor/syntaxwarning.svg images/newlook/classparser/class.svg images/newlook/classparser/define.svg images/newlook/classparser/enum.svg @@ -127,11 +132,6 @@ images/newlook/classparser/var_private.svg images/newlook/classparser/var_protected.svg images/newlook/classparser/var_public.svg - images/newlook/editor/bookmark.svg - images/newlook/editor/breakpoint.svg - images/newlook/editor/currentline.svg - images/newlook/editor/syntaxerror.svg - images/newlook/editor/syntaxwarning.svg images/newlook/actions/00Misc-01Back.svg images/newlook/actions/00Misc-02Forward.svg images/newlook/actions/00Misc-03Add.svg @@ -155,23 +155,23 @@ images/newlook/actions/01File-09Open_Folder.svg images/newlook/actions/01File-10FileProperties.svg images/newlook/actions/01File-11Locate.svg - images/newlook/actions/02Project_01New.svg - images/newlook/actions/02Project_02Save.svg - images/newlook/actions/02Project_03Close.svg - images/newlook/actions/02Project_04NewFile.svg - images/newlook/actions/02Project_05AddFile.svg - images/newlook/actions/02Project_06RemoveFile.svg - images/newlook/actions/02Project_07Properties.svg - images/newlook/actions/03Edit_01Undo.svg - images/newlook/actions/03Edit_02Redo.svg - images/newlook/actions/03Edit_03Cut.svg - images/newlook/actions/03Edit_04Copy.svg - images/newlook/actions/03Edit_05Paste.svg - images/newlook/actions/03Edit_06Indent.svg - images/newlook/actions/03Edit_07Unindent.svg - images/newlook/actions/03Edit_08Search.svg - images/newlook/actions/03Edit_09Replace.svg - images/newlook/actions/03Edit_10SearchInFiles.svg + images/newlook/actions/02Project-01New.svg + images/newlook/actions/02Project-02Save.svg + images/newlook/actions/02Project-03Close.svg + images/newlook/actions/02Project-04NewFile.svg + images/newlook/actions/02Project-05AddFile.svg + images/newlook/actions/02Project-06RemoveFile.svg + images/newlook/actions/02Project-07Properties.svg + images/newlook/actions/03Edit-01Undo.svg + images/newlook/actions/03Edit-02Redo.svg + images/newlook/actions/03Edit-03Cut.svg + images/newlook/actions/03Edit-04Copy.svg + images/newlook/actions/03Edit-05Paste.svg + images/newlook/actions/03Edit-06Indent.svg + images/newlook/actions/03Edit-07Unindent.svg + images/newlook/actions/03Edit-08Search.svg + images/newlook/actions/03Edit-09Replace.svg + images/newlook/actions/03Edit-10SearchInFiles.svg images/newlook/actions/03Edit-11SortByName.svg images/newlook/actions/03Edit-12ShowInherited.svg images/newlook/actions/03Edit-12SortByType.svg @@ -197,6 +197,7 @@ images/newlook/actions/05Run-13RemoveWatch.svg images/newlook/actions/05Run-14StepOverInstruction.svg images/newlook/actions/05Run-15StepIntoInstruction.svg + images/newlook/actions/05Run-16Interrupt.svg images/newlook/actions/06View-01Maximum.svg images/newlook/actions/06View-02ClassBrowser.svg images/newlook/actions/06View-03Files.svg @@ -204,11 +205,13 @@ images/newlook/actions/06View-05Bookmark.svg images/newlook/actions/06View-06Todo.svg images/newlook/actions/07Help-01About.svg - images/newlook/actions/08Problem_01Problem.svg - images/newlook/actions/08Problem_02ProblemSet.svg - images/newlook/actions/08Problem_03Properties.svg - images/newlook/actions/08Problem_04EditSource.svg - images/newlook/actions/08Problem_05RunCases.svg - images/newlook/actions/05Run-16Interrupt.svg + images/newlook/actions/08Problem-01Problem.svg + images/newlook/actions/08Problem-02ProblemSet.svg + images/newlook/actions/08Problem-03Properties.svg + images/newlook/actions/08Problem-04EditSource.svg + images/newlook/actions/08Problem-05RunCases.svg + images/newlook/actions/08Problem-06Correct.svg + images/newlook/actions/08Problem-07Wrong.svg + images/newlook/actions/08Problem-08Running.svg diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp index 72319f01..d010f0f9 100644 --- a/RedPandaIDE/iconsmanager.cpp +++ b/RedPandaIDE/iconsmanager.cpp @@ -92,23 +92,23 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) mIconPixmaps.insert(ACTION_FILE_PROPERTIES, createSVGIcon(iconFolder+"01File-10FileProperties.svg",size,size)); mIconPixmaps.insert(ACTION_FILE_LOCATE, createSVGIcon(iconFolder+"01File-11Locate.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_NEW, createSVGIcon(iconFolder+"02Project_01New.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_SAVE, createSVGIcon(iconFolder+"02Project_02Save.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_CLOSE, createSVGIcon(iconFolder+"02Project_03Close.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_NEW_FILE, createSVGIcon(iconFolder+"02Project_04NewFile.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_ADD_FILE, createSVGIcon(iconFolder+"02Project_05AddFile.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_REMOVE_FILE, createSVGIcon(iconFolder+"02Project_06RemoveFile.svg",size,size)); - mIconPixmaps.insert(ACTION_PROJECT_PROPERTIES, createSVGIcon(iconFolder+"02Project_07Properties.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_UNDO, createSVGIcon(iconFolder+"03Edit_01Undo.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_REDO, createSVGIcon(iconFolder+"03Edit_02Redo.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_CUT, createSVGIcon(iconFolder+"03Edit_03Cut.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_COPY, createSVGIcon(iconFolder+"03Edit_04Copy.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_PASTE, createSVGIcon(iconFolder+"03Edit_05Paste.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_INDENT, createSVGIcon(iconFolder+"03Edit_06Indent.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_UNINDENT, createSVGIcon(iconFolder+"03Edit_07Unindent.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit_08Search.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_REPLACE, createSVGIcon(iconFolder+"03Edit_09Replace.svg",size,size)); - mIconPixmaps.insert(ACTION_EDIT_SEARCH_IN_FILES, createSVGIcon(iconFolder+"03Edit_10SearchInFiles.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_NEW, createSVGIcon(iconFolder+"02Project-01New.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_SAVE, createSVGIcon(iconFolder+"02Project-02Save.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_CLOSE, createSVGIcon(iconFolder+"02Project-03Close.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_NEW_FILE, createSVGIcon(iconFolder+"02Project-04NewFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_ADD_FILE, createSVGIcon(iconFolder+"02Project-05AddFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_REMOVE_FILE, createSVGIcon(iconFolder+"02Project-06RemoveFile.svg",size,size)); + mIconPixmaps.insert(ACTION_PROJECT_PROPERTIES, createSVGIcon(iconFolder+"02Project-07Properties.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_UNDO, createSVGIcon(iconFolder+"03Edit-01Undo.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_REDO, createSVGIcon(iconFolder+"03Edit-02Redo.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_CUT, createSVGIcon(iconFolder+"03Edit-03Cut.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_COPY, createSVGIcon(iconFolder+"03Edit-04Copy.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_PASTE, createSVGIcon(iconFolder+"03Edit-05Paste.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_INDENT, createSVGIcon(iconFolder+"03Edit-06Indent.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_UNINDENT, createSVGIcon(iconFolder+"03Edit-07Unindent.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit-08Search.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_REPLACE, createSVGIcon(iconFolder+"03Edit-09Replace.svg",size,size)); + mIconPixmaps.insert(ACTION_EDIT_SEARCH_IN_FILES, createSVGIcon(iconFolder+"03Edit-10SearchInFiles.svg",size,size)); mIconPixmaps.insert(ACTION_EDIT_SORT_BY_NAME, createSVGIcon(iconFolder+"03Edit-11SortByName.svg",size,size)); mIconPixmaps.insert(ACTION_EDIT_SORT_BY_TYPE, createSVGIcon(iconFolder+"03Edit-12SortByType.svg",size,size)); mIconPixmaps.insert(ACTION_EDIT_SHOW_INHERITED, createSVGIcon(iconFolder+"03Edit-13ShowInherited.svg",size,size)); @@ -146,11 +146,14 @@ void IconsManager::updateActionIcons(const QString iconSet, int size) mIconPixmaps.insert(ACTION_HELP_ABOUT, createSVGIcon(iconFolder+"07Help-01About.svg",size,size)); - mIconPixmaps.insert(ACTION_PROBLEM_PROBLEM, createSVGIcon(iconFolder+"08Problem_01Problem.svg",size,size)); - mIconPixmaps.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem_02ProblemSet.svg",size,size)); - mIconPixmaps.insert(ACTION_PROBLEM_PROPERTIES, createSVGIcon(iconFolder+"08Problem_03Properties.svg",size,size)); - mIconPixmaps.insert(ACTION_PROBLEM_EDIT_SOURCE, createSVGIcon(iconFolder+"08Problem_04EditSource.svg",size,size)); - mIconPixmaps.insert(ACTION_PROBLEM_RUN_CASES, createSVGIcon(iconFolder+"08Problem_05RunCases.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_PROBLEM, createSVGIcon(iconFolder+"08Problem-01Problem.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem-02ProblemSet.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_PROPERTIES, createSVGIcon(iconFolder+"08Problem-03Properties.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_EDIT_SOURCE, createSVGIcon(iconFolder+"08Problem-04EditSource.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_RUN_CASES, createSVGIcon(iconFolder+"08Problem-05RunCases.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_PASSED, createSVGIcon(iconFolder+"08Problem-06Correct.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_FALIED, createSVGIcon(iconFolder+"08Problem-07Wrong.svg",size,size)); + mIconPixmaps.insert(ACTION_PROBLEM_TESTING, createSVGIcon(iconFolder+"08Problem-08Running.svg",size,size)); emit actionIconsUpdated(); diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h index e06e89b7..f869a510 100644 --- a/RedPandaIDE/iconsmanager.h +++ b/RedPandaIDE/iconsmanager.h @@ -138,7 +138,10 @@ public: ACTION_PROBLEM_SET, ACTION_PROBLEM_PROPERTIES, ACTION_PROBLEM_EDIT_SOURCE, - ACTION_PROBLEM_RUN_CASES + ACTION_PROBLEM_RUN_CASES, + ACTION_PROBLEM_PASSED, + ACTION_PROBLEM_FALIED, + ACTION_PROBLEM_TESTING }; explicit IconsManager(QObject *parent = nullptr); diff --git a/RedPandaIDE/images/newlook/actions/02Project_01New.svg b/RedPandaIDE/images/newlook/actions/02Project-01New.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_01New.svg rename to RedPandaIDE/images/newlook/actions/02Project-01New.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_02Save.svg b/RedPandaIDE/images/newlook/actions/02Project-02Save.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_02Save.svg rename to RedPandaIDE/images/newlook/actions/02Project-02Save.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_03Close.svg b/RedPandaIDE/images/newlook/actions/02Project-03Close.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_03Close.svg rename to RedPandaIDE/images/newlook/actions/02Project-03Close.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_04NewFile.svg b/RedPandaIDE/images/newlook/actions/02Project-04NewFile.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_04NewFile.svg rename to RedPandaIDE/images/newlook/actions/02Project-04NewFile.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_05AddFile.svg b/RedPandaIDE/images/newlook/actions/02Project-05AddFile.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_05AddFile.svg rename to RedPandaIDE/images/newlook/actions/02Project-05AddFile.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_06RemoveFile.svg b/RedPandaIDE/images/newlook/actions/02Project-06RemoveFile.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_06RemoveFile.svg rename to RedPandaIDE/images/newlook/actions/02Project-06RemoveFile.svg diff --git a/RedPandaIDE/images/newlook/actions/02Project_07Properties.svg b/RedPandaIDE/images/newlook/actions/02Project-07Properties.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/02Project_07Properties.svg rename to RedPandaIDE/images/newlook/actions/02Project-07Properties.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_01Undo.svg b/RedPandaIDE/images/newlook/actions/03Edit-01Undo.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_01Undo.svg rename to RedPandaIDE/images/newlook/actions/03Edit-01Undo.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_02Redo.svg b/RedPandaIDE/images/newlook/actions/03Edit-02Redo.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_02Redo.svg rename to RedPandaIDE/images/newlook/actions/03Edit-02Redo.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_03Cut.svg b/RedPandaIDE/images/newlook/actions/03Edit-03Cut.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_03Cut.svg rename to RedPandaIDE/images/newlook/actions/03Edit-03Cut.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_04Copy.svg b/RedPandaIDE/images/newlook/actions/03Edit-04Copy.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_04Copy.svg rename to RedPandaIDE/images/newlook/actions/03Edit-04Copy.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_05Paste.svg b/RedPandaIDE/images/newlook/actions/03Edit-05Paste.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_05Paste.svg rename to RedPandaIDE/images/newlook/actions/03Edit-05Paste.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_06Indent.svg b/RedPandaIDE/images/newlook/actions/03Edit-06Indent.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_06Indent.svg rename to RedPandaIDE/images/newlook/actions/03Edit-06Indent.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_07Unindent.svg b/RedPandaIDE/images/newlook/actions/03Edit-07Unindent.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_07Unindent.svg rename to RedPandaIDE/images/newlook/actions/03Edit-07Unindent.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_08Search.svg b/RedPandaIDE/images/newlook/actions/03Edit-08Search.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_08Search.svg rename to RedPandaIDE/images/newlook/actions/03Edit-08Search.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_09Replace.svg b/RedPandaIDE/images/newlook/actions/03Edit-09Replace.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_09Replace.svg rename to RedPandaIDE/images/newlook/actions/03Edit-09Replace.svg diff --git a/RedPandaIDE/images/newlook/actions/03Edit_10SearchInFiles.svg b/RedPandaIDE/images/newlook/actions/03Edit-10SearchInFiles.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/03Edit_10SearchInFiles.svg rename to RedPandaIDE/images/newlook/actions/03Edit-10SearchInFiles.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem_01Problem.svg b/RedPandaIDE/images/newlook/actions/08Problem-01Problem.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/08Problem_01Problem.svg rename to RedPandaIDE/images/newlook/actions/08Problem-01Problem.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem_02ProblemSet.svg b/RedPandaIDE/images/newlook/actions/08Problem-02ProblemSet.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/08Problem_02ProblemSet.svg rename to RedPandaIDE/images/newlook/actions/08Problem-02ProblemSet.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem_03Properties.svg b/RedPandaIDE/images/newlook/actions/08Problem-03Properties.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/08Problem_03Properties.svg rename to RedPandaIDE/images/newlook/actions/08Problem-03Properties.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem_04EditSource.svg b/RedPandaIDE/images/newlook/actions/08Problem-04EditSource.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/08Problem_04EditSource.svg rename to RedPandaIDE/images/newlook/actions/08Problem-04EditSource.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem_05RunCases.svg b/RedPandaIDE/images/newlook/actions/08Problem-05RunCases.svg similarity index 100% rename from RedPandaIDE/images/newlook/actions/08Problem_05RunCases.svg rename to RedPandaIDE/images/newlook/actions/08Problem-05RunCases.svg diff --git a/RedPandaIDE/images/newlook/actions/08Problem-06Correct.svg b/RedPandaIDE/images/newlook/actions/08Problem-06Correct.svg new file mode 100644 index 00000000..d0d633cb --- /dev/null +++ b/RedPandaIDE/images/newlook/actions/08Problem-06Correct.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/images/newlook/actions/08Problem-07Wrong.svg b/RedPandaIDE/images/newlook/actions/08Problem-07Wrong.svg new file mode 100644 index 00000000..742a9783 --- /dev/null +++ b/RedPandaIDE/images/newlook/actions/08Problem-07Wrong.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 52286c72..a4684ce7 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -265,6 +265,9 @@ MainWindow::MainWindow(QWidget *parent) connect(&mTcpServer,&QTcpServer::newConnection, this, &MainWindow::onNewProblemConnection); + connect(&mOJProblemModel, &OJProblemModel::dataChanged, + this, &MainWindow::updateProblemTitle); + //files view ui->treeFiles->setModel(&mFileSystemModel); mFileSystemModel.setReadOnly(true); @@ -2106,8 +2109,7 @@ void MainWindow::buildContextMenus() problem->url = dialog.url(); problem->description = dialog.description(); if (problem == mOJProblemModel.problem()) { - ui->lblProblem->setText(mOJProblemModel.getTitle()); - ui->lblProblem->setToolTip(mOJProblemModel.getTooltip()); + updateProblemTitle(); } } }); @@ -3016,8 +3018,7 @@ void MainWindow::onProblemSetIndexChanged(const QModelIndex ¤t, const QMod ui->btnRemoveProblem->setEnabled(true); POJProblem problem = mOJProblemSetModel.problem(idx.row()); mOJProblemModel.setProblem(problem); - ui->lblProblem->setText(mOJProblemModel.getTitle()); - ui->lblProblem->setToolTip(mOJProblemModel.getTooltip()); + updateProblemTitle(); if (mOJProblemModel.count()>0) { ui->lstProblemCases->setCurrentIndex(mOJProblemModel.index(0,0)); } else { @@ -3062,9 +3063,7 @@ void MainWindow::onProblemNameChanged(int index) { QModelIndex idx = ui->lstProblemSet->currentIndex(); if (idx.isValid() && index == idx.row()) { - POJProblem problem = mOJProblemSetModel.problem(idx.row()); - ui->lblProblem->setText(mOJProblemModel.getTitle()); - ui->lblProblem->setToolTip(mOJProblemModel.getTooltip()); + updateProblemTitle(); } } @@ -3133,6 +3132,12 @@ void MainWindow::onNewProblemConnection() } } +void MainWindow::updateProblemTitle() +{ + ui->lblProblem->setText(mOJProblemModel.getTitle()); + ui->lblProblem->setToolTip(mOJProblemModel.getTooltip()); +} + void MainWindow::onEditorClosed() { if (mQuitting) @@ -3949,6 +3954,7 @@ void MainWindow::onRunPausingForFinish() void MainWindow::onRunProblemFinished() { + updateProblemTitle(); ui->pbProblemCases->setVisible(false); updateCompileActions(); updateAppTitle(); @@ -3987,7 +3993,7 @@ void MainWindow::onOJProblemCaseFinished(const QString& id, int current, int tot } ui->pbProblemCases->setMaximum(total); ui->pbProblemCases->setValue(current); - // ui->lblProblem->setText(mOJProblemModel.getProblemTitle()); + updateProblemTitle(); } void MainWindow::onOJProblemCaseNewOutputLineGetted(const QString &, const QString &line) diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index aba47579..11f0eed6 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -267,6 +267,7 @@ private slots: void onProblemCaseIndexChanged(const QModelIndex ¤t, const QModelIndex &previous); void onProblemNameChanged(int index); void onNewProblemConnection(); + void updateProblemTitle(); void onEditorClosed(); void onShowInsertCodeSnippetMenu(); diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index d65db685..98ae78af 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -506,7 +506,7 @@ QTabWidget::South - 2 + 6 @@ -540,6 +540,7 @@ + 50 false @@ -1397,7 +1398,7 @@ 0 0 1114 - 25 + 26 diff --git a/RedPandaIDE/widgets/ojproblemsetmodel.cpp b/RedPandaIDE/widgets/ojproblemsetmodel.cpp index 82ac1f6d..ac191cc3 100644 --- a/RedPandaIDE/widgets/ojproblemsetmodel.cpp +++ b/RedPandaIDE/widgets/ojproblemsetmodel.cpp @@ -342,11 +342,11 @@ QVariant OJProblemModel::data(const QModelIndex &index, int role) const } else if (role == Qt::DecorationRole) { switch (mProblem->cases[index.row()]->testState) { case ProblemCaseTestState::Failed: - return QIcon(":/icons/images/newlook24/008-close.png"); + return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_FALIED); case ProblemCaseTestState::Passed: - return QIcon(":/icons/images/newlook24/007-bughlp.png"); + return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PASSED); case ProblemCaseTestState::Testing: - return QIcon(":/icons/images/newlook24/052-next.png"); + return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_TESTING); default: return QVariant(); }