WSL/SLF GitLab Repository

Commit 056996f1 authored by Michael Reisecker's avatar Michael Reisecker
Browse files

Fix wrongly localized expressions

Cf. issue 873
parent 2b016709
......@@ -16,6 +16,7 @@ Releases of the INIshell project will be documented in this file.
### Changed
- Optional/mandatory highlighting is now done on the label
- (In)valid expressions are marked with little icons leading to the help files
- Help is now displayed in a separate browser
(handling all help topics)
- Settings are now a separate window:
......@@ -23,6 +24,7 @@ Releases of the INIshell project will be documented in this file.
- Display sections for missing mandatory INI keys in "unsaved" warning message
- Jump to 1st missing input value if saving is cancelled
- Workflow panel is now toggled instead of separate show/hide menus
- Always use/show '.' as decimal separator
### Fixed
......
......@@ -53,6 +53,8 @@
#include <QTimer>
#include <QToolBar>
#include <clocale>
#ifdef DEBUG
#include <iostream>
#endif
......@@ -148,6 +150,12 @@ MainWindow::MainWindow(QString &settings_location, const QStringList &errors, QM
* Output to file <----- INIParser class
*/
//The following is needed especially for the tinyexpr external library when a locale is set
//interpreting something else than '.' as decimal separator. Here we override this so that
//expressions are parsed assuming a dot (i. e. not a comma).
//(must be set from inside event loop?)
setlocale(LC_NUMERIC, "C");
status_timer_ = new QTimer(this); //for temporary status messages
status_timer_->setSingleShot(true);
connect(status_timer_, &QTimer::timeout, this, &MainWindow::clearStatus);
......
......@@ -23,6 +23,7 @@
#include <QDoubleSpinBox>
#include <QFontMetrics>
#include <QLocale>
#include <QSpinBox>
#include <QTimer>
......@@ -109,6 +110,7 @@ Number::Number(const QString &section, const QString &key, const QDomNode &optio
number_element_->setFixedWidth(Cst::width_number_min);
key_filter_ = new KeyPressFilter;
number_element_->installEventFilter(key_filter_);
number_element_->setLocale(QLocale::C); //display '.' as decimal separator
/* free text expression entering */
expression_element_ = new QLineEdit(this);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment