mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 03:00:38 +08:00
Use std::string internally instead of wxString.
This commit is contained in:
parent
ad22956391
commit
08611ffc8c
@ -119,7 +119,7 @@ void Plater::add() {
|
||||
const auto& input_files{open_model(this, *(this->settings), wxTheApp->GetTopWindow())};
|
||||
for (const auto& f : input_files) {
|
||||
Log::info(LogChannel, (wxString(L"Calling Load File for ") + f).ToStdWstring());
|
||||
this->load_file(f);
|
||||
this->load_file(f.ToStdString());
|
||||
}
|
||||
|
||||
// abort if no objects actually added.
|
||||
@ -144,7 +144,7 @@ void Plater::add() {
|
||||
|
||||
}
|
||||
|
||||
std::vector<int> Plater::load_file(const wxString& file, const int obj_idx_to_load) {
|
||||
std::vector<int> Plater::load_file(const std::string file, const int obj_idx_to_load) {
|
||||
|
||||
auto input_file {wxFileName(file)};
|
||||
settings->skein_directory = input_file.GetPath();
|
||||
@ -158,7 +158,7 @@ std::vector<int> Plater::load_file(const wxString& file, const int obj_idx_to_lo
|
||||
progress_dialog->Pulse();
|
||||
//TODO: Add a std::wstring so we can handle non-roman characters as file names.
|
||||
try {
|
||||
model = Slic3r::Model::read_from_file(file.ToStdString());
|
||||
model = Slic3r::Model::read_from_file(file);
|
||||
} catch (std::runtime_error& e) {
|
||||
show_error(this, e.what());
|
||||
Slic3r::Log::error(LogChannel, LOG_WSTRING(file << " failed to load: " << e.what()));
|
||||
@ -177,10 +177,10 @@ std::vector<int> Plater::load_file(const wxString& file, const int obj_idx_to_lo
|
||||
|
||||
for (auto i = 0U; i < model.objects.size(); i++) {
|
||||
auto object {model.objects[i]};
|
||||
object->input_file = file.ToStdString();
|
||||
object->input_file = file;
|
||||
for (auto j = 0U; j < object->volumes.size(); j++) {
|
||||
auto volume {object->volumes.at(j)};
|
||||
volume->input_file = file.ToStdString();
|
||||
volume->input_file = file;
|
||||
volume->input_file_obj_idx = i;
|
||||
volume->input_file_vol_idx = j;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ private:
|
||||
Plate2D* canvas2D {}; //< 2D plater canvas
|
||||
|
||||
/// Handles the actual load of the file from the dialog handoff.
|
||||
std::vector<int> load_file(const wxString& file, const int obj_idx_to_load = -1);
|
||||
std::vector<int> load_file(const std::string file, const int obj_idx_to_load = -1);
|
||||
|
||||
const std::string LogChannel {"GUI_Plater"}; //< Which log these messages should go to.
|
||||
|
||||
|
@ -12,9 +12,9 @@ namespace Slic3r { namespace GUI {
|
||||
|
||||
class PlaterObject {
|
||||
public:
|
||||
wxString name {L""};
|
||||
std::string name {""};
|
||||
size_t identifier {0U};
|
||||
wxString input_file {L""};
|
||||
std::string input_file {""};
|
||||
int input_file_obj_idx {-1};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user