From a11e98ab1f594e4a7227b151a2c8d95d592bfcc8 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Tue, 15 Sep 2020 09:55:39 +0200 Subject: [PATCH] canvasmain: Add a message to the nodes whose parameters were not restored --- orangecanvas/application/canvasmain.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/orangecanvas/application/canvasmain.py b/orangecanvas/application/canvasmain.py index 72b5f93ce..b17cb9fa7 100644 --- a/orangecanvas/application/canvasmain.py +++ b/orangecanvas/application/canvasmain.py @@ -52,6 +52,7 @@ from ..scheme import Scheme, IncompatibleChannelTypeError from ..scheme import readwrite from ..scheme.readwrite import UnknownWidgetDefinition +from ..scheme.node import UserMessage from ..gui.dropshadow import DropShadowFrame from ..gui.dock import CollapsibleDockWidget from ..gui.quickhelp import QuickHelpTipEvent @@ -1306,6 +1307,15 @@ def load(fileobj, warning_handler=None, fileobj, warning_handler=None, data_deserializer=data_deserializer ) + for e in list(errors): + if isinstance(e, readwrite.UnsupportedPickleFormatError): + if e.node is not None and e.node in new_scheme.nodes: + e.node.set_state_message( + UserMessage( + "Did not restore settings", UserMessage.Warning, + message_id="-properties-restore-error-data", + )) + errors.remove(e) except Exception: # pylint: disable=broad-except log.exception("") message_critical(