1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Highlight the current workspace

This commit is contained in:
Daniele Forsi 2024-05-26 12:03:33 +02:00
parent c7c0247f81
commit af712de404
6 changed files with 7 additions and 6 deletions

View File

@ -299,7 +299,7 @@ void ChannelGUI::showHelp()
void ChannelGUI::openMoveToWorkspaceDialog() void ChannelGUI::openMoveToWorkspaceDialog()
{ {
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces(); int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this); WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
dialog.exec(); dialog.exec();
if (dialog.hasChanged()) { if (dialog.hasChanged()) {

View File

@ -370,7 +370,7 @@ void DeviceGUI::showHelp()
void DeviceGUI::openMoveToWorkspaceDialog() void DeviceGUI::openMoveToWorkspaceDialog()
{ {
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces(); int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this); WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
dialog.exec(); dialog.exec();
if (dialog.hasChanged()) { if (dialog.hasChanged()) {

View File

@ -250,7 +250,7 @@ void FeatureGUI::showHelp()
void FeatureGUI::openMoveToWorkspaceDialog() void FeatureGUI::openMoveToWorkspaceDialog()
{ {
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces(); int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this); WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
dialog.exec(); dialog.exec();
if (dialog.hasChanged()) { if (dialog.hasChanged()) {

View File

@ -23,7 +23,7 @@
#include "workspaceselectiondialog.h" #include "workspaceselectiondialog.h"
#include "ui_workspaceselectiondialog.h" #include "ui_workspaceselectiondialog.h"
WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, QWidget *parent) : WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, int workspaceIndex, QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::WorkspaceSelectionDialog), ui(new Ui::WorkspaceSelectionDialog),
m_numberOfWorkspaces(numberOfWorkspaces), m_numberOfWorkspaces(numberOfWorkspaces),
@ -34,6 +34,7 @@ WorkspaceSelectionDialog::WorkspaceSelectionDialog(int numberOfWorkspaces, QWidg
for (int i = 0; i < m_numberOfWorkspaces; i++) { for (int i = 0; i < m_numberOfWorkspaces; i++) {
ui->workspaceList->addItem(tr("W:%1").arg(i)); ui->workspaceList->addItem(tr("W:%1").arg(i));
} }
ui->workspaceList->setCurrentRow(workspaceIndex);
} }
WorkspaceSelectionDialog::~WorkspaceSelectionDialog() WorkspaceSelectionDialog::~WorkspaceSelectionDialog()

View File

@ -33,7 +33,7 @@ class SDRGUI_API WorkspaceSelectionDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit WorkspaceSelectionDialog(int numberOfWorkspaces, QWidget *parent = nullptr); explicit WorkspaceSelectionDialog(int numberOfWorkspaces, int workspaceIndex, QWidget *parent = nullptr);
~WorkspaceSelectionDialog(); ~WorkspaceSelectionDialog();
bool hasChanged() const { return m_hasChanged; } bool hasChanged() const { return m_hasChanged; }

View File

@ -257,7 +257,7 @@ void MainSpectrumGUI::showHelp()
void MainSpectrumGUI::openMoveToWorkspaceDialog() void MainSpectrumGUI::openMoveToWorkspaceDialog()
{ {
int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces(); int numberOfWorkspaces = MainWindow::getInstance()->getNumberOfWorkspaces();
WorkspaceSelectionDialog dialog(numberOfWorkspaces, this); WorkspaceSelectionDialog dialog(numberOfWorkspaces, getWorkspaceIndex(), this);
dialog.exec(); dialog.exec();
if (dialog.hasChanged()) { if (dialog.hasChanged()) {