diff --git a/qt/OpenRGBProfileSaveDialog.cpp b/qt/OpenRGBProfileSaveDialog.cpp index eabd27e5..54ff052b 100644 --- a/qt/OpenRGBProfileSaveDialog.cpp +++ b/qt/OpenRGBProfileSaveDialog.cpp @@ -1,6 +1,7 @@ #include #include "ResourceManager.h" #include "OpenRGBDialog2.h" +#include "ProfileManager.h" #include "OpenRGBProfileSaveDialog.h" #include "ui_OpenRGBProfileSaveDialog.h" @@ -12,6 +13,25 @@ Ui::OpenRGBProfileSaveDialog::OpenRGBProfileSaveDialog(QWidget *parent) : QDialog(parent), ui(new Ui::OpenRGBProfileSaveDialogUi) { ui->setupUi(this); + + std::vector filenames = ResourceManager::get()->GetProfileManager()->profile_list; + + if(filenames.empty()) + { + ui->list_profile->setVisible(false); + ui->existing->setVisible(false); + } + else + { + for(const std::string& f: filenames) + { + ui->list_profile->addItem(QString::fromStdString(f)); + } + + connect(ui->list_profile, &QListWidget::currentItemChanged, [=](){ + ui->lineEdit->setText(ui->list_profile->currentItem()->text()); + }); + } } Ui::OpenRGBProfileSaveDialog::~OpenRGBProfileSaveDialog() diff --git a/qt/OpenRGBProfileSaveDialog.ui b/qt/OpenRGBProfileSaveDialog.ui index 7218169a..70c9871d 100644 --- a/qt/OpenRGBProfileSaveDialog.ui +++ b/qt/OpenRGBProfileSaveDialog.ui @@ -6,18 +6,34 @@ 0 0 - 400 - 110 + 184 + 186 + + + 0 + 0 + + Profile Name - + - + - New Profile Name: + Save to an existing profile: + + + + + + + + + + Create a new profile: