Moved back open_model to GUI_App

This commit is contained in:
YuSanka 2018-09-20 13:12:35 +02:00
parent bcbeb56217
commit e86f149cbd
3 changed files with 18 additions and 15 deletions

View file

@ -545,7 +545,7 @@ void add_menus(wxMenuBar *menu, int event_preferences_changed, int event_languag
} }
void open_model(wxWindow *parent, wxArrayString& input_files){ void open_model(wxWindow *parent, wxArrayString& input_files){
auto dialog = new wxFileDialog(parent ? parent : GetTopWindow(), auto dialog = new wxFileDialog(parent /*? parent : GetTopWindow()*/,
_(L("Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):")), _(L("Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):")),
g_AppConfig->get_last_dir(), "", g_AppConfig->get_last_dir(), "",
MODEL_WILDCARD, wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST); MODEL_WILDCARD, wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST);

View file

@ -8,6 +8,7 @@
#include <wx/display.h> #include <wx/display.h>
#include <wx/menu.h> #include <wx/menu.h>
#include <wx/menuitem.h> #include <wx/menuitem.h>
#include <wx/filedlg.h>
#include "Utils.hpp" #include "Utils.hpp"
#include "GUI.hpp" #include "GUI.hpp"
@ -222,20 +223,21 @@ void GUI_App::update_ui_from_settings(){
mainframe->update_ui_from_settings(); mainframe->update_ui_from_settings();
} }
// wxArrayString GUI::open_model(wxWindow* window){
// auto dialog = new wxFileDialog(window ? window : GetTopWindow(), void GUI_App::open_model(wxWindow *parent, wxArrayString& input_files)
// _(L("Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):")), {
// app_config->get_last_dir(), "", get_model_wildcard(), auto dialog = new wxFileDialog(parent ? parent : GetTopWindow(),
// wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST); _(L("Choose one or more files (STL/OBJ/AMF/3MF/PRUSA):")),
// if (dialog->ShowModal() != wxID_OK) { app_config->get_last_dir(), "",
// dialog->Destroy; MODEL_WILDCARD, wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST);
// return; if (dialog->ShowModal() != wxID_OK) {
// } dialog->Destroy();
// wxArrayString input_files; return;
// dialog->GetPaths(input_files); }
// dialog->Destroy();
// return input_files; dialog->GetPaths(input_files);
// } dialog->Destroy();
}
void GUI_App::CallAfter(std::function<void()> cb) void GUI_App::CallAfter(std::function<void()> cb)
{ {

View file

@ -42,6 +42,7 @@ public:
void recreate_GUI(); void recreate_GUI();
void system_info(); void system_info();
void open_model(wxWindow *parent, wxArrayString& input_files);
static bool catch_error(std::function<void()> cb, static bool catch_error(std::function<void()> cb,
// wxMessageDialog* message_dialog, // wxMessageDialog* message_dialog,
const std::string& err); const std::string& err);