diff options
-rw-r--r-- | utils/alsoft-config/mainwindow.cpp | 7 | ||||
-rw-r--r-- | utils/alsoft-config/mainwindow.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index f2db5c54..0047233f 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -96,6 +96,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->hrtfAddButton, SIGNAL(clicked()), this, SLOT(addHrtfFile())); connect(ui->hrtfRemoveButton, SIGNAL(clicked()), this, SLOT(removeHrtfFile())); + connect(ui->hrtfFileList, SIGNAL(itemSelectionChanged()), this, SLOT(updateHrtfRemoveButton())); ui->enabledBackendList->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->enabledBackendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showEnabledBackendMenu(QPoint))); @@ -238,6 +239,7 @@ void MainWindow::loadConfig(const QString &fname) hrtf_tables.begin(), std::mem_fun_ref(&QString::trimmed)); ui->hrtfFileList->clear(); ui->hrtfFileList->addItems(hrtf_tables); + updateHrtfRemoveButton(); ui->enabledBackendList->clear(); ui->disabledBackendList->clear(); @@ -495,6 +497,11 @@ void MainWindow::removeHrtfFile() delete item; } +void MainWindow::updateHrtfRemoveButton() +{ + ui->hrtfRemoveButton->setEnabled(ui->hrtfFileList->selectedItems().size() != 0); +} + void MainWindow::showEnabledBackendMenu(QPoint pt) { QMap<QAction*,QString> actionMap; diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h index 28e109a2..0421aabb 100644 --- a/utils/alsoft-config/mainwindow.h +++ b/utils/alsoft-config/mainwindow.h @@ -30,6 +30,8 @@ private slots: void addHrtfFile(); void removeHrtfFile(); + void updateHrtfRemoveButton(); + void showEnabledBackendMenu(QPoint pt); void showDisabledBackendMenu(QPoint pt); |