calendarium@kami911: timezone fixes, auto-detected location, customizable border, French Republican calendar - #1895
Open
KAMI911 wants to merge 12 commits into
Open
calendarium@kami911: timezone fixes, auto-detected location, customizable border, French Republican calendar#1895KAMI911 wants to merge 12 commits into
KAMI911 wants to merge 12 commits into
Conversation
_onCityNameChanged() looked up the typed city name via Geocoder.search() and saved the match's lat/lon/tz, but never wrote the canonical, correctly-capitalized name (e.g. "london" -> "London") back to the city-name setting itself — so the displayed label kept whatever casing the user originally typed. Found while porting this same logic to a Firefox extension version of Calendarium and fixing it there first.
…Alternate Calendars Ported from the Firefox extension version of Calendarium, where this was researched and implemented first: Year 1 began at the true autumnal equinox of 22 September 1792, and each subsequent Republican year begins at the *next* true autumnal equinox — not a fixed arithmetic leap-year rule (the later "Romme method" some software uses instead). Whether a given Republican year has 5 or 6 intercalary Sansculottide days falls out naturally from the actual gap between two real consecutive equinoxes (365 or 366 days), which is why this builds on lib/solstice.js's existing Meeus-algorithm equinox calculation rather than an arithmetic approximation. New setting "show-french-republican" under Alternate Calendars, wired into desklet.js's settings binding and _updateAltCal(), with lib/ calendars.js gaining toFrenchRepublican()/formatFrenchRepublican() alongside the existing Julian/Hebrew/Islamic/Persian converters. Translations added to all 5 existing .po files plus the .pot template. Verified numerically against known reference dates (the 22 Sept 1792 epoch, and the 1794->1795 sextile/leap year's extra "Jour de la Révolution" day) before committing.
… times The primary-location sunrise/sunset and moonrise/moonset calculations called Sun.getSunTimes()/getMoonTimes() without a UTC offset, so they were always rendered in the computer's system timezone even when the primary location sits in a different one (e.g. Marmaris, Turkey on a CET machine). Add a "primary-tz" IANA timezone setting, populated automatically by the city search (alongside latitude/longitude) just like the additional cities. When set, its current UTC offset is passed to the Sun/Moon calculations; when empty the behaviour is unchanged and the system timezone is used. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
…imezone When "Use manual location" is off, the desklet no longer hard-codes Budapest. It resolves the computer's system IANA timezone (via GLib.TimeZone, /etc/timezone or the /etc/localtime symlink) and looks up approximate coordinates for it in tzdata's zone1970.tab / zone.tab. Budapest remains the fallback when the timezone cannot be resolved. The settings panel wording is updated accordingly, and the result is cached for the desklet's lifetime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
New Appearance settings: "Draw a border around the desklet" with adjustable width (1–10 px), color (colorchooser) and corner radius (0–40 px). Off by default; when enabled the border and radius are applied to the container style alongside the existing background/opacity styling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
Best-practices scannerThis is a regex-based check for API usage that can pose security, performance or This check is not perfect and will not replace a normal review.Found 3 potential issue(s):
|
Address the best-practices scanner warnings on PR linuxmint#1895: the system timezone / coordinate lookup used synchronous GLib.file_get_contents() and Gio query_info(), which block the main loop. Replace them with Gio.File.load_contents_async() and query_info_async(). The lookup now runs once at startup via _resolveSystemLocationAsync(); until it completes _systemLocation() returns the Budapest default, and a redraw is triggered when the real result arrives (only when the primary location is auto-detected). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
…zone Add a "Show the clock and date in the primary location's timezone" checkbox (Location section, off by default). When enabled, the main clock, date label, month name and the date-based calendar sections use the primary location's timezone (the primary-tz setting, or the auto-detected system timezone) instead of the computer's own time. Default behaviour is unchanged: the clock follows the computer. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
The Appearance section (icon size, text scale, background opacity, border) was the last section on the crowded General page. Give it a dedicated "Appearance" settings page, between Location and Wikipedia. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PNasJnrStmVjJgJ8MULzcG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alternate calendars
Location & timezone
primary-tzIANA timezone setting, auto-filled by the city search alongside latitude/longitude (empty = use the system timezone)/etc/timezoneor the/etc/localtimesymlink, then looked up in tzdata'szone1970.tab/zone.tab), instead of hard-coding Budapest — Budapest remains the fallbackAppearance
Zodiac icons
Translations