Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
LabPlot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
LabPlot
Commits
b65f506a
Commit
b65f506a
authored
Jul 15, 2020
by
Stefan Gerlach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[locale] show current number locale in about dialog
parent
dc16327e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
src/kdefrontend/LabPlot.cpp
src/kdefrontend/LabPlot.cpp
+12
-11
src/kdefrontend/SettingsGeneralPage.cpp
src/kdefrontend/SettingsGeneralPage.cpp
+8
-0
No files found.
src/kdefrontend/LabPlot.cpp
View file @
b65f506a
...
...
@@ -61,27 +61,28 @@ const QString getSystemInfo() {
#else
const
QString
buildType
(
i18n
(
"Debug build"
));
#endif
const
QLocale
locale
;
const
QString
localeInfo
{
QLatin1String
(
" ("
)
+
i18n
(
"Decimal point
: "
)
+
'\''
+
QString
(
l
ocale
.
decimalPoint
())
SET_NUMBER_LOCALE
const
QString
numberLocaleInfo
{
' '
+
i18n
(
"Decimal point
"
)
+
'\''
+
QString
(
numberL
ocale
.
decimalPoint
())
+
QLatin1String
(
"
\'
, "
)
+
i18n
(
"Group separator
: "
)
+
'\''
+
QString
(
l
ocale
.
groupSeparator
())
+
i18n
(
"Group separator
"
)
+
'\''
+
QString
(
numberL
ocale
.
groupSeparator
())
+
QLatin1String
(
"
\'
, "
)
+
i18n
(
"Exponential
: "
)
+
'\''
+
QString
(
l
ocale
.
exponential
())
+
i18n
(
"Exponential
"
)
+
'\''
+
QString
(
numberL
ocale
.
exponential
())
+
QLatin1String
(
"
\'
, "
)
+
i18n
(
"Zero digit: "
)
+
'\''
+
QString
(
l
ocale
.
zeroDigit
())
+
i18n
(
"Zero digit: "
)
+
'\''
+
QString
(
numberL
ocale
.
zeroDigit
())
+
QLatin1String
(
"
\'
, "
)
+
i18n
(
"Percent: "
)
+
'\''
+
QString
(
l
ocale
.
percent
())
+
i18n
(
"Percent: "
)
+
'\''
+
QString
(
numberL
ocale
.
percent
())
+
QLatin1String
(
"
\'
, "
)
+
i18n
(
"Positive/Negative sign: "
)
+
'\''
+
QString
(
locale
.
positiveSign
())
+
'\''
+
'/'
+
'\''
+
QString
(
locale
.
negativeSign
())
+
QLatin1String
(
"
\'
)"
)};
+
i18n
(
"Positive/Negative sign: "
)
+
'\''
+
QString
(
numberLocale
.
positiveSign
())
+
'\''
+
'/'
+
'\''
+
QString
(
numberLocale
.
negativeSign
())
};
QLocale
locale
;
return
buildType
+
'\n'
+
QString
(
"%1, %2"
).
arg
(
__DATE__
).
arg
(
__TIME__
)
+
'\n'
+
i18n
(
"System: "
)
+
QSysInfo
::
prettyProductName
()
+
'\n'
+
i18n
(
"Locale: "
)
+
QLocale
::
languageToString
(
locale
.
language
())
+
','
+
QLocale
::
countryToString
(
locale
.
country
())
+
localeInfo
+
'\n'
+
QLocale
::
countryToString
(
locale
.
country
())
+
'\n'
+
i18n
(
"Number settings:"
)
+
numberLocaleInfo
+
'\n'
+
i18n
(
"Architecture: "
)
+
QSysInfo
::
buildAbi
()
+
'\n'
+
i18n
(
"Kernel: "
)
+
QSysInfo
::
kernelType
()
+
' '
+
QSysInfo
::
kernelVersion
()
+
'\n'
+
i18n
(
"C++ Compiler: "
)
+
QString
(
CXX_COMPILER
)
+
'\n'
...
...
src/kdefrontend/SettingsGeneralPage.cpp
View file @
b65f506a
...
...
@@ -58,7 +58,11 @@ SettingsGeneralPage::SettingsGeneralPage(QWidget* parent) : SettingsPage(parent)
}
SettingsGeneralPage
::
DecimalSeparator
SettingsGeneralPage
::
decimalSeparator
(
QLocale
locale
)
{
DEBUG
(
"SettingsGeneralPage::decimalSeparator()"
)
DEBUG
(
" LOCALE: "
<<
STDSTRING
(
locale
.
name
()))
DEBUG
(
" LOCALE LANG: "
<<
locale
.
language
())
QChar
decimalPoint
{
locale
.
decimalPoint
()};
DEBUG
(
" SEPARATING CHAR: "
<<
STDSTRING
(
QString
(
decimalPoint
))
)
if
(
decimalPoint
==
QChar
(
'.'
))
return
DecimalSeparator
::
Dot
;
else
if
(
decimalPoint
==
QChar
(
','
))
...
...
@@ -69,6 +73,10 @@ SettingsGeneralPage::DecimalSeparator SettingsGeneralPage::decimalSeparator(QLoc
QLocale
::
Language
SettingsGeneralPage
::
decimalSeparatorLocale
()
const
{
int
currentIndex
=
ui
.
cbDecimalSeparator
->
currentIndex
();
DEBUG
(
" SYSTEM LOCALE: "
<<
STDSTRING
(
QLocale
().
name
()))
DEBUG
(
" SYSTEM LOCALE LANG: "
<<
QLocale
().
language
())
DEBUG
(
" CURRENT SEPARATING CHAR: "
<<
STDSTRING
(
QString
(
QLocale
().
decimalPoint
()))
)
DEBUG
(
" GERMAN SEPARATING CHAR: "
<<
STDSTRING
(
QString
(
QLocale
(
QLocale
::
Language
::
German
).
decimalPoint
()))
)
if
(
currentIndex
==
static_cast
<
int
>
(
decimalSeparator
()))
// system decimal separator selected
return
QLocale
().
language
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment