Add standard Cura install directories to resource and plugin paths

Contributes to #41
Contributes to #42
This commit is contained in:
Arjen Hiemstra 2015-05-18 15:01:40 +02:00
parent 7e9870c6cb
commit 70f5dede95

View file

@ -35,6 +35,7 @@ from . import PrintInformation
from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty from PyQt5.QtCore import pyqtSlot, QUrl, Qt, pyqtSignal, pyqtProperty
from PyQt5.QtGui import QColor from PyQt5.QtGui import QColor
import platform
import sys import sys
import os.path import os.path
import numpy import numpy
@ -42,6 +43,7 @@ numpy.seterr(all="ignore")
class CuraApplication(QtApplication): class CuraApplication(QtApplication):
def __init__(self): def __init__(self):
Resources.addResourcePath(os.path.join(QtApplication.getInstallPrefix(), "share", "cura"))
if not hasattr(sys, "frozen"): if not hasattr(sys, "frozen"):
Resources.addResourcePath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) Resources.addResourcePath(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
@ -72,6 +74,7 @@ class CuraApplication(QtApplication):
## Handle loading of all plugin types (and the backend explicitly) ## Handle loading of all plugin types (and the backend explicitly)
# \sa PluginRegistery # \sa PluginRegistery
def _loadPlugins(self): def _loadPlugins(self):
self._plugin_registry.addPluginLocation(os.path.join(QtApplication.getInstallPrefix(), "lib", "cura"))
if not hasattr(sys, "frozen"): if not hasattr(sys, "frozen"):
self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "plugins")) self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "plugins"))