[Commits] [wesnoth/wesnoth] ea9d07: fs: Add utility functions for the new file dialog
GitHub
noreply at github.com
Wed Oct 5 06:06:45 UTC 2016
Branch: refs/heads/master
Home: https://github.com/wesnoth/wesnoth
Commit: ea9d077b89dcefd33bba7aeb2ddee0479ae4fafa
https://github.com/wesnoth/wesnoth/commit/ea9d077b89dcefd33bba7aeb2ddee0479ae4fafa
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M SConstruct
M projectfiles/CodeBlocks/wesnoth.cbp
M projectfiles/CodeBlocks/wesnothd.cbp
M src/CMakeLists.txt
M src/filesystem.hpp
M src/filesystem_boost.cpp
M src/tests/test_filesystem.cpp
Log Message:
-----------
fs: Add utility functions for the new file dialog
These include an alternate mode of normalize_path() that enforces the
platform's preferred path delimiter (i.e. backslash on Windows) on the
output, and a function to detect whether a path refers to a root
directory.
Unfortunately, the last bit requires introducing a new link-time
dependency on Windows, against a system library. It's guaranteed to be
always there but it seems kind of a waste. The alternative would be to
hand-parse the string but that seems even more of a waste. And no,
Boost.Filesystem can't do this in a straightforward fashion right now.
Commit: f3795467dca9c71112aec3150d64c782833c8e2d
https://github.com/wesnoth/wesnoth/commit/f3795467dca9c71112aec3150d64c782833c8e2d
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/filesystem.hpp
M src/filesystem_boost.cpp
M src/tests/test_filesystem.cpp
Log Message:
-----------
fs: Add nearest_extant_parent() function and tests
Commit: ff07aecdf09ac6c1f8808c7bc1340c9f6b8060af
https://github.com/wesnoth/wesnoth/commit/ff07aecdf09ac6c1f8808c7bc1340c9f6b8060af
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/filesystem.hpp
M src/filesystem_boost.cpp
M src/tests/test_filesystem.cpp
Log Message:
-----------
fs: Add three-parameter form of normalize_path() that returns canonical paths
This means resolving . and .. components, which is an operation that may
fail if any component does not exist.
Commit: d301f8027fe5a9ab59730071d8bb0107431db841
https://github.com/wesnoth/wesnoth/commit/d301f8027fe5a9ab59730071d8bb0107431db841
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/filesystem.hpp
M src/filesystem_boost.cpp
Log Message:
-----------
fs: Add root_name() function
Commit: 6e1f6bb68645ba23cbc594d10dc2fb1d68f11042
https://github.com/wesnoth/wesnoth/commit/6e1f6bb68645ba23cbc594d10dc2fb1d68f11042
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
A data/gui/window/file_dialog.cfg
M projectfiles/CodeBlocks/wesnoth.cbp
M src/CMakeLists.txt
M src/SConscript
M src/filechooser.cpp
A src/gui/dialogs/file_dialog.cpp
A src/gui/dialogs/file_dialog.hpp
M src/tests/gui/test_gui2.cpp
Log Message:
-----------
gui2/tfile_dialog: Initial port of the filechooser dialog to GUI2
This provides, as far as I can tell, all the filechooser functionality
that is actually in use in Open File mode except for the "type-ahead"
option that is used to set filename extension hints.
There's some newly-introduced border cases courtesy of Boost.Filesystem
that I really feel we shouldn't worry about for now:
* // is handled weirdly thanks to BFS honoring the POSIX provision for
implementation-defined behavior regarding it.
* UNCs on Windows are not supported. Just like in mostly everywhere
else in Wesnoth. Same applies to \\.\, \\?\ and \??\.
* Non-directory path components on Windows are not handled very
gracefully (particularly obvious with volumes mounted as NTFS
junction points, or symbolic links for the Documents folder on
Wine) due to quirks in BFS's path::canonical() method and how it
relies on dereferencing individual path components to resolve dot
entries.
Haven't tested all callers yet, they are still using the original
filechooser entry points for now. I need to remove those and make
everyone use gui2::tfile_dialog directly before this can be merged to
master.
Commit: fc593270dc0f9d85faf9bb9b24ccb22c17542376
https://github.com/wesnoth/wesnoth/commit/fc593270dc0f9d85faf9bb9b24ccb22c17542376
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
M src/gui/dialogs/file_dialog.hpp
Log Message:
-----------
gui2/tfile_dialog: Allow callers to set a custom label for the OK button
Commit: 409b61f5befb34f81cb591d40f5fc7dd26fb34c8
https://github.com/wesnoth/wesnoth/commit/409b61f5befb34f81cb591d40f5fc7dd26fb34c8
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M data/gui/window/file_dialog.cfg
Log Message:
-----------
gui2/tfile_dialog: We can delete folders too
Commit: ef09ef9e6cb603460f4f31d2825f6c120d889272
https://github.com/wesnoth/wesnoth/commit/ef09ef9e6cb603460f4f31d2825f6c120d889272
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
Log Message:
-----------
gui2/tfile_dialog: Add deletion prompt and fix deleting folders
Commit: c89b7596ec78a09f0ffbbcfd392a9403afaac1a3
https://github.com/wesnoth/wesnoth/commit/c89b7596ec78a09f0ffbbcfd392a9403afaac1a3
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
Log Message:
-----------
gui2/tfile_dialog: Avoid redundant grid pointer retrieval
Commit: 0cd131b537529f71bfd0442436595953b466715f
https://github.com/wesnoth/wesnoth/commit/0cd131b537529f71bfd0442436595953b466715f
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gettext.hpp
M src/gettext_boost.cpp
Log Message:
-----------
i18n: Add case-insenstitive icompare() function, document compare()
Commit: 7b3fdedc855ce5b71e6a4752e02536deb78b53c0
https://github.com/wesnoth/wesnoth/commit/7b3fdedc855ce5b71e6a4752e02536deb78b53c0
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
Log Message:
-----------
gui2/tfile_dialog: Sort directory entries ignoring character case
Commit: 0f83718965d74a144842dee44025e00d00473122
https://github.com/wesnoth/wesnoth/commit/0f83718965d74a144842dee44025e00d00473122
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M data/gui/window/file_dialog.cfg
Log Message:
-----------
gui2/tfile_dialog: Set maximum dialog height
Commit: 3fa0fc954897ed633b354ffe21e9b7508642e9c6
https://github.com/wesnoth/wesnoth/commit/3fa0fc954897ed633b354ffe21e9b7508642e9c6
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/widgets/text.cpp
M src/gui/widgets/text.hpp
Log Message:
-----------
gui2/ttext_: Add a public method for setting the selection range
Unlike the internal (protected) methods, this makes sure to call
update_canvas() when done so that e.g. text_box's highlight rectangle
is properly updated on the canvas with the right variables so that it's
drawn after we're done handling events.
Commit: 8056d638f17c1b1b8564020b7252745323a711a4
https://github.com/wesnoth/wesnoth/commit/8056d638f17c1b1b8564020b7252745323a711a4
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
M src/gui/dialogs/file_dialog.hpp
Log Message:
-----------
gui2/tfile_dialog: Add support for a filename extension hint
This allows setting a hint in save mode so that the name portion of the
filename will be selected whenever the user selects a file with a
matching extension on the fileview, and so that whenever the textbox is
cleared by code (e.g. when browsing into directories) it is pre-filled
with the extension with the cursor at the start.
With this, the dialog is now feature-complete compared to the GUI1
version.
Commit: 285bbe723777b53921075656258ee9fcb8c897c9
https://github.com/wesnoth/wesnoth/commit/285bbe723777b53921075656258ee9fcb8c897c9
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M projectfiles/CodeBlocks/wesnoth.cbp
M src/CMakeLists.txt
M src/SConscript
M src/editor/controller/editor_controller.cpp
M src/editor/map/context_manager.cpp
R src/filechooser.cpp
R src/filechooser.hpp
M src/gui/dialogs/editor/custom_tod.cpp
M src/gui/dialogs/editor/custom_tod.hpp
M src/menu_events.cpp
M src/preferences_display.cpp
R src/widgets/file_menu.cpp
R src/widgets/file_menu.hpp
Log Message:
-----------
gui: Remove GUI1 filechooser
This switches all existing callsites to using gui2::tfile_dialog, and
fixes a build issue due to editor/controller/editor_controller.cpp
relying on an indirect include from gui/dialogs/editor/custom_tod.hpp
for a full type declaration.
Commit: 2cc1f6692a94c684baffd1a82ef8b4f8cd0e2dce
https://github.com/wesnoth/wesnoth/commit/2cc1f6692a94c684baffd1a82ef8b4f8cd0e2dce
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.hpp
Log Message:
-----------
gui2/tfile_dialog: Clarify defaults
Commit: ddd3dc726196027fbd4ae78a7907126401613833
https://github.com/wesnoth/wesnoth/commit/ddd3dc726196027fbd4ae78a7907126401613833
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/preferences_display.cpp
Log Message:
-----------
preferences: Make wesnothd search starting point sane, simplify code
The previous logic reinvents filesystem::directory_name() in a
platform-dependent fashion (it will break if the wesnothd path in
preferences has backslashes on Windows, which is exactly what the GUI2
file dialog delivers), and uses the compile-time install prefix
(non-Windows platforms) or the current working dir (all platforms)
instead of using the game executable's directory, which we can reliably
obtain on Windows or Linux, and automatically fall back to the cwd
otherwise.
Using filesystem::get_exe_dir() as a starting point instead allows for a
much simpler and platform-independent logic (except for the .exe
extension for the binary on Windows, of course).
Commit: 8c14dc1872cde14b31fe5dfaf851a474da4b5809
https://github.com/wesnoth/wesnoth/commit/8c14dc1872cde14b31fe5dfaf851a474da4b5809
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/gui/dialogs/file_dialog.cpp
Log Message:
-----------
gui2/tfile_dialog: Make it so the fileview and textbox "share" the focus
This allows the user to use the arrow keys to select fileview entries,
and character keys to enter a name into the textbox below, just like in
the GUI1 version.
Thanks to celticminstrel and vultraz for the tip.
Commit: 95a192fe796a81d5329fcbc90a6626cb54736159
https://github.com/wesnoth/wesnoth/commit/95a192fe796a81d5329fcbc90a6626cb54736159
Author: Ignacio R. Morelle <shadowm at wesnoth.org>
Date: 2016-10-05 (Wed, 05 Oct 2016)
Changed paths:
M src/preferences_display.cpp
Log Message:
-----------
preferences: Reword part of the file dialog message
Compare: https://github.com/wesnoth/wesnoth/compare/e38dd8ff16c0...95a192fe796a
More information about the Commits
mailing list