mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 05:39:02 +08:00
Use python's webbrowser instead of Qt.openUrlExternally for opening urls
Qt.openUrlExternally crashes on Windows, but python webbrowser works. So use that instead. Fixes Asana issue 33694049548892
This commit is contained in:
parent
15e66a7a18
commit
3c5096cebc
15
cura/CuraActions.py
Normal file
15
cura/CuraActions.py
Normal file
@ -0,0 +1,15 @@
|
||||
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty
|
||||
|
||||
import webbrowser
|
||||
|
||||
class CuraActions(QObject):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
|
||||
@pyqtSlot()
|
||||
def openDocumentation(self):
|
||||
webbrowser.open("http://ultimaker.com/en/support/software")
|
||||
|
||||
@pyqtSlot()
|
||||
def openBugReportPage(self):
|
||||
webbrowser.open("http://github.com/Ultimaker/Cura/issues")
|
@ -33,6 +33,7 @@ from . import PlatformPhysics
|
||||
from . import BuildVolume
|
||||
from . import CameraAnimation
|
||||
from . import PrintInformation
|
||||
from . import CuraActions
|
||||
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty
|
||||
from PyQt5.QtGui import QColor
|
||||
@ -184,6 +185,8 @@ class CuraApplication(QtApplication):
|
||||
engine.rootContext().setContextProperty("Printer", self)
|
||||
self._print_information = PrintInformation.PrintInformation()
|
||||
engine.rootContext().setContextProperty("PrintInformation", self._print_information)
|
||||
self._cura_actions = CuraActions.CuraActions(self)
|
||||
engine.rootContext().setContextProperty("CuraActions", self._cura_actions)
|
||||
|
||||
def onSelectionChanged(self):
|
||||
if Selection.hasSelection():
|
||||
|
@ -337,8 +337,8 @@ UM.MainWindow {
|
||||
preferences.onTriggered: preferences.visible = true;
|
||||
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(2); }
|
||||
|
||||
documentation.onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/support");
|
||||
reportBug.onTriggered: Qt.openUrlExternally("https://github.com/Ultimaker/Cura/issues");
|
||||
documentation.onTriggered: CuraActions.openDocumentation();
|
||||
reportBug.onTriggered: CuraActions.openBugReportPage();
|
||||
showEngineLog.onTriggered: engineLog.visible = true;
|
||||
about.onTriggered: aboutDialog.visible = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user