Add button to open settings folder

This commit is contained in:
morg
2021-05-05 20:32:26 +02:00
committed by Adam Honse
parent 30f88d5fcf
commit 0fbe96f8ec
3 changed files with 28 additions and 5 deletions

View File

@@ -1,5 +1,8 @@
#include "OpenRGBSupportedDevicesPage.h"
#include "ui_OpenRGBSupportedDevicesPage.h"
#include "ResourceManager.h"
#include <QUrl>
#include <QDesktopServices>
using namespace Ui;
@@ -43,6 +46,13 @@ void OpenRGBSupportedDevicesPage::on_SaveButton_clicked()
detectorTableModel->applySettings();
}
void OpenRGBSupportedDevicesPage::on_OpenSettingsFolderButton_clicked()
{
std::string config_dir = ResourceManager::get()->GetConfigurationDirectory();
QUrl url = QUrl::fromLocalFile(QString::fromStdString(config_dir));
QDesktopServices::openUrl(url);
}
void OpenRGBSupportedDevicesPage::on_Filter_textChanged(const QString &arg1)
{
#ifdef _QT6

View File

@@ -23,6 +23,8 @@ public:
private slots:
void on_SaveButton_clicked();
void on_OpenSettingsFolderButton_clicked();
void on_Filter_textChanged(const QString &arg1);
void on_ToggleAllCheckbox_toggled(const bool checked);

View File

@@ -39,11 +39,22 @@
<widget class="QTableView" name="SupportedDevicesTable"/>
</item>
<item>
<widget class="QPushButton" name="SaveButton">
<property name="text">
<string>Apply changes</string>
</property>
</widget>
<layout class="QHBoxLayout" name="ButtonsLayout">
<item>
<widget class="QPushButton" name="OpenSettingsFolderButton">
<property name="text">
<string>Open settings folder</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="SaveButton">
<property name="text">
<string>Apply changes</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>