not1mm 24.4.1.2__py3-none-any.whl → 24.4.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- not1mm/__main__.py +137 -90
- not1mm/bandmap.py +50 -23
- not1mm/checkwindow.py +45 -21
- not1mm/data/checkwindow.ui +1 -1
- not1mm/data/cty.json +1 -1
- not1mm/data/vfo.ui +18 -0
- not1mm/lib/about.py +1 -1
- not1mm/lib/edit_contact.py +1 -1
- not1mm/lib/edit_macro.py +1 -1
- not1mm/lib/edit_opon.py +1 -1
- not1mm/lib/edit_station.py +2 -1
- not1mm/lib/lookup.py +6 -0
- not1mm/lib/multicast.py +7 -5
- not1mm/lib/new_contest.py +1 -1
- not1mm/lib/select_contest.py +1 -1
- not1mm/lib/settings.py +1 -1
- not1mm/lib/version.py +1 -1
- not1mm/logwindow.py +59 -23
- not1mm/plugins/10_10_fall_cw.py +1 -1
- not1mm/plugins/10_10_spring_cw.py +1 -2
- not1mm/plugins/10_10_summer_phone.py +1 -1
- not1mm/plugins/10_10_winter_phone.py +1 -1
- not1mm/plugins/arrl_10m.py +1 -1
- not1mm/plugins/arrl_dx_cw.py +1 -1
- not1mm/plugins/arrl_dx_ssb.py +1 -1
- not1mm/plugins/arrl_field_day.py +1 -1
- not1mm/plugins/arrl_rtty_ru.py +1 -1
- not1mm/plugins/arrl_ss_cw.py +3 -3
- not1mm/plugins/arrl_ss_phone.py +3 -3
- not1mm/plugins/arrl_vhf_jan.py +1 -1
- not1mm/plugins/arrl_vhf_jun.py +1 -1
- not1mm/plugins/arrl_vhf_sep.py +1 -1
- not1mm/plugins/canada_day.py +1 -1
- not1mm/plugins/cq_160_cw.py +1 -1
- not1mm/plugins/cq_160_ssb.py +1 -1
- not1mm/plugins/cq_wpx_cw.py +1 -1
- not1mm/plugins/cq_wpx_ssb.py +1 -1
- not1mm/plugins/cq_ww_cw.py +1 -1
- not1mm/plugins/cq_ww_ssb.py +1 -1
- not1mm/plugins/cwt.py +1 -1
- not1mm/plugins/general_logging.py +1 -1
- not1mm/plugins/iaru_hf.py +1 -1
- not1mm/plugins/jidx_cw.py +1 -1
- not1mm/plugins/jidx_ph.py +1 -1
- not1mm/plugins/naqp_cw.py +1 -1
- not1mm/plugins/naqp_ssb.py +1 -1
- not1mm/plugins/phone_weekly_test.py +1 -1
- not1mm/plugins/stew_perry_topband.py +1 -1
- not1mm/plugins/winter_field_day.py +1 -1
- not1mm/vfo.py +55 -25
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/METADATA +9 -8
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/RECORD +56 -56
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/LICENSE +0 -0
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/WHEEL +0 -0
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/entry_points.txt +0 -0
- {not1mm-24.4.1.2.dist-info → not1mm-24.4.2.1.dist-info}/top_level.txt +0 -0
not1mm/__main__.py
CHANGED
@@ -18,7 +18,6 @@ import platform
|
|
18
18
|
import re
|
19
19
|
import socket
|
20
20
|
|
21
|
-
# import subprocess
|
22
21
|
import sys
|
23
22
|
import threading
|
24
23
|
import uuid
|
@@ -31,10 +30,10 @@ import notctyparser
|
|
31
30
|
import psutil
|
32
31
|
import sounddevice as sd
|
33
32
|
import soundfile as sf
|
34
|
-
from
|
35
|
-
from
|
36
|
-
from
|
37
|
-
from
|
33
|
+
from PyQt6 import QtCore, QtGui, QtWidgets, uic
|
34
|
+
from PyQt6.QtCore import QDir, Qt
|
35
|
+
from PyQt6.QtGui import QFontDatabase, QColorConstants
|
36
|
+
from PyQt6.QtWidgets import QFileDialog
|
38
37
|
|
39
38
|
from not1mm.lib.about import About
|
40
39
|
from not1mm.lib.cat_interface import CAT
|
@@ -177,7 +176,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
177
176
|
cw_entry_visible = False
|
178
177
|
last_focus = None
|
179
178
|
oldtext = ""
|
180
|
-
text_color =
|
179
|
+
text_color = QColorConstants.Black
|
181
180
|
current_palette = None
|
182
181
|
|
183
182
|
log_window = None
|
@@ -188,10 +187,12 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
188
187
|
def __init__(self, *args, **kwargs):
|
189
188
|
super().__init__(*args, **kwargs)
|
190
189
|
logger.info("MainWindow: __init__")
|
191
|
-
self.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea)
|
192
|
-
self.setCorner(
|
193
|
-
|
194
|
-
|
190
|
+
self.setCorner(Qt.Corner.TopRightCorner, Qt.DockWidgetArea.RightDockWidgetArea)
|
191
|
+
self.setCorner(
|
192
|
+
Qt.Corner.BottomRightCorner, Qt.DockWidgetArea.RightDockWidgetArea
|
193
|
+
)
|
194
|
+
self.setCorner(Qt.Corner.TopLeftCorner, Qt.DockWidgetArea.LeftDockWidgetArea)
|
195
|
+
self.setCorner(Qt.Corner.BottomLeftCorner, Qt.DockWidgetArea.LeftDockWidgetArea)
|
195
196
|
data_path = fsutils.APP_DATA_PATH / "main.ui"
|
196
197
|
uic.loadUi(data_path, self)
|
197
198
|
self.cw_entry.hide()
|
@@ -264,40 +265,40 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
264
265
|
self.radio_green = QtGui.QPixmap(str(icon_path / "radio_green.png"))
|
265
266
|
self.radio_icon.setPixmap(self.radio_grey)
|
266
267
|
|
267
|
-
self.F1.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
268
|
+
self.F1.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
268
269
|
self.F1.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F1))
|
269
270
|
self.F1.clicked.connect(lambda x: self.process_function_key(self.F1))
|
270
|
-
self.F2.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
271
|
+
self.F2.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
271
272
|
self.F2.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F2))
|
272
273
|
self.F2.clicked.connect(lambda x: self.process_function_key(self.F2))
|
273
|
-
self.F3.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
274
|
+
self.F3.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
274
275
|
self.F3.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F3))
|
275
276
|
self.F3.clicked.connect(lambda x: self.process_function_key(self.F3))
|
276
|
-
self.F4.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
277
|
+
self.F4.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
277
278
|
self.F4.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F4))
|
278
279
|
self.F4.clicked.connect(lambda x: self.process_function_key(self.F4))
|
279
|
-
self.F5.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
280
|
+
self.F5.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
280
281
|
self.F5.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F5))
|
281
282
|
self.F5.clicked.connect(lambda x: self.process_function_key(self.F5))
|
282
|
-
self.F6.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
283
|
+
self.F6.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
283
284
|
self.F6.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F6))
|
284
285
|
self.F6.clicked.connect(lambda x: self.process_function_key(self.F6))
|
285
|
-
self.F7.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
286
|
+
self.F7.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
286
287
|
self.F7.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F7))
|
287
288
|
self.F7.clicked.connect(lambda x: self.process_function_key(self.F7))
|
288
|
-
self.F8.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
289
|
+
self.F8.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
289
290
|
self.F8.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F8))
|
290
291
|
self.F8.clicked.connect(lambda x: self.process_function_key(self.F8))
|
291
|
-
self.F9.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
292
|
+
self.F9.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
292
293
|
self.F9.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F9))
|
293
294
|
self.F9.clicked.connect(lambda x: self.process_function_key(self.F9))
|
294
|
-
self.F10.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
295
|
+
self.F10.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
295
296
|
self.F10.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F10))
|
296
297
|
self.F10.clicked.connect(lambda x: self.process_function_key(self.F10))
|
297
|
-
self.F11.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
298
|
+
self.F11.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
298
299
|
self.F11.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F11))
|
299
300
|
self.F11.clicked.connect(lambda x: self.process_function_key(self.F11))
|
300
|
-
self.F12.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
301
|
+
self.F12.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
301
302
|
self.F12.customContextMenuRequested.connect(lambda x: self.edit_macro(self.F12))
|
302
303
|
self.F12.clicked.connect(lambda x: self.process_function_key(self.F12))
|
303
304
|
|
@@ -505,25 +506,45 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
505
506
|
darkPalette = QtGui.QPalette()
|
506
507
|
darkColor = QtGui.QColor(56, 56, 56)
|
507
508
|
disabledColor = QtGui.QColor(127, 127, 127)
|
508
|
-
darkPalette.setColor(QtGui.QPalette.Window, darkColor)
|
509
|
-
darkPalette.setColor(
|
510
|
-
|
511
|
-
|
512
|
-
darkPalette.setColor(
|
509
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Window, darkColor)
|
510
|
+
darkPalette.setColor(
|
511
|
+
QtGui.QPalette.ColorRole.WindowText, QColorConstants.White
|
512
|
+
)
|
513
|
+
darkPalette.setColor(
|
514
|
+
QtGui.QPalette.ColorRole.Base, QtGui.QColor(45, 45, 45)
|
515
|
+
)
|
516
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.AlternateBase, darkColor)
|
517
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Text, QColorConstants.White)
|
518
|
+
darkPalette.setColor(
|
519
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
520
|
+
QtGui.QPalette.ColorRole.Text,
|
521
|
+
disabledColor,
|
522
|
+
)
|
523
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Button, darkColor)
|
524
|
+
darkPalette.setColor(
|
525
|
+
QtGui.QPalette.ColorRole.ButtonText, QColorConstants.White
|
526
|
+
)
|
513
527
|
darkPalette.setColor(
|
514
|
-
QtGui.QPalette.Disabled,
|
528
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
529
|
+
QtGui.QPalette.ColorRole.ButtonText,
|
530
|
+
disabledColor,
|
515
531
|
)
|
516
|
-
darkPalette.setColor(QtGui.QPalette.Button, darkColor)
|
517
|
-
darkPalette.setColor(QtGui.QPalette.ButtonText, Qt.white)
|
518
532
|
darkPalette.setColor(
|
519
|
-
QtGui.QPalette.
|
533
|
+
QtGui.QPalette.ColorRole.BrightText, QColorConstants.Red
|
520
534
|
)
|
521
|
-
darkPalette.setColor(QtGui.QPalette.BrightText, Qt.red)
|
522
|
-
darkPalette.setColor(QtGui.QPalette.Link, QtGui.QColor(42, 130, 218))
|
523
|
-
darkPalette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(42, 130, 218))
|
524
|
-
darkPalette.setColor(QtGui.QPalette.HighlightedText, Qt.black)
|
525
535
|
darkPalette.setColor(
|
526
|
-
QtGui.QPalette.
|
536
|
+
QtGui.QPalette.ColorRole.Link, QtGui.QColor(42, 130, 218)
|
537
|
+
)
|
538
|
+
darkPalette.setColor(
|
539
|
+
QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(42, 130, 218)
|
540
|
+
)
|
541
|
+
darkPalette.setColor(
|
542
|
+
QtGui.QPalette.ColorRole.HighlightedText, QColorConstants.Black
|
543
|
+
)
|
544
|
+
darkPalette.setColor(
|
545
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
546
|
+
QtGui.QPalette.ColorRole.HighlightedText,
|
547
|
+
disabledColor,
|
527
548
|
)
|
528
549
|
dark_button_style = (
|
529
550
|
"QPushButton {"
|
@@ -542,7 +563,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
542
563
|
)
|
543
564
|
self.current_palette = darkPalette
|
544
565
|
self.setPalette(darkPalette)
|
545
|
-
self.text_color =
|
566
|
+
self.text_color = QColorConstants.White
|
546
567
|
self.menuFile.setPalette(darkPalette)
|
547
568
|
self.menuHelp.setPalette(darkPalette)
|
548
569
|
self.menuOther.setPalette(darkPalette)
|
@@ -581,7 +602,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
581
602
|
self.other_1.setPalette(palette)
|
582
603
|
self.other_2.setPalette(palette)
|
583
604
|
self.cw_entry.setPalette(palette)
|
584
|
-
self.text_color =
|
605
|
+
self.text_color = QColorConstants.Black
|
585
606
|
light_button_style = (
|
586
607
|
"QPushButton {"
|
587
608
|
"background-color: rgb(245,245,245);"
|
@@ -750,11 +771,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
750
771
|
message_box = QtWidgets.QMessageBox()
|
751
772
|
if self.current_palette:
|
752
773
|
message_box.setPalette(self.current_palette)
|
753
|
-
message_box.setIcon(QtWidgets.QMessageBox.Information)
|
774
|
+
message_box.setIcon(QtWidgets.QMessageBox.Icon.Information)
|
754
775
|
message_box.setText(message)
|
755
776
|
message_box.setWindowTitle("Information")
|
756
|
-
message_box.setStandardButtons(QtWidgets.QMessageBox.Ok)
|
757
|
-
_ = message_box.
|
777
|
+
message_box.setStandardButtons(QtWidgets.QMessageBox.StandardButton.Ok)
|
778
|
+
_ = message_box.exec()
|
758
779
|
|
759
780
|
def show_about_dialog(self) -> None:
|
760
781
|
"""
|
@@ -1339,9 +1360,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1339
1360
|
str: filename
|
1340
1361
|
"""
|
1341
1362
|
|
1342
|
-
options =
|
1343
|
-
|
1344
|
-
|
1363
|
+
options = (
|
1364
|
+
QFileDialog.Option.DontUseNativeDialog
|
1365
|
+
| QFileDialog.Option.DontConfirmOverwrite
|
1366
|
+
)
|
1345
1367
|
if action == "new":
|
1346
1368
|
file, _ = QFileDialog.getSaveFileName(
|
1347
1369
|
self,
|
@@ -1367,30 +1389,34 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1367
1389
|
|
1368
1390
|
def launch_log_window(self) -> None:
|
1369
1391
|
"""Launch the log window"""
|
1370
|
-
if
|
1371
|
-
self.log_window
|
1372
|
-
|
1392
|
+
if self.log_window:
|
1393
|
+
self.log_window.close()
|
1394
|
+
self.log_window = LogWindow()
|
1395
|
+
self.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.log_window)
|
1373
1396
|
self.log_window.show()
|
1374
1397
|
|
1375
1398
|
def launch_bandmap_window(self) -> None:
|
1376
1399
|
"""Launch the bandmap window"""
|
1377
|
-
if
|
1378
|
-
self.bandmap_window
|
1379
|
-
|
1400
|
+
if self.bandmap_window:
|
1401
|
+
self.bandmap_window.close()
|
1402
|
+
self.bandmap_window = BandMapWindow()
|
1403
|
+
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.bandmap_window)
|
1380
1404
|
self.bandmap_window.show()
|
1381
1405
|
|
1382
1406
|
def launch_check_window(self) -> None:
|
1383
1407
|
"""Launch the check window"""
|
1384
|
-
if
|
1385
|
-
self.check_window
|
1386
|
-
|
1408
|
+
if self.check_window:
|
1409
|
+
self.check_window.close()
|
1410
|
+
self.check_window = CheckWindow()
|
1411
|
+
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.check_window)
|
1387
1412
|
self.check_window.show()
|
1388
1413
|
|
1389
1414
|
def launch_vfo(self) -> None:
|
1390
1415
|
"""Launch the VFO window"""
|
1391
|
-
if
|
1392
|
-
self.vfo_window
|
1393
|
-
|
1416
|
+
if self.vfo_window:
|
1417
|
+
self.vfo_window.close()
|
1418
|
+
self.vfo_window = VfoWindow()
|
1419
|
+
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.vfo_window)
|
1394
1420
|
self.vfo_window.show()
|
1395
1421
|
|
1396
1422
|
def clear_band_indicators(self) -> None:
|
@@ -1407,8 +1433,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1407
1433
|
"""
|
1408
1434
|
for _, indicators in self.all_mode_indicators.items():
|
1409
1435
|
for _, indicator in indicators.items():
|
1410
|
-
indicator.setFrameShape(QtWidgets.QFrame.NoFrame)
|
1411
|
-
if self.text_color ==
|
1436
|
+
indicator.setFrameShape(QtWidgets.QFrame.Shape.NoFrame)
|
1437
|
+
if self.text_color == QColorConstants.Black:
|
1412
1438
|
indicator.setStyleSheet(
|
1413
1439
|
"font-family: JetBrains Mono; color: black;"
|
1414
1440
|
)
|
@@ -1433,7 +1459,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1433
1459
|
self.clear_band_indicators()
|
1434
1460
|
indicator = self.all_mode_indicators[self.current_mode].get(band, None)
|
1435
1461
|
if indicator:
|
1436
|
-
indicator.setFrameShape(QtWidgets.QFrame.Box)
|
1462
|
+
indicator.setFrameShape(QtWidgets.QFrame.Shape.Box)
|
1437
1463
|
indicator.setStyleSheet("font-family: JetBrains Mono; color: green;")
|
1438
1464
|
|
1439
1465
|
def closeEvent(self, _event) -> None:
|
@@ -1522,7 +1548,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1522
1548
|
if event.key() == Qt.Key.Key_K:
|
1523
1549
|
self.toggle_cw_entry()
|
1524
1550
|
return
|
1525
|
-
if
|
1551
|
+
if (
|
1552
|
+
event.key() == Qt.Key.Key_S
|
1553
|
+
and modifier == Qt.KeyboardModifier.ControlModifier
|
1554
|
+
):
|
1526
1555
|
freq = self.radio_state.get("vfoa")
|
1527
1556
|
dx = self.callsign.text()
|
1528
1557
|
if freq and dx:
|
@@ -1533,7 +1562,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1533
1562
|
cmd["freq"] = float(int(freq) / 1000)
|
1534
1563
|
self.multicast_interface.send_as_json(cmd)
|
1535
1564
|
return
|
1536
|
-
if
|
1565
|
+
if (
|
1566
|
+
event.key() == Qt.Key.Key_M
|
1567
|
+
and modifier == Qt.KeyboardModifier.ControlModifier
|
1568
|
+
):
|
1537
1569
|
freq = self.radio_state.get("vfoa")
|
1538
1570
|
dx = self.callsign.text()
|
1539
1571
|
if freq and dx:
|
@@ -1544,7 +1576,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1544
1576
|
cmd["freq"] = float(int(freq) / 1000)
|
1545
1577
|
self.multicast_interface.send_as_json(cmd)
|
1546
1578
|
return
|
1547
|
-
if
|
1579
|
+
if (
|
1580
|
+
event.key() == Qt.Key.Key_G
|
1581
|
+
and modifier == Qt.KeyboardModifier.ControlModifier
|
1582
|
+
):
|
1548
1583
|
dx = self.callsign.text()
|
1549
1584
|
if dx:
|
1550
1585
|
cmd = {}
|
@@ -1554,11 +1589,15 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1554
1589
|
self.multicast_interface.send_as_json(cmd)
|
1555
1590
|
return
|
1556
1591
|
if (
|
1557
|
-
event.key() == Qt.Key.Key_Escape
|
1592
|
+
event.key() == Qt.Key.Key_Escape
|
1593
|
+
and modifier != Qt.KeyboardModifier.ControlModifier
|
1558
1594
|
): # pylint: disable=no-member
|
1559
1595
|
self.clearinputs()
|
1560
1596
|
return
|
1561
|
-
if
|
1597
|
+
if (
|
1598
|
+
event.key() == Qt.Key.Key_Escape
|
1599
|
+
and modifier == Qt.KeyboardModifier.ControlModifier
|
1600
|
+
):
|
1562
1601
|
if self.cw is not None:
|
1563
1602
|
if self.cw.servertype == 1:
|
1564
1603
|
self.cw.sendcw("\x1b4")
|
@@ -1575,7 +1614,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1575
1614
|
cmd["station"] = platform.node()
|
1576
1615
|
self.multicast_interface.send_as_json(cmd)
|
1577
1616
|
return
|
1578
|
-
if
|
1617
|
+
if (
|
1618
|
+
event.key() == Qt.Key.Key_PageUp
|
1619
|
+
and modifier != Qt.KeyboardModifier.ControlModifier
|
1620
|
+
):
|
1579
1621
|
if self.cw is not None:
|
1580
1622
|
self.cw.speed += 1
|
1581
1623
|
self.cw_speed.setValue(self.cw.speed)
|
@@ -1584,7 +1626,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1584
1626
|
if self.cw.servertype == 2:
|
1585
1627
|
self.cw.set_winkeyer_speed(self.cw_speed.value())
|
1586
1628
|
return
|
1587
|
-
if
|
1629
|
+
if (
|
1630
|
+
event.key() == Qt.Key.Key_PageDown
|
1631
|
+
and modifier != Qt.KeyboardModifier.ControlModifier
|
1632
|
+
):
|
1588
1633
|
if self.cw is not None:
|
1589
1634
|
self.cw.speed -= 1
|
1590
1635
|
self.cw_speed.setValue(self.cw.speed)
|
@@ -1596,7 +1641,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1596
1641
|
if event.key() == Qt.Key.Key_Tab or event.key() == Qt.Key.Key_Backtab:
|
1597
1642
|
if self.sent.hasFocus():
|
1598
1643
|
logger.debug("From sent")
|
1599
|
-
if modifier == Qt.ShiftModifier:
|
1644
|
+
if modifier == Qt.KeyboardModifier.ShiftModifier:
|
1600
1645
|
prev_tab = self.tab_prev.get(self.sent)
|
1601
1646
|
prev_tab.setFocus()
|
1602
1647
|
prev_tab.deselect()
|
@@ -1609,7 +1654,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1609
1654
|
return
|
1610
1655
|
if self.receive.hasFocus():
|
1611
1656
|
logger.debug("From receive")
|
1612
|
-
if modifier == Qt.ShiftModifier:
|
1657
|
+
if modifier == Qt.KeyboardModifier.ShiftModifier:
|
1613
1658
|
prev_tab = self.tab_prev.get(self.receive)
|
1614
1659
|
prev_tab.setFocus()
|
1615
1660
|
prev_tab.deselect()
|
@@ -1622,7 +1667,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1622
1667
|
return
|
1623
1668
|
if self.other_1.hasFocus():
|
1624
1669
|
logger.debug("From other_1")
|
1625
|
-
if modifier == Qt.ShiftModifier:
|
1670
|
+
if modifier == Qt.KeyboardModifier.ShiftModifier:
|
1626
1671
|
prev_tab = self.tab_prev.get(self.other_1)
|
1627
1672
|
prev_tab.setFocus()
|
1628
1673
|
prev_tab.deselect()
|
@@ -1635,7 +1680,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1635
1680
|
return
|
1636
1681
|
if self.other_2.hasFocus():
|
1637
1682
|
logger.debug("From other_2")
|
1638
|
-
if modifier == Qt.ShiftModifier:
|
1683
|
+
if modifier == Qt.KeyboardModifier.ShiftModifier:
|
1639
1684
|
prev_tab = self.tab_prev.get(self.other_2)
|
1640
1685
|
prev_tab.setFocus()
|
1641
1686
|
prev_tab.deselect()
|
@@ -1653,7 +1698,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1653
1698
|
self.dupe_indicator.show()
|
1654
1699
|
else:
|
1655
1700
|
self.dupe_indicator.hide()
|
1656
|
-
if modifier == Qt.ShiftModifier:
|
1701
|
+
if modifier == Qt.KeyboardModifier.ShiftModifier:
|
1657
1702
|
prev_tab = self.tab_prev.get(self.callsign)
|
1658
1703
|
prev_tab.setFocus()
|
1659
1704
|
prev_tab.deselect()
|
@@ -1672,29 +1717,29 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1672
1717
|
next_tab.deselect()
|
1673
1718
|
next_tab.end(False)
|
1674
1719
|
return
|
1675
|
-
if event.key() == Qt.Key_F1:
|
1720
|
+
if event.key() == Qt.Key.Key_F1:
|
1676
1721
|
self.process_function_key(self.F1)
|
1677
|
-
if event.key() == Qt.Key_F2:
|
1722
|
+
if event.key() == Qt.Key.Key_F2:
|
1678
1723
|
self.process_function_key(self.F2)
|
1679
|
-
if event.key() == Qt.Key_F3:
|
1724
|
+
if event.key() == Qt.Key.Key_F3:
|
1680
1725
|
self.process_function_key(self.F3)
|
1681
|
-
if event.key() == Qt.Key_F4:
|
1726
|
+
if event.key() == Qt.Key.Key_F4:
|
1682
1727
|
self.process_function_key(self.F4)
|
1683
|
-
if event.key() == Qt.Key_F5:
|
1728
|
+
if event.key() == Qt.Key.Key_F5:
|
1684
1729
|
self.process_function_key(self.F5)
|
1685
|
-
if event.key() == Qt.Key_F6:
|
1730
|
+
if event.key() == Qt.Key.Key_F6:
|
1686
1731
|
self.process_function_key(self.F6)
|
1687
|
-
if event.key() == Qt.Key_F7:
|
1732
|
+
if event.key() == Qt.Key.Key_F7:
|
1688
1733
|
self.process_function_key(self.F7)
|
1689
|
-
if event.key() == Qt.Key_F8:
|
1734
|
+
if event.key() == Qt.Key.Key_F8:
|
1690
1735
|
self.process_function_key(self.F8)
|
1691
|
-
if event.key() == Qt.Key_F9:
|
1736
|
+
if event.key() == Qt.Key.Key_F9:
|
1692
1737
|
self.process_function_key(self.F9)
|
1693
|
-
if event.key() == Qt.Key_F10:
|
1738
|
+
if event.key() == Qt.Key.Key_F10:
|
1694
1739
|
self.process_function_key(self.F10)
|
1695
|
-
if event.key() == Qt.Key_F11:
|
1740
|
+
if event.key() == Qt.Key.Key_F11:
|
1696
1741
|
self.process_function_key(self.F11)
|
1697
|
-
if event.key() == Qt.Key_F12:
|
1742
|
+
if event.key() == Qt.Key.Key_F12:
|
1698
1743
|
self.process_function_key(self.F12)
|
1699
1744
|
|
1700
1745
|
def set_window_title(self) -> None:
|
@@ -2905,12 +2950,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2905
2950
|
debug_response = f"{response}"
|
2906
2951
|
logger.debug("The Response: %s\n", debug_response)
|
2907
2952
|
if response:
|
2908
|
-
theirgrid = response.get("grid")
|
2953
|
+
theirgrid = response.get("grid", "")
|
2909
2954
|
self.contact["GridSquare"] = theirgrid
|
2910
|
-
_theircountry = response.get("country")
|
2955
|
+
_theircountry = response.get("country", "")
|
2911
2956
|
if self.station.get("GridSquare", ""):
|
2912
2957
|
heading = bearing(self.station.get("GridSquare", ""), theirgrid)
|
2913
|
-
kilometers = distance(
|
2958
|
+
kilometers = distance(
|
2959
|
+
self.station.get("GridSquare", ""), theirgrid
|
2960
|
+
)
|
2914
2961
|
self.heading_distance.setText(
|
2915
2962
|
f"{theirgrid} Hdg {heading}° LP {reciprocol(heading)}° / "
|
2916
2963
|
f"distance {int(kilometers*0.621371)}mi {kilometers}km"
|
@@ -3267,18 +3314,18 @@ def install_icons() -> None:
|
|
3267
3314
|
if sys.platform == "linux":
|
3268
3315
|
os.system(
|
3269
3316
|
"xdg-icon-resource install --size 32 --context apps --mode user "
|
3270
|
-
f"{fsutils.
|
3317
|
+
f"{fsutils.APP_DATA_PATH}/k6gte.not1mm-32.png k6gte-not1mm"
|
3271
3318
|
)
|
3272
3319
|
os.system(
|
3273
3320
|
"xdg-icon-resource install --size 64 --context apps --mode user "
|
3274
|
-
f"{fsutils.
|
3321
|
+
f"{fsutils.APP_DATA_PATH}/k6gte.not1mm-64.png k6gte-not1mm"
|
3275
3322
|
)
|
3276
3323
|
os.system(
|
3277
3324
|
"xdg-icon-resource install --size 128 --context apps --mode user "
|
3278
|
-
f"{fsutils.
|
3325
|
+
f"{fsutils.APP_DATA_PATH}/k6gte.not1mm-128.png k6gte-not1mm"
|
3279
3326
|
)
|
3280
3327
|
os.system(
|
3281
|
-
f"xdg-desktop-menu install {fsutils.
|
3328
|
+
f"xdg-desktop-menu install {fsutils.APP_DATA_PATH}/k6gte-not1mm.desktop"
|
3282
3329
|
)
|
3283
3330
|
|
3284
3331
|
|
not1mm/bandmap.py
CHANGED
@@ -16,8 +16,9 @@ from datetime import datetime, timezone
|
|
16
16
|
from decimal import Decimal
|
17
17
|
from json import loads
|
18
18
|
|
19
|
-
from
|
20
|
-
from
|
19
|
+
from PyQt6 import QtCore, QtGui, QtWidgets, uic, QtNetwork
|
20
|
+
from PyQt6.QtGui import QColorConstants
|
21
|
+
from PyQt6.QtWidgets import QDockWidget
|
21
22
|
|
22
23
|
import not1mm.fsutils as fsutils
|
23
24
|
from not1mm.lib.multicast import Multicast
|
@@ -301,7 +302,7 @@ class Database:
|
|
301
302
|
)
|
302
303
|
|
303
304
|
|
304
|
-
class BandMapWindow(
|
305
|
+
class BandMapWindow(QDockWidget):
|
305
306
|
"""The BandMapWindow class."""
|
306
307
|
|
307
308
|
zoom = 5
|
@@ -320,11 +321,17 @@ class BandMapWindow(QtWidgets.QDockWidget):
|
|
320
321
|
multicast_interface = None
|
321
322
|
text_color = QtGui.QColor(45, 45, 45)
|
322
323
|
|
323
|
-
def __init__(self
|
324
|
-
super().__init__(
|
324
|
+
def __init__(self):
|
325
|
+
super().__init__()
|
325
326
|
self._udpwatch = None
|
326
327
|
|
327
328
|
uic.loadUi(fsutils.APP_DATA_PATH / "bandmap.ui", self)
|
329
|
+
self.setFeatures(
|
330
|
+
QDockWidget.DockWidgetFeature.DockWidgetMovable
|
331
|
+
| QDockWidget.DockWidgetFeature.DockWidgetFloatable
|
332
|
+
| QDockWidget.DockWidgetFeature.DockWidgetClosable
|
333
|
+
)
|
334
|
+
self.setAllowedAreas(QtCore.Qt.DockWidgetArea.AllDockWidgetAreas)
|
328
335
|
self.settings = self.get_settings()
|
329
336
|
self.agetime = self.clear_spot_olderSpinBox.value()
|
330
337
|
self.clear_spot_olderSpinBox.valueChanged.connect(self.spot_aging_changed)
|
@@ -370,27 +377,47 @@ class BandMapWindow(QtWidgets.QDockWidget):
|
|
370
377
|
if setdarkmode:
|
371
378
|
darkPalette = QtGui.QPalette()
|
372
379
|
darkColor = QtGui.QColor(56, 56, 56)
|
373
|
-
self.text_color =
|
380
|
+
self.text_color = QColorConstants.White
|
374
381
|
disabledColor = QtGui.QColor(127, 127, 127)
|
375
|
-
darkPalette.setColor(QtGui.QPalette.Window, darkColor)
|
376
|
-
darkPalette.setColor(
|
377
|
-
|
378
|
-
|
379
|
-
darkPalette.setColor(
|
382
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Window, darkColor)
|
383
|
+
darkPalette.setColor(
|
384
|
+
QtGui.QPalette.ColorRole.WindowText, QColorConstants.White
|
385
|
+
)
|
386
|
+
darkPalette.setColor(
|
387
|
+
QtGui.QPalette.ColorRole.Base, QtGui.QColor(45, 45, 45)
|
388
|
+
)
|
389
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.AlternateBase, darkColor)
|
390
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Text, QColorConstants.White)
|
391
|
+
darkPalette.setColor(
|
392
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
393
|
+
QtGui.QPalette.ColorRole.Text,
|
394
|
+
disabledColor,
|
395
|
+
)
|
396
|
+
darkPalette.setColor(QtGui.QPalette.ColorRole.Button, darkColor)
|
397
|
+
darkPalette.setColor(
|
398
|
+
QtGui.QPalette.ColorRole.ButtonText, QColorConstants.White
|
399
|
+
)
|
400
|
+
darkPalette.setColor(
|
401
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
402
|
+
QtGui.QPalette.ColorRole.ButtonText,
|
403
|
+
disabledColor,
|
404
|
+
)
|
405
|
+
darkPalette.setColor(
|
406
|
+
QtGui.QPalette.ColorRole.BrightText, QColorConstants.Red
|
407
|
+
)
|
408
|
+
darkPalette.setColor(
|
409
|
+
QtGui.QPalette.ColorRole.Link, QtGui.QColor(42, 130, 218)
|
410
|
+
)
|
380
411
|
darkPalette.setColor(
|
381
|
-
QtGui.QPalette.
|
412
|
+
QtGui.QPalette.ColorRole.Highlight, QtGui.QColor(42, 130, 218)
|
382
413
|
)
|
383
|
-
darkPalette.setColor(QtGui.QPalette.Button, darkColor)
|
384
|
-
darkPalette.setColor(QtGui.QPalette.ButtonText, Qt.white)
|
385
414
|
darkPalette.setColor(
|
386
|
-
QtGui.QPalette.
|
415
|
+
QtGui.QPalette.ColorRole.HighlightedText, QColorConstants.Black
|
387
416
|
)
|
388
|
-
darkPalette.setColor(QtGui.QPalette.BrightText, Qt.red)
|
389
|
-
darkPalette.setColor(QtGui.QPalette.Link, QtGui.QColor(42, 130, 218))
|
390
|
-
darkPalette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(42, 130, 218))
|
391
|
-
darkPalette.setColor(QtGui.QPalette.HighlightedText, Qt.black)
|
392
417
|
darkPalette.setColor(
|
393
|
-
QtGui.QPalette.Disabled,
|
418
|
+
QtGui.QPalette.ColorGroup.Disabled,
|
419
|
+
QtGui.QPalette.ColorRole.HighlightedText,
|
420
|
+
disabledColor,
|
394
421
|
)
|
395
422
|
|
396
423
|
self.setPalette(darkPalette)
|
@@ -419,7 +446,7 @@ class BandMapWindow(QtWidgets.QDockWidget):
|
|
419
446
|
palette = self.style().standardPalette()
|
420
447
|
self.setPalette(palette)
|
421
448
|
self.callsignField.setPalette(palette)
|
422
|
-
self.text_color =
|
449
|
+
self.text_color = QColorConstants.Black
|
423
450
|
self.update()
|
424
451
|
light_button_style = (
|
425
452
|
"QPushButton {"
|
@@ -789,8 +816,8 @@ class BandMapWindow(QtWidgets.QDockWidget):
|
|
789
816
|
text.document().setDocumentMargin(0)
|
790
817
|
text.setPos(60, text_y - (text.boundingRect().height() / 2))
|
791
818
|
text.setFlags(
|
792
|
-
QtWidgets.QGraphicsItem.ItemIsFocusable
|
793
|
-
| QtWidgets.QGraphicsItem.ItemIsSelectable
|
819
|
+
QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable
|
820
|
+
| QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsSelectable
|
794
821
|
| text.flags()
|
795
822
|
)
|
796
823
|
text.setProperty("freq", items.get("freq"))
|