2016-05-16 01:06:51 +02:00
|
|
|
#include "WorldViewer.hpp"
|
|
|
|
#include "ViewerWidget.hpp"
|
|
|
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
2018-01-16 02:05:23 +01:00
|
|
|
WorldViewer::WorldViewer(QWidget* parent, Qt::WindowFlags f)
|
2016-09-09 22:13:21 +02:00
|
|
|
: ViewerInterface(parent, f) {
|
|
|
|
mainLayout = new QVBoxLayout;
|
2016-05-16 01:06:51 +02:00
|
|
|
|
2018-01-16 02:05:23 +01:00
|
|
|
mainLayout->addWidget(QWidget::createWindowContainer(createViewer()));
|
2016-05-16 01:06:51 +02:00
|
|
|
|
2018-01-16 02:05:23 +01:00
|
|
|
setLayout(mainLayout);
|
2016-05-16 01:06:51 +02:00
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
void WorldViewer::loadPlacements(const QString& file) {
|
|
|
|
world()->placeItems(file.toStdString());
|
|
|
|
placementsLoaded(file);
|
2016-05-16 01:06:51 +02:00
|
|
|
}
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
void WorldViewer::loadPlacements() {
|
|
|
|
QFileDialog dialog(this, "Open Placements", "", "Placement (*.ipl)");
|
|
|
|
if (dialog.exec()) {
|
|
|
|
loadPlacements(dialog.selectedFiles()[0]);
|
|
|
|
}
|
2016-05-16 01:06:51 +02:00
|
|
|
}
|