- fix: problem cases doesn't use svg icons

- fix: problem's title info not updated after running cases
This commit is contained in:
Roy Qu 2022-01-01 17:24:18 +08:00
parent 7aae4714a0
commit d51f60b40b
32 changed files with 233 additions and 64 deletions

View File

@ -1,5 +1,7 @@
Red Panda C++ Version 0.12.6 Red Panda C++ Version 0.12.6
- fix: heartbeat for gdb server async command shouldn't disable actions - 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 Red Panda C++ Version 0.12.5
- fix: compile error in linux - fix: compile error in linux

View File

@ -108,6 +108,11 @@
<file>images/associations/rc.ico</file> <file>images/associations/rc.ico</file>
<file>images/associations/template.ico</file> <file>images/associations/template.ico</file>
<file>images/dark-close.svg</file> <file>images/dark-close.svg</file>
<file>images/newlook/editor/bookmark.svg</file>
<file>images/newlook/editor/breakpoint.svg</file>
<file>images/newlook/editor/currentline.svg</file>
<file>images/newlook/editor/syntaxerror.svg</file>
<file>images/newlook/editor/syntaxwarning.svg</file>
<file>images/newlook/classparser/class.svg</file> <file>images/newlook/classparser/class.svg</file>
<file>images/newlook/classparser/define.svg</file> <file>images/newlook/classparser/define.svg</file>
<file>images/newlook/classparser/enum.svg</file> <file>images/newlook/classparser/enum.svg</file>
@ -127,11 +132,6 @@
<file>images/newlook/classparser/var_private.svg</file> <file>images/newlook/classparser/var_private.svg</file>
<file>images/newlook/classparser/var_protected.svg</file> <file>images/newlook/classparser/var_protected.svg</file>
<file>images/newlook/classparser/var_public.svg</file> <file>images/newlook/classparser/var_public.svg</file>
<file>images/newlook/editor/bookmark.svg</file>
<file>images/newlook/editor/breakpoint.svg</file>
<file>images/newlook/editor/currentline.svg</file>
<file>images/newlook/editor/syntaxerror.svg</file>
<file>images/newlook/editor/syntaxwarning.svg</file>
<file>images/newlook/actions/00Misc-01Back.svg</file> <file>images/newlook/actions/00Misc-01Back.svg</file>
<file>images/newlook/actions/00Misc-02Forward.svg</file> <file>images/newlook/actions/00Misc-02Forward.svg</file>
<file>images/newlook/actions/00Misc-03Add.svg</file> <file>images/newlook/actions/00Misc-03Add.svg</file>
@ -155,23 +155,23 @@
<file>images/newlook/actions/01File-09Open_Folder.svg</file> <file>images/newlook/actions/01File-09Open_Folder.svg</file>
<file>images/newlook/actions/01File-10FileProperties.svg</file> <file>images/newlook/actions/01File-10FileProperties.svg</file>
<file>images/newlook/actions/01File-11Locate.svg</file> <file>images/newlook/actions/01File-11Locate.svg</file>
<file>images/newlook/actions/02Project_01New.svg</file> <file>images/newlook/actions/02Project-01New.svg</file>
<file>images/newlook/actions/02Project_02Save.svg</file> <file>images/newlook/actions/02Project-02Save.svg</file>
<file>images/newlook/actions/02Project_03Close.svg</file> <file>images/newlook/actions/02Project-03Close.svg</file>
<file>images/newlook/actions/02Project_04NewFile.svg</file> <file>images/newlook/actions/02Project-04NewFile.svg</file>
<file>images/newlook/actions/02Project_05AddFile.svg</file> <file>images/newlook/actions/02Project-05AddFile.svg</file>
<file>images/newlook/actions/02Project_06RemoveFile.svg</file> <file>images/newlook/actions/02Project-06RemoveFile.svg</file>
<file>images/newlook/actions/02Project_07Properties.svg</file> <file>images/newlook/actions/02Project-07Properties.svg</file>
<file>images/newlook/actions/03Edit_01Undo.svg</file> <file>images/newlook/actions/03Edit-01Undo.svg</file>
<file>images/newlook/actions/03Edit_02Redo.svg</file> <file>images/newlook/actions/03Edit-02Redo.svg</file>
<file>images/newlook/actions/03Edit_03Cut.svg</file> <file>images/newlook/actions/03Edit-03Cut.svg</file>
<file>images/newlook/actions/03Edit_04Copy.svg</file> <file>images/newlook/actions/03Edit-04Copy.svg</file>
<file>images/newlook/actions/03Edit_05Paste.svg</file> <file>images/newlook/actions/03Edit-05Paste.svg</file>
<file>images/newlook/actions/03Edit_06Indent.svg</file> <file>images/newlook/actions/03Edit-06Indent.svg</file>
<file>images/newlook/actions/03Edit_07Unindent.svg</file> <file>images/newlook/actions/03Edit-07Unindent.svg</file>
<file>images/newlook/actions/03Edit_08Search.svg</file> <file>images/newlook/actions/03Edit-08Search.svg</file>
<file>images/newlook/actions/03Edit_09Replace.svg</file> <file>images/newlook/actions/03Edit-09Replace.svg</file>
<file>images/newlook/actions/03Edit_10SearchInFiles.svg</file> <file>images/newlook/actions/03Edit-10SearchInFiles.svg</file>
<file>images/newlook/actions/03Edit-11SortByName.svg</file> <file>images/newlook/actions/03Edit-11SortByName.svg</file>
<file>images/newlook/actions/03Edit-12ShowInherited.svg</file> <file>images/newlook/actions/03Edit-12ShowInherited.svg</file>
<file>images/newlook/actions/03Edit-12SortByType.svg</file> <file>images/newlook/actions/03Edit-12SortByType.svg</file>
@ -197,6 +197,7 @@
<file>images/newlook/actions/05Run-13RemoveWatch.svg</file> <file>images/newlook/actions/05Run-13RemoveWatch.svg</file>
<file>images/newlook/actions/05Run-14StepOverInstruction.svg</file> <file>images/newlook/actions/05Run-14StepOverInstruction.svg</file>
<file>images/newlook/actions/05Run-15StepIntoInstruction.svg</file> <file>images/newlook/actions/05Run-15StepIntoInstruction.svg</file>
<file>images/newlook/actions/05Run-16Interrupt.svg</file>
<file>images/newlook/actions/06View-01Maximum.svg</file> <file>images/newlook/actions/06View-01Maximum.svg</file>
<file>images/newlook/actions/06View-02ClassBrowser.svg</file> <file>images/newlook/actions/06View-02ClassBrowser.svg</file>
<file>images/newlook/actions/06View-03Files.svg</file> <file>images/newlook/actions/06View-03Files.svg</file>
@ -204,11 +205,13 @@
<file>images/newlook/actions/06View-05Bookmark.svg</file> <file>images/newlook/actions/06View-05Bookmark.svg</file>
<file>images/newlook/actions/06View-06Todo.svg</file> <file>images/newlook/actions/06View-06Todo.svg</file>
<file>images/newlook/actions/07Help-01About.svg</file> <file>images/newlook/actions/07Help-01About.svg</file>
<file>images/newlook/actions/08Problem_01Problem.svg</file> <file>images/newlook/actions/08Problem-01Problem.svg</file>
<file>images/newlook/actions/08Problem_02ProblemSet.svg</file> <file>images/newlook/actions/08Problem-02ProblemSet.svg</file>
<file>images/newlook/actions/08Problem_03Properties.svg</file> <file>images/newlook/actions/08Problem-03Properties.svg</file>
<file>images/newlook/actions/08Problem_04EditSource.svg</file> <file>images/newlook/actions/08Problem-04EditSource.svg</file>
<file>images/newlook/actions/08Problem_05RunCases.svg</file> <file>images/newlook/actions/08Problem-05RunCases.svg</file>
<file>images/newlook/actions/05Run-16Interrupt.svg</file> <file>images/newlook/actions/08Problem-06Correct.svg</file>
<file>images/newlook/actions/08Problem-07Wrong.svg</file>
<file>images/newlook/actions/08Problem-08Running.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -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_PROPERTIES, createSVGIcon(iconFolder+"01File-10FileProperties.svg",size,size));
mIconPixmaps.insert(ACTION_FILE_LOCATE, createSVGIcon(iconFolder+"01File-11Locate.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_NEW, createSVGIcon(iconFolder+"02Project-01New.svg",size,size));
mIconPixmaps.insert(ACTION_PROJECT_SAVE, createSVGIcon(iconFolder+"02Project_02Save.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_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_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_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_REMOVE_FILE, createSVGIcon(iconFolder+"02Project-06RemoveFile.svg",size,size));
mIconPixmaps.insert(ACTION_PROJECT_PROPERTIES, createSVGIcon(iconFolder+"02Project_07Properties.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_UNDO, createSVGIcon(iconFolder+"03Edit-01Undo.svg",size,size));
mIconPixmaps.insert(ACTION_EDIT_REDO, createSVGIcon(iconFolder+"03Edit_02Redo.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_CUT, createSVGIcon(iconFolder+"03Edit-03Cut.svg",size,size));
mIconPixmaps.insert(ACTION_EDIT_COPY, createSVGIcon(iconFolder+"03Edit_04Copy.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_PASTE, createSVGIcon(iconFolder+"03Edit-05Paste.svg",size,size));
mIconPixmaps.insert(ACTION_EDIT_INDENT, createSVGIcon(iconFolder+"03Edit_06Indent.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_UNINDENT, createSVGIcon(iconFolder+"03Edit-07Unindent.svg",size,size));
mIconPixmaps.insert(ACTION_EDIT_SEARCH, createSVGIcon(iconFolder+"03Edit_08Search.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_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_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_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_SORT_BY_TYPE, createSVGIcon(iconFolder+"03Edit-12SortByType.svg",size,size));
mIconPixmaps.insert(ACTION_EDIT_SHOW_INHERITED, createSVGIcon(iconFolder+"03Edit-13ShowInherited.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_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_PROBLEM, createSVGIcon(iconFolder+"08Problem-01Problem.svg",size,size));
mIconPixmaps.insert(ACTION_PROBLEM_SET, createSVGIcon(iconFolder+"08Problem_02ProblemSet.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_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_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_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(); emit actionIconsUpdated();

View File

@ -138,7 +138,10 @@ public:
ACTION_PROBLEM_SET, ACTION_PROBLEM_SET,
ACTION_PROBLEM_PROPERTIES, ACTION_PROBLEM_PROPERTIES,
ACTION_PROBLEM_EDIT_SOURCE, 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); explicit IconsManager(QObject *parent = nullptr);

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="007-bughlp.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="4.0920135"
inkscape:cx="-23.704712"
inkscape:cy="70.991946"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient1033"
inkscape:swatch="gradient">
<stop
style="stop-color:#d3d2cf;stop-opacity:1"
offset="0"
id="stop1029" />
<stop
style="stop-color:#bebbb7;stop-opacity:1"
offset="1"
id="stop1031" />
</linearGradient>
<linearGradient
id="linearGradient3056">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#45c200;stop-opacity:0"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#000000;stroke-width:3.70417;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 2.3907683,14.328959 4.2497037,7.138412 3.10899,1.463054 3.291872,-1.463054 11.048658,-15.1771277"
id="path1509-3"
sodipodi:nodetypes="ccccc" />
<path
style="fill:none;stroke:#9d0ab8;stroke-width:2.64583;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 2.6170727,14.700745 4.0233989,6.766626 3.10899,1.463054 3.2918724,-1.463054 10.790024,-14.8134238"
id="path1509" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
viewBox="0 0 26.458333 26.458333"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="00Misc-06Cross.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="false"
inkscape:zoom="5.786981"
inkscape:cx="19.353787"
inkscape:cy="57.974961"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
units="px"
width="100px" />
<defs
id="defs2">
<linearGradient
id="linearGradient3056"
inkscape:swatch="gradient">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop826" />
<stop
style="stop-color:#53e900;stop-opacity:1"
offset="1"
id="stop828" />
</linearGradient>
<linearGradient
id="linearGradient3056-2">
<stop
style="stop-color:#45c200;stop-opacity:1"
offset="0"
id="stop3052" />
<stop
style="stop-color:#5fff07;stop-opacity:1"
offset="1"
id="stop3054" />
</linearGradient>
</defs>
<g
inkscape:label="图层 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#ff4c04;fill-opacity:1;stroke:#000000;stroke-width:0.79375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 6.295134,2.2249039 -4.1159505,4.1159505 6.7351921,6.7351926 -6.7351921,6.735192 4.1159505,4.11595 6.735192,-6.735192 6.735193,6.735192 4.11595,-4.11595 -6.735192,-6.735192 6.735192,-6.7351926 -4.11595,-4.1159505 -6.735193,6.7351921 z"
id="path1359"
sodipodi:nodetypes="ccccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -265,6 +265,9 @@ MainWindow::MainWindow(QWidget *parent)
connect(&mTcpServer,&QTcpServer::newConnection, connect(&mTcpServer,&QTcpServer::newConnection,
this, &MainWindow::onNewProblemConnection); this, &MainWindow::onNewProblemConnection);
connect(&mOJProblemModel, &OJProblemModel::dataChanged,
this, &MainWindow::updateProblemTitle);
//files view //files view
ui->treeFiles->setModel(&mFileSystemModel); ui->treeFiles->setModel(&mFileSystemModel);
mFileSystemModel.setReadOnly(true); mFileSystemModel.setReadOnly(true);
@ -2106,8 +2109,7 @@ void MainWindow::buildContextMenus()
problem->url = dialog.url(); problem->url = dialog.url();
problem->description = dialog.description(); problem->description = dialog.description();
if (problem == mOJProblemModel.problem()) { if (problem == mOJProblemModel.problem()) {
ui->lblProblem->setText(mOJProblemModel.getTitle()); updateProblemTitle();
ui->lblProblem->setToolTip(mOJProblemModel.getTooltip());
} }
} }
}); });
@ -3016,8 +3018,7 @@ void MainWindow::onProblemSetIndexChanged(const QModelIndex &current, const QMod
ui->btnRemoveProblem->setEnabled(true); ui->btnRemoveProblem->setEnabled(true);
POJProblem problem = mOJProblemSetModel.problem(idx.row()); POJProblem problem = mOJProblemSetModel.problem(idx.row());
mOJProblemModel.setProblem(problem); mOJProblemModel.setProblem(problem);
ui->lblProblem->setText(mOJProblemModel.getTitle()); updateProblemTitle();
ui->lblProblem->setToolTip(mOJProblemModel.getTooltip());
if (mOJProblemModel.count()>0) { if (mOJProblemModel.count()>0) {
ui->lstProblemCases->setCurrentIndex(mOJProblemModel.index(0,0)); ui->lstProblemCases->setCurrentIndex(mOJProblemModel.index(0,0));
} else { } else {
@ -3062,9 +3063,7 @@ void MainWindow::onProblemNameChanged(int index)
{ {
QModelIndex idx = ui->lstProblemSet->currentIndex(); QModelIndex idx = ui->lstProblemSet->currentIndex();
if (idx.isValid() && index == idx.row()) { if (idx.isValid() && index == idx.row()) {
POJProblem problem = mOJProblemSetModel.problem(idx.row()); updateProblemTitle();
ui->lblProblem->setText(mOJProblemModel.getTitle());
ui->lblProblem->setToolTip(mOJProblemModel.getTooltip());
} }
} }
@ -3133,6 +3132,12 @@ void MainWindow::onNewProblemConnection()
} }
} }
void MainWindow::updateProblemTitle()
{
ui->lblProblem->setText(mOJProblemModel.getTitle());
ui->lblProblem->setToolTip(mOJProblemModel.getTooltip());
}
void MainWindow::onEditorClosed() void MainWindow::onEditorClosed()
{ {
if (mQuitting) if (mQuitting)
@ -3949,6 +3954,7 @@ void MainWindow::onRunPausingForFinish()
void MainWindow::onRunProblemFinished() void MainWindow::onRunProblemFinished()
{ {
updateProblemTitle();
ui->pbProblemCases->setVisible(false); ui->pbProblemCases->setVisible(false);
updateCompileActions(); updateCompileActions();
updateAppTitle(); updateAppTitle();
@ -3987,7 +3993,7 @@ void MainWindow::onOJProblemCaseFinished(const QString& id, int current, int tot
} }
ui->pbProblemCases->setMaximum(total); ui->pbProblemCases->setMaximum(total);
ui->pbProblemCases->setValue(current); ui->pbProblemCases->setValue(current);
// ui->lblProblem->setText(mOJProblemModel.getProblemTitle()); updateProblemTitle();
} }
void MainWindow::onOJProblemCaseNewOutputLineGetted(const QString &, const QString &line) void MainWindow::onOJProblemCaseNewOutputLineGetted(const QString &, const QString &line)

View File

@ -267,6 +267,7 @@ private slots:
void onProblemCaseIndexChanged(const QModelIndex &current, const QModelIndex &previous); void onProblemCaseIndexChanged(const QModelIndex &current, const QModelIndex &previous);
void onProblemNameChanged(int index); void onProblemNameChanged(int index);
void onNewProblemConnection(); void onNewProblemConnection();
void updateProblemTitle();
void onEditorClosed(); void onEditorClosed();
void onShowInsertCodeSnippetMenu(); void onShowInsertCodeSnippetMenu();

View File

@ -506,7 +506,7 @@
<enum>QTabWidget::South</enum> <enum>QTabWidget::South</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>6</number>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -540,6 +540,7 @@
<widget class="IssuesTable" name="tableIssues"> <widget class="IssuesTable" name="tableIssues">
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight>
<bold>false</bold> <bold>false</bold>
</font> </font>
</property> </property>
@ -1397,7 +1398,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1114</width> <width>1114</width>
<height>25</height> <height>26</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

View File

@ -342,11 +342,11 @@ QVariant OJProblemModel::data(const QModelIndex &index, int role) const
} else if (role == Qt::DecorationRole) { } else if (role == Qt::DecorationRole) {
switch (mProblem->cases[index.row()]->testState) { switch (mProblem->cases[index.row()]->testState) {
case ProblemCaseTestState::Failed: case ProblemCaseTestState::Failed:
return QIcon(":/icons/images/newlook24/008-close.png"); return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_FALIED);
case ProblemCaseTestState::Passed: case ProblemCaseTestState::Passed:
return QIcon(":/icons/images/newlook24/007-bughlp.png"); return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_PASSED);
case ProblemCaseTestState::Testing: case ProblemCaseTestState::Testing:
return QIcon(":/icons/images/newlook24/052-next.png"); return pIconsManager->getIcon(IconsManager::ACTION_PROBLEM_TESTING);
default: default:
return QVariant(); return QVariant();
} }