Merge lp:~widelands-dev/widelands/bug-1560454-mapdir into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8015
Proposed branch: lp:~widelands-dev/widelands/bug-1560454-mapdir
Merge into: lp:widelands
Diff against target: 313 lines (+75/-11)
10 files modified
src/editor/ui_menus/main_menu_load_map.cc (+22/-2)
src/editor/ui_menus/main_menu_load_map.h (+2/-0)
src/editor/ui_menus/main_menu_load_or_save_map.cc (+14/-4)
src/editor/ui_menus/main_menu_load_or_save_map.h (+7/-1)
src/editor/ui_menus/main_menu_save_map.cc (+12/-3)
src/editor/ui_menus/main_menu_save_map.h (+4/-0)
src/editor/ui_menus/main_menu_save_map_make_directory.cc (+1/-0)
src/wui/mapdata.cc (+9/-0)
src/wui/mapdata.h (+3/-0)
src/wui/maptable.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1560454-mapdir
Reviewer Review Type Date Requested Status
SirVer Approve
kaputtnik (community) testing Approve
Review via email: mp+294725@code.launchpad.net

Commit message

UI improvements for saving maps:
- Maps are now saved in a "My Maps" subdirectory to prevent overwriting of official maps
- Show full save path to user
- After creating a new directory, enter it
- Automatically focus directory name editbox when creating new directory
- Got rid of blank space in load map screen
- Made show map names/filenames button wide

To post a comment you must log in.
Revision history for this message
Miroslav Remák (miroslavr256) wrote :

For me it shows a different save path than where the map is actually saved: /widelands_working_dir/maps/My_Maps/map.wmf instead of /home/user/.widelands/maps/My_Maps/map.wmf. I guess that's because canonicalize_name does not take file system layers into account.

Revision history for this message
kaputtnik (franku) wrote :

> - Show full save path to user
This shows the wrong path. Here it is shown: /home/kaputtnik/widelands-repo/bug-1560454-mapdir/maps/My_Maps
Instead the map is saved in: /home/kaputtnik/.widelands/maps/My_Maps

> - After creating a new directory, enter it
Good idea :-) But it confuses a bit, because one couldn't see which folder is currently shown.

> - Automatically focus map name editbox when creating new map
I couldn't find this feature :-S Either it is not working or i do not understand it. If i create a new map nothing is shown to edit the name of the map. And if i want to save the map, the focus is always on the map, not in the menu (f.e. hitting "f" toggles Fullscreen). If i first choose the map options menu, there is also no focus on the map name edit box.

It is not possible anymore to store a map in a folder which was created prior this changes, because i couldn't go to the "previous folder". So my maps stored in folder ~/.widelands/maps/test/ could be loaded, but not saved in this folder anymore. One has to move the previous folders he created in ~/.widelands/maps into ~/.widelands/maps/My_Maps/ to save his own maps in his own folders again. Same goes for maps which are stored in ~/.widelands/maps/

As mentioned in the bug report i would like to see the "Shipped maps" in a sub folder in menu "Load map" where the shipped maps could be found. In menu "Save map" this folder shouldn't be shown then. I believe this would be the better approach. Isn't that possible?

Needs fixing because of "Show full path to the user".

review: Needs Fixing
Revision history for this message
GunChleoc (gunchleoc) wrote :

> > - Show full save path to user
> This shows the wrong path. Here it is shown: /home/kaputtnik/widelands-
> repo/bug-1560454-mapdir/maps/My_Maps
> Instead the map is saved in: /home/kaputtnik/.widelands/maps/My_Maps

I'll look into this.

> > - After creating a new directory, enter it
> Good idea :-) But it confuses a bit, because one couldn't see which folder is
> currently shown.

I'll remove this feature then

> > - Automatically focus map name editbox when creating new map
> I couldn't find this feature :-S Either it is not working or i do not
> understand it.

Sorry, I meant create directory, not create map.

> It is not possible anymore to store a map in a folder which was created prior
> this changes, because i couldn't go to the "previous folder". So my maps
> stored in folder ~/.widelands/maps/test/ could be loaded, but not saved in
> this folder anymore. One has to move the previous folders he created in
> ~/.widelands/maps into ~/.widelands/maps/My_Maps/ to save his own maps in his
> own folders again. Same goes for maps which are stored in ~/.widelands/maps/

Yes, they will have to be moved. Which is why I came up with the idea of displaying the full directory, so the user can go find the maps on their computer and fix.

> As mentioned in the bug report i would like to see the "Shipped maps" in a sub
> folder in menu "Load map" where the shipped maps could be found. In menu "Save
> map" this folder shouldn't be shown then. I believe this would be the better
> approach. Isn't that possible?

And how would this look when creating a new game then? All users, even those who don't have any own maps, will have to enter a "Shipped Maps" subfolder every time in order to start a new game?

Revision history for this message
kaputtnik (franku) wrote :

> > As mentioned in the bug report i would like to see the "Shipped maps" in a
> sub
> > folder in menu "Load map" where the shipped maps could be found. In menu
> "Save
> > map" this folder shouldn't be shown then. I believe this would be the better
> > approach. Isn't that possible?
>
> And how would this look when creating a new game then? All users, even those
> who don't have any own maps, will have to enter a "Shipped Maps" subfolder
> every time in order to start a new game?

Sorry, i forget always that "New game" and "Load map" is the same menu :-S

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 1127. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/130361026.
Appveyor build 964. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1560454_mapdir-964.

Revision history for this message
kaputtnik (franku) wrote :

> > > - Automatically focus map name editbox when creating new map
> > I couldn't find this feature :-S Either it is not working or i do not
> > understand it.
>
> Sorry, I meant create directory, not create map.

If i create a new directory the map name editbox isn't focused here ("f" button toggles fullscreen).

Revision history for this message
GunChleoc (gunchleoc) wrote :

Displaying the absolute path is less than trivial, because the LayeredFilesystem will iterate internally over all file systems until it finds a match. So, I decided to display the relative directory instead, both in the load and save screens.

> If i create a new directory the map name editbox isn't focused here ("f"
> button toggles fullscreen).

The shortcut for toggle fullscreen is CTRL+f, so I have no idea how you managed this.

What I am talking about is:

Old behaviour: Save Map -> Make Directory, click the edit box, start typing
New behaviour: Save Map -> Make Directory, start typing right away

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 1132. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/130773045.
Appveyor build 969. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1560454_mapdir-969.

Revision history for this message
kaputtnik (franku) wrote :

Ahhh... now i got it. I've always tested the map name edit box (as the commit message says, even after you've changed it) but you meant the directory name edit box... This is a really good enhancement :-)

Showing the relative directory is IMHO ok. The position of this could be discussed... but i think we should discuss this if we have time to make a menu overhaul. I want to make some mockups with my suggestions if i am ready with the website code.

The "f" button toggles fullscreen without "CTRL" here. Just like it is explained in the help ;)

review: Approve (testing)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Oops, I fixed the commit message. I don't get the problem with the fullscreen toggling while the text input is focused. You're right, it's without the Ctrl key.

Revision history for this message
kaputtnik (franku) wrote :

If the focus is in the directory name edit box, all works correct, no keyboard shortcuts works then.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Bunnybot encountered an error while working on this merge proposal:

The read operation timed out

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 1132. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/130773045.
Appveyor build 969. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1560454_mapdir-969.

Revision history for this message
SirVer (sirver) wrote :

look at me! I did a codereview!!!

code lgtm. only one nit.

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

LOL thanks!

Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/editor/ui_menus/main_menu_load_map.cc'
--- src/editor/ui_menus/main_menu_load_map.cc 2016-04-06 09:23:04 +0000
+++ src/editor/ui_menus/main_menu_load_map.cc 2016-06-07 09:07:42 +0000
@@ -19,6 +19,9 @@
1919
20#include "editor/ui_menus/main_menu_load_map.h"20#include "editor/ui_menus/main_menu_load_map.h"
2121
22#include <boost/algorithm/string.hpp>
23#include <boost/format.hpp>
24
22#include "base/i18n.h"25#include "base/i18n.h"
23#include "editor/editorinteractive.h"26#include "editor/editorinteractive.h"
24#include "io/filesystem/layered_filesystem.h"27#include "io/filesystem/layered_filesystem.h"
@@ -30,7 +33,8 @@
30 * Create all the buttons etc...33 * Create all the buttons etc...
31*/34*/
32MainMenuLoadMap::MainMenuLoadMap(EditorInteractive& parent)35MainMenuLoadMap::MainMenuLoadMap(EditorInteractive& parent)
33 : MainMenuLoadOrSaveMap(parent, "load_map_menu", _("Load Map")) {36 : MainMenuLoadOrSaveMap(parent, 2, "load_map_menu", _("Load Map")) {
37 set_current_directory(curdir_);
3438
35 table_.selected.connect(boost::bind(&MainMenuLoadMap::entry_selected, this));39 table_.selected.connect(boost::bind(&MainMenuLoadMap::entry_selected, this));
36 table_.double_clicked.connect(boost::bind(&MainMenuLoadMap::clicked_ok, boost::ref(*this)));40 table_.double_clicked.connect(boost::bind(&MainMenuLoadMap::clicked_ok, boost::ref(*this)));
@@ -45,7 +49,7 @@
45 const MapData& mapdata = maps_data_[table_.get_selected()];49 const MapData& mapdata = maps_data_[table_.get_selected()];
46 if (g_fs->is_directory(mapdata.filename) &&50 if (g_fs->is_directory(mapdata.filename) &&
47 !Widelands::WidelandsMapLoader::is_widelands_map(mapdata.filename)) {51 !Widelands::WidelandsMapLoader::is_widelands_map(mapdata.filename)) {
48 curdir_ = mapdata.filename;52 set_current_directory(mapdata.filename);
49 fill_table();53 fill_table();
50 } else {54 } else {
51 EditorInteractive& eia = dynamic_cast<EditorInteractive&>(*get_parent());55 EditorInteractive& eia = dynamic_cast<EditorInteractive&>(*get_parent());
@@ -54,6 +58,22 @@
54 }58 }
55}59}
5660
61void MainMenuLoadMap::set_current_directory(const std::string& filename) {
62 curdir_ = filename;
63
64 std::string display_dir = curdir_.substr(basedir_.size());
65 if (boost::starts_with(display_dir, "/")) {
66 display_dir = display_dir.substr(1);
67 }
68 if (boost::starts_with(display_dir, "My_Maps")) {
69 boost::replace_first(display_dir, "My_Maps", _("My Maps"));
70 } else if (boost::starts_with(display_dir, "MP_Scenarios")) {
71 boost::replace_first(display_dir, "MP_Scenarios", _("Multiplayer Scenarios"));
72 }
73 /** TRANSLATORS: The folder that a file will be saved to. */
74 directory_info_.set_text((boost::format(_("Current Directory: %s")) % display_dir).str());
75}
76
57/**77/**
58 * Called when a entry is selected78 * Called when a entry is selected
59 */79 */
6080
=== modified file 'src/editor/ui_menus/main_menu_load_map.h'
--- src/editor/ui_menus/main_menu_load_map.h 2016-04-06 09:23:04 +0000
+++ src/editor/ui_menus/main_menu_load_map.h 2016-06-07 09:07:42 +0000
@@ -33,6 +33,8 @@
3333
34protected:34protected:
35 void clicked_ok() override;35 void clicked_ok() override;
36 // Sets the current dir and updates labels.
37 void set_current_directory(const std::string& filename) override;
3638
37private:39private:
38 void entry_selected();40 void entry_selected();
3941
=== modified file 'src/editor/ui_menus/main_menu_load_or_save_map.cc'
--- src/editor/ui_menus/main_menu_load_or_save_map.cc 2016-04-20 07:58:14 +0000
+++ src/editor/ui_menus/main_menu_load_or_save_map.cc 2016-06-07 09:07:42 +0000
@@ -32,8 +32,10 @@
32#include "map_io/widelands_map_loader.h"32#include "map_io/widelands_map_loader.h"
3333
34MainMenuLoadOrSaveMap::MainMenuLoadOrSaveMap(EditorInteractive& parent,34MainMenuLoadOrSaveMap::MainMenuLoadOrSaveMap(EditorInteractive& parent,
35 int no_of_bottom_rows,
35 const std::string& name,36 const std::string& name,
36 const std::string& title)37 const std::string& title,
38 const std::string& basedir)
37 : UI::Window(&parent, name, 0, 0, parent.get_inner_w() - 40, parent.get_inner_h() - 40, title),39 : UI::Window(&parent, name, 0, 0, parent.get_inner_w() - 40, parent.get_inner_h() - 40, title),
3840
39 // Values for alignment and size41 // Values for alignment and size
@@ -42,7 +44,7 @@
42 tablex_(padding_),44 tablex_(padding_),
43 tabley_(buth_ + 2 * padding_),45 tabley_(buth_ + 2 * padding_),
44 tablew_(get_inner_w() * 7 / 12),46 tablew_(get_inner_w() * 7 / 12),
45 tableh_(get_inner_h() - tabley_ - 3 * buth_ - 2 * padding_),47 tableh_(get_inner_h() - tabley_ - (no_of_bottom_rows + 1) * buth_ - no_of_bottom_rows * padding_),
46 right_column_x_(tablew_ + 2 * padding_),48 right_column_x_(tablew_ + 2 * padding_),
47 butw_((get_inner_w() - right_column_x_ - 2 * padding_) / 2),49 butw_((get_inner_w() - right_column_x_ - 2 * padding_) / 2),
4850
@@ -50,6 +52,11 @@
50 map_details_(52 map_details_(
51 this, right_column_x_, tabley_, get_inner_w() - right_column_x_ - padding_, tableh_,53 this, right_column_x_, tabley_, get_inner_w() - right_column_x_ - padding_, tableh_,
52 MapDetails::Style::kWui),54 MapDetails::Style::kWui),
55 directory_info_(this,
56 padding_,
57 get_inner_h() - 2 * buth_ - 4 * padding_,
58 "",
59 UI::Align::kLeft),
53 ok_(this,60 ok_(this,
54 "ok",61 "ok",
55 UI::g_fh1->fontset()->is_rtl() ? get_inner_w() / 2 - butw_ - padding_ : get_inner_w() / 2 + padding_,62 UI::g_fh1->fontset()->is_rtl() ? get_inner_w() / 2 - butw_ - padding_ : get_inner_w() / 2 + padding_,
@@ -68,9 +75,10 @@
68 buth_,75 buth_,
69 g_gr->images().get("images/ui_basic/but1.png"),76 g_gr->images().get("images/ui_basic/but1.png"),
70 _("Cancel")),77 _("Cancel")),
71 basedir_("maps"),78 basedir_(basedir),
72 has_translated_mapname_(false),79 has_translated_mapname_(false),
73 showing_mapames_(false) {80 showing_mapames_(false) {
81 g_fs->ensure_directory_exists(basedir_);
74 curdir_ = basedir_;82 curdir_ = basedir_;
7583
76 UI::Box* vbox = new UI::Box(this, tablex_, padding_, UI::Box::Horizontal, padding_, get_w());84 UI::Box* vbox = new UI::Box(this, tablex_, padding_, UI::Box::Horizontal, padding_, get_w());
@@ -78,7 +86,7 @@
78 "show_mapnames",86 "show_mapnames",
79 0,87 0,
80 0,88 0,
81 butw_,89 2 * butw_,
82 buth_,90 buth_,
83 g_gr->images().get("images/ui_basic/but1.png"),91 g_gr->images().get("images/ui_basic/but1.png"),
84 _("Show Map Names"));92 _("Show Map Names"));
@@ -155,6 +163,8 @@
155 // about the absolute filesystem top!) we manually add ".."163 // about the absolute filesystem top!) we manually add ".."
156 if (curdir_ != basedir_) {164 if (curdir_ != basedir_) {
157 maps_data_.push_back(MapData::create_parent_dir(curdir_));165 maps_data_.push_back(MapData::create_parent_dir(curdir_));
166 } else if (files.empty()) {
167 maps_data_.push_back(MapData::create_empty_dir(curdir_));
158 }168 }
159169
160 MapData::DisplayType display_type;170 MapData::DisplayType display_type;
161171
=== modified file 'src/editor/ui_menus/main_menu_load_or_save_map.h'
--- src/editor/ui_menus/main_menu_load_or_save_map.h 2016-04-06 09:23:04 +0000
+++ src/editor/ui_menus/main_menu_load_or_save_map.h 2016-06-07 09:07:42 +0000
@@ -25,6 +25,7 @@
25#include "editor/editorinteractive.h"25#include "editor/editorinteractive.h"
26#include "ui_basic/button.h"26#include "ui_basic/button.h"
27#include "ui_basic/checkbox.h"27#include "ui_basic/checkbox.h"
28#include "ui_basic/textarea.h"
28#include "ui_basic/window.h"29#include "ui_basic/window.h"
29#include "wui/mapdetails.h"30#include "wui/mapdetails.h"
30#include "wui/maptable.h"31#include "wui/maptable.h"
@@ -34,12 +35,16 @@
34*/35*/
35struct MainMenuLoadOrSaveMap : public UI::Window {36struct MainMenuLoadOrSaveMap : public UI::Window {
36 MainMenuLoadOrSaveMap(EditorInteractive& parent,37 MainMenuLoadOrSaveMap(EditorInteractive& parent,
38 int no_of_bottom_rows,
37 const std::string& name,39 const std::string& name,
38 const std::string& title);40 const std::string& title,
41 const std::string& basedir = "maps");
3942
40protected:43protected:
41 virtual void clicked_ok() = 0;44 virtual void clicked_ok() = 0;
42 void toggle_mapnames();45 void toggle_mapnames();
46 // Sets the current dir and updates labels.
47 virtual void set_current_directory(const std::string& filename) = 0;
43 void fill_table();48 void fill_table();
4449
45 bool compare_players(uint32_t, uint32_t);50 bool compare_players(uint32_t, uint32_t);
@@ -57,6 +62,7 @@
57 std::vector<MapData> maps_data_;62 std::vector<MapData> maps_data_;
58 MapDetails map_details_;63 MapDetails map_details_;
5964
65 UI::Textarea directory_info_;
60 UI::Button ok_, cancel_;66 UI::Button ok_, cancel_;
6167
62 const std::string basedir_;68 const std::string basedir_;
6369
=== modified file 'src/editor/ui_menus/main_menu_save_map.cc'
--- src/editor/ui_menus/main_menu_save_map.cc 2016-05-07 18:54:04 +0000
+++ src/editor/ui_menus/main_menu_save_map.cc 2016-06-07 09:07:42 +0000
@@ -49,7 +49,7 @@
4949
50// TODO(GunChleoc): Arabic: Make directory dialog: buttons need more height for Arabic.50// TODO(GunChleoc): Arabic: Make directory dialog: buttons need more height for Arabic.
51MainMenuSaveMap::MainMenuSaveMap(EditorInteractive& parent)51MainMenuSaveMap::MainMenuSaveMap(EditorInteractive& parent)
52 : MainMenuLoadOrSaveMap(parent, "save_map_menu", _("Save Map")),52 : MainMenuLoadOrSaveMap(parent, 3, "save_map_menu", _("Save Map"), "maps/My_Maps"),
5353
54 make_directory_(this,54 make_directory_(this,
55 "make_directory",55 "make_directory",
@@ -74,6 +74,7 @@
74 buth_,74 buth_,
75 _("Filename:"),75 _("Filename:"),
76 UI::Align::kLeft) {76 UI::Align::kLeft) {
77 set_current_directory(curdir_);
7778
78 // Make room for edit_options_ button79 // Make room for edit_options_ button
79 map_details_.set_max_height(map_details_.get_h() - buth_ - padding_);80 map_details_.set_max_height(map_details_.get_h() - buth_ - padding_);
@@ -131,7 +132,7 @@
131132
132 if (g_fs->is_directory(complete_filename.c_str()) &&133 if (g_fs->is_directory(complete_filename.c_str()) &&
133 !Widelands::WidelandsMapLoader::is_widelands_map(complete_filename)) {134 !Widelands::WidelandsMapLoader::is_widelands_map(complete_filename)) {
134 curdir_ = complete_filename;135 set_current_directory(complete_filename);
135 fill_table();136 fill_table();
136 } else { // Ok, save this map137 } else { // Ok, save this map
137 Widelands::Map& map = eia().egbase().map();138 Widelands::Map& map = eia().egbase().map();
@@ -151,6 +152,7 @@
151 * Called, when the make directory button was clicked.152 * Called, when the make directory button was clicked.
152 */153 */
153void MainMenuSaveMap::clicked_make_directory() {154void MainMenuSaveMap::clicked_make_directory() {
155 /** TRANSLATORS: A folder that hasn't been given a name yet */
154 MainMenuSaveMapMakeDirectory md(this, _("unnamed"));156 MainMenuSaveMapMakeDirectory md(this, _("unnamed"));
155 if (md.run<UI::Panel::Returncodes>() == UI::Panel::Returncodes::kOk) {157 if (md.run<UI::Panel::Returncodes>() == UI::Panel::Returncodes::kOk) {
156 g_fs->ensure_directory_exists(curdir_);158 g_fs->ensure_directory_exists(curdir_);
@@ -201,7 +203,7 @@
201 assert(table_.has_selection());203 assert(table_.has_selection());
202 const MapData& mapdata = maps_data_[table_.get_selected()];204 const MapData& mapdata = maps_data_[table_.get_selected()];
203 if (mapdata.maptype == MapData::MapType::kDirectory) {205 if (mapdata.maptype == MapData::MapType::kDirectory) {
204 curdir_ = mapdata.filename;206 set_current_directory(mapdata.filename);
205 fill_table();207 fill_table();
206 } else {208 } else {
207 clicked_ok();209 clicked_ok();
@@ -216,6 +218,13 @@
216 ok_.set_enabled(!editbox_->text().empty());218 ok_.set_enabled(!editbox_->text().empty());
217}219}
218220
221void MainMenuSaveMap::set_current_directory(const std::string& filename) {
222 curdir_ = filename;
223 /** TRANSLATORS: The folder that a file will be saved to. */
224 directory_info_.set_text((boost::format(_("Current Directory: %s"))
225 % (_("My Maps") + curdir_.substr(basedir_.size()))).str());
226}
227
219/**228/**
220 * Save the map in the current directory with229 * Save the map in the current directory with
221 * the current filename230 * the current filename
222231
=== modified file 'src/editor/ui_menus/main_menu_save_map.h'
--- src/editor/ui_menus/main_menu_save_map.h 2016-04-06 09:23:04 +0000
+++ src/editor/ui_menus/main_menu_save_map.h 2016-06-07 09:07:42 +0000
@@ -34,6 +34,10 @@
34struct MainMenuSaveMap : public MainMenuLoadOrSaveMap {34struct MainMenuSaveMap : public MainMenuLoadOrSaveMap {
35 MainMenuSaveMap(EditorInteractive& parent);35 MainMenuSaveMap(EditorInteractive& parent);
3636
37protected:
38 // Sets the current dir and updates labels.
39 void set_current_directory(const std::string& filename) override;
40
37private:41private:
38 EditorInteractive & eia();42 EditorInteractive & eia();
39 void clicked_ok();43 void clicked_ok();
4044
=== modified file 'src/editor/ui_menus/main_menu_save_map_make_directory.cc'
--- src/editor/ui_menus/main_menu_save_map_make_directory.cc 2016-04-23 08:05:31 +0000
+++ src/editor/ui_menus/main_menu_save_map_make_directory.cc 2016-06-07 09:07:42 +0000
@@ -66,6 +66,7 @@
66 boost::ref(*this),66 boost::ref(*this),
67 UI::Panel::Returncodes::kBack));67 UI::Panel::Returncodes::kBack));
68 center_to_parent();68 center_to_parent();
69 edit_.focus();
69}70}
7071
7172
7273
=== modified file 'src/wui/mapdata.cc'
--- src/wui/mapdata.cc 2016-04-16 07:10:03 +0000
+++ src/wui/mapdata.cc 2016-06-07 09:07:42 +0000
@@ -131,11 +131,20 @@
131}131}
132132
133// static133// static
134MapData MapData::create_empty_dir(const std::string& current_dir) {
135 /** TRANSLATORS: This label is shown when a folder is empty */
136 return MapData(current_dir, (boost::format("<%s>") % _("empty")).str());
137}
138
139// static
134MapData MapData::create_directory(const std::string& directory) {140MapData MapData::create_directory(const std::string& directory) {
135 std::string localized_name;141 std::string localized_name;
136 if (boost::equals(directory, "maps/MP_Scenarios")) {142 if (boost::equals(directory, "maps/MP_Scenarios")) {
137 /** TRANSLATORS: Directory name for MP Scenarios in map selection */143 /** TRANSLATORS: Directory name for MP Scenarios in map selection */
138 localized_name = _("Multiplayer Scenarios");144 localized_name = _("Multiplayer Scenarios");
145 } else if (boost::equals(directory, "maps/My_Maps")) {
146 /** TRANSLATORS: Directory name for user maps in map selection */
147 localized_name = _("My Maps");
139 } else {148 } else {
140 localized_name = FileSystem::fs_filename(directory.c_str());149 localized_name = FileSystem::fs_filename(directory.c_str());
141 }150 }
142151
=== modified file 'src/wui/mapdata.h'
--- src/wui/mapdata.h 2016-02-06 18:58:57 +0000
+++ src/wui/mapdata.h 2016-06-07 09:07:42 +0000
@@ -89,6 +89,9 @@
89 /// Get the ".." directory89 /// Get the ".." directory
90 static MapData create_parent_dir(const std::string& current_dir);90 static MapData create_parent_dir(const std::string& current_dir);
9191
92 /// To display if the directory is empty and has no parent
93 static MapData create_empty_dir(const std::string& current_dir);
94
92 /// Create a subdirectory95 /// Create a subdirectory
93 static MapData create_directory(const std::string& directory);96 static MapData create_directory(const std::string& directory);
9497
9598
=== modified file 'src/wui/maptable.cc'
--- src/wui/maptable.cc 2016-01-29 08:37:22 +0000
+++ src/wui/maptable.cc 2016-06-07 09:07:42 +0000
@@ -34,7 +34,7 @@
3434
35 /** TRANSLATORS: Column title for number of players in map list */35 /** TRANSLATORS: Column title for number of players in map list */
36 add_column(35, _("Pl."), _("Number of players"), UI::Align::kHCenter);36 add_column(35, _("Pl."), _("Number of players"), UI::Align::kHCenter);
37 add_column(get_w() - 35 - 115, "", _("The name of the map or scenario"), UI::Align::kLeft);37 add_column(get_w() - 35 - 115, _("Filename"), _("The name of the map or scenario"), UI::Align::kLeft);
38 add_column(115, _("Size"), _("The size of the map (Width x Height)"), UI::Align::kLeft);38 add_column(115, _("Size"), _("The size of the map (Width x Height)"), UI::Align::kLeft);
39 set_sort_column(0);39 set_sort_column(0);
40}40}

Subscribers

People subscribed via source and target branches

to status/vote changes: