[Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20246
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by wmayer »

Can I use your code?
Sure, feel free to do whatever you want.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by openBrain »

dprojects wrote: Wed Mar 30, 2022 11:45 am Oh Man !!! This is what I was looking for. I added "Std_About" to the woodworking workbench because I didn't know how to grab the info content. Can I use your code? for example to add some info that the details has been already copied or something like that.
I have found several issues when triggering this code in different situations.
You can find here a fixed version : https://github.com/0penBrain/FCsuWB/blo ... /fcinfo.py
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by dprojects »

wmayer wrote: Wed Mar 30, 2022 11:57 am
Can I use your code?
Sure, feel free to do whatever you want.
Thanks !!! I will add link in the code to this topic here.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by Kunda1 »

wmayer wrote: Wed Mar 30, 2022 7:57 am
@wmayer how can I get this same output but using freecad --console ?
Not at all. Or how do you think to open the About dialog in CLI mode?
Sorry, should of clarified!

I didn't mean to be able to open the GUI About dialog from CLI. What I meant: what is the equivalent of this code block but in CLI mode where the results (full About info) are explicitly returned and/or copied to buffer?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20246
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by wmayer »

I didn't mean to be able to open the GUI About dialog from CLI. What I meant: what is the equivalent of this code block but in CLI mode where the results (full About info) are explicitly returned and/or copied to buffer?
No, the information is all in the GUI part of the application.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by Kunda1 »

wmayer wrote: Wed Mar 30, 2022 12:51 pm No, the information is all in the GUI part of the application.
Thanks for the reply wmayer!

JFYI, opened a separate thread exploring how we can do it via --console mode.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by dprojects »

wmayer wrote: Wed Mar 30, 2022 12:51 pm
Thanks again, it is very useful to have it as separate command !
I made it this way (this open under button with bug icon):
Image

and this is the code changes: here

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by openBrain »

dprojects wrote: Wed Mar 30, 2022 4:04 pm Thanks again, it is very useful to have it as separate command !
I made it this way (this open under button with bug icon):
You may ignore my previous post, but you could encounter exceptions with this code especially if launched from a GUI widget.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: [Solved] Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by dprojects »

openBrain wrote: Wed Mar 30, 2022 4:14 pm You may ignore my previous post, but you could encounter exceptions with this code especially if launched from a GUI widget.
I saw it, but didn't notice any issues with the code, it works very well. Also I don't know how the code works to change it, for me it is some kind of black magic or Chinese ;-)
Probably the system info can be taken in other way but it is better to have it exactly as FreeCAD does.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Help firing AboutDialog::on_copyButton_clicked() wanted by n00b

Post by dprojects »

openBrain wrote: Wed Mar 30, 2022 12:05 pm I have found several issues when triggering this code in different situations.
I have already installed Ubuntu 22.04 LTS and for native installation (sudo apt-get install freecad) I got error like that:

Code: Select all

Running the Python command 'DEBUGINFO' failed:
Traceback (most recent call last):
  File "/home/user/.FreeCAD/Mod/Woodworking/loadTools.py", line 185, in Activated
    __import__(module, globals(), locals(), [], 0)
  File "/usr/lib/python3/dist-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "/home/user/.FreeCAD/Mod/Woodworking/Tools/debugInfo.py", line 25, in <module>
    QtGui.qApp.installEventFilter(ai)

module 'PySide.QtGui' has no attribute 'qApp'
Info for native installation:

Code: Select all

OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
But this probably means You may have wrong FreeCAD installation, if you have problem with the code. Because this problem is related to FreeCAD lib dependencies.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
Post Reply