The directive sat at global scope in a header that DeviceManager.hpp
includes, so most of the GUI compiled with all of std in the global
namespace. 42 files had come to rely on it, mostly for string, vector
and unordered_map, four of them for the ""sv and ""ms literals.
Those sites are qualified. GCodeViewer.cpp spelled the type as
std::vector<::string>, which only resolved through the directive. The
files that use the ""sv and ""ms literals get a file-scope
"using namespace std::string_view_literals;" or
"using namespace std::chrono_literals;", as other sources already do.
- ClipperUtils.hpp imported jtMiter, jtRound and jtSquare into the
global namespace for every includer. No code names them there.
- BBLStatusBar.hpp, BBLStatusBarBind.hpp, BBLStatusBarPrint.hpp,
BBLStatusBarSend.hpp and ProgressStatusBar.hpp re-exported their class
into Slic3r::GUI. Nothing refers to the class through that namespace.
- Jobs/SendJob.hpp, Jobs/BindJob.hpp, Jobs/UpgradeNetworkJob.hpp and
AuxiliaryDataViewModel.hpp declared "namespace fs = boost::filesystem;"
at global scope without using it.
Each of these headers put a using or namespace alias at global or
namespace scope, which every includer inherited:
- BBLTopbar.hpp: "using namespace Slic3r::GUI;" at global scope, reached
through MainFrame.hpp. Seven source files used GUI names unqualified
outside the namespace because of it, one of them as "::RadioBox".
- IMSlider.hpp and TickCode.hpp: "using namespace CustomGCode;" inside
Slic3r.
- ProjectTask.hpp, Jobs/PrintJob.hpp and ConfigWizard_private.hpp:
"namespace fs = boost::filesystem;". PresetBundle.cpp and GUI_App.cpp
had no alias of their own.
- VoronoiUtils.hpp: "using VD = Slic3r::Geometry::VoronoiDiagram;" at
global scope.
The headers now spell the names out. Source files that used them get
the qualifier, or a using of their own where there are many uses.
151 using-directives, using-declarations, type aliases and namespace
aliases in source and test files that nothing refers to: the name is
never used, it duplicates a using already in scope, or the code sits
inside the namespace it names. Each one was removed on its own and the
file still compiled, both as it is and with every header-level using
taken away, so none of them was only redundant because a header leaks
the same name.
With the using gone, 28 #include lines and one forward declaration had
no other reference left in their file (boost/optional.hpp without any
optional, property_tree headers without any ptree) and go with it.
No header is touched.
* Stop Leaking json Through Headers and Drop Includes Kept Only for the Name
AppConfig.hpp, DeviceManager.hpp and UserManager.hpp carried a global
"using namespace nlohmann;", json_diff.hpp a global "using json =
nlohmann::json;" and PrinterFileSystem.h a global "using nlohmann::json;".
Every file that included one of them, directly or not, could write a
bare json, and 63 did without declaring it.
The last two also made the include checker treat json_diff.hpp and
PrinterFileSystem.h as the headers that provide json, so they were
included from files that use nothing else from them: 57 of the 59
includers of json_diff.hpp never name json_diff.
The five statements are removed. Headers that use the type now spell
nlohmann::json, source files declare their own "using json =
nlohmann::json;", and the includes that only supplied the name are
dropped or replaced by <nlohmann/json.hpp>.
Eight files reached json_diff.hpp only through an include that is now
gone and with it lost that header's "using namespace std;". The std
names they used unqualified are qualified.
* Declare json in OrcaSlicer.cpp on Every Platform
OrcaSlicer.cpp had its "using namespace nlohmann;" and the json include
inside the Linux-only include block, so on Windows and macOS it took
json from AppConfig.hpp's global directive, which is gone. The include
and a "using json = nlohmann::json;" now sit outside the block.
* fix: crash in LAN mode when the printer type is not known yet
InputIpAddressDialog::set_machine_obj() built the help image name from
the printer config with no fallback. If the printer type is empty or
unknown, for example before the first push_all arrives on a flaky LAN
link, the lookup returns "" and create_scaled_bitmap("_en") throws.
The dialog is opened by the "LAN Connection Failed" handlers in
MediaPlayCtrl and MediaFilePanel, where nothing catches the exception,
so the app crashes.
Use input_access_code_x1 when there is no image, and the _cn image for
zh_CN, the same as ConnectPrinterDialog::init_bitmap().
Ported from Bambu Studio 52ca2ec5d1.
* fix: return an empty bitmap for an empty icon name
create_scaled_bitmap() threw when a caller passed an empty name. That
happens when a printer config lookup has no entry, for example in
AMSSetting::update_ams_img() for a printer type with no AMS image.
Log an error and return wxNullBitmap instead.
Ported from Bambu Studio 52ca2ec5d1.
They now sit above the features' framed list as fixed view switches:
a click no longer selects them, they stay put while the features scroll,
their eyes line up with the features' eyes, and their labels dim when
hidden. Ctrl+Shift+O toggles the Origin from the keyboard, as
Ctrl+Shift+B does the Bed. The test script's position for the first
feature row is calculated, not measured, and needs re-measuring on the
test setup.
The bed's show/hide state is now remembered across sessions like the Origin
row's, shown by default. The GUI ladder's ribbon x-coordinates are shifted by
the removed checkbox's derived width and still need re-measuring on the rig.
Sketch on a picked flat face or reference plane opens the sketch on it at once. With nothing
picked it no longer enters sketch mode: the reference planes and axes come up, and the plane or
flat face clicked next opens the sketch and puts them away. Esc or Cancel leaves without one.
A picked plane is used up by the sketch on it and dropped by Esc or a click on nothing, the plane
prompt is no longer replaced by a stale tool hint, and clicking the face a sketch was just
cancelled on picks that face again rather than the whole body.
Esc and Cancel now put the body back, and Confirm keeps the new position. A click off the
gizmo only moves the camera and no longer leaves the Move card and its buttons dead. Starting
another edit or a rebuild keeps the position, and undo is refused until the Move is confirmed
or cancelled.
The XY, XZ and YZ planes no longer cross through the bed. Each is a small square in its axis
colour, set off from the axes into the corner that faces the default front view, with its name
written in the plane. Dash-dot axes run between the squares and replace the bed's axis triad
while they show. Hovering a plane greys it and selecting one makes it solid, and picking a
solid face now clears a previously picked plane.
Grabbing an arrow anywhere along its length snapped the body's centre to that point as soon
as the mouse moved. The body now moves by how far the cursor travels from where the arrow
was grabbed, including when it is grabbed while looking straight down the axis.
The XY/XZ/YZ planes are cut along each other and drawn back to front, with
lines along every crossing, and their fills are strong enough for the order
to show. Before, they blended into one grey smear and were too pale to work with.
In the Design tab the button always swung the camera to the plate view and framed the whole
bed, whatever was selected: the tab's picks and sketches are neither the canvas's selection
nor its volumes. It now frames the selected faces, body, edges, vertex, sketch region or
sketch entities, and with nothing selected everything on show — the visible bodies, the
feature preview and the sketches — keeping the current view direction. An empty tab still
frames the bed as before.
The line started at a fixed inset scaled like the ImGui style, while the navigator and the
round canvas buttons scale with the monitor's DPI on Windows, so at 150% the buttons covered
its first words. It now starts past the edge the canvas reports for that corner.
* plates-toolbar-scrollbar-size
* update
* filament grouping dialog
* mixed filament list
* Update StepMeshDialog.cpp
* moves plot scrollbar
* fix position of popups
* printer agent combo box width
* match multiline text control background
* add dots to configure button
* also correct label color for multiline input
* side tools connecting text color
* recenter dialog text color
* preferences experimental features
* upgrade panel hyperlink color + right margin
* fix position of + sign on printer selector
* speed control popup
* bbl fan control window
* AMS materials setting
* monitor > ams section
* match background color of multiline text editor on project page
* Fix SwitchButton colors
* bbl camera popup
* BBL > Send print dialog
* Revert "BBL > Send print dialog"
This reverts commit 128e145897.
* Revert "bbl fan control window"
This reverts commit 4a0db62790.
* Revert "bbl camera popup"
This reverts commit e2301e3237.
* Revert "monitor > ams section"
This reverts commit 66e6894eb1.
* Revert "fix position of + sign on printer selector"
This reverts commit 1523ba24c0.
* Revert "upgrade panel hyperlink color + right margin"
This reverts commit 541f2514c5.
* Revert "side tools connecting text color"
This reverts commit a9ab074247.
* Revert "recenter dialog text color"
This reverts commit f4670d32b2.
* Revert "AMS materials setting"
This reverts commit b12827f9b5.
* Revert "Fix SwitchButton colors"
This reverts commit 2d4f1d1fe9.
* match object list background color
* match compare dialog wxDataViewCtrl background color
* fix centering of iconized buttons on linux
* fix compare dialog background color not applied on linux
* edit gcode dialog components background color
* Update Plater.cpp
* fix dev button font size
* Fix scaling issue on SwitchButton while using 150%
* transfer or discard changes dialog wiki label
* "Transfer or Discard changes" / "Unsaved Changes" dialog header color
* object table colors & header spacing
* progress dialog
* fix progressbar look on linux
* fix build
* fix build
* fix centering of iconized icon again
* fix header background color
* revert bbl fan control
* add includes
---------
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Panning or orbiting with a right-drag no longer ends the polyline chain or drops
the point already placed. Only a right-click that doesn't move does. In the
Touchpad camera style, Alt+move and Shift+move now orbit and pan even while a
draw tool is armed.