diff options
author | Nao Pross <naopross@thearcway.org> | 2018-01-01 18:44:35 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-01-01 18:44:35 +0100 |
commit | 7ea534dd1c8bf72200a999cae554d842d9035ba9 (patch) | |
tree | 6b2438ea6f7c27c8069458d599bfbf2ba5534ce7 /src/ui/mainwindow.cpp | |
parent | Implement basic ui (diff) | |
download | OrbitingYeti-7ea534dd1c8bf72200a999cae554d842d9035ba9.tar.gz OrbitingYeti-7ea534dd1c8bf72200a999cae554d842d9035ba9.zip |
New StatementDialog, rename diagram classes
Other changes:
- Use raw pointer instead of smart pointers to manage resources
- Initial Painter implementation
Diffstat (limited to 'src/ui/mainwindow.cpp')
-rw-r--r-- | src/ui/mainwindow.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 5776db7..8b40c1b 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -1,9 +1,12 @@ #include "debugtools.h" #include "ui/metadatadialog.h" +#include "ui/statementdialog.h" #include "ui/mainwindow.h" #include "ui_mainwindow.h" +#include "diagram/statement.h" + #include <iostream> #include <QMessageBox> @@ -15,6 +18,7 @@ MainWindow::MainWindow(samb::Structogram *structogram, QWidget *parent) : _structogram(structogram) { _ui->setupUi(this); + _ui->painter->structogram(&_structogram); toolButtonsEnabled((_structogram != nullptr)); } @@ -53,7 +57,7 @@ void MainWindow::on_openButton_clicked() return; QString fileName = QFileDialog::getOpenFileName(this, - tr("Load diagram"), "", "NS Diagram (*.nsdg);;All Files (*)"); + tr("Load diagram"), "", tr("NS Diagram (*.nsdg);;All Files (*)")); if (fileName.isEmpty()) return; @@ -86,18 +90,24 @@ void MainWindow::on_metadataButton_clicked() if (_structogram == nullptr) return; - MetadataDialog *dialog = new MetadataDialog(this); - dialog->setMetadata(_structogram->title(), _structogram->author()); + MetadataDialog dialog(this); + dialog.setMetadata(_structogram->title(), _structogram->author()); - if (dialog->exec() == QDialog::Accepted) { - _structogram->title(dialog->title()); - _structogram->author(dialog->author()); + if (dialog.exec() == QDialog::Accepted) { + _structogram->title(dialog.title()); + _structogram->author(dialog.author()); } } void MainWindow::on_newStatementButton_clicked() { + if (_structogram == nullptr) + return; + + StatementDialog dialog(this); + if (dialog.exec() == QDialog::Accepted) { + } } /**** private methods ****/ |