Commit Graph
62 Commits
Author SHA1 Message Date
HanifKoh 4895bc03b4 Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced (#16099)
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced

Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.

clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.

* Remove Unused Project Includes From Files With Platform-Specific Code

A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block.

* Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass

The platform-file pass treated pchheader.hpp as an ordinary header and
emptied it, and left GUI_Preview.hpp and 14 other files relying on
headers they no longer reached directly.

* Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call

* Include Headers That Files Reached Through Ones the Cleanup Removed

* Drop Includes Duplicated by the Cleanup or by Main's Own Additions

* Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
2026-10-05 16:47:17 +08:00
HanifKoh 84657ff11e Add Missing Includes Across the Remaining Sources and Tests (#16071)
* Ignore Clipper, libpng, mcut and Boost.Polygon Internals in clang-tidy

Each only works through a wrapper or umbrella header: libslic3r/clipper.hpp or clipper_z.hpp configure Clipper before including it, png.h pulls in libpng's config headers, and Boost.Polygon's headers only compile through polygon.hpp or voronoi.hpp.

* Ignore minilzo's Config Headers in clang-tidy

lzoconf.h and lzodefs.h are internal to minilzo.h, which is what the code includes.

* Add Missing Includes Across the Remaining Sources and Tests

Covers src/slic3r/Utils, src/slic3r/plugin, src/slic3r/Config, src/libvgcode, src/dev-utils, src/OrcaSlicer.cpp and tests/, the directories left after src/slic3r/GUI and src/libslic3r. Generated with clang-tidy misc-include-cleaner. libvgcode's own headers are included by relative path as in the rest of that library, and Catch2 and pybind11 with angle brackets as elsewhere in the repo.

* Make the GUI and Test Headers Compile on Their Own

Each now includes, or forward-declares, what it uses instead of relying on what its includers happened to include first. Headers that only compile on one platform, or that nothing built includes, are left alone.

* Keep Windows and nanosvg Setup Ahead of the Added Includes

OrcaSlicer.cpp and several tests set _WIN32_WINNT, WIN32_LEAN_AND_MEAN or NOMINMAX before including Windows.h, and the profile validator defines NANOSVG_IMPLEMENTATION before any libslic3r header. The added includes had landed above those blocks, which broke the Windows build.

* Add the GUI Includes the First Pass Missed

Covers headers that only became editable once they compiled on their own, and wx symbols whose suggested header changed as the clang-tidy ignore list grew after the src/slic3r/GUI pass.

* Keep the Added Test Includes Below the NOMINMAX Guard

test_marchingsquares.cpp and test_texture_displacement.cpp had includes inside #ifndef NOMINMAX, which the tests inherit as defined on Windows from libslic3r, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory, as in #16068.
2026-10-03 13:45:21 +08:00
HanifKoh 1a5f91d727 Add Missing Includes Across src/slic3r/GUI (#16048)
* Add Missing Includes Across src/slic3r/GUI

Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained.

* Drop the OS-Specific Includes Added Outside Their Platform Guards

GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build.

* Add the clang-tidy Configuration That Generated These Includes

Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly.

* Match Windows Paths in the clang-tidy Ignore List

Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
2026-10-02 14:56:56 +08:00
Kiss Lorand 0a630738f1 Fix untranslated language dialog captions (#15600) 2026-09-10 18:15:06 -03:00
Kris Austin 36740ffdd8 build: clear 53 warnings - discarded values and i18n markers (#15421)
build: clear 53 unused value warnings

49 of them are deliberate i18n markers. L(s) expands to s, so
L("Main Extruder"); is a string literal as a statement and its value is
discarded. The strings have to stay, because the real values come from
printers/*.json at runtime and xgettext cannot scan those. Each block is
now a static const char *const markers[], which uses the values rather
than discarding them. Extraction is unchanged: the xgettext invocation
from scripts/run_gettext.bat gives 76 msgids over the two marker files
before and after, with identical msgid and msgctxt sets.

The other 4 are statements with no effect. AMSItem.cpp:117 and :174
construct and drop a wxColour(255, 255, 255); AMS_TRAY_DEFAULT_COL is
that colour, and the line above already assigns it. UpgradePanel.cpp:865
reads a member and drops it.

wgtDeviceNozzleSelect.cpp:269 writes
if (item; auto ptr = m_nozzle_rack.lock()), which puts the null check in
the init-statement position where its value is discarded, so the check
never runs, and sGetNozzlePosId then dereferences item. Nothing reaches
that today, because the only sender of the event sets itself as the
event object and the dynamic_cast always succeeds. The check now runs.
2026-08-31 10:55:42 -03:00
Ian Bassi d6cb667b89 Localization refactor pt 2 (#14907) 2026-07-24 09:41:24 -03:00
Alexandre Folle de Menezes ad57020139 Fix spacing issues (#12404) 2026-02-23 23:31:23 -03:00
Noisyfox 614612ed38 Merge branch 'main' into dev/p2s-pr
# Conflicts:
#	src/slic3r/GUI/DeviceErrorDialog.cpp
2025-11-09 12:35:32 +08:00
Alexandre Folle de Menezes 14dd1078bf Spellcheck translatable strings (#11242)
* Spellcheck translatable strings
2025-11-09 11:52:27 +08:00
xin.zhang e686424e8c FIX: FanControlPopupNew::init_names
JIRA: [STUDIO-14993]
Change-Id: Ie33bcde858ef379deaaeea99f790fd880eb0184e
(cherry picked from commit 3b7016d5598b2e655446019d8ad710e1612281a2)
2025-10-28 15:30:03 +08:00
xin.zhang 1ea5aa9017 FIX: FanControlPopupNew update the Layout and Refresh
JIRA: [STUDIO-14785]
Change-Id: I91c930d0e1b92dd5f2e4d21f3d851e5826307071
(cherry picked from commit 2f25351f330c1c3c6f2bda7a178946b923a4cc2f)
2025-10-28 15:29:57 +08:00
xin.zhang abefa5ec4d ENH: update text for Fans
jira: [STUDIO-14707]
Change-Id: I46a8ea876e2fb6f7dc985729bb3aee5a27889743
(cherry picked from commit 4b9a9f6463c7be55c9070b1847f7f545574d0fe5)
2025-10-28 15:29:54 +08:00
xin.zhang 2339f5a789 ENH: update airducts
jira: [STUDIO-13298]
Change-Id: I95905b6fd8a29617eeaff24e01bc64b4d7008a7d
(cherry picked from commit f212752cfcfde27d38444d77eda2938990a6cf78)
2025-10-28 15:29:47 +08:00
xin.zhang fb2266f901 ENH: update airducts
jira: [STUDIO-13296]
Change-Id: If5805345b0429504eba551a3115d8fcedd199c6d
(cherry picked from commit c586f91e63e46ab8910bb7aca1537ba4cf47396a)
2025-10-28 15:29:47 +08:00
Noisyfox 83c167450b Some dark mode fix 2025-10-08 17:05:55 +08:00
Noisyfox a9c0490c68 Update color 2025-10-05 16:02:17 +08:00
xin.zhang db05e4ac64 ENH: update airducts
jira: [STUDIO-13296]
Change-Id: I5cdb34cc254933be9a91313462a6b03b0dca117b
(cherry picked from commit fbf88ce6f226496723344e60f57632eadfaf5ee9)
2025-10-03 22:18:33 +08:00
xin.zhang 4a787f6ff8 ENH: clean codes about device
JIRA: [STUDIO-13609]
Change-Id: I591de7033360b9570600006cfbce2148a8d031d5
(cherry picked from commit e9c774be8f4c89b8dafa14ef56913612fb68bd0c)
2025-10-02 09:30:48 +08:00
xin.zhang 55e3bd1a4d FIX: update the data on init
jira: [STUDIO-13453]
Change-Id: I5a3fed24b0eb0a6e7da7ceff3450da95f29fdaae
(cherry picked from commit 8057ee846c8dbb6d19006ccaaf56c9fabcb66d3f)
2025-09-30 10:51:03 +08:00
xin.zhang c415eea556 FIX: use data to check the fan control
jira: [STUDIO-12917]
Change-Id: I74f816a21beb2dfb4191bb73298882efd22a6191
(cherry picked from commit 4f0f4fc64802d777d11105d433e59f57168bfd66)
2025-09-28 11:35:57 +08:00
xin.zhang 1e9febbe4d ENH: add some support for fan control
jira: [STUDIO-12076] [STUDIO-12373]
Change-Id: I04e23acc802987dc7a657274074abb961f692896
(cherry picked from commit 359d52c9139b7a1aae59b990dc03f45ce4a1bc89)
(cherry picked from commit 9e16d9a4a6ce059dc134ffd388b753490dff0946)
(cherry picked from commit 4cdd1937fea90c3dd1cf0c73a7cd5172346abb40)
2025-09-28 11:35:50 +08:00
xin.zhang 6f7704470f FIX: do not change others if mode not changed
JIRA: [STUDIO-12375]
Change-Id: I2ba64346706f22a6f143242c9236605de033754b
(cherry picked from commit 7b031c1536440dad942d536c831e316c5c57e677)
2025-09-25 16:25:59 +08:00
Erwin Ried ad6681fa9d Update FanControl.cpp
(cherry picked from commit ce9a5c6bc9688bdb77c31a2c7daf128a26ab9695)
2025-09-24 13:12:55 +08:00
xin.zhang 98a4aee666 FIX: do not popup if mode not changed
jira: [STUDIO-12375]
Change-Id: Ifc5ac737d49b7482de86f031bbc4bf2a6da6744e
(cherry picked from commit db91857bda4b8ecf66469dbf3c0c8c5a41c84ef2)
2025-09-24 11:14:52 +08:00
zhou.xu 517b6c09a8 FIX:WxColour (0x00AE42) represents bgr input, incorrect use
jira: STUDIO-12347
Change-Id: If03e23f2ee7cbb5dcb124453fb0a1ea67c3633a0
(cherry picked from commit 8a22fab6d73fe2694b5006712d5e72619ddea51c)
2025-09-24 10:40:45 +08:00
xin.zhang 21f9866847 FIX: FanControl the info text display wrap
jira: [STUDIO-12088]
Change-Id: Ic6a1d9ea60e85859f412bc65184b0eb085bba5b2
(cherry picked from commit 8dd0cb4901f43bcea062eac893466e58c0c35e7e)
2025-09-23 09:00:52 +08:00
xin.zhang 6547cb766c ENH: update air condition control
jira: [STUDIO-11373]
Change-Id: Ib25952165ec5489ef51ec7f5472fb319b0328ffc
(cherry picked from commit 307c83bb8434c40a3c7f0678a1c2abf2b361cd7a)
2025-09-21 13:48:01 +08:00
Peter Feerick 230eb6c9f5 fix: typo "pringing"
(cherry picked from commit c65faf05b3a2a0b77c639374bb96f0385e85f7bf)
2025-09-21 13:48:00 +08:00
xin.zhang 4cd0dc883f FIX: check the return value
jira: [STUDIO-11485]
Change-Id: I60f7d571cd93b0e4f26a965f54c19987843c6265
(cherry picked from commit 85378a7e99bca847bbcb51be1eeaa137eb0a06ea)
2025-09-21 13:47:57 +08:00
xin.zhang 554c192be1 FIX: do not need the button
jira: [STUDIO-11231]
Change-Id: Ia2425864b37d3b158d5c37978e1db04dfc6e63c1
(cherry picked from commit 90ca1c5b4b977fbe98d37718a363c2a31265816e)
2025-09-21 13:47:57 +08:00
xin.zhang c743085c4e ENH: add "Don't show again" to fan speed control
jira: [STUDIO-11231]
Change-Id: I160d122155302195edf4b97e8b92e96350f9d600
(cherry picked from commit 0ba097de36efd077244ea3d1f435c9e5dc7f9637)
2025-09-21 13:47:51 +08:00
xin.zhang d61b2a7b73 FIX: the fan speed control in mac OS
jira: [STUDIO-9566]
Change-Id: I781ee149a2b184ee8d559dbb494798386e67e059
(cherry picked from commit 77dc987ad58534b033b025b9d47bb806718667c3)
2025-09-18 11:06:17 +08:00
xin.zhang 193d2dc598 FIX: update the panel
jira: [STUDIO-9241]
Change-Id: I9a309594814e0547f7a6ef247ad710636f478b79
(cherry picked from commit 99ec1acc276800b8fcfe933fb224156a7890a7a6)
2025-09-17 23:30:34 +08:00
xin.zhang 198c78cac9 FIX: the DPI issue
jira: [STUDIO-9238]
Change-Id: I8ab364402358b8b21e6768ecdd0da9cfe6541777
(cherry picked from commit 6dda5f3e523e79485cd0f10c333849fbaa3e0851)
2025-09-17 23:07:08 +08:00
xin.zhang 740f7eabb1 FIX: use dialog instead of popup window
jira: [STUDIO-10692]
Change-Id: I85e8da120946fc6ff845c9b88d4f1594e313652b
(cherry picked from commit 7115c1ca177e98c2931517d748ce4d63d3a067da)
2025-09-17 21:53:27 +08:00
xin.zhang 875d461120 FIX: the tab change display
jira: [STUDIO-9748]
Change-Id: I3178a43ec9de091790b1df760c0b029c0f03229e
(cherry picked from commit 96c2cff2828c4f541f8aa5f59efabcbf0c0df9ef)
2025-09-17 14:04:11 +08:00
tao wang 0e763dd300 ENH:Optimize translation
Change-Id: Ic45baaa974af044a1bc166faf6e27ca5ee4e155b
(cherry picked from commit 4a8304486789965c85a498d72250ea84088730a8)
2025-09-10 16:23:33 +08:00
xin.zhang 20b10ead1e FIX: update some translation
jira: [none]
Change-Id: I6b87aaebe880c925df4bc2bb9234b53b15abb773
(cherry picked from commit 1ed22291281637a8f8d7631274ea2c9fd6ea7ac4)
2025-09-10 09:25:02 +08:00
tao wang 1052036719 ENH:allow fan control when printing
jira:[STUDIO-9700]

Change-Id: I3637705b8c9dfe1b35766bf35dab2a286ee1e7a1
(cherry picked from commit 8f5887735a31cffab94b27d937479bbcb5da487d)
2025-09-10 07:29:31 +08:00
tao wang 8a58583122 FIX:fixed fan control issue on macOS
Change-Id: Id5b31ad46d3cb521b2d5252e6656037605e11d73
(cherry picked from commit c0899e05eff3dd906cc8ee5d8353a9abcefedaa2)
2025-09-09 16:53:40 +08:00
Kunlong Ma 9e16287b21 FIX: hide fan when device not in fdm
JIRA: none

Change-Id: I14a6e01b4e0950ca1bc3c805fe00313cfd7caf06
(cherry picked from commit c12b4f13911a7f6057eced54dba9e41cf75985ea)
2025-09-09 16:52:44 +08:00
xin.zhang d6c92423d7 FIX: update some translation
jira: none
Change-Id: I7bc210c054480ce5d2b10d714a7dfd63699dfed9
(cherry picked from commit 9e29cd3d213b1c63e7fcb4fce6664b8a1bc31956)
2025-09-07 21:57:37 +08:00
Kunlong Ma 81c7c8f9dc ENH: Restrictions on setting the air duct mode during printing
JIRA: STUDIO-9350

Change-Id: Ie6442eccfef78d5431316f91b68fd0e55d4644aa
(cherry picked from commit eaafe82f6f14462a1043db944f8e6763a822de12)
2025-09-07 00:47:35 +08:00
xin.zhang 88938ad5dd FIX: update some message
jira: [STUDIO-9148] [STUDIO-9348] [STUDIO-9390]
Change-Id: I7fe2a4744a9b21db990ac819873817b0b5c0820b
(cherry picked from commit 8891bbcf17574b67ba507c9223c57acea59afd1f)
2025-09-07 00:10:32 +08:00
Kunlong Ma 1e44033480 FIX: fix fan issue
JIRA: STUDIO-9277 STUDIO-9280 STUDIO-9238 STUDIO-9239 STUDIO-9190
STUDIO-9189 STUDIO-9191

Change-Id: Id70f02fa40369d38c082d2d5a71a6b0808938e38
(cherry picked from commit fc7a2d28f27115eacd8bff5d713e08db9f310205)
2025-09-06 22:22:08 +08:00
Kunlong Ma 5233702681 NEW: new fan ctrl
JIRA: none

Change-Id: I4e84d455fa728dffb00706f4c07310fcd1b8335c
(cherry picked from commit 0a739fe087933cc89af541817315c7a3d6096b22)
2025-08-28 11:29:00 +08:00
SoftFever 7082e945b1 Revert "Fix Compile Warnings (#5963)"
This reverts commit b83e16dbdd.

Found regressions like auto orientation didn't work anymore after this change, revert it
2024-08-12 00:00:20 +08:00
OcraftyoneandSoftFever b83e16dbdd Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor

* Fix use of wxTimerEvent

* Fix unrecognized character escape sequence

* Fix signed/unsigned mismatch

At least as much as possible without significantly altering parts of the application

* Clean unreferenced variables

* fix mistyped namespace selector

* Update deprecated calls

* Fix preprocessor statement

* Remove empty switch statements

* Change int vector used as bool to bool vector

* Remove empty control statements and related unused code

* Change multi character constant to string constant

* Fix discarded return value

json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured.

* Rename ICON_SIZE def used by MultiMachine

By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future.

* Remove unused includes

* Fix linux/macOS compilation

* Hide unused-function errors on non-Windows systems

* Disable signed/unsigned comparison mismatch error

* Remove/Disable more unused variables

Still TODO: check double for loop in Print.cpp

* Remove unused variable that was missed

* Remove unused variables in libraries in the src folder

* Apply temporary fix for subobject linkage error

* Remove/Disable last set of unused variables reported by GCC

* remove redundant for loop

* fix misspelled ifdef check

* Update message on dialog

* Fix hard-coded platform specific modifier keys

* Remove duplicate for loop

* Disable -Wmisleading-indentation warning

* disable -Wswitch warning

* Remove unused local typedefs

* Fix -Wunused-value

* Fix pragma error on Windows from subobject linkage fix

* Fix -Waddress

* Fix null conversions (-Wconversion-null)

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2024-07-29 21:00:26 +08:00
SoftFever 374f78c768 Revert to WxWidgets 3.1.5 (#3249)
* revert to WxWidgets 3.1.5

* update nanosvg unicode path
2023-12-23 17:44:09 +08:00
25a055491e Update wxWidgets to v3.2.1 (#2905)
* Upgrade wxWidgets to 3.2.1
Based on prusa3d/PrusaSlicer@9a7e024

Co-authored-by: tamasmeszaros <meszaros.q@gmail.com>

* Implement BitmapCache

* update wxExtensions while keeping legacy items

* update dc.DrawBitmap calls to use get_bitmap

* Fix GetSize/Width/Height calls

* update BitmapComboBox

* fix ifndef in wxExtensions.hpp

* update my todos to OcraftyoneTODO

* Get to a compilable state
Everything seems to be working (including the plater). I am not seeing any graphical issues

* fix extruder color icons

* fix crash on opening support tab

* remove GetBmpSize method from DropDown.cpp

* Update TextInput to use bitmap bundles

* update a TODO after testing

* fix the rendering of the icons on combobox

* fix a few todos

* fix WipeTowerDialog.cpp

* Overhaul WipeTowerDialog

Removed simple version of the dialog since BBS removed the functionality but left the code.
Center the table (only seen when the table is smaller than the minimum size of the dialog)
Fix issue where editing a value causes the m_min_flush_label to change colors slightly
Fix an issue where changing a value or running an auto calc changes the disabled value from "-" to "0"

* update a few todos

* Update some todos

* Show dropdown when editing is started

* Update NanoSVG.cmake

Update NanoSVG to work with PR #2780

* Dim the icon on ComboBox when disabled

* solve ObjectDataViewModel todos

leaving colPrint and colEditing cases alone as it does not seem to impact anything

* Update names in wxExtensions

-Rename msw_rescale to sys_color_changed
-Replace GetBmpSize, GetBmpWidth, GetBmpHeight with renamed version (same name without "Bmp")

Both of these changes were also made by PrusaSlicer.

Original Commit: Prusa3D/PrusaSlicer@066b567
Co-authored-by: YuSanka <yusanka@gmail.com>

* update BitmapCache::from_svg

disable finding bundle in the cache to match load_svg
update to match values used in load_svg

* Update ScalableButton

change the signature and remove functions/vars pertaining to a default bmp
fix TODOs in ScalableButton

Original Commit: Prusa3D/PrusaSlicer@066b567
Co-authored-by: YuSanka <yusanka@gmail.com>

* fix up some more todos in wxExtensions

* update ScalableBitmap to use bmp bundles

use wxBitmapBundle by default
add flag to use old scaled bitmap function (specifically to solve issue with advanced toggle)

* attempt to fix macos deps build

* fix ubuntu build

* Revert "attempt to fix macos deps build"

Mistakenly made change to wrong file

This reverts commit d9c20b5121.

* update wxWidgets patch

an attempt to fix macOS build

* Remove duplicate variable from OrcaSlicer.cpp

* Fix macOS build issue

* Fix blank DataViewItem being added to objects list

* Filament ComboBox editor updates

-Add show drop down feature to ObjectTable
-Call finish editing when ComboBox is closed in ObjectList

* remove Apple specific declarations missed during refactor

* delete old wxWidgets patch

* fix ubuntu seg fault

* include patch from #2926

* update patch to include wxWidgets/wxWidgets@991a74c

* fix deps not compiling on Windows

* update WipeTowerDialog

relocates the recalculate button back to its previous position
changes the wording of the tip message label
add spacing below the matrix

* finish patching wxWidgets

from prusa3d/PrusaSlicer@f8477d1 and prusa3d/PrusaSlicer@066b567

Co-authored-by: YuSanka <yusanka@gmail.com>

* fix combobox crash

* revert outside plate changes

---------

Co-authored-by: tamasmeszaros <meszaros.q@gmail.com>
Co-authored-by: YuSanka <yusanka@gmail.com>
2023-12-04 15:21:49 +00:00