Commit 4aa45bc7 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][[plotterparameterseditor] Implement creation of a valid asset

The prototype while conceptually valid doesn't contain valid
plotter. This commit fixes that by selecting a valid Plotter
automatically.

Related to #244
parent 17ea4b25
......@@ -48,6 +48,7 @@ from ..decorators import frozen
from .scrollwidget import ScrollWidget
from .dialogs import AssetCreationDialog
from .editor import AbstractAssetEditor
from .parameterwidget import InputType
from .spinboxes import NumpySpinBox
......@@ -478,6 +479,20 @@ class PlotterParametersEditor(AbstractAssetEditor):
if self.parameter_viewers:
QTimer.singleShot(100, self.__showLatestParameter)
def _createNewAsset(self, creation_type, asset_info):
"""Re-implement to ensure we"""
plotterparameters, data = super(PlotterParametersEditor, self)._createNewAsset(
creation_type, asset_info
)
if creation_type == AssetCreationDialog.NEW:
declaration = plotterparameters.declaration
declaration["plotter"] = self.plotter_model.index(0, 0).data()
plotterparameters.declaration = declaration
return plotterparameters, data
def _load_json(self, json_object):
"""Load the json object passed as parameter"""
......
Supports Markdown
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