42 Commits (30335f27f09ed919ee1416a49f8876d23486bfcf)

Author SHA1 Message Date
Adriaan de Groot 0948963d86 [locale] Port TZ widget lookup to new find() method
- The TZ widget uses a different coordinate system (mapping lat and lon
  to pixel locations, and then calculating Manhattan distance from
  that), so needs a different distance function.
- Simplify code: there's just one "closest TZ" function.
5 years ago
Adriaan de Groot 626dd038da [locale] Re-do locale module with new TZ data
- The Config object now uses the re-done models and timezone data
- most of the properties of the locale Config are unchanged
- much less complication in extracting data from the zones model
5 years ago
Adriaan de Groot 4f684be83d [locale] Avoid crashes in the map widget if there is no current location 5 years ago
Adriaan de Groot 726f882185 [locale] Move current-location to Config 5 years ago
Adriaan de Groot f0cac7d669 [locale] Hook tz widget up to the Config's data 5 years ago
Adriaan de Groot 931ce20f30 [locale] Reduce API surface
- getLocationPosition doesn't need to be a method, since it calls out
  to a static function of TimeZoneImageList anyway.
5 years ago
Adriaan de Groot c0be53523c [locale] Give TZWidget a fixed size 5 years ago
Adriaan de Groot b890345b1f [locale] Tidy includes 5 years ago
Adriaan de Groot f7a87338b8 [locale] math headers got lost 5 years ago
Adriaan de Groot 1d5c4f13aa [locale] Move the find-a-zone-image-for position to the image list 5 years ago
Adriaan de Groot 6173f9337a [locale] Refactor long+lat -> x,y mapping
- Move this code to a static method since it only depends on the
  expected image size (which here, is managed by the image list).
5 years ago
Adriaan de Groot 3945008956 [locale] Test the TZ image loader
- QImage needs Qt5::Gui, so this isn't a guiless-test; it can use
  the offscreen QPA, though.
- Check that the images are all the same size
- Debugging / check code removed from timezonewidget
5 years ago
Adriaan de Groot 340c462062 [locale] Refactor loading of timezone images
- Move the image-loading to a separate class
5 years ago
Adriaan de Groot e84db033b0 [locale] Debug-message typo 5 years ago
Adriaan de Groot f9d888ec24 [locale] Warnings--
- remove unused variables, tighten up code some
- while here, apply coding style
5 years ago
Adriaan de Groot 022e62b829 [licale] Fix build with DEBUG_TIMEZONES
- QLatin1String isn't a constexpr; the whole ZONE is a bit derpy,
  so let's just #define it.
5 years ago
Adriaan de Groot 1625bb1dae [locale] Support Qt 5.9
FIXES #1296
5 years ago
Adriaan de Groot 7bea19a62c [locale] Fix build with debugging enabled (API changes) 5 years ago
Adriaan de Groot 242b79e2e1 [locale] Remove old Location information
- all the TZ location information now lives in the Calamares
   locale service and the TZ list
 - replace the Location class that was local to the timezone
   widget by the TZZone class
 - chase a bunch of small API changes that this needs
5 years ago
Adriaan de Groot e164f8d63a [locale] Fix build with DEBUG_TIMEZONE
- all the API changes were not reflected in the debugging code
5 years ago
Adriaan de Groot fb9d53909e [locale] Drop ZONES #define
- this was a "cheap" way to write a list, but going through
   QStringList::split() is just a long-way-around for static
   initialization
5 years ago
Adriaan de Groot 2dfbed40c5 [locale] Move defines
- Used in only one place, move to .cpp
 - Drop useless scaling all the images *are* that size already
 - Add debugging check that the images match expected size
5 years ago
Adriaan de Groot 7354d35faf [locale] Apply coding style to timezonewidget/ 5 years ago
Adriaan de Groot 1e04924224 [locale] Drop the TZ-widget's timezone database
- use the global TZ service instead
 - contains hacks to keep some of the API unchanged, which will be
   removed shortly
5 years ago
Adriaan de Groot ad868033f3 [locale] Chase deprecations in Qt 5 years ago
Andrius Štikonas 490c14d93d QLatin1Literal->QLatin1String. 6 years ago
Adriaan de Groot 520478847c Make logging more consistent.
- Across all the C++ modules, use Logger::SubEntry for sub/continues
   log lines, instead of somewhat-random indent strings.
6 years ago
Adriaan de Groot dd8e53dc22 Copyright: update copyright lines on files touched in 2018
Contributions from:
  Adriaan de Groot <groot@kde.org>
  Gabriel Craciunescu <crazy@frugalware.org>
  AlmAck <gluca86@gmail.com>
  Andrius Štikonas <andrius@stikonas.eu>
  Caio Carvalho <caiojcarvalho@gmail.com>
  Raul Rodrigo Segura <raurodse@gmail.com>
7 years ago
Adriaan de Groot 40b60abcb3 [locale] Move constants for map-munging
These don't have to be defines at all.
7 years ago
Adriaan de Groot 6b3299e6ff [locale] Adjust the North
- Fudge the numbers in the North, to improve location
   of the pins and lines of latitude.
 - Inuvik, Yellowknife, Cambridge Bay, Resolute look ok
 - Thule, Scoresbysund look ok; Danmarkshavn a pixel or so too far North
 - Reykjavik is a bit too far North
 - Longyearbyen is a bit too far North

Since these places are off by one or two pixels, this becomes
invisible when a large pin + text label is placed on it.
7 years ago
Adriaan de Groot b7dbc8cc1f [locale] Name zones when debugging
- When debugging timezones, state their names (e.g. UTC offset)
   and also log the pixel position under consideration.
7 years ago
Adriaan de Groot 2c18ba6ddb [locale] Adjust latitude calculation in the southern hemisphere
The scaling on the map was a little off; the degrees of latitude
are a little wider there than around the equator and Europe.

 - Johannesburg is in the right spot
 - Hobart is no longer a suburb of Melbourne
 - Punta Arenas is in Chile
7 years ago
Adriaan de Groot 9f8f76befc [locale] Introduce timezone-widget debugging
Replace pin and text label with just a dot (to pinpoint where
locations are) and draw latitude lines on the globe when
DEbUG_TIMEZONE is set at compile time. Since there's probably
still timezone-related bugs (in particular in the images that
map points on the globe to timezones), leave this in the codebase.
7 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Adriaan de Groot 9f84519e87 Merge branch '3.1.x-stable'
- pull in northern-locations fixes
 - pull in testing yaml-config
8 years ago
Adriaan de Groot 00fa7bff1c Code-formatting, add copyright notice 8 years ago
Adriaan de Groot 78031636af Correct for distortion of globe.
In the timezone widget, locations in the far north -- Inuvik,
Thule, Longyearbyen -- were displayed too far south, because the
map location calculation assumes a linear gradient, which places
90 degrees north at about 70 degrees. Change calculation to
pretend the world is flat south of 62 degrees north, and then
'bend' the remaining 28 degrees of latitude to the top of the
image. This puts most places in the right spot, although Yellowknife
is now on the south shore of Great Slave.

Fort Nelson should be north of Dawson Creek, too -- the math still
needs a little work.

While here, put Antarctica in the south, otherwise Rothera keeps
showing up in Greenland.
8 years ago
Adriaan de Groot bd4ee9320d Clang: warnings--, drop unused WindowFlags parameter 8 years ago
Gormogon e2d05cb9f2 Align Pointers 10 years ago
Teo Mrnjavac 71851ed274 Process user-visible strings in TimezoneWidget and LocalePage. 10 years ago
Kevin Kofler 75adfa03fc locale: timezonewidget: Use the system default font.
Don't hardcode the Cantarell font.
11 years ago
Teo Mrnjavac 1ac10b40e6 Initial commit for the locale viewmodule. 11 years ago