QTfrontend/ui/page/pagedrawmap.cpp
changeset 13217 e9e4cc867b6e
parent 13214 f5d36be88c61
--- a/QTfrontend/ui/page/pagedrawmap.cpp	Wed Mar 14 23:02:39 2018 +0100
+++ b/QTfrontend/ui/page/pagedrawmap.cpp	Wed Mar 14 23:55:13 2018 +0100
@@ -22,9 +22,11 @@
 #include <QCheckBox>
 #include <QRadioButton>
 #include <QSpinBox>
+#include <QDir>
 
 #include "pagedrawmap.h"
 #include "drawmapwidget.h"
+#include "hwconsts.h"
 
 
 QLayout * PageDrawMap::bodyLayoutDefinition()
@@ -106,7 +108,8 @@
 
 void PageDrawMap::load()
 {
-    QString fileName = QFileDialog::getOpenFileName(NULL, tr("Load drawn map"), ".", tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
+    QString loadDir = QDir(cfgdir->absolutePath() + "/DrawnMaps").absolutePath();
+    QString fileName = QFileDialog::getOpenFileName(this, tr("Load drawn map"), loadDir, tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
 
     if(!fileName.isEmpty())
         drawMapWidget->load(fileName);
@@ -114,7 +117,8 @@
 
 void PageDrawMap::save()
 {
-    QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save drawn map"), "./map.hwmap", tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
+    QString saveDir = QDir(cfgdir->absolutePath() + "/DrawnMaps/map.hwmap").absolutePath();
+    QString fileName = QFileDialog::getSaveFileName(this, tr("Save drawn map"), saveDir, tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
 
     if(!fileName.isEmpty())
         drawMapWidget->save(fileName);