Page 1 of 1

Trying to add Show QR Code action raises an error

Posted: Sun Sep 17, 2017 8:37 pm
by Boolean263
I don't know if this is a beta-specific bug, but since I'm running the beta (actually RC) version, thought I should post it here.

I can't add a "Show QR Code" action to a macro. When I select it from the Add Action dialog and click OK, I get the following error dump (this is with debugging information enabled):

Code: Select all

Traceback (most recent call last) (0.5.0-rc4):
  File "E:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
    self.Configure(*args, **kwargs)
  File "E:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
    treeItem.Configure(*args)
  File "E:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
    return self.executable.Configure(*args)
  File "E:\Program Files (x86)\EventGhost\plugins\System\__init__.py", line 1646, in Configure
    textWidth = 105
  File "E:\Program Files (x86)\EventGhost\eg\Classes\SmartSpinIntCtrl.py", line 61, in __init__
    textWidth = textWidth
  File "E:\Program Files (x86)\EventGhost\eg\Classes\SmartSpinNumCtrl.py", line 61, in __init__
    self.ctrl = self.CreateCtrl(int(not isinstance(value, (int, float))))
  File "E:\Program Files (x86)\EventGhost\eg\Classes\SmartSpinNumCtrl.py", line 72, in CreateCtrl
    **self.kwargs
  File "E:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 89, in __init__
    numCtrl.SetValue(value)  # To avoid bug in NumCtrl
  File "wx\lib\masked\numctrl.pyc", line 1281, in SetValue
  File "wx\lib\masked\numctrl.pyc", line 1604, in _toGUI
ValueError: value 0 is below minimum value of control

Re: Trying to add Show QR Code action raises an error

Posted: Mon Sep 18, 2017 3:05 am
by kgschlosser
I have a question. is the qrcode something that you actually use or is it something that you tested to see what it does. because in all honesty i do not see what the point to it is. But i will have a look see at it.

Re: Trying to add Show QR Code action raises an error

Posted: Tue Sep 19, 2017 12:51 am
by Boolean263
Which answer will encourage you to fix it? :lol:

I've been trying to test every action that I can as I go about documenting the various plugins. (System was a beast, just because it has so many actions available.) This is how I discovered that Show QR Code is broken.

Somebody obviously saw a point in having that action, because they created it, and someone (possibly the same person, possibly not) decided it was useful enough to include in a core plugin. So I'd advise caution before tearing it out.

But if you are looking at removing unneeded actions, you should also look at Display Image vs Show Picture. To me, they're the same thing, I don't see a good reason why they're both needed. Show Picture has fewer features, so perhaps it can be cut.

Re: Trying to add Show QR Code action raises an error

Posted: Mon Sep 25, 2017 10:40 am
by topix
To fix it do the following:
In eg/Classes/SmartSpinNumCtrl.py change line 43 from

Code: Select all

self.initValue = 0.0
to

Code: Select all

self.initValue = value

Re: Trying to add Show QR Code action raises an error

Posted: Wed Oct 04, 2017 11:19 pm
by kgschlosser
this problem is not in SmartSpinNumCtrl. it is actually in SpinNumCtrl.


because the control sets the value at 0 when it creates the instance of the control and then sets the parameters after that and then sets the value. if you specify a min value higher then 0 the value error occurs.

but if we set the value before the parameters and the default min value is 0.0 and the value is below that. we have the same issue. I have corrected this and will have it added to the core code. but attached is the SpinNumCtrl.py file that has the proper solution.

Thanks for reporting this.

Re: Trying to add Show QR Code action raises an error

Posted: Thu Oct 05, 2017 5:47 am
by Luca Brasi
This worked for me for the same error with the Pusle-Eight Hdmi CEC 1.1b plugin.

Re: Trying to add Show QR Code action raises an error

Posted: Thu Oct 05, 2017 9:00 am
by kgschlosser
yup it should