From 8a6cf3374eabb386d59df572c9b15eee63987a15 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 14 May 2016 03:36:28 +0200 Subject: [PATCH] Multi device support: changing input view tab changes all other tabs accordingly --- sdrbase/mainwindow.cpp | 14 +++++++++++++- sdrbase/mainwindow.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 4c859fd54..c2dd40f23 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -98,7 +98,7 @@ MainWindow::MainWindow(QWidget* parent) : ui->menu_Window->addAction(ui->channelDock->toggleViewAction()); //ui->tabInputsVoew->setStyleSheet("background-color: rgb(46,46,46)"); - ui->tabInputsView->setStyleSheet("QWidget { background: rgb(46,46,46); } "); + ui->tabInputsView->setStyleSheet("QWidget { background: rgb(46,46,46); }"); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection); @@ -162,6 +162,8 @@ MainWindow::MainWindow(QWidget* parent) : updatePresetControls(); qDebug() << "MainWindow::MainWindow: end"; + + connect(ui->tabInputsView, SIGNAL(currentChanged(int)), this, SLOT(tabInputViewIndexChanged())); } MainWindow::~MainWindow() @@ -734,6 +736,16 @@ void MainWindow::on_action_removeDevice_triggered() } } +void MainWindow::tabInputViewIndexChanged() +{ + int inputViewIndex = ui->tabInputsView->currentIndex(); + + ui->tabSpectra->setCurrentIndex(inputViewIndex); + ui->tabChannels->setCurrentIndex(inputViewIndex); + ui->tabInputsSelect->setCurrentIndex(inputViewIndex); + ui->tabSpectraGUI->setCurrentIndex(inputViewIndex); +} + void MainWindow::updateStatus() { m_dateTimeWidget->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss t")); diff --git a/sdrbase/mainwindow.h b/sdrbase/mainwindow.h index 36878c80a..083e62be8 100644 --- a/sdrbase/mainwindow.h +++ b/sdrbase/mainwindow.h @@ -149,6 +149,7 @@ private slots: void on_action_About_triggered(); void on_action_addDevice_triggered(); void on_action_removeDevice_triggered(); + void tabInputViewIndexChanged(); }; #endif // INCLUDE_MAINWINDOW_H