BCF Support GSoC Proposal

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
saso
Posts: 1305
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: BCF Support GSoC Proposal

Postby saso » Tue Aug 06, 2019 2:56 pm

pPodest wrote:
Tue Aug 06, 2019 1:00 pm
Does this match what you had in mind?
Yes and no :) Was thinking to have it open all the time... But it is ok, don't loose time with this, it is not so important and others maybe would not agree with me :)
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Postby pPodest » Wed Aug 07, 2019 4:57 am

Well as I think about it, this implementation is actually a drop down list :lol:
The constant open list is totally doable, but the I think it takes up too much of screen real estate, especially on small screens. On the other hand it could still be done in a vertical way, where the group containing the "open" and "save" button is beside the list of topics. That, I think, would not take up to much vertical space.
saso wrote:
Tue Aug 06, 2019 2:56 pm
But it is ok, don't loose time with this, it is not so important and others maybe would not agree with me :)
I would estimate that it takes just one hour, since it is only changing some lines in the view part of the application, so not that big of a deal ;). I could show you a draft by tomorrow.
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Postby pPodest » Thu Aug 08, 2019 9:05 am

@saso: attached you find my second take on the list of topics to select from. It still needs a little polishing though. But first let's see what other people think of this design :)
Attachments
topicListv2.gif
topicListv2.gif (90.32 KiB) Viewed 426 times
User avatar
yorik
Site Admin
Posts: 11458
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: BCF Support GSoC Proposal

Postby yorik » Fri Aug 09, 2019 11:28 pm

I also like the idea to see the list of topics in one go... It gives you a quick overview of how deep in the word censored you are with a particular model :D

Maybe try this: there is a Qt widget that is a kind of resizable frame, (QSplitter I think). You could have two regions, one above and one below, the topics list above and the topic details below, and that would allow the user to drag the splitter, and therefore determine how much space they wish for each...

For the GSOC question, I don't think it is much important in your case, as the work done is clearly visible and well formatted, easy to review, and easy to tell apart from the work done in FreeCAD, as all your work is in its own repo. Just make sure your readme is up to date and gives a short overview of the whole adventure (google people might just look there and not further), and you should be fine...

On the FreeCAD side, regarding packaging: I think you're almost there, I see you added a convenience macro, etc.. I would suggest one thing, which is move the macro to the root of your repo. That should be all that is needed to add it to the addons installer later on (the macro will be picked up and copied to the macros folder automatically).

If you feel like it, I would maybe also add some other goodie: register the .bcf file extension so opening one with FreeCAD would fire up your plugin. Basically you need to add an Init.py file to your repo root, and inside:

Code: Select all

App.addImportType("BCF Files (*.bcf)","bcfImportPlugin")
bcfImportPlugin being any importable module that contains both an open(filename) and insert(filename,docname) functions. In your case, both can do the same thing since they don't add anything to the document anyway.

Regarding the plugin itself, gave it a test spin today, it's awesome! I have these two little cosmetic suggestions:

Use a vertical spacer to make things look a bit more compact:
Screenshot from 2019-08-09 20-19-21.png
Screenshot from 2019-08-09 20-19-21.png (109.89 KiB) Viewed 379 times
Don't use black text ;) Use QtGui.QApplication.palette().text()
Screenshot from 2019-08-09 20-21-28.png
Screenshot from 2019-08-09 20-21-28.png (52.24 KiB) Viewed 379 times
User avatar
Kunda1
Posts: 5139
Joined: Thu Jan 05, 2017 9:03 pm

Re: BCF Support GSoC Proposal

Postby Kunda1 » Sat Aug 10, 2019 5:07 pm

yorik wrote:
Fri Aug 09, 2019 11:28 pm
Don't use black text Use QtGui.QApplication.palette().text()
The blue colored text is also harsh in the dark theme
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

Re: BCF Support GSoC Proposal

Postby amrit3701 » Sun Aug 11, 2019 6:22 pm

Kunda1 wrote:
Sat Aug 10, 2019 5:07 pm
The blue colored text is also harsh in the dark theme
+1
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Postby pPodest » Mon Aug 12, 2019 4:43 am

Thank you for your valuable feedback @yorik. Especially the registration of a new import type in FreeCAD seems like a real cool feature for the plugin, I will implement it tomorrow.

Regarding the topic list, instead of the combo box: it will be switched then, to give the developer an impression of (like you said it) "how deep in the word censored he/she is" :lol:
The tip with the QSplitter is also really great, that removes some of the burden of rightfully dimensioning all UI elements off of me, thank you!

The thing with the dark theme is ... well I didn't consider a dark theme at all, even though nowadays everyone wants a dark theme for everything. The text colors will be fixed. Thanks for pointing that out @yorik, @amrit3701 and @Kunda1!

Otherwise I think a little update is appropriate at this point:
Except the changes discussed above, I am currently working on a feature that let's you create a complete new project/bcf file. Topics can already be added to an existing project/bcf file. I still have some issues with the size of comments, as it does not get calculated correctly right at the start of the plugin. And this week I am also focusing more on documenting the code and updating the wiki pages and the readme I have written.
Also I have added a little more functionality to the listview listing the additional document references in the "topic metrics" dialog. A double click on an element in either column tries to open the file from disk or copy the path of the file to the clipboard, respectively.
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Postby pPodest » Fri Aug 16, 2019 11:27 am

Here the probably last update of GSoC'19, since next week already the final evaluation round is taking place.
I just released the final version of the plugin, you can check it out here.
This release incorporates your suggestions about the text colours, which are not hardcoded anylonger ;)
Not that much has else changed since the last release, though. Attached you will find the release notes file.

Next week I will still be updating the wiki pages, because I didn't get to it this week, apart from adding two new sections to the gui tutorial.

@luzpaz created an issue asking if the repository could already be added to the addons repository of FreeCAD. As of this release I am pretty confident that the plugin complies with the addon manager's requirements. But I am eager to see :D
Attachments
release-notes.txt
(2.63 KiB) Downloaded 7 times
User avatar
yorik
Site Admin
Posts: 11458
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: BCF Support GSoC Proposal

Postby yorik » Fri Aug 16, 2019 5:46 pm

Code: Select all

  File "/home/yorik/.FreeCAD/Mod/BCFPlugin/bcfplugin/gui/plugin_view.py", line 213, in setupSplitter
    splitter.setOrientation(Qt.Vertical)
<class 'NameError'>: name 'Qt' is not defined
Same in gui/views/viewpointslist.py and snapshotlist.py (I'm using your master branch and not the release). Some "from QtCore import Qt" missing I guess...

Well done! I'm playing with it now, this is functional, elegant, usable, and I see you paid attention to a lot of smaller usability details already (warning before closing unsaved file, etc..). Very impressive job you did!

The Readme looks okay to me, so I think basically everything is ready for GSOC.
Let's add it to the Addon Manager? That would be the icing on the cake... I don't think there is anything else to be done on your side, the macro will be picked up automatically by the addon manager.

A couple of small cosmetic details more, if you are up to it:
Screenshot from 2019-08-16 14-35-37.png
Screenshot from 2019-08-16 14-35-37.png (121.57 KiB) Viewed 237 times
1) the Topic metrics view should have its "stretch last column" property turned on (you can do that in QDesigner)
2) When selecting a comment, it uses white background and the white text is not visible.. I think either you force white background and black text, or you use selected background and selected text color (both should be there somewhere in the QPalette I think)
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Postby pPodest » Mon Aug 19, 2019 6:20 am

Hi Yorik, thanks for the feedback!
yorik wrote:
Fri Aug 16, 2019 5:46 pm
Code: Select all

File "/home/yorik/.FreeCAD/Mod/BCFPlugin/bcfplugin/gui/plugin_view.py", line 213, in setupSplitter
splitter.setOrientation(Qt.Vertical)
<class 'NameError'>: name 'Qt' is not defined

Same in gui/views/viewpointslist.py and snapshotlist.py (I'm using your master branch and not the release). Some "from QtCore import Qt" missing I guess...
Strangely I didn't get these error messages. Maybe it has todo with the PySide version (5.13.0-2) I am using, that Qt automatically gets imported too, if something is imported from QtCore. Anyways I added Qt explicitly now in the import statement from PySide2.QtCore import (..., Qt, ...)

I also fixed the issue with the topic metrics table, thanks for the suggestion of view.(horizontal|vertical)Header().setStretchLastSection(bool).

But sadly I can't recreate the comment-colour selection issue.
comment-selection-issue.jpg
comment-selection-issue.jpg (18.8 KiB) Viewed 210 times
I currently have the Arc-Dark theme active and I am using the kvantum-qt5 theme engine. To fix this issue could you tell me which qt theme you are using?
The code selecting the font colour is the following:

Code: Select all

elif role == Qt.ForegroundRole:
	# set the color if a viewpoint is linked to the comment
        link = QApplication.palette().link()
        normal = QApplication.palette().text()
        brush = normal if item.viewpoint is None else link

        return brush
Otherwise, I am not setting any colours in for the comment list. Is maybe QApplication.palette() is the wrong instance in this case?