Skip to content

Commit

Permalink
canvasmain: Add a message to the nodes whose parameters were not rest…
Browse files Browse the repository at this point in the history
…ored
  • Loading branch information
ales-erjavec committed Aug 20, 2021
1 parent 251765f commit 28847dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions orangecanvas/application/canvasmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from ..scheme import Scheme, IncompatibleChannelTypeError, SchemeNode
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
Expand Down Expand Up @@ -1301,6 +1302,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(
Expand Down

0 comments on commit 28847dd

Please sign in to comment.