From c5f3ceba7c3aaa836e195d6223310b3e11c97e39 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 13 May 2024 14:34:38 -0700 Subject: [PATCH 1/3] Fix crash when moving memories near edges This fixes us trying to push the spreadsheet cursor past the edges of the sheet when doing move-up or move-down, if the cursor was already at the edge. Fixes: #11344 --- chirp/wxui/memedit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chirp/wxui/memedit.py b/chirp/wxui/memedit.py index 13b9df41b..8d0d3b93f 100644 --- a/chirp/wxui/memedit.py +++ b/chirp/wxui/memedit.py @@ -2064,7 +2064,10 @@ def cb_move(self, direction): for mem in to_set: self.set_memory(mem) cursor_r, cursor_c = self._grid.GetGridCursorCoords() - self._grid.SetGridCursor(cursor_r + direction, cursor_c) + cursor_r += direction + if 0 <= cursor_r <= last_row: + # Avoid pushing the cursor past the edges + self._grid.SetGridCursor(cursor_r, cursor_c) wx.PostEvent(self, common.EditorChanged(self.GetId())) From 55020d23dcfa35afa7366442ec790a84a063f8fe Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 13 May 2024 14:37:11 -0700 Subject: [PATCH 2/3] Extend TID H3 range bottom to 18MHz As reported, the H3 now receives down to 18MHz as of firmware H3_240427. Fixes: #11347 --- chirp/drivers/tdh8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chirp/drivers/tdh8.py b/chirp/drivers/tdh8.py index 2c7c1dbf7..52cbca8e8 100644 --- a/chirp/drivers/tdh8.py +++ b/chirp/drivers/tdh8.py @@ -2498,7 +2498,7 @@ class TDH3(TDH8): _ranges_main = [(0x0000, 0x1fef)] _idents = [TD_H3] _txbands = [(136000000, 600000000)] - _rxbands = [(50000000, 107999000), (108000000, 136000000)] + _rxbands = [(18000000, 107999000), (108000000, 136000000)] _aux_block = True _tri_power = True _gmrs = False From e130fd392e72f50e222570c4501bd60674cd33f7 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 13 May 2024 15:17:56 -0700 Subject: [PATCH 3/3] Fix desktop icon prompt parent window Fixes #11346 --- chirp/wxui/__init__.py | 6 +++--- tests/unit/test_wxui_radiothread.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chirp/wxui/__init__.py b/chirp/wxui/__init__.py index 1102d46fe..6f9c3b860 100644 --- a/chirp/wxui/__init__.py +++ b/chirp/wxui/__init__.py @@ -25,7 +25,7 @@ def developer_mode(enabled=None): return CONF.get('developer_mode', 'state') == CHIRP_VERSION -def maybe_install_desktop(args): +def maybe_install_desktop(args, parent): local = os.path.join(os.path.expanduser('~'), '.local') desktop_path = os.path.join(local, 'share', 'applications', 'chirp.desktop') @@ -56,7 +56,7 @@ def maybe_install_desktop(args): import wx r = wx.MessageBox( _('Would you like CHIRP to install a desktop icon for you?'), - _('Install desktop icon?'), style=wx.YES_NO) + _('Install desktop icon?'), parent=parent, style=wx.YES_NO) if r != wx.YES: CONF.set_bool('offered_desktop', True, 'state') return @@ -244,7 +244,7 @@ def chirpmain(): if sys.platform == 'linux': try: - maybe_install_desktop(args) + maybe_install_desktop(args, mainwindow) except Exception as e: LOG.exception('Failed to run linux desktop installer: %s', e) diff --git a/tests/unit/test_wxui_radiothread.py b/tests/unit/test_wxui_radiothread.py index aedd7c8fd..9039ab4eb 100644 --- a/tests/unit/test_wxui_radiothread.py +++ b/tests/unit/test_wxui_radiothread.py @@ -205,21 +205,21 @@ def test_linux_desktop_file(self, optin, optout, exists, last, answ): # If we made it through all the checks, and thus prompted the user, # make sure we get to the makedirs part if expected self.assertRaises(TestException, - self.maybe_install_desktop, self.args) + self.maybe_install_desktop, self.args, None) elif answ is False: # If we were supposed to make it to the prompt but answer no, # make sure we did - self.maybe_install_desktop(self.args) + self.maybe_install_desktop(self.args, None) self.assertFalse(os.makedirs.called) self.assertTrue(wx.MessageBox.called) else: # If we were not supposed to make it to the prompt, make sure we # didn't, nor did we do any create actions - self.maybe_install_desktop(self.args) + self.maybe_install_desktop(self.args, None) self.assertFalse(os.makedirs.called) self.assertFalse(wx.MessageBox.called) def test_linux_desktop_file_exists(self): os.path.exists.return_value = True - self.maybe_install_desktop(self.args) + self.maybe_install_desktop(self.args, None) self.assertFalse(os.makedirs.called)