2025-05-30 16:28:51 +08:00
|
|
|
#include <QPushButton>
|
|
|
|
|
#include "createEditor.h"
|
2025-10-24 21:11:07 +08:00
|
|
|
#include "projectManager.h"
|
2025-05-30 16:28:51 +08:00
|
|
|
#include "ui_createEditor.h"
|
|
|
|
|
|
|
|
|
|
CreateEditor::CreateEditor(QWidget *parent)
|
|
|
|
|
: QDialog(parent)
|
|
|
|
|
, ui(new Ui::createEditor)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
|
|
|
|
initial();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CreateEditor::~CreateEditor()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CreateEditor::initial()
|
|
|
|
|
{
|
2025-06-03 09:45:27 +08:00
|
|
|
connect(ui->btn_ok,&QPushButton::clicked,this,&CreateEditor::onOkClicked);
|
|
|
|
|
connect(ui->btn_cancel,&QPushButton::clicked,this,&CreateEditor::onCancelClicked);
|
2025-05-30 16:28:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CreateEditor::showDlg()
|
|
|
|
|
{
|
|
|
|
|
show();
|
|
|
|
|
ui->le_name->clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CreateEditor::onOkClicked()
|
|
|
|
|
{
|
2025-10-24 21:11:07 +08:00
|
|
|
ProjectManager::instance().createEditor(ui->le_name->text());
|
2025-05-30 16:28:51 +08:00
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CreateEditor::onCancelClicked()
|
|
|
|
|
{
|
|
|
|
|
hide();
|
|
|
|
|
}
|