Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two UI things and extend H3 range #1033

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chirp/drivers/tdh8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions chirp/wxui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 4 additions & 1 deletion chirp/wxui/memedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_wxui_radiothread.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading