PrintMakerLab / mks-wifi-plugin

MKS wifi plugin for Cura
https://marketplace.ultimaker.com/app/cura/plugins/Jeredian/MKSWifiPlugin
GNU Affero General Public License v3.0
138 stars 56 forks source link

[CPR] Qt 6 (Cura 5) and Qt 5 (Cura 4) Dual Compatibility #294

Closed ParkerK closed 2 years ago

ParkerK commented 2 years ago

Description

Using https://github.com/fieldOfView/Cura-OctoPrintPlugin/blob/release/OctoPrintOutputDevice.py as a reference, I made some changes that allow the plugin to work on both Cura 4.9+ and Cura 5.0 without needing different versions in the marketplace.

If you would rather have different versions for the plugin, please feel free to ignore/reject this PR.

This uses Python 3.6's 'ModuleNotFoundError' (Cura 4.9 uses Python 3.8, not sure what the version was before that) to try to import PyQt6. If it fails and throws ModuleNotFoundError, then it will import PyQt5.

There is also a second directory called qml_qt5 that will be used instead of qml is PyQt5 is used.

Testing

I was able to slice and print a model in both Cura 4.13.1 and Cura 5.0 beta using these changes without issue. I was also able to add/edit/remove a printer. Feel free to test more thoroughly, but everything appears to be functioning with these changes.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Jeredian commented 2 years ago

Definitely looks interesting, but we decided to be up to the Cura 5 only. Because we want to prevent major issues with both versions support. Anyway, thanks for your time and this code changes. Lets keep it in a pull requests history.