Skip to content

Commit

Permalink
Merge pull request #167 from mbridak/Change_CW_placeholder_text
Browse files Browse the repository at this point in the history
@mbridak Fix crash on Tune to spot. Change placeholder text for the C…
  • Loading branch information
mbridak authored Oct 8, 2024
2 parents c8fa45e + 4a4662e commit 6fc2ffa
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- [24-10-8] Fix crash on Tune to spot. Change placeholder text for the CW port for those unable to read documentation.
- [24-10-6] Removed 60, 30, 17 and 12M from the default list of bands.
- [24-10-5-1] Store the bandmap spots age timer in the preferences.
- [24-10-5] Force reselction of contest after different DB opened.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.

## Recent Changes

- [24-10-8] Fix crash on Tune to spot. Change placeholder text for the CW port for those unable to read documentation.
- [24-10-6] Removed 60, 30, 17 and 12M from the default list of bands.
- [24-10-5-1] Store the bandmap spots age timer in the preferences.
- [24-10-5] Force reselction of contest after different DB opened.
Expand Down
18 changes: 9 additions & 9 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2609,13 +2609,16 @@ def readpreferences(self) -> None:
self.rig_control.poll_callback.connect(self.poll_radio)
self.radio_thread.start()

if self.pref.get("cwtype", 0) == 0:
self.cw = None
else:
self.cw = None
if (
self.pref.get("cwport")
and self.pref.get("cwip")
and self.pref.get("cwtype")
):
self.cw = CW(
int(self.pref.get("cwtype")),
self.pref.get("cwip"),
int(self.pref.get("cwport", 6789)),
int(self.pref.get("cwport")),
)
self.cw.speed = 20
if self.cw.servertype == 2:
Expand Down Expand Up @@ -2646,13 +2649,9 @@ def readpreferences(self) -> None:
self.pref["bands"] = [
"160",
"80",
"60",
"40",
"30",
"20",
"17",
"15",
"12",
"10",
]

Expand Down Expand Up @@ -2711,7 +2710,8 @@ def watch_udp(self) -> None:
self.callsign_changed()
self.callsign.setFocus()
self.callsign.activateWindow()
window.raise_()
# This broke somehow.
# window.raise_()
continue

if (
Expand Down
41 changes: 36 additions & 5 deletions not1mm/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def __init__(self, app_data_path, pref, parent=None):
self.logger = logging.getLogger("settings")
uic.loadUi(app_data_path / "configuration.ui", self)
self.buttonBox.accepted.connect(self.save_changes)
self.usecwdaemon_radioButton.clicked.connect(self.set_cwdaemon_port_hint)
self.usepywinkeyer_radioButton.clicked.connect(self.set_winkeyer_port_hint)
self.usecwviacat_radioButton.clicked.connect(self.set_catforcw_port_hint)
self.preference = pref
if sd:
self.devices = sd.query_devices()
Expand All @@ -37,7 +40,6 @@ def setup(self):
if index != -1:
self.sounddevice.setCurrentIndex(index)
self.useqrz_radioButton.setChecked(bool(self.preference.get("useqrz")))
# self.usehamdb_radioButton.setChecked(bool(self.preference.get("usehamdb")))
self.usehamqth_radioButton.setChecked(bool(self.preference.get("usehamqth")))
self.lookup_user_name_field.setText(
str(self.preference.get("lookupusername", ""))
Expand All @@ -51,7 +53,10 @@ def setup(self):
self.useflrig_radioButton.setChecked(bool(self.preference.get("useflrig")))

self.cwip_field.setText(str(self.preference.get("cwip", "")))
self.cwport_field.setText(str(self.preference.get("cwport", "")))
if self.preference.get("cwport", ""):
self.cwport_field.setText(str(self.preference.get("cwport", "")))
else:
self.cwport_field.setText("")
self.usecwdaemon_radioButton.setChecked(
bool(self.preference.get("cwtype") == 1)
)
Expand All @@ -61,6 +66,13 @@ def setup(self):
self.usecwviacat_radioButton.setChecked(
bool(self.preference.get("cwtype") == 3)
)
if self.preference.get("cwtype") == 1:
self.set_cwdaemon_port_hint()
elif self.preference.get("cwtype") == 2:
self.set_winkeyer_port_hint()
elif self.preference.get("cwtype") == 3:
self.set_catforcw_port_hint()

self.connect_to_server.setChecked(bool(self.preference.get("useserver")))
self.multicast_group.setText(str(self.preference.get("multicast_group", "")))
self.multicast_port.setText(str(self.preference.get("multicast_port", "")))
Expand All @@ -73,13 +85,14 @@ def setup(self):
str(self.preference.get("n1mm_station_name", ""))
)
self.n1mm_operator.setText(str(self.preference.get("n1mm_operator", "")))
# self.n1mm_ip.setText(str(self.preference.get("n1mm_ip", "")))
self.n1mm_radioport.setText(str(self.preference.get("n1mm_radioport", "")))
self.n1mm_contactport.setText(str(self.preference.get("n1mm_contactport", "")))
self.n1mm_lookupport.setText(str(self.preference.get("n1mm_lookupport", "")))
self.n1mm_scoreport.setText(str(self.preference.get("n1mm_scoreport", "")))
self.send_n1mm_radio.setChecked(bool(self.preference.get("send_n1mm_radio")))
self.send_n1mm_contact.setChecked(bool(self.preference.get("send_n1mm_contact")))
self.send_n1mm_contact.setChecked(
bool(self.preference.get("send_n1mm_contact"))
)
self.send_n1mm_lookup.setChecked(bool(self.preference.get("send_n1mm_lookup")))
self.send_n1mm_score.setChecked(bool(self.preference.get("send_n1mm_score")))

Expand All @@ -105,11 +118,28 @@ def setup(self):
self.activate_6m.setChecked(bool("6" in self.preference.get("bands", [])))
self.activate_4m.setChecked(bool("4" in self.preference.get("bands", [])))
self.activate_2m.setChecked(bool("2" in self.preference.get("bands", [])))
self.activate_1dot25.setChecked(bool("1.25" in self.preference.get("bands", [])))
self.activate_1dot25.setChecked(
bool("1.25" in self.preference.get("bands", []))
)
self.activate_70cm.setChecked(bool("70cm" in self.preference.get("bands", [])))
self.activate_33cm.setChecked(bool("33cm" in self.preference.get("bands", [])))
self.activate_23cm.setChecked(bool("23cm" in self.preference.get("bands", [])))

def set_cwdaemon_port_hint(self):
"""Sets placeholder hint for the CW interface."""
self.cwip_field.setPlaceholderText("127.0.0.1")
self.cwport_field.setPlaceholderText("6789")

def set_winkeyer_port_hint(self):
"""Sets placeholder hint for the CW interface."""
self.cwip_field.setPlaceholderText("127.0.0.1")
self.cwport_field.setPlaceholderText("8000")

def set_catforcw_port_hint(self):
"""Sets placeholder hint for the CW interface."""
self.cwip_field.setPlaceholderText("")
self.cwport_field.setPlaceholderText("")

def save_changes(self):
"""
Write preferences to json file.
Expand All @@ -131,6 +161,7 @@ def save_changes(self):
try:
self.preference["cwport"] = int(self.cwport_field.text())
except ValueError:
self.preference["cwport"] = None
...
self.preference["cwtype"] = 0
if self.usecwdaemon_radioButton.isChecked():
Expand Down
2 changes: 1 addition & 1 deletion not1mm/lib/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""It's the version"""

__version__ = "24.10.6"
__version__ = "24.10.8"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "not1mm"
version = "24.10.6"
version = "24.10.8"
description = "NOT1MM Logger"
readme = "README.md"
requires-python = ">=3.9"
Expand Down Expand Up @@ -43,7 +43,7 @@ classifiers = [
[tool.setuptools.packages.find]
where = ["."]

exclude = ["not1mm.testing*", "not1mm.not1mm.testing*", "testing*", "usb_vfo_knob*",]
exclude = ["not1mm.testing*", "not1mm.not1mm.testing*", "testing*", "test","usb_vfo_knob*",]

[tool.setuptools.package-data]
"not1mm.data" = ["*.json", "*.txt", "*.SCP", "*.ui", "*.ttf", "*.desktop", "*.png", "*.qss", "*.sql", "*.html",]
Expand Down

0 comments on commit 6fc2ffa

Please sign in to comment.