From 1939e61c57f91658587c04c2c4a3edcec0baa65e Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 16 May 2013 12:32:33 +0200 Subject: [PATCH] Check for decimal and group separator on startup (Windows) --- src/Gui/Application.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index da74a7e5f..0ae0513cf 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -335,6 +335,18 @@ Application::Application(bool GUIenabled) ("User parameter:BaseApp/Preferences/Units"); Base::UnitsApi::setDecimals(hUnits->GetInt("Decimals", Base::UnitsApi::getDecimals())); + // Check for the symbols for group separator and deciaml point. They must be different otherwise + // Qt doesn't work properly. +#if defined(Q_OS_WIN32) + if (QLocale::system().groupSeparator() == QLocale::system().decimalPoint()) { + QMessageBox::critical(0, QLatin1String("Invalid system settings"), + QLatin1String("Your system uses the same symbol for decimal point and group separator.\n\n" + "This causes serious problems and makes the application fail to work properly.\n" + "Go to the system configuration panel of the OS and fix this issue, please.")); + throw Base::Exception("Invalid system settings"); + } +#endif + // setting up Python binding Base::PyGILStateLocker lock; PyObject* module = Py_InitModule3("FreeCADGui", Application::Methods,