Line data Source code
1 : #include <QDialog>
2 : #include <QWidget>
3 :
4 : #include "dbe/SchemaNoteEditor.hpp"
5 : #include "dbe/SchemaGraphicNote.hpp"
6 : #include "ui_SchemaNoteEditor.h"
7 :
8 : namespace dbse {
9 0 : SchemaNoteEditor::SchemaNoteEditor(SchemaGraphicNote* note, QWidget* parent)
10 0 : : QDialog(parent), m_note(note), m_ui(new Ui::SchemaNoteEditor) {
11 :
12 0 : m_ui->setupUi(this);
13 0 : m_ui->text->setPlainText(m_note->text());
14 0 : m_ui->text->setFocus();
15 0 : connect(m_ui->buttons, SIGNAL(accepted()), this, SLOT(update_text()));
16 0 : connect(m_ui->buttons, SIGNAL(rejected()), this, SLOT(cancel_note()));
17 0 : }
18 :
19 0 : SchemaNoteEditor::~SchemaNoteEditor() {
20 0 : delete m_ui;
21 0 : }
22 :
23 0 : void SchemaNoteEditor::cancel_note() {
24 0 : emit cancelled(m_note);
25 0 : }
26 :
27 0 : void SchemaNoteEditor::update_text() {
28 0 : emit note_accepted(m_note);
29 0 : m_note->update_note(m_ui->text->toPlainText());
30 0 : }
31 : } //namespace dbse
|