Skip to content

Commit 5dd1381

Browse files
committed
Fix typos in function names and UI elements; update styles for clarity
1 parent 3ca1545 commit 5dd1381

File tree

6 files changed

+31
-32
lines changed

6 files changed

+31
-32
lines changed

not1mm/__main__.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
distance_with_latlon,
5151
get_logged_band,
5252
getband,
53-
reciprocol,
53+
reciprocal,
5454
fakefreq,
5555
)
5656

@@ -1350,7 +1350,7 @@ def dockwidget_message(self, msg):
13501350
self.station.get("GridSquare", ""), grid
13511351
)
13521352
self.heading_distance.setText(
1353-
f"{grid} Hdg {heading}° LP {reciprocol(heading)}° / "
1353+
f"{grid} Hdg {heading}° LP {reciprocal(heading)}° / "
13541354
f"distance {int(kilometers*0.621371)}mi {kilometers}km"
13551355
f" {msg.get('result', {}).get('name_fmt', '')}"
13561356
)
@@ -2470,13 +2470,9 @@ def clear_band_indicators(self) -> None:
24702470
for _, indicator in indicators.items():
24712471
indicator.setFrameShape(QtWidgets.QFrame.Shape.NoFrame)
24722472
if self.text_color == QColorConstants.Black:
2473-
indicator.setStyleSheet(
2474-
f"font-family: {self.fontfamily}; color: black;"
2475-
)
2473+
indicator.setStyleSheet("color: black;")
24762474
else:
2477-
indicator.setStyleSheet(
2478-
f"font-family: {self.fontfamily}; color: white;"
2479-
)
2475+
indicator.setStyleSheet("color: white;")
24802476

24812477
def set_band_indicator(self, band: str) -> None:
24822478
"""
@@ -2497,9 +2493,7 @@ def set_band_indicator(self, band: str) -> None:
24972493
indicator = self.all_mode_indicators[self.current_mode].get(band, None)
24982494
if indicator:
24992495
indicator.setFrameShape(QtWidgets.QFrame.Shape.Box)
2500-
indicator.setStyleSheet(
2501-
f"font-family: {self.fontfamily}; color: green;"
2502-
)
2496+
indicator.setStyleSheet("color: green;")
25032497

25042498
def closeEvent(self, _event) -> None:
25052499
"""
@@ -4305,7 +4299,7 @@ def check_callsign(self, callsign) -> None:
43054299
heading = bearing_with_latlon(self.station.get("GridSquare"), lat, lon)
43064300
kilometers = distance_with_latlon(self.station.get("GridSquare"), lat, lon)
43074301
self.heading_distance.setText(
4308-
f"Regional Hdg {heading}° LP {reciprocol(heading)}° / "
4302+
f"Regional Hdg {heading}° LP {reciprocal(heading)}° / "
43094303
f"distance {int(kilometers*0.621371)}mi {kilometers}km"
43104304
)
43114305
if self.rotator_window is not None:

not1mm/bandmap.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
import logging
1414
import os
1515
import platform
16+
import re
1617
import sqlite3
1718
from datetime import datetime, timezone
1819
from decimal import Decimal
1920
from json import loads
2021

2122
from PyQt6 import QtCore, QtGui, QtWidgets, uic, QtNetwork
2223
from PyQt6.QtGui import QColorConstants, QFont, QColor
23-
from PyQt6.QtWidgets import QDockWidget
24+
from PyQt6.QtWidgets import QDockWidget, QStyle
2425
from PyQt6.QtCore import Qt, pyqtSignal
2526

2627
import not1mm.fsutils as fsutils
@@ -344,6 +345,7 @@ class BandMapWindow(QDockWidget):
344345
text_color = QColor(45, 45, 45)
345346
cluster_expire = pyqtSignal(str)
346347
message = pyqtSignal(dict)
348+
date_pattern = r"^\d{2}-[A-Za-z]{3}-\d{4}$"
347349

348350
def __init__(self, action):
349351
super().__init__()
@@ -362,7 +364,11 @@ def __init__(self, action):
362364
self.agetime = self.clear_spot_olderSpinBox.value()
363365
self.clear_spot_olderSpinBox.valueChanged.connect(self.spot_aging_changed)
364366
self.clearButton.clicked.connect(self.clear_spots)
367+
pixmapi = QStyle.StandardPixmap.SP_TrashIcon
368+
icon = self.style().standardIcon(pixmapi)
369+
self.clearButton.setIcon(icon)
365370
self.clearmarkedButton.clicked.connect(self.clear_marked)
371+
self.clearmarkedButton.setIcon(icon)
366372
self.zoominButton.clicked.connect(self.dec_zoom)
367373
self.zoomoutButton.clicked.connect(self.inc_zoom)
368374
self.connectButton.clicked.connect(self.connect)
@@ -884,8 +890,20 @@ def receive(self) -> None:
884890
self.send_command(
885891
"set dx mode " + self.settings.get("cluster_mode", "OPEN")
886892
)
893+
self.send_command("sh ww")
887894
logger.debug(f"callsign login acknowledged {data}")
888895

896+
items = data.split()
897+
if items:
898+
if re.match(self.date_pattern, items[0]):
899+
try:
900+
sfi = items[2]
901+
aindex = items[3]
902+
kindex = items[4]
903+
print(f"{sfi=} {aindex=} {kindex=}")
904+
except IndexError:
905+
...
906+
889907
def maybeconnected(self) -> None:
890908
"""Update visual state of the connect button."""
891909
self.connectButton.setText("Connecting")

not1mm/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def send_chat(self):
4444

4545
def display_chat(self, sender, body):
4646
"""Displays the chat history."""
47-
print(f"{self.mycall=}")
47+
4848
if self.mycall in body.upper():
4949
self.chat_history.setTextColor(QtGui.QColor(245, 121, 0))
5050
self.chat_history.insertPlainText(f"\n{sender}: {body}")

not1mm/data/bandmap.ui

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
<string>BandMap</string>
1515
</property>
1616
<widget class="QWidget" name="widget">
17-
<property name="font">
18-
<font>
19-
<family>JetBrains Mono</family>
20-
</font>
21-
</property>
22-
<layout class="QVBoxLayout" name="verticalLayout_2">
17+
<layout class="QVBoxLayout" name="verticalLayout_2">
2318
<property name="spacing">
2419
<number>6</number>
2520
</property>
@@ -166,7 +161,7 @@
166161
<string>clear spots</string>
167162
</property>
168163
<property name="text">
169-
<string>🗑 Spots</string>
164+
<string>Spots</string>
170165
</property>
171166
</widget>
172167
</item>
@@ -191,7 +186,7 @@
191186
<string>Erase Marked Spots</string>
192187
</property>
193188
<property name="text">
194-
<string>🗑 Marked</string>
189+
<string>Marked</string>
195190
</property>
196191
</widget>
197192
</item>

not1mm/data/checkwindow.ui

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@
1717
<string>CheckPartial</string>
1818
</property>
1919
<widget class="QWidget" name="widget">
20-
<property name="font">
21-
<font>
22-
<family>JetBrains Mono</family>
23-
</font>
24-
</property>
25-
<layout class="QGridLayout" name="checkpartialgridlayout">
20+
<layout class="QGridLayout" name="checkpartialgridlayout">
2621
<property name="margin" stdset="0">
2722
<number>2</number>
2823
</property>
@@ -141,7 +136,6 @@
141136
<widget class="QLabel" name="logListLabel">
142137
<property name="font">
143138
<font>
144-
<family>JetBrains Mono</family>
145139
<pointsize>10</pointsize>
146140
</font>
147141
</property>
@@ -154,7 +148,6 @@
154148
<widget class="QLabel" name="masterListLabel">
155149
<property name="font">
156150
<font>
157-
<family>JetBrains Mono</family>
158151
<pointsize>10</pointsize>
159152
</font>
160153
</property>
@@ -167,7 +160,6 @@
167160
<widget class="QLabel" name="telnetListLabel">
168161
<property name="font">
169162
<font>
170-
<family>JetBrains Mono</family>
171163
<pointsize>10</pointsize>
172164
</font>
173165
</property>

not1mm/lib/ham_utility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def bearing(grid1: str, grid2: str) -> float:
478478
return round(brng)
479479

480480

481-
def reciprocol(heading):
481+
def reciprocal(heading):
482482
"""return back of the beam heading"""
483483
heading += 180
484484
if heading > 360:

0 commit comments

Comments
 (0)