# HG changeset patch # User Wuzzy # Date 1521068113 -3600 # Node ID e9e4cc867b6e109ee7297ea09788691db2a49017 # Parent 667f28278aa4a203da3ceb5ff80ce8ff53ad1c2e Add default directory DrawnMaps to put hand-drawn maps into diff -r 667f28278aa4 -r e9e4cc867b6e ChangeLog.txt --- a/ChangeLog.txt Wed Mar 14 23:02:39 2018 +0100 +++ b/ChangeLog.txt Wed Mar 14 23:55:13 2018 +0100 @@ -19,7 +19,9 @@ * When using seduction, only show “CENSORED” text in English locale Frontend: + + Migrate to Qt 5 + Schemes are now stored in separate files under Schemes + + Add default directory DrawnMaps for hand-drawn maps + Lead player to training missions when starting Hedgewars the first time * Fix broken preview of team hats (e.g. cap_team) diff -r 667f28278aa4 -r e9e4cc867b6e QTfrontend/main.cpp --- a/QTfrontend/main.cpp Wed Mar 14 23:02:39 2018 +0100 +++ b/QTfrontend/main.cpp Wed Mar 14 23:55:13 2018 +0100 @@ -318,6 +318,7 @@ // config/save paths checkForDir(cfgdir->absolutePath() + "/Demos"); + checkForDir(cfgdir->absolutePath() + "/DrawnMaps"); checkForDir(cfgdir->absolutePath() + "/Saves"); checkForDir(cfgdir->absolutePath() + "/Screenshots"); checkForDir(cfgdir->absolutePath() + "/Teams"); diff -r 667f28278aa4 -r e9e4cc867b6e QTfrontend/ui/page/pagedrawmap.cpp --- 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 #include #include +#include #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); diff -r 667f28278aa4 -r e9e4cc867b6e QTfrontend/ui/widget/mapContainer.cpp --- a/QTfrontend/ui/widget/mapContainer.cpp Wed Mar 14 23:02:39 2018 +0100 +++ b/QTfrontend/ui/widget/mapContainer.cpp Wed Mar 14 23:55:13 2018 +0100 @@ -1068,7 +1068,8 @@ void HWMapContainer::loadDrawing() { - 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()) return;