diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 16a63bc24..c11809f16 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -199,7 +199,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con { if (topWinAllowsPop) { - messageBox.setText(msg); + messageBox.setText(VAbstractApplication::ClearMessage(msg)); messageBox.setStandardButtons(QMessageBox::Ok); messageBox.setWindowModality(Qt::ApplicationModal); messageBox.setModal(true); diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 0b8fb5ffb..56c358081 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -185,20 +185,20 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con switch (type) { case QtWarningMsg: - messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Warning.")); + messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Warning")); messageBox.setIcon(QMessageBox::Warning); break; case QtCriticalMsg: - messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Critical error.")); + messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Critical error")); messageBox.setIcon(QMessageBox::Critical); break; case QtFatalMsg: - messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Fatal error.")); + messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Fatal error")); messageBox.setIcon(QMessageBox::Critical); break; #if QT_VERSION > QT_VERSION_CHECK(5, 4, 2) case QtInfoMsg: - messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Information.")); + messageBox.setWindowTitle(QApplication::translate("vNoisyHandler", "Information")); messageBox.setIcon(QMessageBox::Information); break; #endif @@ -213,7 +213,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con { if (topWinAllowsPop) { - messageBox.setText(msg); + messageBox.setText(VAbstractApplication::ClearMessage(msg)); messageBox.setStandardButtons(QMessageBox::Ok); messageBox.setWindowModality(Qt::ApplicationModal); messageBox.setModal(true); diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 1a1a52516..5bb27e04a 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -234,6 +234,23 @@ QUndoStack *VAbstractApplication::getUndoStack() const return undoStack; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief ClearMessage helps to clear a message string from standard Qt function. + * @param msg the message that contains '"' at the start and at the end + * @return cleared string + */ +QString VAbstractApplication::ClearMessage(QString msg) +{ + if (msg.startsWith('"') && msg.endsWith('"')) + { + msg.remove(0, 1); + msg.chop(1); + } + + return msg; +} + //--------------------------------------------------------------------------------------------------------------------- #if defined(Q_OS_WIN) void VAbstractApplication::WinAttachConsole() diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index 226ae258d..b1af80e65 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -115,6 +115,8 @@ public: static void WinAttachConsole(); #endif + static QString ClearMessage(QString msg); + protected: QUndoStack *undoStack;