Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default page selection #2569

Merged
merged 1 commit into from Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libslic3r/AppConfig.cpp
Expand Up @@ -149,6 +149,9 @@ void AppConfig::set_defaults()

if (get("use_inches").empty())
set("use_inches", "0");

if (get("default_page").empty())
set("default_page", "0");
}
else {
#ifdef _WIN32
Expand Down
2 changes: 2 additions & 0 deletions src/slic3r/GUI/GUI_App.cpp
Expand Up @@ -1107,6 +1107,8 @@ void GUI_App::post_init()
//#endif
if (is_editor())
mainframe->select_tab(size_t(0));
if (app_config->get("default_page") == "1")
mainframe->select_tab(size_t(1));
mainframe->Thaw();
plater_->trigger_restore_project(1);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", end load_gl_resources";
Expand Down
4 changes: 4 additions & 0 deletions src/slic3r/GUI/Preferences.cpp
Expand Up @@ -979,6 +979,9 @@ wxWindow* PreferencesDialog::create_general_page()
std::vector<wxString> Units = {_L("Metric") + " (mm, g)", _L("Imperial") + " (in, oz)"};
auto item_currency = create_item_combobox(_L("Units"), page, _L("Units"), "use_inches", Units);

std::vector<wxString> DefaultPage = {_L("Home"), _L("Prepare")};
auto item_default_page = create_item_combobox(_L("Default Page"), page, _L("Set the page opened on startup."), "default_page", DefaultPage);

auto item_mouse_zoom_settings = create_item_checkbox(_L("Zoom to mouse position"), page, _L("Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center."), 50, "zoom_to_mouse");
auto item_use_free_camera_settings = create_item_checkbox(_L("Use free camera"), page, _L("If enabled, use free camera. If not enabled, use constrained camera."), 50, "use_free_camera");

Expand Down Expand Up @@ -1039,6 +1042,7 @@ wxWindow* PreferencesDialog::create_general_page()
sizer_page->Add(item_language, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_region, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_currency, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_default_page, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_mouse_zoom_settings, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_use_free_camera_settings, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_hints, 0, wxTOP, FromDIP(3));
Expand Down