Skip to content

Commit 97cdc2f

Browse files
committed
Fix decimal input in signal cursor dialogs with comma locale
Closes #276 Fixed decimal value input failing in signal cursor dialogs when using regional settings with comma as decimal separator (e.g., French, German locales).
1 parent 17f61b5 commit 97cdc2f

File tree

6 files changed

+112
-5
lines changed

6 files changed

+112
-5
lines changed

datalab/widgets/signalcursor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from guidata.configtools import get_icon
1313
from plotpy.builder import make
1414
from plotpy.plot import PlotDialog
15+
from qtpy import QtCore as QC
1516
from qtpy import QtGui as QG
1617
from qtpy import QtWidgets as QW
1718
from sigima.tools.signal.features import find_x_values_at_y
@@ -76,10 +77,14 @@ def __setup_dialog(self) -> None:
7677
ylabel = QW.QLabel("Y=")
7778
self.xlineedit = QW.QLineEdit()
7879
self.xlineedit.editingFinished.connect(self.xlineedit_editing_finished)
79-
self.xlineedit.setValidator(QG.QDoubleValidator())
80+
x_validator = QG.QDoubleValidator()
81+
x_validator.setLocale(QC.QLocale("C"))
82+
self.xlineedit.setValidator(x_validator)
8083
self.ylineedit = QW.QLineEdit()
8184
self.ylineedit.editingFinished.connect(self.ylineedit_editing_finished)
82-
self.ylineedit.setValidator(QG.QDoubleValidator())
85+
y_validator = QG.QDoubleValidator()
86+
y_validator.setLocale(QC.QLocale("C"))
87+
self.ylineedit.setValidator(y_validator)
8388
self.xlineedit.setReadOnly(self.__cursor_orientation == "horizontal")
8489
self.xlineedit.setDisabled(self.__cursor_orientation == "horizontal")
8590
self.ylineedit.setReadOnly(self.__cursor_orientation == "vertical")

datalab/widgets/signaldeltax.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from guidata.configtools import get_icon
1616
from plotpy.builder import make
1717
from plotpy.plot import PlotDialog
18+
from qtpy import QtCore as QC
1819
from qtpy import QtGui as QG
1920
from qtpy import QtWidgets as QW
2021
from sigima.tools.signal.pulse import full_width_at_y
@@ -68,7 +69,9 @@ def __setup_dialog(self) -> None:
6869
self.deltaxlineedit.setDisabled(True)
6970
self.ylineedit = QW.QLineEdit()
7071
self.ylineedit.editingFinished.connect(self.ylineedit_editing_finished)
71-
self.ylineedit.setValidator(QG.QDoubleValidator())
72+
y_validator = QG.QDoubleValidator()
73+
y_validator.setLocale(QC.QLocale("C"))
74+
self.ylineedit.setValidator(y_validator)
7275
xygroup = QW.QGroupBox(_("Cursor position"))
7376
xylayout = QW.QHBoxLayout()
7477
xylayout.addWidget(xlabel)

doc/locale/fr/LC_MESSAGES/features/advanced/proxy.po

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: DataLab \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-10-16 16:57+0200\n"
11+
"POT-Creation-Date: 2025-12-13 08:36+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: fr\n"
@@ -334,6 +334,24 @@ msgstr ""
334334
msgid "list of file names"
335335
msgstr ""
336336

337+
msgid "Load native DataLab HDF5 workspace files without any GUI elements."
338+
msgstr ""
339+
340+
msgid "This method can be safely called from scripts (e.g., internal console, macros) as it does not create any Qt widgets, dialogs, or progress bars."
341+
msgstr ""
342+
343+
msgid "This method only supports native DataLab HDF5 files. For importing arbitrary HDF5 files (non-native), use :meth:`open_h5_files` or :meth:`import_h5_file` instead."
344+
msgstr ""
345+
346+
msgid "List of native DataLab HDF5 filenames"
347+
msgstr ""
348+
349+
msgid "Reset all application data before importing. Defaults to False."
350+
msgstr ""
351+
352+
msgid "If a file is not a valid native DataLab HDF5 file"
353+
msgstr ""
354+
337355
msgid "Open a DataLab HDF5 file or import from any other HDF5 file."
338356
msgstr ""
339357

@@ -358,6 +376,15 @@ msgstr ""
358376
msgid "if macro not found"
359377
msgstr ""
360378

379+
msgid "Save current workspace to a native DataLab HDF5 file without GUI elements."
380+
msgstr ""
381+
382+
msgid "HDF5 filename to save to"
383+
msgstr ""
384+
385+
msgid "If file cannot be saved"
386+
msgstr ""
387+
361388
msgid "Save to a DataLab HDF5 file."
362389
msgstr ""
363390

@@ -433,6 +460,30 @@ msgstr ""
433460
msgid "panel name (valid values: \"signal\", \"image\"). If None, current panel is used"
434461
msgstr ""
435462

463+
msgid "Load HDF5 workspace files without showing file dialog."
464+
msgstr ""
465+
466+
msgid "This method loads one or more DataLab native HDF5 files directly, bypassing the file dialog. It is safe to call from the internal console or any context where Qt dialogs would cause threading issues."
467+
msgstr ""
468+
469+
msgid "Path(s) to HDF5 file(s). Can be a single path string or a list of paths"
470+
msgstr ""
471+
472+
msgid "If True, reset workspace before loading. Defaults to False."
473+
msgstr ""
474+
475+
msgid "if file is not a DataLab native HDF5 file"
476+
msgstr ""
477+
478+
msgid "Save workspace to HDF5 file without showing file dialog."
479+
msgstr ""
480+
481+
msgid "This method saves the current workspace to a DataLab native HDF5 file directly, bypassing the file dialog. It is safe to call from the internal console or any context where Qt dialogs would cause threading issues."
482+
msgstr ""
483+
484+
msgid "Path to the output HDF5 file"
485+
msgstr ""
486+
436487
msgid "Proxy context manager"
437488
msgstr ""
438489

doc/locale/fr/LC_MESSAGES/features/advanced/remote.po

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: DataLab \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-10-16 16:42+0200\n"
11+
"POT-Creation-Date: 2025-12-13 08:36+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -444,6 +444,25 @@ msgstr ""
444444
msgid "list of file names"
445445
msgstr ""
446446

447+
msgid "Load native DataLab HDF5 workspace files without any GUI elements."
448+
msgstr ""
449+
450+
msgid "This method can be safely called from scripts (e.g., internal console, macros) as it does not create any Qt widgets, dialogs, or progress bars."
451+
msgstr ""
452+
453+
msgid "This method only supports native DataLab HDF5 files. For importing arbitrary HDF5 files (non-native), use :meth:`open_h5_files` or :meth:`import_h5_file` instead."
454+
msgstr ""
455+
456+
#, fuzzy
457+
msgid "List of native DataLab HDF5 filenames"
458+
msgstr "Enregistrer la session en cours dans un fichier HDF5"
459+
460+
msgid "Reset all application data before importing. Defaults to False."
461+
msgstr ""
462+
463+
msgid "If a file is not a valid native DataLab HDF5 file"
464+
msgstr ""
465+
447466
msgid "Open a DataLab HDF5 file or import from any other HDF5 file."
448467
msgstr ""
449468

@@ -468,6 +487,16 @@ msgstr ""
468487
msgid "if macro not found"
469488
msgstr ""
470489

490+
msgid "Save current workspace to a native DataLab HDF5 file without GUI elements."
491+
msgstr ""
492+
493+
#, fuzzy
494+
msgid "HDF5 filename to save to"
495+
msgstr "Parcourir un fichier HDF5"
496+
497+
msgid "If file cannot be saved"
498+
msgstr ""
499+
471500
#, fuzzy
472501
msgid "Save to a DataLab HDF5 file."
473502
msgstr "Enregistrer la session en cours dans un fichier HDF5"
@@ -508,3 +537,4 @@ msgstr ""
508537

509538
msgid "Show titles state"
510539
msgstr ""
540+

doc/locale/fr/LC_MESSAGES/release_notes/release_1.00.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ msgstr "Note : `load_h5_workspace()` ne prend en charge que les fichiers HDF5 na
119119
msgid "This closes [Issue #275](https://github.com/datalab-platform/datalab/issues/275) - Console freezes when calling `open_h5_files()` from internal console"
120120
msgstr "Ceci clôture [Issue #275](https://github.com/datalab-platform/datalab/issues/275) - Blocage de la console lors de l'appel de `open_h5_files()` depuis la console interne"
121121

122+
msgid "**Signal cursor dialogs - Decimal input with regional settings:**"
123+
msgstr "**Boîtes de dialogue de curseur de signal - Saisie décimale avec les paramètres régionaux :**"
124+
125+
msgid "Fixed decimal value input failing in signal cursor dialogs when using regional settings with comma as decimal separator (e.g., French, German locales)"
126+
msgstr "Correction de l'échec de la saisie de valeurs décimales dans les boîtes de dialogue de curseur de signal lors de l'utilisation de paramètres régionaux avec la virgule comme séparateur décimal (par exemple, locales française, allemande)"
127+
128+
msgid "The Y input field in \"First abscissa at y=...\", \"Ordinate at x=...\", and \"Full width at y=...\" dialogs now consistently accepts dot as decimal separator regardless of system locale"
129+
msgstr "Le champ de saisie Y dans les boîtes de dialogue \"Première abscisse à y=...\", \"Ordonnée à x=...\" et \"Largeur totale à y=...\" accepte désormais systématiquement le point comme séparateur décimal, quelle que soit la locale du système"
130+
131+
msgid "This closes [Issue #276](https://github.com/datalab-platform/datalab/issues/276) - Decimal input fails with regional settings using comma as decimal separator"
132+
msgstr "Ceci clôture [Issue #276](https://github.com/datalab-platform/datalab/issues/276) - Échec de la saisie décimale avec les paramètres régionaux utilisant la virgule comme séparateur décimal"
133+
122134
msgid "DataLab Version 1.0.2 (2025-12-03)"
123135
msgstr "DataLab Version 1.0.2 (03/12/2025)"
124136

doc/release_notes/release_1.00.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
* Note: `load_h5_workspace()` only supports native DataLab HDF5 files; for importing arbitrary HDF5 files, use macros with `RemoteProxy`
4949
* This closes [Issue #275](https://github.com/datalab-platform/datalab/issues/275) - Console freezes when calling `open_h5_files()` from internal console
5050

51+
**Signal cursor dialogs - Decimal input with regional settings:**
52+
53+
* Fixed decimal value input failing in signal cursor dialogs when using regional settings with comma as decimal separator (e.g., French, German locales)
54+
* The Y input field in "First abscissa at y=...", "Ordinate at x=...", and "Full width at y=..." dialogs now consistently accepts dot as decimal separator regardless of system locale
55+
* This closes [Issue #276](https://github.com/datalab-platform/datalab/issues/276) - Decimal input fails with regional settings using comma as decimal separator
56+
5157
## DataLab Version 1.0.2 (2025-12-03) ##
5258

5359
### 🛠️ Bug Fixes since version 1.0.1 ###

0 commit comments

Comments
 (0)