diff options
author | Vojtech Kral <vojtech@kral.hk> | 2019-01-02 17:11:05 +0300 |
---|---|---|
committer | Vojtech Kral <vojtech@kral.hk> | 2019-01-02 17:53:52 +0300 |
commit | 2db0906071495ea2ddedef0a30a076954fb49007 (patch) | |
tree | 08d93d1400002cecf817cc3f89dc7bbe0117ec40 /src/slic3r/GUI/GUI.cpp | |
parent | 760b1cd9bc9485c4995f25aa20f80f77ec6205e6 (diff) |
Fix fs::path <-> wxString conversions
Diffstat (limited to 'src/slic3r/GUI/GUI.cpp')
-rw-r--r-- | src/slic3r/GUI/GUI.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 04e9a315c..0761845b6 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -4,6 +4,7 @@ #include "WipeTowerDialog.hpp" #include <assert.h> +#include <string> #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> @@ -314,6 +315,20 @@ std::string into_u8(const wxString &str) return std::string(buffer_utf8.data()); } +wxString from_path(const boost::filesystem::path &path) +{ +#ifdef _WIN32 + return wxString(path.string<std::wstring>()); +#else + return wxString::FromUTF8(path.string<std::string>()); +#endif +} + +boost::filesystem::path into_path(const wxString &str) +{ + return boost::filesystem::path(str.wx_str()); +} + bool get_current_screen_size(wxWindow *window, unsigned &width, unsigned &height) { const auto idx = wxDisplay::GetFromWindow(window); |