Skip to content

Commit

Permalink
Help Prolific refugees to understand their hostage situation
Browse files Browse the repository at this point in the history
This attempts to warn Windows users who have had their devices
poisoned by the Prolific driver heist of the problem and the
workaround. Hopefully this will prevent users from opening bugs
thinking that CHIRP is at fault.

Related to #11552
  • Loading branch information
kk7ds committed Sep 19, 2024
1 parent ee2883a commit 6cd1c6c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions chirp/wxui/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import re
import textwrap
import threading
import webbrowser

import serial
from serial.tools import list_ports
Expand All @@ -40,6 +41,10 @@
CUSTOM = _('Custom...')


def is_prolific_warning(string):
return 'PL2303' in string and 'CONTACT YOUR SUPPLIER' in string


def get_fakes():
return {
'Fake NOP': developer.FakeSerial(),
Expand Down Expand Up @@ -468,6 +473,18 @@ def _port_assist(self, event):
return
self.set_ports(after, select=found.device)

def _prolific_assist(self, event):
r = wx.MessageBox(
_('Your Prolific-based USB device will not work without '
'reverting to an older version of the driver. Visit the '
'CHIRP website to read more about how to resolve this?'),
_('Prolific USB device'),
style=wx.YES | wx.NO | wx.YES_DEFAULT, parent=self)
if r == wx.YES:
webbrowser.open(
'https://chirpmyradio.com/projects/chirp/wiki/'
'ProlificDriverDeprecation')

def _add_aliases(self, rclass):
for alias in rclass.ALIASES:
class DynamicRadioAlias(rclass):
Expand All @@ -490,6 +507,7 @@ def _persist_choices(self):
raise NotImplementedError()

def _selected_port(self, event):
okay_btn = self.FindWindowById(self.GetAffirmativeId())
if self._port.GetStringSelection() == CUSTOM:
port = wx.GetTextFromUser(_('Enter custom port:'),
_('Custom Port'),
Expand All @@ -501,7 +519,12 @@ def _selected_port(self, event):
elif self._port.GetStringSelection() == HELPME:
self._port_assist(event)
return
elif is_prolific_warning(self._port.GetStringSelection()):
self._prolific_assist(event)
okay_btn.Enable(False)
return
self._persist_choices()
okay_btn.Enable(True)

def _select_vendor(self, vendor):
display_models = []
Expand Down

0 comments on commit 6cd1c6c

Please sign in to comment.