Skip to content

Commit

Permalink
@mbridak Add Rate Window menu item.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Jan 13, 2025
1 parent 89764f6 commit 0c8a9da
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
32 changes: 32 additions & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
from not1mm.checkwindow import CheckWindow
from not1mm.bandmap import BandMapWindow
from not1mm.vfo import VfoWindow
from not1mm.ratewindow import RateWindow
from not1mm.radio import Radio
from not1mm.voice_keying import Voice
from not1mm.lookupservice import LookupService
Expand Down Expand Up @@ -136,6 +137,7 @@ class MainWindow(QtWidgets.QMainWindow):
"bandmapwindow": False,
"checkwindow": False,
"vfowindow": False,
"ratewindow": False,
"darkmode": True,
}
appstarted = False
Expand Down Expand Up @@ -236,6 +238,7 @@ def __init__(self, splash):
self.actionLog_Window.triggered.connect(self.launch_log_window)
self.actionBandmap.triggered.connect(self.launch_bandmap_window)
self.actionCheck_Window.triggered.connect(self.launch_check_window)
self.actionRate_Window.triggered.connect(self.launch_rate_window)
self.actionVFO.triggered.connect(self.launch_vfo)
self.actionRecalculate_Mults.triggered.connect(self.recalculate_mults)
self.actionLoad_Call_History_File.triggered.connect(self.load_call_history)
Expand Down Expand Up @@ -642,6 +645,15 @@ def __init__(self, splash):
self.check_window.hide()
self.check_window.message.connect(self.dockwidget_message)

self.show_splash_msg("Setting up RateWindow.")
self.rate_window = RateWindow()
self.rate_window.setObjectName("rate-window")
if os.environ.get("WAYLAND_DISPLAY") and old_Qt is True:
self.rate_window.setFeatures(dockfeatures)
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.rate_window)
self.rate_window.hide()
self.rate_window.message.connect(self.dockwidget_message)

self.show_splash_msg("Setting up VFOWindow.")
self.vfo_window = VfoWindow()
self.vfo_window.setObjectName("vfo-window")
Expand Down Expand Up @@ -692,6 +704,15 @@ def __init__(self, splash):
self.check_window.hide()
self.check_window.setActive(False)

self.actionRate_Window.setChecked(self.pref.get("ratewindow", False))
if self.actionRate_Window.isChecked():
print(f"===============ratewindow=============")
self.rate_window.show()
self.rate_window.setActive(True)
else:
self.rate_window.hide()
self.rate_window.setActive(False)

self.actionVFO.setChecked(self.pref.get("vfowindow", False))
if self.actionVFO.isChecked():
self.vfo_window.show()
Expand Down Expand Up @@ -1841,6 +1862,17 @@ def launch_check_window(self) -> None:
self.check_window.hide()
self.check_window.setActive(False)

def launch_rate_window(self) -> None:
"""Launch the check window"""
self.pref["ratewindow"] = self.actionRate_Window.isChecked()
self.write_preference()
if self.actionRate_Window.isChecked():
self.rate_window.show()
self.rate_window.setActive(True)
else:
self.rate_window.hide()
self.rate_window.setActive(False)

def launch_vfo(self) -> None:
"""Launch the VFO window"""
self.pref["vfowindow"] = self.actionVFO.isChecked()
Expand Down
14 changes: 14 additions & 0 deletions not1mm/data/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@
<addaction name="actionLog_Window"/>
<addaction name="actionBandmap"/>
<addaction name="actionCheck_Window"/>
<addaction name="actionRate_Window"/>
<addaction name="actionVFO"/>
</widget>
<widget class="QMenu" name="menuOther">
Expand Down Expand Up @@ -1961,6 +1962,19 @@
</font>
</property>
</action>
<action name="actionRate_Window">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Rate Window</string>
</property>
<property name="font">
<font>
<family>JetBrains Mono ExtraLight</family>
</font>
</property>
</action>
<action name="actionVFO">
<property name="checkable">
<bool>true</bool>
Expand Down

0 comments on commit 0c8a9da

Please sign in to comment.