Commit graph

294 commits

Author SHA1 Message Date
Robert Ancell
dd06bf7c11 datetime: Fix NTP switch getting out of sync.
The state needs to be set to the state that was requested before the D-Bus call.
The existing code used the state received from D-Bus, which will be the previous state.
2023-03-30 09:19:34 +13:00
Robert Ancell
00e303998e datetime: Use g_object_bind_property to show NTP state 2023-03-30 09:17:21 +13:00
Robert Ancell
a3d99c78f6 datetime: Fix widget names and types 2023-03-29 11:04:24 +00:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Alessandro Bono
7c356d8c7d datetime: Decouple active and state properties usage
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2330
2023-03-03 18:16:57 +00:00
Mohammed Sadiq
b5e02cdbe5 Remove no longer used timezone map 2022-12-04 21:38:34 +00:00
Mohammed Sadiq
5e41174475 datetime: Use the new timezone dialog
This commit also removes the deprecated GtkListStore usage
2022-12-04 21:38:34 +00:00
Mohammed Sadiq
eda96f8bc5 datetime: Implement the new timezone selection dialog
which fits better on small screen and is more accessible than a map.
This is based on GNOME Clocks world clock[0] and GNOME Settings[1] designs

[0] https://gitlab.gnome.org/Teams/Design/app-mockups/-/blob/master/clocks/clocks.png
[1] https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/date-and-time/time-zone-picker.png
2022-12-04 21:38:34 +00:00
Mohammed Sadiq
39267eb2a6 datetime: Add cc-tz-row 2022-12-04 21:38:34 +00:00
Mohammed Sadiq
da777d3edd datetime: Add cc-tz-item 2022-12-04 21:38:34 +00:00
Mohammed Sadiq
1885b2c4f3 datetime: Display month in 2 columns
So that it fits better in smaller screens and the user
doesn't have to scroll to select some months.

This commit implements the updated design[0]

[0] https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/time-date/time-date-adaptive.png
2022-12-01 01:21:24 +00:00
Mohammed Sadiq
e23ff1befc Add cc-month-row
This will be used to show month in the month selection grid
2022-12-01 01:21:24 +00:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Jakub Steiner
064c6a807d timezone: Use blank map 2022-07-07 11:37:39 +00:00
Carlos Garnacho
f923c3ca01 datetime: Drop timezone highlighting
In most situations it is sufficient with the hint bubble being
displayed, or city name search, rely on these.
2022-07-07 11:37:39 +00:00
Carlos Garnacho
65d83189e9 datetime: Drop colormap
This image file is nowadays unused, except for loading/destroying it.
We can simply drop this.
2022-07-07 11:37:39 +00:00
Lukáš Tyrychtr
46932dcffe Fix indent 2022-05-30 22:24:47 +00:00
Lukáš Tyrychtr
fd7691c0b9 Add a missing label to the automatic timezone switch 2022-05-30 22:24:47 +00:00
Mohammed Sadiq
4b2d32e53f datetime: Fix crash when loading the panel
When the month row value is changed, the signal callback uses
the year value from the year spin button.  So set year value
before month is set so that the year is set to a valid value
thus avoiding a crash with invalid year.
2022-02-01 13:59:33 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Georges Basile Stavracas Neto
043d4fab74 datetime: Switch day row to AdwActionRow
Another small cleanup.
2022-01-26 23:47:36 -03:00
Georges Basile Stavracas Neto
b7876233e9 datetime: Switch year row to AdwActionRow
Another nice, small cleanup
2022-01-26 23:46:10 -03:00
Georges Basile Stavracas Neto
65c53a4c57 datetime: Switch Month row to AdwComboRow
It fits it much better, and allows for a great cleanup.
2022-01-26 23:43:43 -03:00
Pablo Correa Gómez
7c91fc1400 datetime: get month_label from GtkFlowBox widget
Using g_date_time_format to get the name of the month
translates the name according to LC_TIME. This is inconsistent
with all other labels displayed, which get translated according
to LC_MESSAGES. By taking the label from the corresponding
entry in the GtkFlowBox, we avoid the incosistency

Fixes #1507
2022-01-25 11:42:41 +00:00
Georges Basile Stavracas Neto
2e73952d28 datetime: Add go-next-symbolic to dialog rows
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
4300a4a290 panels: Use new CcPanel helpers for title widgets
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Christopher Davis
24fbb5e49a cc-datetime-panel: Use AdwComboRow
The API is nicer, and it's the recommended widget to use
for dropdown rows.
2022-01-06 11:47:10 -08:00
Christopher Davis
0a5515463d cc-datetime-panel: Use AdwPreferencesGroup
Lets us get rid of our manual listboxes.
2022-01-06 11:42:08 -08:00
Christopher Davis
d3756aaf26 cc-datetime-panel: Move activation handling to rows 2022-01-06 11:42:08 -08:00
Christopher Davis
3b90e5b43f cc-datetime-panel: Set activatable-widget on rows with switches 2022-01-06 11:42:08 -08:00
Christopher Davis
52a32574fb cc-datetime-panel: Remove keynav-failed handling 2022-01-06 11:42:08 -08:00
Colin Watson
14a2672e28 datetime: Fix handling of Irish timezone on map
The timezone map tries to highlight regions of the world that keep the
same time, approximating this by their non-daylight-savings UTC offset.
There's no reasonable API for this, and it goes wrong in various cases,
such as Irish Standard Time which is legally defined as the country's
summer time with a negative DST offset in winter.

Hardcoding this is unpleasant, but there doesn't seem to be a better
solution, and in any case there's already similar hardcoding implied by
the segmented map images in panels/datetime/data/timezone_*.png.  I've
tried to make it practical to fix other similar disagreements between
the detected offset and the groupings implied by map images, though for
now I've conservatively fixed only the case I'm familiar with.

Fixes: #1341
2021-12-17 14:49:24 +00:00
Colin Watson
1b874509a4 datetime: Remove tzname_daylight
The code that set it could only ever have worked by luck in some
timezones on some systems, and there's no API to obtain the information
we were trying to store in it.  Nothing uses it, so there's no point
trying to fix it.

tzname_normal is also unused, but slightly useful for debugging, so
rename it to tzname but otherwise keep it in place.
2021-12-17 14:48:45 +00:00
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Georges Basile Stavracas Neto
c6dd59f378 datetime: Port to GTK4
Of particular relevance, the timezone map was massively cleaned up.
It is much more pleasant to use now.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
6cc5bbd074 datetime: Use g_time_zone_new_identifier
g_time_zone_new() is deprecated in favour of g_time_zone_new_identifier().

g_time_zone_new_identifier() returns NULL if no matching identifier is
found, so warn and fallback to UTC in that case.
2021-07-29 23:43:29 +00:00
Mohammed Sadiq
ea821e5c3a datetime: Use content style for listbox 2021-05-19 03:25:47 +00:00
Benjamin Berg
3bf6ea7794 datetime: Improve NTP switch handling fixing update loop
We cannot simply set the state/active property of the switch without
also triggering the notify:: or state-set signals at the same time. As
such, we need to block the "set-state" handler when we update the
"state" of the switch.

Also, while at it, change the switch to react to "state-set" and only
update the "state" after we received the response from the system.

Fixes: #1299
2021-05-07 03:46:13 +00:00
Mohammed Sadiq
55ea4cabda datetime: Implement the new time-date editor dialog design 2020-09-15 03:07:41 +00:00
Mohammed Sadiq
c2b0f8cb1d datetime: Fix activating time and timezone rows
These rows seems not activatable by default and thus not able to edit those values
2020-08-10 13:06:30 +00:00
Adrien Plazas
0c71793e7c Stop using the action HdyActionRow child type
It has been dropped and is now the default child type.
2020-07-20 08:04:28 +02:00
Adrien Plazas
f06379e30c Replace HdyColumn by HdyClamp
In libhandy 1, HdyClamp replaces HdyColumn. This stops setting values
when they match HdyClamp's defaults.
2020-07-20 08:04:28 +02:00
lionirdeadman
5b573b7e25 Seperate timezone and date controls as per recent design mockups. 2020-07-17 03:32:02 +00:00
Mohammed Sadiq
7683a09ff7 datetime: Use the new time editor 2020-06-15 04:55:39 +00:00
Robert Ancell
9bc6d2d3f1 datetime: Replace ifdefs with #pragma once 2019-11-27 21:56:10 +00:00
Andre Klapper
397a0ce673 Correct incorrect timezone on world map for North Korea
Fixes #713
2019-10-17 10:05:56 +13:00
Andre Klapper
a3af25fd8a Correct incorrect timezone on world map for Venezuela
Fixes #714
2019-10-14 20:12:26 +00:00
Andre Klapper
e4b1df23a4 Correct incorrect timezone on world map for Sri Lanka
Fixes #709
2019-10-13 21:51:21 +00:00