diff --git a/sdrgui/gui/devicesetselectiondialog.cpp b/sdrgui/gui/devicesetselectiondialog.cpp index 0455216c7..769621f19 100644 --- a/sdrgui/gui/devicesetselectiondialog.cpp +++ b/sdrgui/gui/devicesetselectiondialog.cpp @@ -52,6 +52,7 @@ DeviceSetSelectionDialog::DeviceSetSelectionDialog(std::vector& de m_deviceSetIndexes.push_back(i); } } + selectIndex(channelDeviceSetIndex); } DeviceSetSelectionDialog::~DeviceSetSelectionDialog() @@ -65,3 +66,14 @@ void DeviceSetSelectionDialog::accept() m_hasChanged = true; QDialog::accept(); } + +void DeviceSetSelectionDialog::selectIndex(int channelDeviceSetIndex) +{ + for (int i = 0; i < (int) m_deviceSetIndexes.size(); i++) + { + if (channelDeviceSetIndex == m_deviceSetIndexes[i]) { + ui->workspaceList->setCurrentRow(i); + break; + } + } +} diff --git a/sdrgui/gui/devicesetselectiondialog.h b/sdrgui/gui/devicesetselectiondialog.h index 7260bbda3..5ca86d68d 100644 --- a/sdrgui/gui/devicesetselectiondialog.h +++ b/sdrgui/gui/devicesetselectiondialog.h @@ -40,6 +40,7 @@ public: bool hasChanged() const { return m_hasChanged; } int getSelectedIndex() const { return m_selectedDeviceSetIndex; } + void selectIndex(int channelDeviceSetIndex); private: Ui::WorkspaceSelectionDialog *ui;