diff --git a/src/CGAL_Nef_polyhedron_DxfData.cc b/src/CGAL_Nef_polyhedron_DxfData.cc index 5ca39e8e..cbb5ce77 100644 --- a/src/CGAL_Nef_polyhedron_DxfData.cc +++ b/src/CGAL_Nef_polyhedron_DxfData.cc @@ -46,7 +46,7 @@ void CGAL_Nef_polyhedron::transform( const Transform3d &matrix ) { if (!this->isEmpty()) { if (matrix.matrix().determinant() == 0) { - PRINT("Warning: Scaling a 3D object with 0 - removing object"); + PRINT("WARNING: Scaling a 3D object with 0 - removing object"); this->reset(); } else { diff --git a/src/FontCache.cc b/src/FontCache.cc index c4b9a9dc..29534383 100644 --- a/src/FontCache.cc +++ b/src/FontCache.cc @@ -101,7 +101,7 @@ FontCache::FontCache() // Just load the configs. We'll build the fonts once all configs are loaded this->config = FcInitLoadConfig(); if (!this->config) { - PRINT("Can't initialize fontconfig library, text() objects will not be rendered"); + PRINT("WARNING: Can't initialize fontconfig library, text() objects will not be rendered"); return; } @@ -147,7 +147,7 @@ FontCache::FontCache() const FT_Error error = FT_Init_FreeType(&this->library); if (error) { - PRINT("Can't initialize freetype library, text() objects will not be rendered"); + PRINT("WARNING: Can't initialize freetype library, text() objects will not be rendered"); return; } diff --git a/src/GeometryEvaluator.cc b/src/GeometryEvaluator.cc index 24118c1f..3c2c8965 100644 --- a/src/GeometryEvaluator.cc +++ b/src/GeometryEvaluator.cc @@ -530,7 +530,7 @@ Response GeometryEvaluator::visit(State &state, const TransformNode &node) if (!isSmartCached(node)) { if (matrix_contains_infinity(node.matrix) || matrix_contains_nan(node.matrix)) { // due to the way parse/eval works we can't currently distinguish between NaN and Inf - PRINT("Warning: Transformation matrix contains Not-a-Number and/or Infinity - removing object."); + PRINT("WARNING: Transformation matrix contains Not-a-Number and/or Infinity - removing object."); } else { // First union all children diff --git a/src/Polygon2d.cc b/src/Polygon2d.cc index aeb22b22..a1e2a664 100644 --- a/src/Polygon2d.cc +++ b/src/Polygon2d.cc @@ -59,7 +59,7 @@ bool Polygon2d::isEmpty() const void Polygon2d::transform(const Transform2d &mat) { if (mat.matrix().determinant() == 0) { - PRINT("Warning: Scaling a 2D object with 0 - removing object"); + PRINT("WARNING: Scaling a 2D object with 0 - removing object"); this->theoutlines.clear(); return; } diff --git a/src/export.cc b/src/export.cc index 7f0331d1..62ff4089 100644 --- a/src/export.cc +++ b/src/export.cc @@ -246,7 +246,7 @@ static void export_stl(const CGAL_Polyhedron &P, std::ostream &output) void export_stl(const CGAL_Nef_polyhedron *root_N, std::ostream &output) { if (!root_N->p3->is_simple()) { - PRINT("Warning: Exported object may not be a valid 2-manifold and may need repair"); + PRINT("WARNING: Exported object may not be a valid 2-manifold and may need repair"); } bool usePolySet = true; @@ -271,10 +271,10 @@ void export_stl(const CGAL_Nef_polyhedron *root_N, std::ostream &output) export_stl(P, output); } catch (const CGAL::Assertion_exception &e) { - PRINTB("CGAL error in CGAL_Nef_polyhedron3::convert_to_Polyhedron(): %s", e.what()); + PRINTB("ERROR: CGAL error in CGAL_Nef_polyhedron3::convert_to_Polyhedron(): %s", e.what()); } catch (...) { - PRINT("CGAL unknown error in CGAL_Nef_polyhedron3::convert_to_Polyhedron()"); + PRINT("ERROR: CGAL unknown error in CGAL_Nef_polyhedron3::convert_to_Polyhedron()"); } CGAL::set_error_behaviour(old_behaviour); } @@ -291,7 +291,7 @@ void export_off(const class PolySet &ps, std::ostream &output) void export_off(const CGAL_Nef_polyhedron *root_N, std::ostream &output) { if (!root_N->p3->is_simple()) { - PRINT("Object isn't a valid 2-manifold! Modify your design."); + PRINT("WARNING: Export failed, the object isn't a valid 2-manifold."); return; } CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); @@ -301,7 +301,7 @@ void export_off(const CGAL_Nef_polyhedron *root_N, std::ostream &output) output << P; } catch (const CGAL::Assertion_exception &e) { - PRINTB("CGAL error in CGAL_Nef_polyhedron3::convert_to_Polyhedron(): %s", e.what()); + PRINTB("ERROR: CGAL error in CGAL_Nef_polyhedron3::convert_to_Polyhedron(): %s", e.what()); } CGAL::set_error_behaviour(old_behaviour); } @@ -321,7 +321,7 @@ void export_amf(const class PolySet &ps, std::ostream &output) void export_amf(const CGAL_Nef_polyhedron *root_N, std::ostream &output) { if (!root_N->p3->is_simple()) { - PRINT("Object isn't a valid 2-manifold! Modify your design."); + PRINT("WARNING: Export failed, the object isn't a valid 2-manifold."); return; } CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); diff --git a/src/func.cc b/src/func.cc index e6830099..75597720 100644 --- a/src/func.cc +++ b/src/func.cc @@ -930,7 +930,7 @@ ValuePtr builtin_norm(const Context *, const EvalContext *evalctx) register double x = v[i].toDouble(); sum += x*x; } else { - PRINT(" WARNING: Incorrect arguments to norm()"); + PRINT("WARNING: Incorrect arguments to norm()"); return ValuePtr::undefined; } return ValuePtr(sqrt(sum)); diff --git a/src/mainwin.cc b/src/mainwin.cc index 2c46b4db..b2ef178f 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1936,7 +1936,7 @@ void MainWindow::actionExport(export_type_e, QString, QString) const CGAL_Nef_polyhedron *N = dynamic_cast(this->root_geom.get()); if (N && !N->p3->is_simple()) { - PRINT("Warning: Object may not be a valid 2-manifold and may need repair! See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export"); + PRINT("WARNING: Object may not be a valid 2-manifold and may need repair! See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export"); } QString title = QString(_("Export %1 File")).arg(type_name); @@ -2524,10 +2524,15 @@ void MainWindow::quit() void MainWindow::consoleOutput(const std::string &msg, void *userdata) { // Invoke the append function in the main thread in case the output - // originates in a worker thread. + // originates in a worker thread. MainWindow *thisp = static_cast(userdata); - QMetaObject::invokeMethod(thisp->console, "append", Qt::QueuedConnection, - Q_ARG(QString, QString::fromUtf8(msg.c_str()))); + QString qmsg = QString::fromUtf8(msg.c_str()); + if (qmsg.startsWith("WARNING:")) { + qmsg = "" + qmsg + ""; + } else if (qmsg.startsWith("ERROR:")) { + qmsg = "" + qmsg + ""; + } + QMetaObject::invokeMethod(thisp->console, "append", Qt::QueuedConnection, Q_ARG(QString, qmsg)); if (thisp->procevents) QApplication::processEvents(); }