From ad915d27dcdb9fc94d800322114d8453cb8e2727 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 27 Jun 2023 17:36:31 -0700 Subject: [PATCH] Fix drag-and-drop of memories The refactor for #10626 caused a breakage in the ability to drag and drop memories between windows and within a window. --- chirp/wxui/memedit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chirp/wxui/memedit.py b/chirp/wxui/memedit.py index d8b3cfcfb..9be362cc2 100644 --- a/chirp/wxui/memedit.py +++ b/chirp/wxui/memedit.py @@ -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) @@ -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 = [] @@ -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()