Disable HRTF remove button when no files selected
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -30,6 +30,8 @@ private slots:
|
||||
void addHrtfFile();
|
||||
void removeHrtfFile();
|
||||
|
||||
void updateHrtfRemoveButton();
|
||||
|
||||
void showEnabledBackendMenu(QPoint pt);
|
||||
void showDisabledBackendMenu(QPoint pt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user