Skip to content

Commit

Permalink
fix arbitrary content being dragged and dropped causing errors
Browse files Browse the repository at this point in the history
Fixes #2630
  • Loading branch information
ugurilter committed Aug 29, 2024
1 parent 777ba69 commit b6ff2f7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/boosterView.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data
data = dragged_data.split(':')

if dragged_data is None:
return t

self.dropFn(x, y, data)
return t

Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/cargoView.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/commandView.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/droneView.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/fighterView.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/implantView.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinAdditionPanes/projectedView.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def __init__(self, dropFn, *args, **kwargs):
def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down
4 changes: 4 additions & 0 deletions gui/builtinViews/fittingView.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def OnData(self, x, y, t):
if self.GetData():
dragged_data = DragDropHelper.data
# pyfalog.debug("fittingView: recieved drag: " + self.dropData.GetText())

if dragged_data is None:
return t

data = dragged_data.split(':')
self.dropFn(x, y, data)
return t
Expand Down

0 comments on commit b6ff2f7

Please sign in to comment.