Skip to content

Commit

Permalink
fix tip of day moving you to setting tab
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jan 5, 2024
1 parent 480db09 commit cf2bf8c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 5 additions & 5 deletions resources/data/hints.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Settings highlight (like search feature)
# hypertext_type = settings
# hypertext_settings_opt = name_of_settings (hover over settings value and copy last line of hover text)
# hypertext_settings_type = 1 (1 - 5 according to settings tab - to be channged to name of tabs instead of numbers)
# hypertext_settings_type = print ( {print, filament, sla_print, sla_material, printer} according to settings tab)
# hypertext_settings_category = Infill (name of panel - written on left in settings)
#
# Plater top toolbar highlight
Expand Down Expand Up @@ -67,7 +67,7 @@
text = Fuzzy skin\nDid you know that you can create rough fibre-like texture on the sides of your models using the<a>Fuzzy skin</a>feature? You can also use modifiers to apply fuzzy-skin only to a portion of your model.
hypertext_type = settings
hypertext_settings_opt = fuzzy_skin
hypertext_settings_type = 1
hypertext_settings_type = print
hypertext_settings_category = Layers and perimeters
disabled_tags = SLA

Expand Down Expand Up @@ -118,7 +118,7 @@ text = Set number of instances\nDid you know that you can right-click a model an
text = Combine infill\nDid you know that you can print the infill with a higher layer height compared to perimeters to save print time using the setting<a>Combine infill every</a>.
hypertext_type = settings
hypertext_settings_opt = infill_every_layers
hypertext_settings_type = 1
hypertext_settings_type = print
hypertext_settings_category = Infill
disabled_tags = SLA; simple

Expand All @@ -142,7 +142,7 @@ disabled_tags = SLA
text = Solid infill threshold area\nDid you know that you can make parts of your model with a small cross-section be filled with solid infill automatically? Set the<a>Solid infill threshold area</a>. (Expert mode only.)
hypertext_type = settings
hypertext_settings_opt = solid_infill_below_area
hypertext_settings_type = 1
hypertext_settings_type = print
hypertext_settings_category = Infill
enabled_tags = FFF; expert

Expand Down Expand Up @@ -207,7 +207,7 @@ hypertext_menubar_item_name = &Configuration Snapshots
text = Minimum shell thickness\nDid you know that instead of the number of top and bottom layers, you can define the<a>Minimum shell thickness</a>in millimeters? This feature is especially useful when using the variable layer height function.
hypertext_type = settings
hypertext_settings_opt = top_solid_min_thickness
hypertext_settings_type = 1
hypertext_settings_type = print
hypertext_settings_category = Layers and perimeters
disabled_tags = SLA

Expand Down
14 changes: 14 additions & 0 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,20 @@ std::string Preset::type_name(Type t) {
}
}

Preset::Type Preset::type_from_name(std::string name) {
if ("print" == name)
return Preset::TYPE_FFF_PRINT;
if ("filament" == name)
return Preset::TYPE_FFF_FILAMENT;
if ("sla_print" == name)
return Preset::TYPE_SLA_PRINT;
if ("sla_material" == name)
return Preset::TYPE_SLA_MATERIAL;
if ("printer" == name)
return Preset::TYPE_PRINTER;
return Preset::TYPE_INVALID;
}

std::string PresetCollection::section_name() const
{
return Preset::type_name(this->type());
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Preset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class Preset
return PrinterTechnology::ptUnknown;
}
static std::string type_name(Type t);
static Type type_from_name(std::string name);

Type type = TYPE_INVALID;

Expand Down
3 changes: 2 additions & 1 deletion src/slic3r/GUI/HintNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ void HintDatabase::load_hints_from_file(const boost::filesystem::path& path)
// highlight settings
} else if (dict["hypertext_type"] == "settings") {
std::string opt = dict["hypertext_settings_opt"];
Preset::Type type = static_cast<Preset::Type>(std::atoi(dict["hypertext_settings_type"].c_str()));
Preset::Type type = static_cast<Preset::Type>(Preset::type_from_name(dict["hypertext_settings_type"]));
assert(type != Preset::Type::TYPE_INVALID && wxGetApp().get_tab(type) != nullptr);
std::wstring category = boost::nowide::widen(dict["hypertext_settings_category"]);
HintData hint_data{ id_string, text1, weight, was_displayed, hypertext_text, follow_text, disabled_tags, enabled_tags, true, documentation_link, [opt, type, category]() { GUI::wxGetApp().sidebar().jump_to_option(opt, type, category); } };
m_loaded_hints.emplace_back(hint_data);
Expand Down

0 comments on commit cf2bf8c

Please sign in to comment.