Commit graph

218 commits

Author SHA1 Message Date
Jan Tojnar
7c4428eb59 region: Fix creating rows for locales without country
When creating a language row for Esperanto (eo.UTF-8), gnome-desktop throws a critical:

    gnome_get_country_from_code: assertion 'code != NULL' failed
2022-05-26 19:05:16 +00:00
Pablo Correa Gómez
42cb548115 common: Wrap CcPermissionInfobar labels to fit in narrower screens 2022-05-10 04:37:42 +00:00
Dor Askayo
9401881a38 common: Add a missing dependency on cc-common-resources.h
cc-common-resources.h is used by both libwidgets and liblanguage, and
so must be generated before they build. However, Meson wasn't aware
of this dependency which resulted in a race condition during build.

Conveniently, "generates_sources_dep" already contains other generated
sources used by these two libraries, so adding cc-common-resources.h
to this list is enough to declare the dependency.
2022-02-25 16:10:58 +00:00
Georges Basile Stavracas Neto
c591ab3f77 common: Slightly increase default width of CcLanguageChooser
So it doesn't cut the title label in Portuguese.
2022-02-07 07:03:42 -03:00
Mohammed Sadiq
9dfaca3725 common: time-entry: Fix changing time clicking the buttons
The change-value signal was not handled when emitted.  Add a handler
to handle the signal and update time as needed.
2022-01-27 03:32:58 +00:00
Christopher Davis
e637f47e78 cc-list-row: Subclass AdwActionRow
AdwActionRow handles many of the properties we use
CcListRow for. We can re-use it instead of re-creating it.

CcListRow is now an AdwActionRow with three suffixes.
The `activatable-widget` is set when the switch is visible.

Since our `icon-name` property was only used for the arrow
icon, it has been replaced with a `show-arrow` property.

The `bold` property has been removed - it was only used in
one place, and it's not a pattern used in other apps.

I decided to go this route because replacing all the
instances of CcListRow with AdwActionRow directly would
end up being more code.
2022-01-06 08:56:12 -08:00
Victor Toso
dac8fd64cd common: Fix leak of GUdevDevice
The add_device() check for g_udev_device_get_parent() was leaking (see
below). As this is actually used in create_device(), I'm passing it as
argument to avoid a second call to that function.

 > 34,175 (1,080 direct, 33,095 indirect) bytes in 27 blocks are definitely lost in loss record 19,729 of 19,758
 >    at 0x4A7A337: g_type_create_instance (gtype.c:1907)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x5EA5A6A: _g_udev_device_new (gudevdevice.c:132)
 >    by 0x4B6D24: add_device (gsd-device-manager.c:447)
 >    by 0x4B6FBF: gsd_device_manager_init (gsd-device-manager.c:517)
 >    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
 >    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
 >    by 0x4A62C7C: g_object_new_with_properties (gobject.c:2114)
 >    by 0x4A63780: g_object_new (gobject.c:1785)
 >    by 0x4B7075: gsd_device_manager_get (gsd-device-manager.c:533)
2021-12-17 09:50:57 +01:00
Georges Basile Stavracas Neto
234d1aadb7 common: Depend on generated sources
Generated sources need to be generated before files that
use them can be built.

Add a separate dependency on them, and make the various
libraries under panels/common/ depend on these sources.
2021-12-15 11:17:57 -03:00
Georges Basile Stavracas Neto
59bdf81028 common: Port to GTK4
This is only the bare minimum to make everything under panels/common
build. Since these widgets are used by the main window, port them
first.

CcTimeEntry was particularly hard to port. That's because GtkEntry
is a final class now. Overall, though, I'm happy with how it turned
out to be - much cleaner, less code, more obvious.
2021-12-14 22:34:21 -03:00
Mohammed Sadiq
f3f4f13fe4 common: Add polkit rules for modem management 2021-08-13 19:25:41 +00:00
Eric
4383f020e7 Switch to g_get_os_info to read os_release
As described in #1346, GLib 2.64 includes a g_get_os_info() function,
providing access to keys from /etc/os-release. This commit replaces calls to
gnome-control-center's custom parser (in panels/common/cc-os-release.c)
with calls to this new function, and deletes the custom parser code.

Closes #1346
2021-06-15 21:54:35 +00:00
Georges Basile Stavracas Neto
9fc0a4c2b1 common/language-chooser: Center More row icon
Otherwise it gets pushed to the start of the row.
2021-03-04 09:33:44 -03:00
Georges Basile Stavracas Neto
c223ba2554 common/language-chooser: Make "More" rows visible by default
The inner box of the More row is visible, but the row itself isn't.
Make the row visible too.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1273
2021-03-04 09:33:40 -03:00
Georges Basile Stavracas Neto
af5d13e7b5 common: Rename 'check' to 'check_image'
The C code tries to fetch and use 'check_image', but the UI definition
calls it 'check', which throws a few warnings. Renaming it in the UI file
is easier than in the C file, so I went with the former.
2021-02-23 10:28:22 -03:00
Georges Basile Stavracas Neto
7167019522 common: Add missing <child> tag to CcLanguageChooser
The UI file is not wrapping the <object> tag with <child>, which
fails to parse and blanks the dialog.

Add the missing <child>  tag around the "More" row object.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1270
2021-02-23 10:28:15 -03:00
Robert Ancell
e50de0def6 common: Use self variable name for CcLanguageChooser 2021-02-01 04:02:22 +00:00
Robert Ancell
d7c8ecee60 common: Move CcLanguageChooser signal handlers into GtkBuilder 2021-02-01 04:02:22 +00:00
Robert Ancell
c7d2b0945d common: Consolidate CcLanguageChooser functions 2021-02-01 04:02:22 +00:00
Robert Ancell
7b07b5d060 common: Use widget types for CcLanguageChooser 2021-02-01 04:02:22 +00:00
Robert Ancell
878f5191db common: Move CcLanguageChooser more row into GtkBuilder 2021-02-01 04:02:22 +00:00
Robert Ancell
35ef98806b common: Move CcLanguageChooser language placeholder widget into GtkBuilder 2021-02-01 04:02:22 +00:00
Robert Ancell
4fb52c8496 common: Split out CcLanguageRow from CcLanguageChooser 2021-02-01 04:02:22 +00:00
Robert Ancell
0d9bf5fa06 Fix PangoAttrList leak introduced in 63243d886a 2021-01-10 20:54:48 +00:00
Mohammed Sadiq
ca7002b0ae list-row: Add API to set sensitivity of switch 2021-01-08 02:54:15 +00:00
Mohammed Sadiq
08defd6ec5 list-row: Add 'bold' property
So that we can set if title is bold or not
2021-01-08 02:54:14 +00:00
Robert Ancell
f355234323 common: Remove unused CcListBox and CcListBoxRow 2020-12-14 11:36:45 +13:00
Philip Withnall
cef9a23e6a cc-permission-infobar: Support customisable titles
Some panels may want to provide more specific context than ‘Change
Settings’.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-11 17:19:11 +00:00
Gunnar Hjalmarsson
5aee280a29 common: Display locale @modifiers properly
Fixes GNOME/gnome-desktop#50
2020-09-21 13:13:10 +00:00
Carlos Garnacho
14da368600 common: Add GsdDevice API to tell whether 2 devices are grouped
This will be used for pad devices, better than the current way of
comparing name strings coming from libwacom.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/415
2020-09-04 21:46:19 +00:00
Adrien Plazas
9e2a2836d9 Use GtkDialog instead of HdyDialog
HdyDialog has been dropped in libhandy 1.
2020-07-20 08:04:28 +02:00
Mohammed Sadiq
7683a09ff7 datetime: Use the new time editor 2020-06-15 04:55:39 +00:00
Mohammed Sadiq
63243d886a Add time editor widget 2020-06-15 04:55:39 +00:00
Matthew Leeds
7b1bed5ab0 common: Improve how we print time periods
Print e.g. "2 minutes" instead of "2 minutes 0 seconds". Also, update
the path in Totem from which this was copied. The MR to make the same
change in Totem is here:
https://gitlab.gnome.org/GNOME/totem/merge_requests/134
2020-03-30 03:43:09 +00:00
Robert Ancell
f1b84e29ef common: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:50 +13:00
Georges Basile Stavracas Neto
c114828ec3 trivial: Replace g_memmove by memmove 2020-02-02 12:25:42 -03:00
Felipe Borges
5d2a884ac7 common: Introduce "CcPermissionInfobar" widget
The "CcPermissionInfobar" widget is a more descriptive way to
communicate that some Settings panel needs authentication in order
to perform certain actions.

This widget doesn't handle the permissions (as in GPermission)
itself. It needs to be binded to an existing instance of GPermission,
and it will react to the permission's state (show when the current
user is not authorized, and hide when the user is authorized).

This is part of a big set of changes that aim to set a consistent
authentication method accross Settings panels.

See #685, #556, and #771
2020-01-06 14:43:11 +00:00
Carlos Garnacho
62d69fb313 common: Fix again tracking of udev device removals
This got fixed in commit 008b1f68c8, and broken again the very same
way in commit 3600cb5a40. Go me.
2019-12-05 17:25:45 +01:00
Robert Ancell
1ea6941fb8 common: Replace ifdefs with #pragma once 2019-11-27 21:56:10 +00:00
Umang Jain
8f513989ef cc-language-dialog: Increase height to 475px
Increase height so that "view-more-symbolic" icon appears
by default when the language-dialog is displayed. This
improves UI-feedback for the user for browsing additional
language entries.
2019-11-21 03:54:28 +00:00
Georges Basile Stavracas Neto
255a1ab948 power: Move helper function to panels/common
It will be used by the Lock Screen panel in the future.
2019-11-07 14:19:23 +13:00
Robert Ancell
4376140183 common: Make the privileged group configurable (i.e. wheel vs sudo)
Fixes #559
2019-10-31 03:34:28 +00:00
Mohammed Sadiq
8950cd5ec2 common: Add cc-list-row 2019-10-29 09:48:08 +13:00
Mohammed Sadiq
23a7401467 language-chooser: Port to HdyDialog
so that it works well on small screens
2019-09-09 22:14:18 +00:00
Robert Ancell
1752cf3bb5 Make /etc/os-release support common
The existing code is used in multiple places with slightly different
implementations.
2019-09-09 21:42:10 +00:00
Carlos Garnacho
f57a117cc1 common: Update to gdk/x11 API
We use gdk_error_trap*() in this little piece of remaining x11
code. Update to gdk_x11_display_error_trap*() found more recent
gtk.
2019-08-08 15:18:07 +00:00
Carlos Garnacho
7e6301d449 common: Remove unused X11/XI1/XI2 API
Those went unused over time. Time to clean those up.
2019-08-08 15:18:07 +00:00
Carlos Garnacho
3600cb5a40 common: Unite GsdDeviceManager
Drop the subtypes, and keep a single udev-based GsdDeviceManager,
which will work on both backends, and should work on all platforms
we care about (?).
2019-08-08 15:18:07 +00:00
Carlos Garnacho
9e5ccbd748 common: Drop update-from-gsd usage
Those files are no longer existent in gnome-settings-daemon, so
this module is free to do as it pleases with them, there doesn't
need to exist any synchronization anymore.
2019-08-08 15:18:07 +00:00
Robert Ancell
e85816f83b common: Fix crash in language chooser
A report in Red Hat bugzilla [1] shows for some reason the country is set to
NULL and this causes a crash when comparing against search terms. The solution
is to handle the NULL without crashing.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1685251
2019-03-26 22:02:32 +00:00
Benjamin Berg
42006249af Remove internal copy of HdyValueObject
The relevant code is included in libhandy 0.8 and can be removed now
that we depend on a new enough version.
2019-03-04 16:59:25 +00:00