mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-11-29 03:48:17 -05:00
Disable delete button when no entry is selected
This commit is contained in:
1 parent
e1b47cc36d
commit
200487198a
2 files changed
+12
No files matched your search
@@ -40,6 +40,7 @@ ManualDevicesSettingsPage::ManualDevicesSettingsPage(QWidget *parent) :
|
||||
ResourceManager::get()->RegisterDetectionEndCallback(&ManualDevicesPageReloadCallback, this);
|
||||
|
||||
reloadList();
|
||||
on_deviceList_itemSelectionChanged(); // Refresh button state
|
||||
}
|
||||
|
||||
ManualDevicesSettingsPage::~ManualDevicesSettingsPage()
|
||||
@@ -192,3 +193,12 @@ void ManualDevicesSettingsPage::addEntries(const std::string& settingsName, Entr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::on_deviceList_itemSelectionChanged()
|
||||
{
|
||||
int cur_row = ui->deviceList->currentRow();
|
||||
|
||||
bool anySelected = (cur_row >= 0);
|
||||
ui->removeDeviceButton->setEnabled(anySelected);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ private slots:
|
||||
void on_removeDeviceButton_clicked();
|
||||
void on_saveConfigurationButton_clicked();
|
||||
|
||||
void on_deviceList_itemSelectionChanged();
|
||||
|
||||
private:
|
||||
Ui::ManualDevicesSettingsPage* ui;
|
||||
std::vector<BaseManualDeviceEntry*> entries;
|
||||
|
||||
Reference in new issue
Block a user