Skip to content

Commit

Permalink
Merge pull request #206 from mbridak/wayland_allow_undockable_widgets
Browse files Browse the repository at this point in the history
@mbridak Allow undocking widgets while using Wayland if PyQt6 version…
  • Loading branch information
mbridak authored Oct 27, 2024
2 parents fe26f5a + 4915be2 commit c2902f4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 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-27-2] Allow BandMap, CheckWindow and LogWindow to undock from main window while using Wayland if PyQt6 version is at least 6.7.1
- [24-10-27-1] Fixed setting radios ssb mode when crossing 10M boundary.
- [24-10-27] Fix bug where a contacts info could be carried over to new contact if no new value was written.
- [24-10-26] Clear inputs when seeking to a call from the bandmap via the arrow up and down. Fixed bandmap crash from bad telnet data. Drop beacons from bandmap.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.

## Recent Changes (Polishing the Turd)

- [24-10-27-2] Allow BandMap, CheckWindow and LogWindow to undock from main window while using Wayland if PyQt6 version is at least 6.7.1
- [24-10-27-1] Fixed setting radios ssb mode when crossing 10M boundary.
- [24-10-27] Fix bug where a contacts info could be carried over to new contact if no new value was written.
- [24-10-26] Clear inputs when seeking to a call from the bandmap via the arrow up and down. Fixed bandmap crash from bad telnet data. Drop beacons from bandmap.
Expand Down
25 changes: 20 additions & 5 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from PyQt6.QtCore import QDir, Qt, QThread, QSettings, QCoreApplication
from PyQt6.QtGui import QFontDatabase, QColorConstants, QPalette, QColor, QPixmap
from PyQt6.QtWidgets import QFileDialog, QSplashScreen, QApplication
from PyQt6.QtCore import QT_VERSION_STR, PYQT_VERSION_STR

from not1mm.lib.about import About
from not1mm.lib.cwinterface import CW
Expand Down Expand Up @@ -589,7 +590,21 @@ def __init__(self, splash):
self.voice_process.current_op = self.current_op
self.make_op_dir()

# Featureset for wayland
logger.debug(f"{QT_VERSION_STR=} {PYQT_VERSION_STR=}")
x = PYQT_VERSION_STR.split(".")
old_Qt = True
# test if pyqt version is at least 6.7.1
if len(x) == 1:
if int(x[0]) > 6:
old_Qt = False
elif len(x) == 2:
if int(x[0]) >= 6 and int(x[1]) > 7:
old_Qt = False
elif len(x) == 3:
if int(x[0]) >= 6 and int(x[1]) >= 7 and int(x[2]) >= 1:
old_Qt = False

# Featureset for wayland if pyqt is older that 6.7.1
dockfeatures = (
QtWidgets.QDockWidget.DockWidgetFeature.DockWidgetClosable
| QtWidgets.QDockWidget.DockWidgetFeature.DockWidgetMovable
Expand All @@ -598,7 +613,7 @@ def __init__(self, splash):
self.show_splash_msg("Setting up BandMapWindow.")
self.bandmap_window = BandMapWindow()
self.bandmap_window.setObjectName("bandmap-window")
if os.environ.get("WAYLAND_DISPLAY"):
if os.environ.get("WAYLAND_DISPLAY") and old_Qt is True:
self.bandmap_window.setFeatures(dockfeatures)
self.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self.bandmap_window)
self.bandmap_window.hide()
Expand All @@ -609,7 +624,7 @@ def __init__(self, splash):
self.show_splash_msg("Setting up CheckWindow.")
self.check_window = CheckWindow()
self.check_window.setObjectName("check-window")
if os.environ.get("WAYLAND_DISPLAY"):
if os.environ.get("WAYLAND_DISPLAY") and old_Qt is True:
self.check_window.setFeatures(dockfeatures)
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.check_window)
self.check_window.hide()
Expand All @@ -618,15 +633,15 @@ def __init__(self, splash):
self.show_splash_msg("Setting up VFOWindow.")
self.vfo_window = VfoWindow()
self.vfo_window.setObjectName("vfo-window")
if os.environ.get("WAYLAND_DISPLAY"):
if os.environ.get("WAYLAND_DISPLAY") and old_Qt is True:
self.vfo_window.setFeatures(dockfeatures)
self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.vfo_window)
self.vfo_window.hide()

self.show_splash_msg("Setting up LogWindow.")
self.log_window = LogWindow()
self.log_window.setObjectName("log-window")
if os.environ.get("WAYLAND_DISPLAY"):
if os.environ.get("WAYLAND_DISPLAY") and old_Qt is True:
self.log_window.setFeatures(dockfeatures)
self.addDockWidget(Qt.DockWidgetArea.TopDockWidgetArea, self.log_window)
self.log_window.hide()
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.27.1"
__version__ = "24.10.27.2"
2 changes: 1 addition & 1 deletion 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.27.1"
version = "24.10.27.2"
description = "NOT1MM Logger"
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit c2902f4

Please sign in to comment.