Skip to content

World Clock: initial submission - #1890

Closed
RobertAlexanderH wants to merge 5 commits into
linuxmint:masterfrom
RobertAlexanderH:world-clock-initial
Closed

World Clock: initial submission#1890
RobertAlexanderH wants to merge 5 commits into
linuxmint:masterfrom
RobertAlexanderH:world-clock-initial

Conversation

@RobertAlexanderH

Copy link
Copy Markdown

Summary

  • New desklet: a grid of named clocks with per-tile timezones
  • UUID: cinnamon-world-clock-desklet@curbsoftware
  • Clocks are added, edited and removed from a per-tile menu or the trailing "+" tile; the local-timezone tile is outlined
  • Layout is auto (near-square) or fixed rows x columns; strftime time/date formats; per-tile font sizes are maximums that scale down to fit
  • Tile chrome is dark-backed so text stays readable on light wallpapers and light themes
  • Derived from TimeAndDate@nightflame (GPLv2); relicensed contact point noted in the README

Validation

  • ./validate-spice cinnamon-world-clock-desklet@curbsoftware — no errors
  • .pot generated with ./cinnamon-spices-makepot
  • Headless unit tests for the layout/list helpers pass under gjs

Test plan

  • Add desklet, add/edit/remove clocks, confirm the last clock cannot be removed
  • Local timezone tile is outlined
  • Settings: auto vs fixed layout, formats, maximum font sizes
  • Reload and cinnamon --replace after helper-module edits
  • Light and dark Cinnamon themes

Tested on Cinnamon 6.6.9 (Mint 22.x), Mint-L-Dark and Mint-Y.

@github-actions

Copy link
Copy Markdown

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Most findings
are advisory and do not automatically disqualify a pull request.

This check is not perfect and will not replace a normal review.


Found 11 potential issue(s):

⚠️ WARNING

⚠️ hardcoded_data_dir

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:16

Gettext.bindtextdomain(uuid, GLib.get_home_dir() + "/.local/share/locale");

Avoid hardcoding .local/share in paths. Use GLib.get_user_data_dir() instead,
which respects the XDG_DATA_HOME environment variable.

⚠️ lang_bind

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:273

this._destroyId = this.connect("destroy", Lang.bind(this, this._cleanup));

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:345

this._rebuildTimeout = Mainloop.timeout_add(100, Lang.bind(this, function () {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:440

widget.actor.connect("clicked", Lang.bind(this, this._onClockTileClicked));

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:464

button.connect("clicked", Lang.bind(this, this._onAddClock));

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:496

editItem.connect("activate", Lang.bind(this, function () {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:503

removeItem.connect("activate", Lang.bind(this, function () {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:512

addItem.connect("activate", Lang.bind(this, this._onAddClock));

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:575

this._clockDialog = ClockDialog.promptClock(_("Add Clock"), ClockActions.DEFAULT_CLOCK, Lang.bind(this, function (values) {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:593

this._clockDialog = ClockDialog.promptClock(_("Edit Clock"), current, Lang.bind(this, function (values) {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.

cinnamon-world-clock-desklet@curbsoftware/files/cinnamon-world-clock-desklet@curbsoftware/desklet.js:611

const doRemove = Lang.bind(this, function () {

Lang.bind() is deprecated. Use arrow functions (() => {}) or Function.prototype.bind() instead.


Automated pattern check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants