From 0fbe96f8ec297d075c4a5de3d2afa9c5641d04db Mon Sep 17 00:00:00 2001 From: morg Date: Wed, 5 May 2021 20:32:26 +0200 Subject: [PATCH] Add button to open settings folder --- qt/OpenRGBSupportedDevicesPage.cpp | 10 ++++++++++ qt/OpenRGBSupportedDevicesPage.h | 2 ++ qt/OpenRGBSupportedDevicesPage.ui | 21 ++++++++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/qt/OpenRGBSupportedDevicesPage.cpp b/qt/OpenRGBSupportedDevicesPage.cpp index a6f5474b0..9bae083c3 100644 --- a/qt/OpenRGBSupportedDevicesPage.cpp +++ b/qt/OpenRGBSupportedDevicesPage.cpp @@ -1,5 +1,8 @@ #include "OpenRGBSupportedDevicesPage.h" #include "ui_OpenRGBSupportedDevicesPage.h" +#include "ResourceManager.h" +#include +#include 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 diff --git a/qt/OpenRGBSupportedDevicesPage.h b/qt/OpenRGBSupportedDevicesPage.h index b0bea4c12..55e664825 100644 --- a/qt/OpenRGBSupportedDevicesPage.h +++ b/qt/OpenRGBSupportedDevicesPage.h @@ -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); diff --git a/qt/OpenRGBSupportedDevicesPage.ui b/qt/OpenRGBSupportedDevicesPage.ui index 201b0b64b..b9c44086a 100644 --- a/qt/OpenRGBSupportedDevicesPage.ui +++ b/qt/OpenRGBSupportedDevicesPage.ui @@ -39,11 +39,22 @@ - - - Apply changes - - + + + + + Open settings folder + + + + + + + Apply changes + + + +