Commit 60209994 authored by Flavio TARSETTI's avatar Flavio TARSETTI

[resources/widgets][toolchaineditor] refactored resources and json loading

parent 09ef7d7b
This diff is collapsed.
......@@ -570,7 +570,7 @@ class ExecutionPropertiesEditor(AbstractBaseEditor):
self.queue_combobox.setModel(self.queue_model)
self.parameters_editor = AlgorithmParametersEditor(prefix_path)
self.remap_button = QPushButton(QIcon(":/resources/remap"), "")
self.remap_button = QPushButton(QIcon(":/resources/img/remap"), "")
self.remap_button.setObjectName("remap")
self.remap_button.setToolTip(self.tr("Remap input and outputs"))
reset_button = QPushButton(
......
......@@ -34,6 +34,8 @@ from PyQt5.QtCore import QRectF
from PyQt5.QtCore import QPointF
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtCore import QFile
from PyQt5.QtCore import QIODevice
from PyQt5.QtGui import QColor
from PyQt5.QtGui import QBrush
......@@ -1419,8 +1421,10 @@ class Toolchain(QWidget):
self.sequential_loop_evaluator_list = []
self.autonomous_loop_evaluator_list = []
with open("beat/editor/widgets/toolchain_style_config.json") as json_file:
config_data = json.load(json_file)
config_data = {}
_file = QFile(":/resources/json/toolchain_style_config")
if _file.open(QFile.ReadOnly | QIODevice.Text):
config_data = json.loads(_file.readAll().data().decode("utf-8"))
self.scene_config = config_data["drawing_space_config"]
self.scene = DrawingSpace(self.scene_config)
......@@ -1435,22 +1439,22 @@ class Toolchain(QWidget):
self.loop_button = QPushButton()
self.loop_button.setToolTip("Loop")
self.loop_button.setIcon(QIcon(":/resources/loop"))
self.loop_button.setIcon(QIcon(":/resources/img/loop"))
self.loop_button.clicked.connect(self.add_loop_block)
self.dataset_button = QPushButton()
self.dataset_button.setToolTip("Dataset")
self.dataset_button.setIcon(QIcon(":/resources/dataset"))
self.dataset_button.setIcon(QIcon(":/resources/img/dataset"))
self.dataset_edit_menu = QMenu(self)
self.block_button = QPushButton()
self.block_button.setToolTip("Block")
self.block_button.setIcon(QIcon(":/resources/block"))
self.block_button.setIcon(QIcon(":/resources/img/block"))
self.block_edit_menu = QMenu(self)
self.analyzer_button = QPushButton()
self.analyzer_button.setToolTip("Analyzer")
self.analyzer_button.setIcon(QIcon(":/resources/analyzer"))
self.analyzer_button.setIcon(QIcon(":/resources/img/analyzer"))
self.analyzer_edit_menu = QMenu(self)
self.toolbar.addWidget(self.dataset_button)
......
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="resources">
<file alias="remap">resources/remap.png</file>
<file alias="docker">resources/icons8-docker-50.png</file>
<file alias="remote">resources/icons8-cloud-development-50.png</file>
<file alias="dataset">resources/dataset.png</file>
<file alias="block">resources/block.png</file>
<file alias="loop">resources/loop.png</file>
<file alias="analyzer">resources/analyzer.png</file>
<file alias="remap">resources/img/remap.png</file>
<file alias="docker">resources/img/icons8-docker-50.png</file>
<file alias="remote">resources/img/icons8-cloud-development-50.png</file>
<file alias="dataset">resources/img/dataset.png</file>
<file alias="block">resources/img/block.png</file>
<file alias="loop">resources/img/loop.png</file>
<file alias="analyzer">resources/img/analyzer.png</file>
<file alias="toolchain_style_config">resources/json/toolchain_style_config.json</file>
</qresource>
</RCC>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment