diff --git a/mapeditor/mainwindow.cpp b/mapeditor/mainwindow.cpp index 16101a07f..aaef9e575 100644 --- a/mapeditor/mainwindow.cpp +++ b/mapeditor/mainwindow.cpp @@ -230,7 +230,7 @@ void MainWindow::saveMap() CMapService mapService; try { - mapService.saveMap(std::unique_ptr(controller.map()), filename.toStdString()); + mapService.saveMap(controller.getMapUniquePtr(), filename.toStdString()); } catch(const std::exception & e) { @@ -762,13 +762,15 @@ void MainWindow::on_inspectorWidget_itemChanged(QTableWidgetItem *item) void MainWindow::on_actionMapSettings_triggered() { - auto mapSettingsDialog = new MapSettings(controller, this); - mapSettingsDialog->setModal(true); + auto settingsDialog = new MapSettings(controller, this); + settingsDialog->setWindowModality(Qt::WindowModal); + settingsDialog->setModal(true); } void MainWindow::on_actionPlayers_settings_triggered() { - auto mapSettingsDialog = new PlayerSettings(*controller.map(), this); - mapSettingsDialog->setModal(true); + auto settingsDialog = new PlayerSettings(*controller.map(), this); + settingsDialog->setWindowModality(Qt::WindowModal); + settingsDialog->setModal(true); } diff --git a/mapeditor/mainwindow.ui b/mapeditor/mainwindow.ui index 62281b603..8464d1967 100644 --- a/mapeditor/mainwindow.ui +++ b/mapeditor/mainwindow.ui @@ -70,8 +70,15 @@ + + + Player + + + + @@ -823,6 +830,14 @@ Players settings + + + true + + + Neutral + + diff --git a/mapeditor/mapcontroller.cpp b/mapeditor/mapcontroller.cpp index 7bc20e59f..879f0b39c 100644 --- a/mapeditor/mapcontroller.cpp +++ b/mapeditor/mapcontroller.cpp @@ -26,6 +26,11 @@ MapController::~MapController() { } +const std::unique_ptr & MapController::getMapUniquePtr() const +{ + return _map; +} + CMap * MapController::map() { return _map.get(); diff --git a/mapeditor/mapcontroller.h b/mapeditor/mapcontroller.h index 3f4cd6c70..181f22d2f 100644 --- a/mapeditor/mapcontroller.h +++ b/mapeditor/mapcontroller.h @@ -17,6 +17,7 @@ public: void setMap(std::unique_ptr); + const std::unique_ptr & getMapUniquePtr() const; //to be used for map saving CMap * map(); MapHandler * mapHandler(); MapScene * scene(int level); diff --git a/mapeditor/playersettings.ui b/mapeditor/playersettings.ui index 881a3eb89..5d111ee04 100644 --- a/mapeditor/playersettings.ui +++ b/mapeditor/playersettings.ui @@ -2,6 +2,9 @@ PlayerSettings + + Qt::WindowModal + 0 @@ -10,8 +13,14 @@ 283 + + Qt::NoFocus + - Dialog + Player settings + + + true