added a copy button which copies all the errors and traceback to clip…#25979
Conversation
21117df to
108cc1c
Compare
|
Is there a reason to create a MessageBox to show that everything is copied? Would it be better to change the title temporarily, like it is done in the About dialog? The same goes to the case if the text is empty. If there is nothing to copy, why bother to show a MessageBox? Why is double "\n" added? Is it more beneficial than one? Is the Copy button suitable to be near the Close button? I think that it is ought to be far to avoid accidental activation. |
<string>&Copy </string>I think that the ampersand before C must be removed, since it is present in the Close button's text. Why does this string end with space? |
|
Thanks for addressing this long standing issue (it existed before #25599 was opened) |
|
Hey @xtemp09
I am also a freelance 3d artist. So I based it on Blender's behaviour. In Blender, there is often a box that pops up in the bottom when some certain tasks are performed, so I thought adding a pop-up to notify would be a good idea. (this can be changed if the maintainers don't like it.)
I noticed this pattern elsewhere in the codebase
I tried to match the pattern of the code in the file
Agreed, that should be removed. |
Usage of amersand creates a mnemonic shortcut.1 Perhaps, the ampersand in the "&Close" button must be removed, for consistency.
I think that a pop-up notification is the best option along with a message in the status bar. =) But, the About dialog already has a button to copy to clipboard. I think it would be beneficial to mimic its behavior. I think also that placing the Copy button next to the Close button is not a good idea. In my opinion, they should be separated with a separator or placed in different locations. Footnotes |
b19baba to
7a5168a
Compare
awaiting feedback from maintainers |
|
It appears the tab order needs to be adjusted. |
|
Thanks for the PR, @Mr-Rahul-Paul (and thanks @xtemp09 for the quick review). @FreeCAD/design-working-group any opinion on this button layout? |
|
@chennes any feed-back from you is appreciated |
0f72e87 to
10c4de1
Compare
10c4de1 to
4b521ef
Compare
chennes
left a comment
There was a problem hiding this comment.
I've made a couple of changes
src/Mod/Test/Gui/UnitTestImp.cpp
Outdated
| QString text; | ||
| QTreeWidgetItemIterator it(ui->treeViewFailure); | ||
| while (*it) { | ||
| text += (*it)->data(0, Qt::UserRole).toString() + "\n\n"; |
There was a problem hiding this comment.
| text += (*it)->data(0, Qt::UserRole).toString() + "\n\n"; | |
| text += (*it)->data(0, Qt::UserRole).toString() + QStringLiteral("\n\n"); |
src/Mod/Test/Gui/UnitTest.ui
Outdated
| <tabstop>helpButton</tabstop> | ||
| <tabstop>aboutButton</tabstop> | ||
| <tabstop>closeButton</tabstop> | ||
| <tabstop>copyButton</tabstop> |
There was a problem hiding this comment.
This should now be above the help button.

Fixes #25599
This PR fixes #25599 by adding a "Copy" button to the Unit Test dialog, allowing users to copy the details of failing tests directly to the clipboard.
Before
No easy way to extract the list of Errors from the UI.

After
A new "Copy" button is added below the Close button. On clicking, it copies errors and traceback(s) to the system clipboard.

How I reproduced the Issue
Changes done
UnitTest.uifile with name "copyButton"onCopyButtonClicked()function inUnitTestImp.hRemarks
onCopyButtonClicked()is that function iterates through the list of failures (treeViewFailure), extracting both the error names and the tracebacks, appending them to a string variable which is then copied to the clipboard.onCopyButtonClicked) and variable naming conventions follow the existing patterns to maintain consistency