Author: mir3x
Date: Sat Dec 10 13:30:52 2016
New Revision: 34696

URL: http://svn.gna.org/viewcvs/freeciv?rev=34696&view=rev
Log:
Qt client - save map image to picture folder or storage folder

See patch #8042


Modified:
    branches/S2_6/client/gui-qt/menu.cpp

Modified: branches/S2_6/client/gui-qt/menu.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.cpp?rev=34696&r1=34695&r2=34696&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.cpp        (original)
+++ branches/S2_6/client/gui-qt/menu.cpp        Sat Dec 10 13:30:52 2016
@@ -3015,6 +3015,7 @@
 {
   int current_width, current_height;
   int full_size_x, full_size_y;
+  QString path;
   hud_message_box saved(gui()->central_wdg);
   bool map_saved;
   QString img_name;
@@ -3034,12 +3035,19 @@
     img_name = img_name + "-"
                 + QString(nation_plural_for_player(client_player()));
   }
+  path = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
+  if (path.isEmpty() == false) {
+    img_name = path + DIR_SEPARATOR + img_name;
+  } else {
+    img_name = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
+               + DIR_SEPARATOR + img_name;
+  }
   map_saved = mapview.store->map_pixmap.save(img_name, "png");
   map_canvas_resized(current_width, current_height);
   saved.setStandardButtons(QMessageBox::Ok);
   saved.setDefaultButton(QMessageBox::Cancel);
   if (map_saved) {
-    saved.set_text_title("Image saved as " + img_name, _("Succeess"));
+    saved.set_text_title("Image saved as:\n" + img_name, _("Succeess"));
   } else {
     saved.set_text_title(_("Failed to save image of the map"), _("Error"));
   }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to