Hide or show the waterfall+audio_widget based on the current main tab

This commit is contained in:
alessandro90
2019-06-25 18:46:06 +02:00
parent 497cdeed4a
commit 52ac5e7752
2 changed files with 22 additions and 1 deletions

View File

@@ -32,7 +32,8 @@ from constants import (Constants,
Database,
ChecksumWhat,
Messages,
Signal,)
Signal,
MainTabs,)
from themesmanager import ThemeManager
from utilities import (checksum_ok,
uncheck_and_emit,
@@ -531,14 +532,24 @@ class Artemis(QMainWindow, Ui_MainWindow):
self.update_forecast_bar.set_idle()
self.forecast_data.update_complete.connect(self.update_forecast)
self.main_tab.currentChanged.connect(self.hide_show_right_widget)
# Final operations.
self.theme_manager.start()
self.load_db()
self.display_signals()
@pyqtSlot()
def hide_show_right_widget(self):
"""Hide or show the waterfall+audio widget based on the current tab."""
if self.main_tab.currentIndex() == MainTabs.FORECAST:
self.fixed_audio_and_image.setVisible(False)
elif not self.fixed_audio_and_image.isVisible():
self.fixed_audio_and_image.setVisible(True)
@pyqtSlot()
def set_visible_tab(self):
"""Set the current main tab when double-clicking a signal name."""
if self.main_tab.currentWidget() != self.signal_properties_tab:
self.main_tab.setCurrentWidget(self.signal_properties_tab)
else: