mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Fix fs::path <-> wxString conversions
This commit is contained in:
parent
760b1cd9bc
commit
2db0906071
6 changed files with 51 additions and 26 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue