Skip to content

Commit 40446f0

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). (cherry picked from commit 97cdc2f)
1 parent 8040b44 commit 40446f0

File tree

6 files changed

+111
-5
lines changed

6 files changed

+111
-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"
@@ -361,6 +361,24 @@ msgstr ""
361361
msgid "list of file names"
362362
msgstr ""
363363

364+
msgid "Load native DataLab HDF5 workspace files without any GUI elements."
365+
msgstr ""
366+
367+
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."
368+
msgstr ""
369+
370+
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."
371+
msgstr ""
372+
373+
msgid "List of native DataLab HDF5 filenames"
374+
msgstr ""
375+
376+
msgid "Reset all application data before importing. Defaults to False."
377+
msgstr ""
378+
379+
msgid "If a file is not a valid native DataLab HDF5 file"
380+
msgstr ""
381+
364382
msgid "Open a DataLab HDF5 file or import from any other HDF5 file."
365383
msgstr ""
366384

@@ -391,6 +409,15 @@ msgstr ""
391409
msgid "if macro not found"
392410
msgstr ""
393411

412+
msgid "Save current workspace to a native DataLab HDF5 file without GUI elements."
413+
msgstr ""
414+
415+
msgid "HDF5 filename to save to"
416+
msgstr ""
417+
418+
msgid "If file cannot be saved"
419+
msgstr ""
420+
394421
msgid "Save to a DataLab HDF5 file."
395422
msgstr ""
396423

@@ -466,6 +493,30 @@ msgstr ""
466493
msgid "panel name (valid values: \"signal\", \"image\"). If None, current panel is used"
467494
msgstr ""
468495

496+
msgid "Load HDF5 workspace files without showing file dialog."
497+
msgstr ""
498+
499+
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."
500+
msgstr ""
501+
502+
msgid "Path(s) to HDF5 file(s). Can be a single path string or a list of paths"
503+
msgstr ""
504+
505+
msgid "If True, reset workspace before loading. Defaults to False."
506+
msgstr ""
507+
508+
msgid "if file is not a DataLab native HDF5 file"
509+
msgstr ""
510+
511+
msgid "Save workspace to HDF5 file without showing file dialog."
512+
msgstr ""
513+
514+
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."
515+
msgstr ""
516+
517+
msgid "Path to the output HDF5 file"
518+
msgstr ""
519+
469520
msgid "Proxy context manager"
470521
msgstr ""
471522

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

Lines changed: 30 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 <[email protected]>\n"
@@ -471,6 +471,25 @@ msgstr ""
471471
msgid "list of file names"
472472
msgstr ""
473473

474+
msgid "Load native DataLab HDF5 workspace files without any GUI elements."
475+
msgstr ""
476+
477+
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."
478+
msgstr ""
479+
480+
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."
481+
msgstr ""
482+
483+
#, fuzzy
484+
msgid "List of native DataLab HDF5 filenames"
485+
msgstr "Enregistrer la session en cours dans un fichier HDF5"
486+
487+
msgid "Reset all application data before importing. Defaults to False."
488+
msgstr ""
489+
490+
msgid "If a file is not a valid native DataLab HDF5 file"
491+
msgstr ""
492+
474493
msgid "Open a DataLab HDF5 file or import from any other HDF5 file."
475494
msgstr ""
476495

@@ -501,6 +520,16 @@ msgstr ""
501520
msgid "if macro not found"
502521
msgstr ""
503522

523+
msgid "Save current workspace to a native DataLab HDF5 file without GUI elements."
524+
msgstr ""
525+
526+
#, fuzzy
527+
msgid "HDF5 filename to save to"
528+
msgstr "Parcourir un fichier HDF5"
529+
530+
msgid "If file cannot be saved"
531+
msgstr ""
532+
504533
#, fuzzy
505534
msgid "Save to a DataLab HDF5 file."
506535
msgstr "Enregistrer la session en cours dans un fichier HDF5"

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)