tb2097 / wacom-gui

Python/PyQt Wacom GUI for KDE
GNU General Public License v3.0
134 stars 36 forks source link

Launch fails on xubuntu and wacom intuos 3 #27

Open batzkass opened 5 years ago

batzkass commented 5 years ago

Hi, I would like first to congratulate you for your project, its very nice, well designed and useful. As I am a python developer, I could help a bit.

I have a wacom intuos 3 (PTZ-630), running on Xubuntu 18.04. I first installed the dconf-tools package, which should be in your prerequisites I think, for desktops that don't use it by default. I launched wacom-gui from source files, but all I got at first were errors:

local variable 'svg_write' referenced before assignment local variable 'svg_write' referenced before assignment Traceback (most recent call last): File "wacom-gui.py", line 741, in main() File "wacom-gui.py", line 733, in main form = WacomGui() File "wacom-gui.py", line 70, in init self.refreshTablets() File "wacom-gui.py", line 108, in refreshTablets self.tabletSelect(0) File "wacom-gui.py", line 300, in tabletSelect self.getConfigs(idx) File "wacom-gui.py", line 259, in getConfigs self.loadConfig(dev, dev_id, self.config) File "wacom-gui.py", line 278, in loadConfig self.configs[dev][config]['pad']['buttons']) File "/home/francois/Téléchargements/wacom-gui/wacom-gui/pad.py", line 172, in init_keys svg_size = svgWidget.sizeHint() AttributeError: 'NoneType' object has no attribute 'sizeHint'

I dug a little bit and modified the wacom_data.py file to make the interface work (it was an svg creation issue): patch.txt

The interface is now usable to setup everything, but with display issues (image of express keys is stretched, no pen image, and mapping settings are not well displayed):

wacom-gui

Also, I found no way to set the two "strips" in the express keys bindings, is this a xsetwacom limitation ?

It would be nice if you find time to look at this but anyway, thanks for sharing this program.

tb2097 commented 5 years ago

Glad to hear you are finding it useful. It looks like your fix should work correctly (minor logic gaffe on my part) but I'll just run it through testing before I push it out. For the other issues:

1) dconf-tools

2) missing icons My guess is you likely didn't run it from the wacom-gui directory. The way the RPM works is it installs to /usr/local/wacom-gui and if the cwd is detected as /usr/local/bin, changes the cwd to the expected install location (pad.py lines 24/25) . There may be a more intelligent way of doing this so I'm open to suggestions. If you can test/verify it'd be appreciated.

3) missing strip keys xsetwacom definitely supports setting values for them. It looks like wacom are not being consistent in how they configure the .tablet files, and there is some parsing that needs to be done for the svg file to properly detect where the strips are located on the tablet. With the older tablets they may have internally updated them to use the "new" method, which is to just assign them a button ID and when the touchstrip is being pressed it repeats the input. You should be able to easily test by trying the following: xsetwacom --list devices - get device id for PAD xsetwacom --set <dev id> button <button #> key +<letter> so, for example, if you want to set Button A to print the letter a, you would do: xsetwacom --set <dev id> button 1 key +a

With touch wheel tablets, button 4 - 7 are reserved for scroll/pan. If those are the IDs used for scroll/pan I can just submit a patch to libwacom to get them up date their files. If they use a different button ID we'd need to do further testing.

As well, if you'd officially like to help with development just let me know. I'd definitely be interested in getting a proper deb package setup for future releases to ease installation.

batzkass commented 5 years ago

Thanks for all these informations. Let's say I can help to test and debug, just like I will do below, but for the future I will do my fork to send merge requests. For the deb package, I simply used alien to convert from rpm to deb.

I dug a little and found the issue with images not showing. self.cwd was the right folder, but you should convert to unicode utf8 as qt appears to need it if there are special chars in the path... which is my case. Note that python3 now uses utf8 encoding by default for strings. Below is a list of all changes to make it work :

./hotkeys.py:23: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8") ./hotkeys.py:244: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8") ./pad.py:23: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8") ./pad.py:274: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8") ./pad.py:426: self.cwd = unicode(os.path.join(os.path.dirname(os.path.abspath(file)), "icons/ui"),"utf-8") ./stylus.py:19: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8") ./wacom-gui.py:25: self.cwd = unicode(os.path.dirname(os.path.abspath(file)),"utf-8")

And now everything is showing well... hum, except: the right side (with parameters) of the mapping tab is still weird, as in the gif I sent you initially. Maybe you could have a look at this ?

Regards, François

tb2097 commented 5 years ago

Thanks for finding those! I'll update to make sure the paths are parsed correctly for unicode, although I'll stick with Python 2.7 for now as that is what we use mainly in the VFX industry. However, I do plan to move over to Python 3 once that transition happens.

With regards to the mode box, my guess is xubuntu is registering the mode box size differently than on MATE (my main test platform). Can you try making this change and see if it resolves the issue with your mode box? You can try increasing the value a little bit at a time to see what seems to work correctly for you.

stylus.py: 462: - self.mode_box.setFixedSize(290, 40) 642: + self.mode_box.setFixedSize(290, 50)