mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-10 18:43:28 -05:00
Merge pull request #2126 from dforsi/feature/highlight
Highlight the current workspace and device in their dialogs
This commit is contained in:
commit
bace0951bb
@ -299,7 +299,7 @@ void ChannelGUI::showHelp()
|
||||
void ChannelGUI::openMoveToWorkspaceDialog()
|
||||
{
|
||||
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this);
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
|
||||
dialog.exec();
|
||||
|
||||
if (dialog.hasChanged()) {
|
||||
|
@ -370,7 +370,7 @@ void DeviceGUI::showHelp()
|
||||
void DeviceGUI::openMoveToWorkspaceDialog()
|
||||
{
|
||||
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this);
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
|
||||
dialog.exec();
|
||||
|
||||
if (dialog.hasChanged()) {
|
||||
|
@ -250,7 +250,7 @@ void FeatureGUI::showHelp()
|
||||
void FeatureGUI::openMoveToWorkspaceDialog()
|
||||
{
|
||||
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this);
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
|
||||
dialog.exec();
|
||||
|
||||
if (dialog.hasChanged()) {
|
||||
|
@ -52,6 +52,7 @@ DeviceSetSelectionDialog::DeviceSetSelectionDialog(std::vector<DeviceUISet*>& 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "workspaceselectiondialog.h"
|
||||
#include "ui_workspaceselectiondialog.h"
|
||||
|
||||
WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, QWidget *parent) :
|
||||
WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, int workspaceIndex, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::WorkspaceSelectionDialog),
|
||||
m_numberOfWorkspaces(numberOfWorkspaces),
|
||||
@ -34,6 +34,7 @@ WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, QWidg
|
||||
for (int i = 0; i < m_numberOfWorkspaces; i++) {
|
||||
ui->workspaceList->addItem(tr("W:%1").arg(i));
|
||||
}
|
||||
ui->workspaceList->setCurrentRow(workspaceIndex);
|
||||
}
|
||||
|
||||
WorkspaceSelectionDialog::~WorkspaceSelectionDialog()
|
||||
|
@ -33,7 +33,7 @@ class SDRGUI_API WorkspaceSelectionDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WorkspaceSelectionDialog(int numberOfWorkspaces, QWidget *parent = nullptr);
|
||||
explicit WorkspaceSelectionDialog(int numberOfWorkspaces, int workspaceIndex, QWidget *parent = nullptr);
|
||||
~WorkspaceSelectionDialog();
|
||||
|
||||
bool hasChanged() const { return m_hasChanged; }
|
||||
|
@ -257,7 +257,7 @@ void MainSpectrumGUI::showHelp()
|
||||
void MainSpectrumGUI::openMoveToWorkspaceDialog()
|
||||
{
|
||||
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this);
|
||||
WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
|
||||
dialog.exec();
|
||||
|
||||
if (dialog.hasChanged()) {
|
||||
|
Loading…
Reference in New Issue
Block a user