[Digital Clock] Add ability to change first day of week
Needs ReviewPublic

Authored by Zren on Jan 6 2019, 5:10 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

CCBUG: 390330

The Qt enum can have Sunday value of 0 or 7, so we start the enum at -1 to represent the locale's default value.


If you have issues with the enum starting at -1, just say so and I'll shift it to Default=0, Sunday=1, Monday=2.

Test Plan
  • Open config > Calendar Tab > Change to First day of week to Wednesday
  • Open Digital Clock popup, confirm it starts at Wednesday
  • Close the widget config.
  • Reopen the widget config and confirm the ComboBox is populated with the correct (new) value.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
Zren created this revision.Jan 6 2019, 5:10 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 6 2019, 5:10 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Zren requested review of this revision.Jan 6 2019, 5:10 PM
ngraham added a subscriber: ngraham.
ngraham added inline comments.
applets/digital-clock/package/contents/ui/configCalendar.qml
56

I'd add a "the" and make this "First day of the week"

Is there a use case for having it configurable inside the plasmoid separately from configuring it system wide?

pino added a subscriber: pino.Jan 7 2019, 9:47 AM
pino added inline comments.
applets/digital-clock/package/contents/ui/configCalendar.qml
68

this needs a context (using i18nc), otherwise translators have no idea what "Default" means

abetts added a subscriber: abetts.Jan 7 2019, 3:36 PM

+1

How was this not an option ever?

Zren added a comment.Jan 8 2019, 1:00 AM

Is there a use case for having it configurable inside the plasmoid separately from configuring it system wide?

https://bugs.kde.org/show_bug.cgi?id=390330#c5

Just change the locale to Egypt [مصر - العربية (ar_EG)] (the user prefers en_US) and many countries in the region and the start of the week will be Saturday.
Changing the local from systemsettings will results in too many changes across KDE that I do not want. Since I can no longer change every minor detail in the Regional settings I had to edit files directly to achieve what I want.

I don't believe anyone asked if he changed the "time locale" to ar_EG while leaving the rest at en_US. However testing with LC_TIME="ar_EG.UTF-8" shows that it would change the hour/month/year into arabic, which probably wasn't desired.

LC_TIME="ar_EG.UTF-8" plasmoidviewer -a org.kde.plasma.digitalclock
LANGUAGE="ar_EG:ar" LANG="ar_EG.UTF-8" LC_TIME="ar_EG.UTF-8" plasmoidviewer -a org.kde.plasma.digitalclock

The ability to customize Qt's en_US locale's firstDayOfWeek system wide would be nice. It would be difficult to do though I assume? We'd essentially need to create a new locale right? Thus the simplicity of making just the widget configurable.

Right now with the patch, the firstDayOfWeek in the widget would be different than the Qt Widget calendar in "Adjust Date and Time...". So we might get new bug reports of the user annoyed that the feature only affects the digitalclock widget.

It also only affecting the current screen, as they'd need to change it on every screen's panel, but that is also a gripe with the "Show Date" toggle as well.

applets/digital-clock/package/contents/ui/configCalendar.qml
68

Is this informative enough? i18nc("locale's default day of week", "Default")

mart added a subscriber: mart.Jan 8 2019, 9:37 AM

-1 on this in particular
+1 for having it system wide