Commit graph

115 commits

Author SHA1 Message Date
Benjamin Berg
8d9affbd6a datetime: Allow changing the timezone when auto-update is prohibited
When the user disables the use of location services in the privacy
panel, then the timezone will never be updated automatically. Automatic
timezone may still be enabled though, so we need to allow the user to
change the timezone when location services are disabled or when
automatic timezone updating is disabled.
2019-09-11 18:39:54 +02:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Robert Ancell
3695c22ab5 datetime: Make .ui filename match the .c filename 2018-11-12 16:41:01 +00:00
Robert Ancell
417fc57392 datetime: Use g_signal_connect_object for all signal handlers
This ensures they wont be called when the handling object is destroyed.
Also connect all in "swapped" form for improved readability.
2018-10-18 01:13:49 +00:00
Robert Ancell
c0f41daff0 shell: Remove the lock button from the shell
Only the date time panel used it, all other panels add their own shell using
cc_shell_embed_widget_in_header which was added after the date time panel was
written. Update the date time panel to use this method.
2018-10-18 00:25:40 +00:00
Robert Ancell
6ce1a1dce6 datetime: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-10 04:01:11 +00:00
Robert Ancell
216736b8dd datetime: Fix warning running callback before objects are created
The following warning occurs when the datetime panel is created:
(gnome-control-center:3173): GLib-GIO-CRITICAL **: 09:18:38.531: g_settings_get_value: assertion 'G_IS_SETTINGS (settings)' failed

This is due to the callback being called before the settings object is created
2018-10-09 20:30:16 +00:00
Petr Kubánek
89fabad809 datetime: grayout automatic timezone
Automatic timezone does not work if location sharing is disabled in privacy.

Grays out automatic timezone setting if location sharing is disabled in privacy
settings. Enable automatic timezone seting if location sharing is enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=788714
2018-09-11 02:11:44 +00:00
Robert Ancell
dd61d98ec5 datetime: Move callbacks into .ui file 2018-06-01 20:35:30 +00:00
Robert Ancell
6a72e73d0c datetime: Use GtkTemplate 2018-05-29 16:34:28 +00:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Dominique Leuenberger
5a66372deb datetime: Allow changing the timezone if polkit says so
As changing the time can have security implications, such as expiring
passwords, while changing the timezone doesn't, it's not unusual to
have a setup where org.freedesktop.timedate1.set-timezone is allowed
while other time-related actions aren't.

Therefore, if org.freedesktop.timedate1.set-timezone is allowed, there's
no reason to require that the user unlocks the panel to enable them to
change the timezone.

https://bugzilla.gnome.org/show_bug.cgi?id=646185
2018-01-26 11:07:59 -02:00
Robert Ancell
d71f705d77 datetime: Use g_auto for variables
https://bugzilla.gnome.org/show_bug.cgi?id=788221
2018-01-18 12:30:37 -02:00
Robert Ancell
e779a30927 datetime: Use G_DEFINE_TYPE 2017-09-26 20:20:45 -04:00
Silvère Latchurié
c890872843 datetime: Fix the style of the date/time selection dialog
Fix the size of the AM/PM button. Add padding to the time widgets and to the panel.

https://bugzilla.gnome.org/show_bug.cgi?id=778146
2017-05-17 17:30:07 +02:00
Bastien Nocera
85cd910af5 datetime: 12h time format is now always available
Following a change in GDateTime, AM/PM format is now always available
even if the support is missing in the locale used.

Remove the code used to detect AM/PM support in the locale, and bump the
GLib requirements to the version that includes this GDateTime change.

See https://bugzilla.gnome.org/show_bug.cgi?id=761889

https://bugzilla.gnome.org/show_bug.cgi?id=780863
2017-04-03 11:32:43 +02:00
Bastien Nocera
ac59708d3f datetime: Fix incorrect sensitivity when permission is missing
When the permission is missing, we shouldn't make the rows sensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=709774
2015-07-10 17:14:02 +02:00
Bastien Nocera
6279dcd0a6 datetime: Respect the date endianess
When the user changes the date, order the widgets in the same order as
how the date is printed in that locale.

https://bugzilla.gnome.org/show_bug.cgi?id=750799
2015-06-30 15:00:07 +02:00
Bastien Nocera
d7bda0bc2e datetime: Don't hard-code font size
Use a percentage instead.

https://bugzilla.gnome.org/show_bug.cgi?id=735973
2014-09-03 18:04:58 +02:00
Bastien Nocera
2ae2eabe2f datetime: Fix crash when setting year to 0
https://bugzilla.gnome.org/show_bug.cgi?id=735352
2014-09-01 14:43:51 +02:00
Stanislav Brabec
98916a60f8 datetime: Make punctuation translatable
https://bugzilla.gnome.org/show_bug.cgi?id=732585
2014-07-15 15:12:04 +02:00
Bastien Nocera
92134ee21b datetime: Use new listbox helpers
https://bugzilla.gnome.org/show_bug.cgi?id=732106
2014-06-24 11:35:30 +02:00
Michael Catanzaro
c8654808c2 datetime: check CanNTP when initializing the panel
If the system does not support NTP (as determined by the presence of an
NTP unit in /usr/lib/systemd/ntp-units.d), the Automatic Date & Time row
is intended to be hidden. We respond to changes to timedated's CanNTP
property, but we never account for the initial state of the property,
so we wind up displaying the Automatic Date & Time row even though the
switch is guaranteed to be broken.

Check CanNTP when initializing the panel to fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=732021
2014-06-23 11:50:34 -05:00
Yosef Or Boczko
576acc1602 datetime: Use header bar in the datetime and the timezone dialogs
The seatch entry in the timezone dialog is moved to the
title of the header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=724299
2014-04-28 17:29:17 +03:00
Kalev Lember
5fa3671289 datetime: Remove unused property setters/getters 2014-03-15 22:13:44 +01:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Matthias Clasen
c462c34b28 datetime: Set the filechooser clock format too
GTK+ now uses a 12h/24h setting in the org.gtk.Settings.FileChooser
schema to switch the time display in the file chooser. Set this
to be in sync with the global time format preference we have.

https://bugzilla.gnome.org/show_bug.cgi?id=722942
2014-01-26 09:47:51 -05:00
Kalev Lember
24faa84d05 datetime: Explicitly destroy toplevel dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=709443
2013-10-07 10:35:52 +02:00
Kalev Lember
47fb0c426f Revert "datetime: Don't leak the dialogs"
This caused criticals when on_permission_changed callback tried to
access priv->datetime_dialog or priv->timezone_dialog before they had
been set up.

Another attempt at fixing the leak in the following patch.

This reverts commit 545c886543.

https://bugzilla.gnome.org/show_bug.cgi?id=709443
2013-10-07 10:35:52 +02:00
Kalev Lember
7ae60ad2cf datetime: Disconnect from GtkStack signals before widget destruction
This fixes a regression from commit 545c886 that caused criticals when
leaving the datetime panel.

https://bugzilla.gnome.org/show_bug.cgi?id=709443
2013-10-07 10:35:52 +02:00
Kalev Lember
2234970583 datetime: Store am_pm_stack in priv structure
This is in preparation for the next patch.

https://bugzilla.gnome.org/show_bug.cgi?id=709443
2013-10-07 10:35:52 +02:00
Rui Matos
a401a914eb datetime: Remove unused toplevel window from .ui file
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:02 +02:00
Rui Matos
545c886543 datetime: Don't leak the dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=708286
2013-10-01 10:05:02 +02:00
Kalev Lember
17a8595ddc datetime: Sync AM/PM button's accessible name with the text displayed
Instead of hardcoding the accessible name as "Switch between AM and
PM.", set it to "AM" or "PM" depending on which label the stack switcher
is currently showing.

https://bugzilla.gnome.org/show_bug.cgi?id=708219
2013-09-17 14:31:22 +02:00
Kalev Lember
47e8406ed6 datetime: Connect arrow up/down keynav across list boxes
https://bugzilla.gnome.org/show_bug.cgi?id=707942
2013-09-15 16:58:43 +02:00
Kalev Lember
5f21f92f7f datetime: Plug a small memory leak 2013-09-12 22:32:46 +02:00
Kalev Lember
16e251ea98 datetime: Use new g_date_time %z format modifier
Use new %:::z format string to display timezone offset in a slightly
nicer way. This is also needed for consistency with the timezone
notifications from gnome-settings-daemon.

Also bump glib dependency to 2.37.7 for the new modifier.

https://bugzilla.gnome.org/show_bug.cgi?id=707253
2013-09-02 19:05:46 +02:00
Kalev Lember
c68f9eca50 datetime: Show the automatic timezone switch
The backend in gnome-settings-daemon is now functional, so we can expose
the option in the UI.

https://bugzilla.gnome.org/show_bug.cgi?id=707252
2013-09-02 19:05:46 +02:00
Kalev Lember
88f4c30c04 datetime: Use GObject property binding for the NTP switch
This makes it possible to remove the code for manually keeping the NTP
switch and the timedated1 DBus proxy properties in sync, and also makes
it easy to share code with the automatic timezone switch.

https://bugzilla.gnome.org/show_bug.cgi?id=707252
2013-09-02 19:04:40 +02:00
Kalev Lember
853fb8cc90 datetime: Move polkit initialization earlier
... so that in the following commit, we can rely on the permissions
being available.

While at this, also create a DATETIME_PERMISSION for the PolicyKit
action ID at the top of the file.

https://bugzilla.gnome.org/show_bug.cgi?id=707252
2013-09-02 19:04:40 +02:00
Kalev Lember
d7847fe7a1 datetime: Exit early if the timedate1 service isn't available
We cannot meaningfully change (or display) any Date & Time system
settings without the timedate1 DBus service, so just exit early.

https://bugzilla.gnome.org/show_bug.cgi?id=707252
2013-09-02 19:04:40 +02:00
Kalev Lember
a709ae41eb datetime: Rename settings to clock_settings
https://bugzilla.gnome.org/show_bug.cgi?id=707252
2013-09-02 19:04:40 +02:00
Kalev Lember
ab1d1b0c54 datetime: Hide the NTP switch when the service is unavailable
https://bugzilla.gnome.org/show_bug.cgi?id=706378
2013-08-29 16:48:54 +02:00
Kalev Lember
c5812c3ccc datetime: Mark the time format strings as translatable
... and add translator comments explainings what they do. The RTL
languages are likely going to want to show them in a different order.

We should eventually move to just using GnomeWallClock and/or
g_date_time_format with %c that already have translated the time format
strings. However, in case this doesn't make it in time for 3.10, mark
the current strings in g-c-c as translatable to get some translation
coverage.

https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 15:49:59 +02:00
Kalev Lember
da9d4a76c9 datetime: Show information about the selected timezone
... using the text bubble API from the previous commit. We're currently
displaying the time zone abbreviation, UTC offset, city and country
name, and the current time.

https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 15:49:59 +02:00
Kalev Lember
718118963e datetime: Implement timezone search with autocompletion
This is first cut at implementing the new timezone dialog design.
Instead of having drop down menus with the city and the continent, we're
now switching to a search entry that has autocompletion.

https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 15:49:50 +02:00
Rui Matos
19d3e96d6a datetime: Ensure that translated strings for timezones are UTF-8
This was fixed in commit 2c4bba74e0 but
then got lost in a code refactor in commit
3686cf7eb8.

https://bugzilla.gnome.org/show_bug.cgi?id=706350
2013-08-20 13:49:52 +01:00
Kalev Lember
6fddedad84 datetime: Toggle the NTP switch when clicking on the row
Pointed out by Allan Day on IRC.

https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 02:30:31 +02:00
Kalev Lember
20670b5360 datetime: Shuffle initialization code around
Move subdialog setup code out of the main init function and to
respective setup_*_dialog() functions.

https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 02:21:21 +02:00
Kalev Lember
f5cb98c94f datetime: Implement new design for the time subdialog
https://bugzilla.gnome.org/show_bug.cgi?id=694985
2013-08-20 02:21:21 +02:00