mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 06:11:07 -04:00
* Make the Get/Set RGBControler descriptor functions static * Add functions for getting the matrix_map_type for zone and segment matrix maps * Rename zone resize dialog to zone editor dialog * Add additional segment types * Add option to import segments configuration from JSON file in zone editor dialog * Update device view to be able to display matrix segment types * Add matrix map editor dialog for creating/editing segment matrix maps * Add option to export segments configuration to JSON file in zone editor dialog
87 lines
2.2 KiB
C++
87 lines
2.2 KiB
C++
/*---------------------------------------------------------*\
|
|
| OpenRGBSegmentExportDialog.cpp |
|
|
| |
|
|
| User interface entry for OpenRGB segment export dialog |
|
|
| |
|
|
| Adam Honse <calcprogrammer1@gmail.com> 22 Feb 2026 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include <QFileDialog>
|
|
#include "OpenRGBSegmentExportDialog.h"
|
|
#include "ui_OpenRGBSegmentExportDialog.h"
|
|
|
|
OpenRGBSegmentExportDialog::OpenRGBSegmentExportDialog(QWidget *parent) :
|
|
QDialog(parent), ui(new Ui::OpenRGBSegmentExportDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
}
|
|
|
|
OpenRGBSegmentExportDialog::~OpenRGBSegmentExportDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void OpenRGBSegmentExportDialog::changeEvent(QEvent *event)
|
|
{
|
|
if(event->type() == QEvent::LanguageChange)
|
|
{
|
|
ui->retranslateUi(this);
|
|
}
|
|
}
|
|
|
|
bool OpenRGBSegmentExportDialog::show()
|
|
{
|
|
int result = this->exec();
|
|
|
|
if(result == QDialog::Rejected)
|
|
{
|
|
return(false);
|
|
}
|
|
else
|
|
{
|
|
filename = ui->LineEditFile->text();
|
|
vendor = ui->LineEditVendor->text();
|
|
device = ui->LineEditDevice->text();
|
|
}
|
|
|
|
return(true);
|
|
}
|
|
|
|
QString OpenRGBSegmentExportDialog::GetDevice()
|
|
{
|
|
return(device);
|
|
}
|
|
|
|
QString OpenRGBSegmentExportDialog::GetFilename()
|
|
{
|
|
return(filename);
|
|
}
|
|
|
|
QString OpenRGBSegmentExportDialog::GetVendor()
|
|
{
|
|
return(vendor);
|
|
}
|
|
|
|
void OpenRGBSegmentExportDialog::on_ButtonChooseFile_clicked()
|
|
{
|
|
QFileDialog file_dialog(this);
|
|
|
|
file_dialog.setFileMode(QFileDialog::AnyFile);
|
|
file_dialog.setNameFilter("*.json");
|
|
file_dialog.setDefaultSuffix(".json");
|
|
file_dialog.setWindowTitle("Export Configuration");
|
|
|
|
if(file_dialog.exec())
|
|
{
|
|
QStringList selected_files = file_dialog.selectedFiles();
|
|
QString filename = selected_files[0];
|
|
|
|
ui->LineEditFile->setText(filename);
|
|
}
|
|
}
|
|
|