2022-01-10 21:49:06 +01:00
|
|
|
#include "userdefinedconstantsdialog.h"
|
|
|
|
|
#include "ui_userdefinedconstantsdialog.h"
|
|
|
|
|
|
2022-01-11 02:35:26 +01:00
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
2022-01-10 21:49:06 +01:00
|
|
|
#include "projectcontainer.h"
|
2022-01-14 21:21:17 +01:00
|
|
|
#include "models/constantsmodel.h"
|
2022-01-10 21:49:06 +01:00
|
|
|
|
|
|
|
|
UserDefinedConstantsDialog::UserDefinedConstantsDialog(ProjectContainer &project, QWidget *parent) :
|
|
|
|
|
QDialog{parent},
|
|
|
|
|
m_ui{std::make_unique<Ui::UserDefinedConstantsDialog>()},
|
|
|
|
|
m_project{project},
|
|
|
|
|
m_model{std::make_unique<ConstantsModel>(m_project, this)}
|
|
|
|
|
{
|
|
|
|
|
m_ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
|
|
|
|
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
|
|
|
|
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
|
|
|
|
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
|
|
|
|
|
|
|
|
|
m_ui->treeView->setModel(m_model.get());
|
2022-01-11 02:35:26 +01:00
|
|
|
|
|
|
|
|
connect(m_ui->pushButtonInsert, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::insertConstant);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonAdd, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::addConstant);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonDelete, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::deleteConstant);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonClear, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::clearConstants);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonUp, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::moveConstantUp);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonDown, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::moveConstantDown);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonSort, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::sortConstants);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonLoad, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::loadConstant);
|
2022-01-11 02:35:26 +01:00
|
|
|
connect(m_ui->pushButtonSave, &QAbstractButton::clicked,
|
2022-01-15 01:52:55 +01:00
|
|
|
this, &UserDefinedConstantsDialog::saveConstant);
|
2022-01-10 21:49:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UserDefinedConstantsDialog::~UserDefinedConstantsDialog() = default;
|
2022-01-11 02:35:26 +01:00
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::insertConstant()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::addConstant()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::deleteConstant()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::clearConstants()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::moveConstantUp()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::moveConstantDown()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::sortConstants()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::loadConstant()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-15 01:52:55 +01:00
|
|
|
void UserDefinedConstantsDialog::saveConstant()
|
2022-01-11 02:35:26 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
|
|
|
|
}
|