Skip to content

Commit

Permalink
Fix drag-and-drop of memories
Browse files Browse the repository at this point in the history
The refactor for #10626 caused a breakage in the ability to drag and
drop memories between windows and within a window.
  • Loading branch information
kk7ds committed Jun 28, 2023
1 parent 43143db commit 5d99a38
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chirp/wxui/memedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def _rowheader_mouseover(self, event):
_('Hold %(key)s to drag multiple memories') % {'key': key})

def _memory_drag(self, event):
data = self.cb_copy()
data = self.cb_copy_getdata()
ds = wx.DropSource(self)
ds.SetData(data)
result = ds.DoDragDrop(wx.Drag_AllowMove)
Expand Down Expand Up @@ -1661,7 +1661,7 @@ def update_font(self, refresh=True):
wx.CallAfter(self._grid.AutoSizeRows, setAsMin=False)
wx.CallAfter(self._grid.SetRowLabelSize, wx.grid.GRID_AUTOSIZE)

def cb_copy(self, cut=False):
def cb_copy_getdata(self, cut=False):
rows = self.get_selected_rows_safe()
offset = self._features.memory_bounds[0]
mems = []
Expand Down Expand Up @@ -1691,7 +1691,10 @@ def cb_copy(self, cut=False):
if cut:
wx.PostEvent(self, common.EditorChanged(self.GetId()))

self.cb_copy_data(data)
return data

def cb_copy(self, cut=False):
self.cb_copy_data(self.cb_copy_getdata(cut=cut))

def memedit_import_all(self, source_radio):
source_rf = source_radio.get_features()
Expand Down

0 comments on commit 5d99a38

Please sign in to comment.