[Macro] Bit of help for super users :)

Need help, or want to share a macro? Post here!
openBrain
Posts: 3091
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Mon Dec 02, 2019 12:50 pm

mario52 wrote:
Mon Dec 02, 2019 10:21 am
i include in Start_up_and_Configuration section Example execute a file
:+1:
I would like to see Preferences > General > Macro > Execute macro ......
That's still another thing... :) So there need to be a global management of startup macros.
openBrain
Posts: 3091
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Wed Dec 04, 2019 5:40 pm

Just released a new version (files updated on OP) that adds a slider on all dock widgets to allow font size tuning.
Slider appears with a middle click on a dock widget title bar and disappears automatically if no action on it is performed.
Again, feedback welcome. ;)
User avatar
Kunda1
Posts: 6463
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Macro] Bit of help for super users :)

Post by Kunda1 » Wed Dec 04, 2019 5:45 pm

Nice, I wonder if @chrisb would be willing to add the macro he was working on(?) to quickly get the Help > About FreeCAD info in to this macro/wb ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chrisb
Posts: 21445
Joined: Tue Mar 17, 2015 9:14 am

Re: [Macro] Bit of help for super users :)

Post by chrisb » Wed Dec 04, 2019 9:17 pm

Neither this nor the macro for copying the FreeCAD info is from me, I only added one line as recommended by Werner. Here is the macro anyway:

Code: Select all

from PySide import QtCore
from PySide import QtGui
from PySide2.QtOpenGL import *

class AboutInfo(QtCore.QObject):
  def eventFilter(self, obj, ev):
    if obj.metaObject().className() == "Gui::Dialog::AboutDialog":
      if ev.type() == ev.ChildPolished:
        print(obj.metaObject().className())
        mo = obj.metaObject()
        index = mo.indexOfMethod("on_copyButton_clicked()")
        if index > 0:
          mo.invokeMethod(obj, "on_copyButton_clicked")
          QtGui.qApp.postEvent(obj, QtGui.QCloseEvent())
    return False

ai=AboutInfo()
QtGui.qApp.installEventFilter(ai)
Gui.runCommand("Std_About")
QtGui.qApp.removeEventFilter(ai)
openBrain
Posts: 3091
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Thu Dec 05, 2019 10:55 am

chrisb wrote:
Wed Dec 04, 2019 9:17 pm
Neither this nor the macro for copying the FreeCAD info is from me, I only added one line as recommended by Werner. Here is the macro anyway:
Thx for that. The macro triggers errors here. I'm not surprised as QtGui.qApp is known to be not correctly initialized is some cases.
So you can find below a patched version (where I also simplified some implementation) :

Code: Select all

from PySide import QtCore, QtGui

class AboutInfo(QtCore.QObject):
  def eventFilter(self, obj, ev):
    if obj.metaObject().className() == "Gui::Dialog::AboutDialog":
      if ev.type() == ev.ChildPolished:
        if hasattr(obj, 'on_copyButton_clicked'):
          obj.on_copyButton_clicked()
          QtGui.QApplication.instance().postEvent(obj, QtGui.QCloseEvent())
    return False

ai=AboutInfo()
QtGui.QApplication.instance().installEventFilter(ai)
Gui.runCommand("Std_About")
QtGui.QApplication.instance().removeEventFilter(ai)
Where do you think this should be added in the FC_SU macro ? As a dedicated button ? Or eg. as middle click on the Combo View button ?
openBrain
Posts: 3091
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Thu Dec 05, 2019 3:49 pm

openBrain wrote:
Thu Dec 05, 2019 10:55 am
Where do you think this should be added in the FC_SU macro ? As a dedicated button ? Or eg. as middle click on the Combo View button ?
I integrated the function to get full FC info (files at OP updated). I go for simplest and it is available by middle/right click on the 'C' Combo View toggler. ;)
User avatar
Kunda1
Posts: 6463
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Macro] Bit of help for super users :)

Post by Kunda1 » Thu Dec 05, 2019 5:06 pm

That's cool. One thing, in addition to the macro that would be really great is if we figured out how to:
A) get all third-party dependency versions listed as well
B) get all installed add-on get hashes and version info if their devs have tagged their add-ons with a version
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
openBrain
Posts: 3091
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Thu Dec 05, 2019 6:22 pm

Kunda1 wrote:
Thu Dec 05, 2019 5:06 pm
That's cool. One thing, in addition to the macro that would be really great is if we figured out how to:
A) get all third-party dependency versions listed as well
B) get all installed add-on get hashes and version info if their devs have tagged their add-ons with a version
This is a bit out of the scope of how I see this macro, but I'll be happy to integrate an enhanced version of the "info" macro. IIRC you had opened a topic for that, right?
User avatar
Kunda1
Posts: 6463
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Macro] Bit of help for super users :)

Post by Kunda1 » Thu Dec 05, 2019 6:32 pm

openBrain wrote:
Thu Dec 05, 2019 6:22 pm
This is a bit out of the scope of how I see this macro, but I'll be happy to integrate an enhanced version of the "info" macro. IIRC you had opened a topic for that, right?
Yes, I did. Need to find it.
Found: https://forum.freecadweb.org/viewtopic.php?f=22&t=40522

Are you sure it's out of scope? I ask because we could see this macro being used by beginners as well which we can eventually educate to use this macro to post their system info.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chrisb
Posts: 21445
Joined: Tue Mar 17, 2015 9:14 am

Re: [Macro] Bit of help for super users :)

Post by chrisb » Thu Dec 05, 2019 7:13 pm

openBrain wrote:
Thu Dec 05, 2019 10:55 am
you can find below a patched version
I tried this new version and it works as can be seen below:

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18822 (Git)
Build type: Release
Branch: master
Hash: 0935aa9f5c446ef493e45abb3eba5ffc1af9f57d
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
Post Reply

Who is online

Users browsing this forum: davecoventry and 3 guests