Removed dependencies of libslic3r on Slic3r GUI library.

This commit is contained in:
bubnikv 2018-06-20 18:55:31 +02:00
parent 02d4f3e14d
commit ac011aec6d
2 changed files with 9 additions and 8 deletions

View File

@ -2,7 +2,12 @@
#include "PreviewData.hpp"
#include <float.h>
#include <wx/intl.h>
#include "slic3r/GUI/GUI.hpp"
#include <I18N.hpp>
#include <boost/format.hpp>
//! macro used to mark string used at localization,
#define L(s) (s)
namespace Slic3r {
@ -405,7 +410,7 @@ GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::
items.reserve(last_valid - first_valid + 1);
for (unsigned int i = (unsigned int)first_valid; i <= (unsigned int)last_valid; ++i)
{
items.emplace_back(_CHB(extrusion.role_names[i].c_str()).data(), extrusion.role_colors[i]);
items.emplace_back(Slic3r::I18N::translate(extrusion.role_names[i]), extrusion.role_colors[i]);
}
break;
@ -436,13 +441,9 @@ GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::
items.reserve(tools_colors_count);
for (unsigned int i = 0; i < tools_colors_count; ++i)
{
char buf[MIN_BUF_LENGTH_FOR_L];
sprintf(buf, _CHB(L("Extruder %d")), i + 1);
GCodePreviewData::Color color;
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + i * 4), 4 * sizeof(float));
items.emplace_back(buf, color);
items.emplace_back((boost::format(Slic3r::I18N::translate(L("Extruder %d"))) % (i + 1)).str(), color);
}
break;

View File

@ -14,7 +14,7 @@
//! macro used to mark string used at localization,
//! return same string
#define L(s) translate(s)
#define L(s) Slic3r::I18N::translate(s)
namespace Slic3r {