Add a toggle all checkbox on supported devices page
This commit is contained in:
parent
065bbd249c
commit
5b35e64fbe
5 changed files with 23 additions and 0 deletions
|
|
@ -145,3 +145,11 @@ void DetectorTableModel::applySettings()
|
||||||
ResourceManager::get()->GetSettingsManager()->SetSettings("Detectors", settings);
|
ResourceManager::get()->GetSettingsManager()->SetSettings("Detectors", settings);
|
||||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DetectorTableModel::toggleAll(const bool state)
|
||||||
|
{
|
||||||
|
for(unsigned int detector_idx = 0; detector_idx < detectors.size(); detector_idx++)
|
||||||
|
{
|
||||||
|
setData(index(detector_idx,1), state, Qt::CheckStateRole);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void applySettings();
|
void applySettings();
|
||||||
|
void toggleAll(const bool state);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DETECTORTABLEMODEL_H
|
#endif // DETECTORTABLEMODEL_H
|
||||||
|
|
|
||||||
|
|
@ -47,3 +47,8 @@ void OpenRGBSupportedDevicesPage::on_Filter_textChanged(const QString &arg1)
|
||||||
{
|
{
|
||||||
detectorSortModel->setFilterRegExp(QRegExp(arg1, Qt::CaseInsensitive));
|
detectorSortModel->setFilterRegExp(QRegExp(arg1, Qt::CaseInsensitive));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenRGBSupportedDevicesPage::on_ToggleAllCheckbox_toggled(const bool checked)
|
||||||
|
{
|
||||||
|
detectorTableModel->toggleAll(checked);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ private slots:
|
||||||
|
|
||||||
void on_Filter_textChanged(const QString &arg1);
|
void on_Filter_textChanged(const QString &arg1);
|
||||||
|
|
||||||
|
void on_ToggleAllCheckbox_toggled(const bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::OpenRGBSupportedDevicesPageUi *ui;
|
Ui::OpenRGBSupportedDevicesPageUi *ui;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="Filter"/>
|
<widget class="QLineEdit" name="Filter"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="ToggleAllCheckbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable/Disable all</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue