1. biolab
  2. Untitled project
  3. orange

Commits

Aleš Erjavec  committed 34029da

Ignore/reject drops on the canvas with unsupported data.

  • Participants
  • Parent commits bcc2297
  • Branches default

Comments (0)

Files changed (1)

File Orange/OrangeCanvas/document/schemeedit.py

View file
  • Ignore whitespace
                         "application/vnv.orange-canvas.registry.qualified-name"
                         ):
                     event.acceptProposedAction()
+                else:
+                    event.ignore()
                 return True
             elif etype == QEvent.GraphicsSceneDrop:
                 data = event.mimeData()
                 qname = data.data(
                     "application/vnv.orange-canvas.registry.qualified-name"
                 )
-                desc = self.__registry.widget(unicode(qname))
-                pos = event.scenePos()
-                self.createNewNode(desc, position=(pos.x(), pos.y()))
+                try:
+                    desc = self.__registry.widget(unicode(qname))
+                except KeyError:
+                    log.error("Unknown qualified name '%s'", qname)
+                else:
+                    pos = event.scenePos()
+                    self.createNewNode(desc, position=(pos.x(), pos.y()))
                 return True
 
             elif etype == QEvent.GraphicsSceneMousePress: