Adriaan de Groot
296146e4f8
[libcalamares] update SPDX licensing on generated files
...
- the scripts are BSD-2-clause,
- the generated files are CC0 (I'm not *100%* sure about the
derived file CountryData_p.cpp, which lists countries and
country codes -- it **is** extracted from CLDR data which
is not CC0)
2020-08-10 09:32:50 +02:00
Adriaan de Groot
e2bf62a64b
[libcalamares] Repair test for old Qt
...
- Qt 5.11 and early 5.12 just don't support Esperanto at all
2020-08-09 22:35:10 +02:00
Adriaan de Groot
5e5701363c
[libcalamares] Test the spot-patch for Johannesburg
...
- Add a note about notation, degrees-minutes
2020-08-09 00:35:19 +10:00
Adriaan de Groot
e35992cf0b
[libcalamares] Add spot-patches to timezone data
...
- for the purposes of Calamares's nearest-location selection algorithm
for timezone selection, introduce spot patches: alternate markers
on the map to indicate "things close to here belong in this timezone".
- hide the implementation detail in the find() methods.
2020-08-09 00:21:31 +10:00
Adriaan de Groot
028d424c73
[libcalamares] Expand testing of TZ location lookup
...
- Cape Town is in South Africa, so one might expect it to get South
Africa's timezone -- which is Africa/Johannesburg -- but Windhoek
is closer, so it gets that.
- Port Elisabeth is similar: Maseru lies between it an Johannesburg,
so it gets the wrong timezone, too.
These both illustrate how the limited resolution of the map, together
with the "closest location" lookup, can give poor results. For most
of South Africa, the "wrong" timezone is closer than the right one.
2020-08-09 00:21:31 +10:00
Adriaan de Groot
6a33e72b58
[libcalamares] Refactor test to be data-driven
...
- this test is going to get a lot more cases, so prepare for that
2020-08-09 00:21:30 +10:00
Adriaan de Groot
00626fd96c
[libcalamares] Refactor timezone loading
...
- load from a TextStream. This is prep-work for alternate TZ data
sources.
2020-08-09 00:21:30 +10:00
Adriaan de Groot
2f871acbfd
[libcalamares] Expose distanceFunc-find for timezones
2020-08-08 13:45:32 +02:00
Adriaan de Groot
0fda1dcf7d
[libcalamares] Refactor finding-TZ algorithm
...
- introduce a distance function and use that, rather than coding it
inside the find() function. This is prep-work for unifying the
find() calls, based on various coordinate systems.
2020-08-08 13:26:39 +02:00
Adriaan de Groot
21f97db8fd
[libcalamares] Offer translation lookup of regions
2020-08-06 16:09:41 +02:00
Adriaan de Groot
296337d45d
[libcalamares] Implement nearest-TZ lookup
...
- This version, based on lat+lon lookup, handles wrap-around the
globe at -180 W (which is very close to +180 E)
- Test wrap-around-the-globe lookups
2020-08-06 14:27:44 +02:00
Adriaan de Groot
9e274aac07
[libcalamares] Make ZonesModel more QML-friendly
...
- expose TZ lookup (as a QObject*, which QML needs)
- C++ code should use find(), which is safer
2020-08-06 14:27:09 +02:00
Adriaan de Groot
ab69e7c83a
[libcalamares] Add API for geographical lookup
...
- find a zone given lat, lon -- with a failing test and a bogus
implementation.
2020-08-06 01:52:50 +02:00
Adriaan de Groot
d814a3dba8
[libcalamares] Sort the models before use
...
- zones and regions alphabetically by key
2020-08-06 01:34:55 +02:00
Adriaan de Groot
37c211fd14
[libcalamares] Add an iterator for the full zones model
2020-08-06 01:34:55 +02:00
Adriaan de Groot
7ea2ad7dc6
[libcalamares] Add accessors for TZ data and region in the model
...
It's convenient when e.g. QComboBox::currentData() gets the key
"automatically", and the default role for that method is UserRole,
so let the value of KeyRole overlap.
2020-08-06 01:34:44 +02:00
Adriaan de Groot
245d4a8ef7
[libcalamares] Add a find() to ZonesModel
...
- Look up TZ data by region and zone name.
2020-08-06 01:33:25 +02:00
Adriaan de Groot
478a275764
[libcalamares] Make TimeZoneData public
...
- Also make it a QObject so we can add properties and make it useful
for QML consumption.
2020-08-06 01:33:21 +02:00
Adriaan de Groot
10fb5b95c7
[libcalamares] Split out CStringPair into TranslatableString
...
The (renamed) class TranslatableString keeps a key value
(e.g. New_York) and a human-readable version around; the
human-readable one is passed through QObject::tr() for translation
on-the-fly.
2020-08-05 17:52:41 +02:00
Adriaan de Groot
3e32335511
[libcalamares] Introduce a filtering model per-region
2020-08-05 17:14:13 +02:00
Adriaan de Groot
1afdcc9c82
[libcalamares] Give zones data, too
...
- while here, fix bug in TimeZoneData that didn't munge names
(so it reported "New_York")
2020-08-05 16:45:41 +02:00
Adriaan de Groot
33e39b92fb
[libcalamares] Satisfy test, return region names
2020-08-05 16:36:00 +02:00
Adriaan de Groot
609ea8350c
[libcalamares] Failing test: there is data in the regions model
2020-08-05 16:25:45 +02:00
Adriaan de Groot
82cc652f55
[libcalamares] Re-done zones loading
...
- just make one big list of zones, one short list of regions
- the models are non-functional right now
2020-08-05 16:21:05 +02:00
Adriaan de Groot
ca40d2e2d9
[libcalamares] Introduce a failing test for the number of regions
2020-08-05 15:17:09 +02:00
Adriaan de Groot
fce05acf1e
[libcalamares] Rip out all the TZ models
...
- The models are overly complicated: **overall** there is just one
list of timezones, and we need various views on that list.
Start over with an empty model of regions.
2020-08-05 15:11:52 +02:00
Adriaan de Groot
3f1b31e352
[libcalamares] Explicit tests for Interlingue
...
- The language code "ie" is not recognized,
- "ia" is, and it seems to be the post-war variant of
Interlingue, so we may want to rename / relabel.
The testEsperanto test -- now split into scripts and
esperanto -- would have picked "ie" out of the list
because it does map to C locale.
2020-08-04 13:26:37 +02:00
Adriaan de Groot
b27bc11975
[libcalamares] Merge locale tests files
...
- No need for a separate .h in most test cases
2020-08-04 12:59:55 +02:00
Adriaan de Groot
682146aa9b
[libcalamares] Expand dox on TimeZone pairs
2020-07-24 12:15:32 +02:00
Adriaan de Groot
192263cf9d
[libcalamares][modules] Use compatibility for QString::split()
...
- Use the compatibility value, which has an enum value suitable
for the Qt version in use.
2020-06-23 11:13:55 +02:00
Callum Farmer
0c4dc71d5c
[libcalamares] Update SPDX identifiers.
...
Update CppJob.h
Update CalamaresConfig.h.in
Update DllMacro.h
Update GlobalStorage.cpp
Update GlobalStorage.h
Update Job.cpp
Update Job.h
Update JobExample.cpp
Update JobExample.h
Update JobQueue.cpp
Update CalamaresConfig.h.in
Update CppJob.cpp
Update CppJob.h
Update DllMacro.h
Update GlobalStorage.cpp
Update GlobalStorage.h
Update Job.cpp
Update Job.h
Update JobExample.cpp
Update JobExample.h
Update JobQueue.h
Update ProcessJob.cpp
Update ProcessJob.h
Update PythonHelper.cpp
Update PythonJob.cpp
Update PythonJob.h
Update PythonHelper.h
Update PythonJobApi.cpp
Update PythonJobApi.h
Update Settings.cpp
Update Settings.h
Update GeoIPJSON.cpp
Update GeoIPJSON.h
Update GeoIPTests.cpp
Update GeoIPTests.h
Update GeoIPXML.cpp
Update GeoIPXML.h
Update Handler.cpp
Update Handler.h
Update Interface.cpp
Update Interface.h
Update test_geoip.cpp
Update CountryData_p.cpp
Update Label.cpp
Update Label.h
Update LabelModel.cpp
Update LabelModel.h
Update CountryData_p.cpp
Update CountryData_p.cpp
Update Lookup.cpp
Update Lookup.h
Update Tests.cpp
Update Tests.h
Update TimeZone.cpp
Update TimeZone.h
Update TranslatableConfiguration.cpp
Update TranslatableConfiguration.h
Update ZoneData_p.cxxtr
Update cldr-extractor.py
Update zone-extractor.py
Update Actions.h
Update Actions.h
Update Descriptor.h
Update InstanceKey.cpp
Update Module.cpp
Update Module.h
Update Requirement.cpp
Update RequirementsChecker.h
Update RequirementsModel.cpp
Update RequirementsModel.h
Update Tests.cpp
Update Manager.cpp
Update Manager.h
Update Tests.cpp
Update FileSystem.cpp
Update FileSystem.h
Update KPMManager.cpp
Update KPMManager.h
Update KPMTests.cpp
Update FileSystem.cpp
Update FileSystem.cpp
Update FileSystem.h
Update KPMManager.cpp
Update KPMManager.h
Update Mount.cpp
Update Mount.h
Update PartitionIterator.cpp
Update PartitionIterator.h
Update PartitionIterator.h
Update PartitionQuery.cpp
Update PartitionQuery.h
Update PartitionSize.cpp
Update PartitionSize.h
Update Sync.cpp
Update Sync.h
Update Tests.cpp
Update Tests.h
Update BoostPython.h
Update CalamaresUtilsSystem.cpp
Update CalamaresUtilsSystem.h
Update CommandList.cpp
Update CommandList.h
Update Dirs.cpp
Update Dirs.h
Update Entropy.cpp
Update Entropy.h
Update Entropy.cpp
Update Logger.cpp
Update Logger.h
Update NamedEnum.h
Update NamedSuffix.h
Update PluginFactory.cpp
Update PluginFactory.h
Update RAII.h
Update RAII.h
Update Retranslator.cpp
Update Retranslator.h
Update String.cpp
Update String.h
Update TestPaths.cpp
Update Tests.cpp
Update Tests.h
Update UMask.cpp
Update UMask.h
Update Units.h
Update Variant.cpp
Update Variant.h
Update Yaml.cpp
Update Yaml.h
Update moc-warnings.h
2020-06-03 12:52:53 +01:00
Adriaan de Groot
d348977d07
[libcalamares] Fix tests
...
- the test checks that the default locale is C or en_US .. let's just
make it so instead of relying on the environment. This fixes tests
on my dev-laptop, which happens to be set to en_NL (with volapuk
date format).
2020-04-21 13:41:04 +02:00
Adriaan de Groot
e3b4689cab
[libcalamares] Warnings--
...
- It's the perennial struggle between Qt index types and STL ones
2020-03-25 00:42:42 +01:00
Adriaan de Groot
998790d69c
[libcalamares] Warnings--
2020-03-24 23:52:57 +01:00
Adriaan de Groot
4aeb774812
[libcalamares] POD don't bother with const&
2020-03-24 23:52:20 +01:00
Adriaan de Groot
177d6fe861
[libcalamares] Apply coding style
2020-03-24 22:57:36 +01:00
Camilo Higuita
e02077d58e
some models need to be updated to work with locale qml view step
2020-03-24 10:04:14 -05:00
Adriaan de Groot
e49fb74847
[libcalamares] Fix more tests
2020-02-21 17:58:55 +01:00
Adriaan de Groot
81752b6f7c
[libcalamares] Document how TranslatedString context works
...
- Support re-using class-specific tr() calls in a standard way
- Document this in the netinstall.conf which uses it
2020-02-19 14:23:34 +01:00
Adriaan de Groot
0ef28f6a50
[libcalamares] Translatable config strings use tr()-infrastructure
...
- Allow TranslatedString to get a context parameter; if it has
one, it will try to use the regular tr()-infrastructure
**as fallback** for the translations from the config file itself.
- This makes it possible to offer -- and translate -- some "standard"
phrases in the module, while allowing the config file the knob
to change strings. Using one of the standard strings gets translations
for "free", while introducing something entirely new means sourcing
translations for it as well.
2020-02-19 14:04:35 +01:00
Adriaan de Groot
ca13d1670e
[libcalamares] Merge more from Camilo
...
- Complete the model for locales
2020-02-12 13:40:59 +01:00
Adriaan de Groot
684c5f477c
[libcalamares] Moc warnings--
...
- don't have a NOTIFY CONSTANT property
- the data is constant, so drop NOTIFY
- remove redundant signals
- remove setLabels() now it's only needed from one constructor
2020-02-11 16:40:36 +01:00
Adriaan de Groot
b4b1bf5de2
[libcalamares] Call delegated constructor
2020-02-11 16:39:39 +01:00
Adriaan de Groot
df5a0d25bc
[libcalamares] Handle empty locale names quickly
2020-02-11 16:37:49 +01:00
Adriaan de Groot
27bc64e63f
[libcalamares] C++ style, warnings--
2020-02-11 15:36:30 +01:00
Adriaan de Groot
241cb04f06
[libcalamares] Coding style
2020-02-11 15:25:28 +01:00
Camilo Higuita
1b3d32ca79
make label item from LabelModel qobject based and expose properties
2020-02-11 15:24:29 +01:00
Adriaan de Groot
2dff2d9d70
[libcalamares] TZRegion is hard to copy
...
- delete the copy and move constructors
- adjust tests (which were just interested in simple tr() behavior) to use TZZone instead
2020-01-07 10:41:14 +01:00
Adriaan de Groot
1b62b2f66c
[libcalamares] Reduce warnings (extra ;, empty statement ..)
2020-01-07 10:19:22 +01:00
Adriaan de Groot
0e7982ec37
[libcalamares] Don't force Hindi on India.
...
FIXES #1284
2019-12-11 18:33:24 +01:00