Skip to content

Commit 0a03f05

Browse files
committed
qtvcp -use PATH to get image directory not INFO
1 parent 9e6c7f0 commit 0a03f05

5 files changed

Lines changed: 16 additions & 14 deletions

File tree

lib/python/qtvcp/lib/gcode_utility/facing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
from PyQt5.QtWidgets import QFileDialog, QMessageBox
1212

1313
from linuxcnc import OPERATOR_ERROR, NML_ERROR
14-
from qtvcp.core import Info, Status, Action
14+
from qtvcp.core import Info, Status, Action, Path
1515

1616
INFO = Info()
1717
STATUS = Status()
1818
ACTION = Action()
19+
PATH = Path()
1920
HERE = os.path.dirname(os.path.abspath(__file__))
20-
IMAGES = os.path.join(INFO.IMAGE_PATH, 'gcode_utility')
21+
IMAGES = os.path.join(PATH.IMAGEDIR, 'gcode_utility')
2122

2223
class Facing(QtWidgets.QWidget):
2324
def __init__(self, parent=None):

lib/python/qtvcp/lib/gcode_utility/hole_circle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor
1414

1515
from linuxcnc import OPERATOR_ERROR, NML_ERROR
16-
from qtvcp.core import Info, Status, Action
16+
from qtvcp.core import Info, Status, Action, Path
1717

1818
INFO = Info()
1919
STATUS = Status()
2020
ACTION = Action()
21+
PATH = Path()
2122

2223
HERE = os.path.dirname(os.path.abspath(__file__))
23-
IMAGES = os.path.join(INFO.IMAGE_PATH, 'gcode_utility')
24+
IMAGES = os.path.join(PATH.IMAGEDIR, 'gcode_utility')
2425

2526
class Preview(QtWidgets.QWidget):
2627
def __init__(self):

lib/python/qtvcp/widgets/basic_probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def next(self,t,direction=None):
630630
file.open(QtCore.QFile.ReadOnly)
631631
html = file.readAll()
632632
html = str(html, encoding='utf8')
633-
html = html.replace("../images/widgets/","{}/widgets/".format(INFO.IMAGE_PATH))
633+
html = html.replace("../images/widgets/","{}/widgets/".format(PATH.IMAGEDIR))
634634
t.setHtml(html)
635635
if t.verticalScrollBar().isVisible():
636636
t.verticalScrollBar().setPageStep(100)

lib/python/qtvcp/widgets/image_switcher.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from PyQt5.QtGui import QPixmap
2323

2424
from qtvcp.widgets.widget_baseclass import _HalWidgetBase
25-
from qtvcp.core import Status, Info, Tool
25+
from qtvcp.core import Status, Info, Tool, Path
2626
from qtvcp import logger
2727

2828
# Instantiate the libraries with global reference
@@ -31,15 +31,15 @@
3131
STATUS = Status()
3232
INFO = Info()
3333
TOOL = Tool()
34+
PATH = Path()
3435
LOG = logger.getLogger(__name__)
3536

3637
# Force the log level for this module
3738
# LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
3839

39-
if INFO.IMAGE_PATH is not None:
40-
DEFAULTIMAGE = (os.path.join(INFO.IMAGE_PATH,'applet-critical.png')) or ''
40+
if PATH.IMAGEDIR is not None:
41+
DEFAULTIMAGE = (os.path.join(PATH.IMAGEDIR,'applet-critical.png')) or ''
4142
else:
42-
INFO.IMAGE_PATH = ''
4343
DEFAULTIMAGE = ''
4444

4545
class ImageSwitcher(QLabel, _HalWidgetBase):
@@ -97,7 +97,7 @@ def show_image_by_number(self, number):
9797
# if path doesn't exist try referencing
9898
# from the built in image folder
9999
if not os.path.exists(path):
100-
path = os.path.join(INFO.IMAGE_PATH, path)
100+
path = os.path.join(PATH.IMAGEDIR, path)
101101
if not os.path.exists(path):
102102
LOG.debug('No Path: {}'.format(path))
103103
pixmap = QPixmap(path)
@@ -148,9 +148,9 @@ class StatusImageSwitcher(ImageSwitcher):
148148

149149
def __init__(self, parent=None):
150150
super(StatusImageSwitcher, self).__init__(parent)
151-
self._imagePath = [os.path.join(INFO.IMAGE_PATH,'applet-critical.png'),
152-
os.path.join(INFO.IMAGE_PATH,'spindle_ccw.gif'),
153-
os.path.join(INFO.IMAGE_PATH,'spindle_cw.gif')]
151+
self._imagePath = [os.path.join(PATH.IMAGEDIR,'applet-critical.png'),
152+
os.path.join(PATH.IMAGEDIR,'spindle_ccw.gif'),
153+
os.path.join(PATH.IMAGEDIR,'spindle_cw.gif')]
154154
self.spindle = True
155155
self.all_homed = False
156156
self.axis_homed = False

lib/python/qtvcp/widgets/versa_probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def next(self,t,direction=None):
698698
file.open(QtCore.QFile.ReadOnly)
699699
html = file.readAll()
700700
html = str(html, encoding='utf8')
701-
html = html.replace("../images/probe_icons/","{}/probe_icons/".format(INFO.IMAGE_PATH))
701+
html = html.replace("../images/probe_icons/","{}/probe_icons/".format(PATH.IMAGEDIR))
702702
t.setHtml(html)
703703
if t.verticalScrollBar().isVisible():
704704
t.verticalScrollBar().setPageStep(20)

0 commit comments

Comments
 (0)