Compare commits

...

1082 Commits
40.7 ... master

Author SHA1 Message Date
Georges Basile Stavracas Neto
a7cb8295fe EOL master 2022-04-26 15:46:10 -03:00
Anders Jonsson
f948a56f98 Update Swedish translation 2022-04-26 18:26:44 +00:00
Yuri Chornoivan
58f5ea715c Update Ukrainian translation 2022-04-26 17:39:23 +00:00
Felipe Borges
5284a1d410 multitasking: Add some new keywords to desktop file
While searching in the Shell, users might input the keywords "Hot
Corner" and "Workspaces".

Fixes #1784
2022-04-26 17:23:45 +00:00
Michael Catanzaro
46bc354cfb sound: remove dog bark sound theme
You're welcome, internet.
2022-04-26 17:17:41 +00:00
Georges Basile Stavracas Neto
0bfb1e8906 Post-branching version bump
Mainline is open for business again
2022-04-26 14:16:07 -03:00
Georges Basile Stavracas Neto
a95f8ec974 Post-release version bump 2022-04-26 14:15:00 -03:00
Georges Basile Stavracas Neto
fdaecc3eac 42.1 2022-04-26 14:04:32 -03:00
Matej Urbančič
fd12b1b3f6 Update Slovenian translation 2022-04-25 19:13:27 +00:00
Danial Behzadi
f048803fb9 Update Persian translation 2022-04-25 13:57:20 +00:00
Marco Ciampa
804cf0b9b9 Update it.po 2022-04-25 13:16:30 +00:00
Zurab Kargareteli
e52fed7b4a Update Georgian translation 2022-04-25 09:17:51 +00:00
Aleksandr Melman
e7cc472ec8 Update Russian translation 2022-04-24 16:36:32 +00:00
Marco Trevisan (Treviño)
f55639cabb display: cleanup monitors list disposition 2022-04-24 12:21:14 +00:00
Marco Trevisan (Treviño)
c6da230052 display: Remove weak references on display disposition
Weak references are added when logical monitors are created, however we
don't remove them when destroying the display.

This means that if a monitor survives to the display finalization
(because may be referenced elsewhere) it will make g-c-c to crash
during its finalization, as that will trigger the weak reference
callback that will try to access to the already-finalized display.
2022-04-24 12:21:14 +00:00
Hu Jialun
8809dbc565 sharing/remote-desktop: handle gracefully when unable to get username
getlogin() can fail for several reasons as detailed in the man page, and
the current behaviour is a segmentation fault when it fails with NULL,
such as due to an unset loginuid.

* Check return value for error and act accordingly.
* Change to getpwuid(getuid())->pw_name, which is less likely to error.
2022-04-24 12:15:56 +00:00
Jeremy Bicha
414d4537cd sharing: Fix Remote Desktop on switch handling
Previously, we were only checking if the gnome-remote-desktop
user service was running but that service is always running
as of
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/commit/7f4ef31fd38

We need to check the gsettings key too.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1775
2022-04-24 12:10:49 +00:00
Felipe Borges
e8a046765f wacom: Fix typo in UI file property name
Fixes #1777
2022-04-24 12:04:38 +00:00
Zurab Kargareteli
43b6e4a928 Update Georgian translation 2022-04-23 16:56:05 +00:00
Piotr Drąg
2318fdb08c Update Polish translation 2022-04-23 14:41:57 +02:00
Ngọc Quân Trần
f13d8641d7 Update Vietnamese translation 2022-04-23 01:13:43 +00:00
Luming Zh
f120537d78 Update Chinese (China) translation 2022-04-23 00:37:20 +00:00
Felipe Borges
633bf89537 sharing: Use GtkWindowControls to wrap the cert fingerprint dialog
Instead of using a plain "flat" button positioned at the window corner,
let's use GtkWindowControls to wrap the close button and get the
default window control styling and alignment.

Fixes #1737
2022-04-22 12:22:27 +00:00
Goran Vidović
b99a987c63 Update Croatian translation 2022-04-21 17:50:42 +00:00
Emin Tufan Çetin
58a1720109 Update Turkish translation 2022-04-21 07:50:25 +00:00
Jiri Grönroos
15a38273cb Update Finnish translation 2022-04-21 07:15:54 +00:00
Rafael Fontenelle
2b1ff315db Update Brazilian Portuguese translation 2022-04-21 01:24:47 +00:00
Hugo Carvalho
28bc160cff Update Portuguese translation 2022-04-20 22:04:46 +00:00
Jordi Mas
f724267394 Update Catalan translation 2022-04-20 22:01:18 +02:00
Goran Vidović
903854d776 Update Croatian translation 2022-04-20 17:29:03 +00:00
Felipe Borges
c2f89ef7ba wacom: Mark two more strings as translatable
See c5d0437c0f (note_1433556)
2022-04-20 18:09:21 +02:00
Piotr Drąg
9495fea0ef Update Polish translation 2022-04-20 18:03:19 +02:00
Sveinn í Felli
34e4314af7 Update Icelandic translation 2022-04-20 11:33:21 +00:00
Fran Dieguez
ba91ad00dc Update Galician translation 2022-04-20 06:55:31 +00:00
Bastien Nocera
1e1fbd6891 online-accounts: Fix feature switches not doing anything
Make sure to keep a reference to the GoaObject of the account around so
that the GBinding that synchronises each switch widget and the account
properties don't get finalized on startup.

 #0  0x00007ffff73c6a20 in g_binding_finalize () at /lib64/libgobject-2.0.so.0
 #1  0x00007ffff73d3d22 in g_object_unref () at /lib64/libgobject-2.0.so.0
 #2  0x00007ffff73c68e8 in weak_unbind () at /lib64/libgobject-2.0.so.0
 #3  0x00007ffff73cf117 in weak_refs_notify () at /lib64/libgobject-2.0.so.0
 #4  0x00007ffff72acd6c in g_data_set_internal () at /lib64/libglib-2.0.so.0
 #5  0x00007ffff73d0195 in g_object_real_dispose.lto_priv () at /lib64/libgobject-2.0.so.0
 #6  0x00007ffff73d3c44 in g_object_unref () at /lib64/libgobject-2.0.so.0
 #7  0x00007ffff72b6793 in g_hash_table_remove_all_nodes.part () at /lib64/libglib-2.0.so.0
 #8  0x00007ffff72ba723 in g_hash_table_unref () at /lib64/libglib-2.0.so.0
 #9  0x00007ffff753403d in g_dbus_object_proxy_finalize () at /lib64/libgio-2.0.so.0
 #10 0x00007ffff73d3d22 in g_object_unref () at /lib64/libgobject-2.0.so.0
 #11 0x0000000000402d08 in glib_autoptr_clear_GoaObject (_ptr=0x5d59f0) at /usr/include/goa-1.0/goa/goa-generated.h:3265
 #12 glib_autoptr_cleanup_GoaObject (_ptr=<synthetic pointer>) at /usr/include/goa-1.0/goa/goa-generated.h:3265
 #13 on_application_activate_show_account_cb (application=0x49f2f0, argv=<optimized out>) at ../../../../Projects/jhbuild/gnome-control-center/panels/online-accounts/gnome-control-center-goa-helper.c:360

Closes: #1721
2022-04-19 23:19:54 +02:00
Alexandre Franke
37b70a230f Update French translation 2022-04-19 20:57:09 +00:00
Alan Mortensen
9277e7573a Update Danish translation 2022-04-19 17:59:02 +00:00
Anders Jonsson
5ec3417a2d Update Swedish translation 2022-04-19 17:48:25 +00:00
Yuri Chornoivan
2896754417 Update Ukrainian translation 2022-04-19 17:15:43 +00:00
oscfdezdz
c5d0437c0f wacom: mark some strings as translatable
Some UI strings were not marked as translatable when the panel was ported to GTK4.
2022-04-19 16:46:59 +00:00
koko ng
322bddd971 user-accounts: Close password change dialog
Fixes #1746
2022-04-19 15:08:49 +00:00
Hugo Carvalho
51faf7090e Update Portuguese translation 2022-04-16 16:46:52 +00:00
Georges Basile Stavracas Neto
e5a49dcf7b display: Return to main page after applying changes
After applying a change, it is useful to see the new state of the
monitors, so move back to the 'displays' page after applying.
2022-04-16 11:47:11 +00:00
Georges Basile Stavracas Neto
214dc277b5 display: Don't render background on selected monitors
In the previous design of this panel, it made sense to show the
currently selected monitor because all editing widgets were in
the same page. With the new design, however, the monitor options
were moved to a separate page, and that page already shows which
monitor is being edited.

Remove the colored background of selected monitors.
2022-04-16 11:47:11 +00:00
Georges Basile Stavracas Neto
ced1386fcd display: Update header title when setting output
Instead of updating the titlebar of the monitor preferences page in
the row clicked callback, update it in set_current_output(). This
ensures that the title of the page is always in sync with the monitor
it's displaying.
2022-04-16 11:47:11 +00:00
Changwoo Ryu
3ffaed73a0 Update Korean translation 2022-04-15 19:28:30 +00:00
Simon McVittie
d27d3df268 appdata: Correct name of launchable
Fixes: acd59aec "Rename app-id to org.gnome.Settings"
Resolves: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1766
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-04-15 10:50:05 +00:00
Bruce Cowan
4491e3d790 Update British English translation 2022-04-14 20:35:03 +00:00
Gun Chleoc
88277534a5 Update Scottish Gaelic translation 2022-04-12 12:11:16 +00:00
Jordi Mas
27b7832931 Update Catalan translation 2022-04-10 21:52:32 +02:00
Piotr Drąg
93cfdd464c Update Polish translation 2022-04-10 12:41:50 +02:00
Aleksandr Melman
37ceaa25f7 Update Russian translation 2022-04-09 15:32:14 +00:00
Alexander Shopov
862ceacc73 Update Bulgarian translation 2022-04-09 08:01:45 +00:00
Sebastian Keller
b213fdc28a lock: Fix wrong time shown in screen lock delay dropdown
The time shown for the 5 minutes setting was 3 minutes.
2022-04-07 11:36:40 +00:00
Brandon Nielsen
7c5beecc97 printers: Use a GtkDropDown in PpOptionsDialog
PpPpdOptionWidget and PpIppOptionWidget both use combo boxes for
certain types of selections. With GTK4, combo boxes no longer
support scrolling[0], which in turn causes problems setting some
things in the PpOptionsDialog[1].

This replaces instances of GtkComboBox with GtkDropDown which do
support scrolling. This change was applied to both PpIppOptionWidget
and PpPpdOptionWidget as both are used in PpOptions dialog.

Since the configuration values passed to CUPS can no longer be stored
in a GtkTreeModel alongside the displayed values, some logic changes
to update_widget_real in PpPpdOptionWidget to maintain the reference
to the ppd_option_t so the selected index can be mapped to the
configuration value.

[0] - https://gitlab.gnome.org/GNOME/gtk/-/issues/3674
[1] - https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1704
2022-04-05 11:52:00 -03:00
Ngọc Quân Trần
7c6a41f807 Update Vietnamese translation 2022-04-05 09:18:20 +00:00
Jordi Mas
31338d4885 Update Catalan translation 2022-04-03 21:27:48 +02:00
Yuri Chornoivan
8ecdee3412 Update Ukrainian translation 2022-04-03 09:15:30 +00:00
Daniel Rusek
2b6b58f29d Update Czech translation 2022-03-31 14:29:50 +00:00
Rūdolfs Mazurs
746ea1138a Update Latvian translation 2022-03-29 20:34:56 +00:00
Jakub Steiner
d57446699c Universal Access: don't depend on gnome-icon-theme-extra
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1713
2022-03-29 15:10:56 +00:00
Georges Basile Stavracas Neto
f42868e616 CI: Fix custom deps script 2022-03-29 11:07:53 -03:00
Georges Basile Stavracas Neto
6898ff58d2 CI: Build libgweather with soup2
It'll bite us in the future, but let's go with this for now.
2022-03-29 10:47:42 -03:00
Georges Basile Stavracas Neto
dd2adb77ec CI: Cleanup gcr-devel from jobs
gcr-devel is installed as part of the base image, we don't need to
install it on every job run.
2022-03-29 10:38:53 -03:00
Gustavo Noronha Silva
de27ec8ba2 flatpak: update and fix openldap build
openldap was failing to build on aarch64 due to an outdated
config.guess, so update it to a more recent version.
2022-03-29 12:47:49 +00:00
Gustavo Noronha Silva
3d34b6ddba flatpak: disable new ModemManager dependency 2022-03-29 12:47:49 +00:00
Gustavo Noronha Silva
9610c2e17b flatpak: fix branches for a couple deps
gweather and mobile-broadband-provider-info have moved to using main as their
principal development branch.
2022-03-29 12:47:49 +00:00
Gustavo Noronha Silva
a294ceba18 flatpak: use https:// for github
github discontinued the unauthenticated use of the git protocol for
security reasons, see:

https://github.blog/2021-09-01-improving-git-protocol-security-github/
2022-03-29 12:47:49 +00:00
Jan Tojnar
7fe322b9ce online-accounts: Fix goa-helper on X11
The handle_str contains the “x11:” prefix so strtol would return 0.
We need to pass it the numeric substring.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1651
2022-03-29 12:33:14 +00:00
Georges Basile Stavracas Neto
ebc54deb62 Ci: Build libgweather from main 2022-03-29 09:27:33 -03:00
Jordi Mas
3d54229d3d Update Catalan translation 2022-03-28 23:16:30 +02:00
Goran Vidović
aba4c668ee Update Croatian translation 2022-03-28 11:07:38 +00:00
Nathan Follens
c6d392727f Update Dutch translation 2022-03-26 22:58:26 +00:00
Nathan Follens
a428799890 Update Dutch translation 2022-03-25 14:27:06 +00:00
Hugo Carvalho
00a7dbec18 Update Portuguese translation 2022-03-24 23:05:52 +00:00
Norbert Pfeiler
88e19f50c9 info-overview: Replace llvmpipe with “Software Rendering” 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
a57d31f0cf info-overview: Add some commonly used trademarks
Those are not always present in the device string.
Guidance was taken from the usage on vendor websites.

NVIDIA actually has the rights to GTX™ but doesn’t seem to use it,
in contrast to RTX™.
2022-03-23 09:36:24 +00:00
Norbert Pfeiler
16fc5a95f8 info-overview: Remove some rare @ x.yz GHz specification 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
4b17d9be8e info-overview: Remove redundant/elaborate info
Remove redundant/elaborate in strings like CPU, Core and Processor.
2022-03-23 09:36:24 +00:00
Norbert Pfeiler
50ab1b0742 info-overview: Remove some junk info, like PCIe and SSE 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
02bbab7b8a info-overview: Replace the trademark symbols in a more generic way 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
54b215e1e9 info-overview: Use a more generic regex to match the Mesa infos 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
827369fe94 info-overview: Always omit Gallium, not just for AMD 2022-03-23 09:36:24 +00:00
Norbert Pfeiler
4b6786bd44 info-overview: If names are all caps, leave them be
This made everything AMD lower case after the second word
and is likely unintentional for something like EPYC™.

e.g. was
AMD Ryzen threadripper 1950x 16-core processor
AMD Radeon rx 580 series
2022-03-23 09:36:24 +00:00
Norbert Pfeiler
68d67adf12 info-overview: There is no “AMD®”
AMD doesn’t have a registered trademark for the string only.
2022-03-23 09:36:24 +00:00
Felipe Borges
52a8c998fb sharing: Remove leftover remote_desktop_password_insert_text_cb
This method is unused and was left behind after the rework in
commit 0ae59467fb

Fixes #1703
2022-03-22 13:54:46 +00:00
Марко Костић
7bbf551cc1 Update Serbian translation 2022-03-19 07:38:01 +00:00
Alberts Muktupāvels
a581395221 display: fix monitor labels
has-toplevel-focus property has been removed from GTK 4:
0ce9f26dc5

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1697
2022-03-18 22:08:49 +00:00
Pauli Virtanen
8c84b9f0d3 subprojects: Update libgvc
This update is necessary to fix a bug that can cause sound device
profiles to be missing, possibly making some sound device ports
unusable.

See https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/merge_requests/19
Fixes #1668
2022-03-18 21:49:36 +00:00
Jonathan Kang
ce93dbb3a0 network/connection-editor: always load all available VPN plugins
Previously, when a list of VPN plugins was loaded once, it will not load
again the next time you try to add a VPN connnection. This causes an
issue that if you keep gnome-control-center open and install a new VPN
plugin, the new VPN plugin won't show up in the VPN plugin list.

Fix that by always load all avilable VPN plugins when showing the
"Add VPN" dialog.
2022-03-18 21:37:48 +00:00
Jonathan Kang
6f1567f236 network/connection-editor: destroy the editor when closing
If an user opens an connection editor and then closes it, repeat this
multiple times causes lots of unused hidden editor windows.

Fix that by destroying the connection editor instead of hiding them
when closing.
2022-03-18 21:37:48 +00:00
Georges Basile Stavracas Neto
6199d4058e 42.0 2022-03-18 18:28:27 -03:00
Sophie Herold
6624179102 appdata: Update screenshots 2022-03-18 10:33:22 +00:00
A S Alam
49ed0d2f69 Update Punjabi translation 2022-03-17 15:54:40 +00:00
Goran Vidović
e807eadde3 Update Croatian translation 2022-03-17 11:26:02 +00:00
Goran Vidović
e909176b5b Update Croatian translation 2022-03-17 11:10:48 +00:00
Milo Casagrande
d232538832 Update Italian translation 2022-03-17 08:37:58 +00:00
sicklylife
c306e685e3 Update Japanese translation 2022-03-16 12:02:30 +00:00
Matej Urbančič
bd179f3171 Update Slovenian translation 2022-03-15 21:25:30 +00:00
Goran Vidović
b6f5333e83 Update Croatian translation 2022-03-15 14:01:36 +00:00
sicklylife
d9c3f51de5 Update Japanese translation 2022-03-15 13:40:15 +00:00
Quentin PAGÈS
328f6b3c11 Update Occitan translation 2022-03-15 09:29:16 +00:00
Balázs Úr
3ed10617ce Update Hungarian translation 2022-03-15 00:45:21 +00:00
Guillaume Bernard
8efecd3ae9 Update French translation 2022-03-14 21:40:18 +00:00
Christian Kirbach
a74eaca42c Update German translation 2022-03-14 21:02:54 +00:00
Christian Kirbach
83091db869 Update German translation 2022-03-14 20:59:46 +00:00
Quentin PAGÈS
8024531130 Update Occitan translation 2022-03-14 19:03:43 +00:00
Daniel Mustieles
87a7518515 Updated Spanish translation 2022-03-14 09:03:28 +01:00
Марко Костић
6b7f4aca98 Update Serbian translation 2022-03-13 05:08:16 +00:00
Piotr Drąg
8f5270e3a9 Update Polish translation 2022-03-12 15:09:30 +01:00
Baurzhan Muftakhidinov
24172abc43 Update Kazakh translation 2022-03-12 14:05:52 +00:00
sicklylife
5a1e5e1a11 Update Japanese translation 2022-03-12 10:41:35 +00:00
Марко Костић
c03d02c002 Update Serbian translation 2022-03-12 06:46:11 +00:00
Alan Mortensen
86e47b6cd8 Update Danish translation 2022-03-11 18:20:45 +00:00
Goran Vidović
db4d258aa5 Update Croatian translation 2022-03-11 16:15:48 +00:00
Anders Jonsson
033ae5a622 Update Swedish translation 2022-03-11 12:34:20 +00:00
Kjartan Maraas
cd3371fc41 Update Norwegian Bokmål translation 2022-03-10 15:24:41 +00:00
Kjartan Maraas
e6ce64df29 Update Norwegian Bokmål translation 2022-03-10 15:19:27 +00:00
sicklylife
a4810f3e9e Update Japanese translation 2022-03-10 13:03:14 +00:00
sicklylife
cee871b5f3 Update Japanese translation 2022-03-10 12:54:26 +00:00
純 小山田
bdb6985861 Update Japanese translation 2022-03-10 12:53:24 +00:00
Aleksandr Melman
35e14d4dd0 Update Russian translation 2022-03-09 21:05:52 +00:00
Luna Jernberg
a90776f6af Update Swedish translation 2022-03-09 18:22:23 +00:00
Jiri Grönroos
f688270d87 Update Finnish translation 2022-03-09 18:21:04 +00:00
Dušan Kazik
1e08e8604f Update Slovak translation 2022-03-09 09:44:36 +00:00
Fabio Tomat
2cf2a8b6af Update Friulian translation 2022-03-07 22:01:16 +00:00
Fabio Tomat
55359e252c Update Friulian translation 2022-03-07 21:58:09 +00:00
Georges Basile Stavracas Neto
90b1f3657f tests: Port tests to GTK4
Port the tests, especially the interactive ones, to GTK4, and
libadwaita.
2022-03-07 19:51:26 +00:00
Benjamin Berg
8d75b24ccc ci: Only use runners with working close_range syscall
If the wrong error code is returned due to broken seccomp filters, then
g_spawn will fail and the tests break.

See https://gitlab.gnome.org/Infrastructure/GitLab/-/issues/545
2022-03-07 19:51:26 +00:00
Yosef Or Boczko
7c9592894f Update Hebrew translation 2022-03-07 18:52:22 +00:00
Georges Basile Stavracas Neto
db1f78706d Post-release version bump 2022-03-07 14:30:07 -03:00
Georges Basile Stavracas Neto
aa126bce45 42.rc 2022-03-07 14:20:22 -03:00
Felipe Borges
b094a0b392 info-overview: Allow changing "Device Name" by pressing "Enter"
The hostname/device name dialog has only a GtkEntry. So a user
navigating with only a keyboard should be able to apply their
changes by pressing "Enter".
2022-03-07 17:02:20 +00:00
Fran Dieguez
6914a69791 Update Galician translation 2022-03-07 16:57:40 +00:00
Aurimas Černius
38a24a26f5 Updated Lithuanian translation 2022-03-07 18:34:28 +02:00
Felipe Borges
854c888214 user-accounts: Add cutout to avatar edit button
Shamelessly copied from
https://gitlab.gnome.org/GNOME/fractal/-/blob/fractal-next/data/resources/ui/content-room-details.ui#L29
and
https://gitlab.gnome.org/GNOME/fractal/-/blob/fractal-next/data/resources/style.css#L506

Fixes #1662
2022-03-07 15:59:46 +00:00
Felipe Borges
fb4f430f79 user-accounts: Drop unused CSS style 2022-03-07 15:59:46 +00:00
Alberts Muktupāvels
ea47caa533 keyboard: restore _GNOME_WM_KEYBINDINGS support
Before d7e794e7ab Keyboard Shortcuts dialog showed keybindings
for current WM. This commit restores this functionality.
2022-03-07 17:46:37 +02:00
Danial Behzadi
c4c400fcf9 Update Persian translation 2022-03-07 10:35:40 +00:00
Kukuh Syafaat
a255b409e2 Update Indonesian translation 2022-03-06 08:32:37 +00:00
Luming Zh
802fb282e3 Update Chinese (China) translation 2022-03-05 23:41:43 +00:00
Alexander Shopov
c0ae7f0442 Update Bulgarian translation 2022-03-05 21:09:50 +00:00
Jordi Mas
1cb06e5182 Update Catalan translation 2022-03-05 20:20:43 +01:00
Changwoo Ryu
6245601620 Update Korean translation 2022-03-05 18:03:03 +00:00
Marek Černocký
4d8a19b073 Updated Czech translation 2022-03-05 11:13:54 +01:00
Enrico Nicoletto
a080e5c45f Update Brazilian Portuguese translation 2022-03-04 22:29:07 +00:00
Hugo Carvalho
cd1a8c3698 Update Portuguese translation 2022-03-04 22:02:19 +00:00
Emin Tufan Çetin
46c9545b2e Update Turkish translation 2022-03-04 21:39:27 +00:00
Asier Sarasua Garmendia
a994bb217e Update Basque translation 2022-03-04 21:39:13 +00:00
Jordi Mas
435881a96d Update Catalan translation 2022-03-04 22:35:42 +01:00
Yuri Chornoivan
6a5645d07a Update Ukrainian translation 2022-03-04 18:11:08 +00:00
Carlos Garnacho
0d82613258 wacom: Bring back empty state view
This went mistakenly missing in the recent UI updates. Since this
panel is still accessible through search despite tablet availability,
we should have a proper empty state view when moving to the panel
with no tablets available.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1684
2022-03-04 15:19:21 +00:00
Tim Sabsch
fc1f83597d Update German translation 2022-03-03 21:27:38 +00:00
Jonas Ådahl
9d76bb3a80 sharing/remote-desktop: Copy entries via editable API
GtkPasswordEntry is not a GtkEntry so can't use that API. Both are
GtkEditable however, so use that instead.
2022-03-03 21:11:23 +00:00
Jonas Ådahl
93754f87b3 sharing/remote-desktop: Make device name and address labels selectable 2022-03-03 21:11:23 +00:00
Jonas Ådahl
58a3229cfc sharing/systemd-service: Treat 'static' state as enabled
Quoting the documentation:

> static indicates that the unit is statically enabled, i.e. always
> enabled and doesn't need to be enabled explicitly
2022-03-03 21:11:23 +00:00
Jonas Ådahl
dde343d8de sharing/remote-desktop: Only try to enable the RDP backend
Turning off the service doesn't mean we need to disable the RDP backend,
the setting can stay enabled in case one wants to manage it directly via
systemd.
2022-03-03 21:11:23 +00:00
Jonas Ådahl
3a9ce7b32b sharing/remote-desktop: Make the finger print view not scroll
Do this by setting the adw status page to expand vertically.
2022-03-03 21:11:23 +00:00
Felipe Borges
dfb2fa31af users: Make FileChooser inside AvatarChooser transient to main window
Depends on
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1253

Fixes #1677
2022-03-03 17:22:38 +01:00
Felipe Borges
dc032c338d user-accounts: Explicitly initialize CcAvatarChooser
Setting the Gtk.MenuButton.popover property to a CcAvatarChooser
object doesn't initialize the CcAvatarChooser object.

Fixes #1689
2022-03-03 16:13:46 +00:00
Changwoo Ryu
73487903ce Update Korean translation 2022-03-03 12:45:16 +00:00
Quentin PAGÈS
9339e130f6 Update Occitan translation 2022-03-02 19:46:13 +00:00
Aleksandr Melman
baf99d5b5b Update Russian translation 2022-03-02 19:30:20 +00:00
Felipe Borges
4b21c5b056 user-accounts: Load avatar image files in "Other users" list
We were checking for the existance of an image file as avatar when
setting up the main avatar widget in the page, but the same wasn't
done for the avatars displayed in the "Other users" list. These
were AdwAvatars simply initialized to use the user initials.

Now we load the user image (if it exists) and it will fallback to
initials when an image isn't set.

Fixes #1658
2022-03-02 16:04:26 +00:00
Alexander Shopov
0adebc9bec Update Bulgarian translation 2022-03-02 15:35:25 +00:00
Daniel Mustieles
96ca1cdcb6 Updated Spanish translation 2022-03-02 15:51:43 +01:00
Emin Tufan Çetin
2dc3755192 Update Turkish translation 2022-03-02 12:30:20 +00:00
Marek Kasik
9f0733182a printers: Destroy ppd selection dialog explicitly
Destroy PpPPDSelectionDialog in dispose method of PpNewPrinterDialog
as its transient-for property was unset by previous commit
and the dialog is not destroyed automatically now.
2022-03-02 11:03:59 +00:00
Marek Kasik
e81651873c printers: Unset transient-for
Unset transient-for for PpPPDSelectionDialog in its responce callback
since due some reason its parent PpNewPrinterDialog is destroyed first
and once the PpPPDSelectionDialog is being destroyed it tries to
unset the transient-for but unsuccesfully resulting in warnings like:

"instance with invalid (NULL) class pointer"
"g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed"
2022-03-02 11:03:59 +00:00
Jakub Steiner
105b8a518d multitasking: clean up illustration
- fills removed to make dark mode possible exposed the rings
  going through the cursors and arrows, which isn't a nice
  aesthetic. convert to shapes and cut them with booleans
  to get the previous look without using solid color fills
2022-03-02 10:00:39 +01:00
Kukuh Syafaat
441567ed63 Update Indonesian translation 2022-03-02 02:41:35 +00:00
Goran Vidović
89944b819b Update Croatian translation 2022-03-02 00:22:42 +00:00
Goran Vidović
7430b7f555 Update Croatian translation 2022-03-02 00:21:27 +00:00
Jakub Steiner
c7ace33d2d screen lock: install icons
- the build files never included the icon

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1621
2022-03-01 14:36:33 +00:00
Jakub Steiner
8b4a5ba2e8 usage: minor icon tweak
- everything but the filesystem device icons has lost the chin
2022-03-01 12:14:52 +01:00
Marek Černocký
35cd231d0d Updated Czech translation 2022-03-01 11:26:30 +01:00
Jordi Mas
4a7e1ea381 Update Catalan translation 2022-02-28 21:02:05 +01:00
Alan Mortensen
8da3668327 Updated Danish translation 2022-02-28 18:46:31 +01:00
Felipe Borges
0019b0869a user-accounts: Reinstate fingerprint dialog
The port of the Fingerprint dialog to gtk4 wasn't completed.
Now the dialog is expected to function again.
2022-02-28 15:47:42 +00:00
Rafael Fontenelle
747f7ef580 Update Brazilian Portuguese translation 2022-02-28 14:53:01 +00:00
Felipe Borges
ccf8961740 multitasking: Display Right-to-Left ilustrations for RTL locales
Fixes #1559
2022-02-28 10:44:07 +00:00
Jakub Steiner
7efd63e2ee multitasking: no more rounded top bar
- update the look of the top bar not to have the rounding of <GNOME 41

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1656
2022-02-28 10:44:07 +00:00
Jakub Steiner
6d9d6bd8b7 multitasking: provide rtl asset
- provide a RTL variant of the hot corner graphic
- revert one of the arrow to be outine only (unrelated to rtl)
- provide RTL variant of the active screen edges (close button
  on the opposite side)

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1559
2022-02-28 10:44:07 +00:00
Yosef Or Boczko
5a7aa11b1e display: Force LTR to the spinbuttons's box 2022-02-28 09:47:53 +00:00
Fran Dieguez
e81b382039 Update Galician translation 2022-02-27 22:45:20 +00:00
Yosef Or Boczko
65d3be2256 Update Hebrew translation 2022-02-27 22:09:37 +00:00
Quentin PAGÈS
9901d6ec08 Update Occitan translation 2022-02-27 12:49:13 +00:00
Asier Sarasua Garmendia
827c8bd341 Update Basque translation 2022-02-27 08:03:59 +00:00
Hugo Carvalho
5e02bc2d1f Update Portuguese translation 2022-02-26 22:00:03 +00:00
Yuri Chornoivan
d9824a39fd Update Ukrainian translation 2022-02-26 19:11:27 +00:00
Jonas Ådahl
5dc4081e2c sharing/remote-desktop: Initialize username/password if not set
If no password or username was set (not even an empty one), initialize
them to something, specifically the username of the user of the session,
and a auto generated password.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
06efa4906e sharing/remote-desktop: Hook up to explicit enable setting
Enabling the service isn't enough, one also needs to enable the relevant
backend.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
e8d574883a sharing/remote-desktop: Add copy buttons 2022-02-26 18:19:14 +00:00
Jonas Ådahl
1436dc8120 sharing/remote-desktop: Use systemd directly to manage service
This means we no longer rely on gsd-sharing to disable/enable the remote
desktop service depending on the current connected network.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
5829e397f2 sharing/systemd-service: Add is_active() helper
Checks whether a service is both enabled and running.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
81d3d16a67 sharing/remote-login: Move systemd unit management into helper
This will make it possible to reuse elsewhere, including for user
services.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
3631338676 sharing: Generate RDP TLS certificates when missing
This also hooks up the certificate verification dialog to the configured
TLS certificate.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
2f298c1cb2 sharing/tls: Change expiration timeout to 2 years
It was 5 years; shorten it to 2 years.
2022-02-26 18:19:14 +00:00
Jonas Ådahl
5eb46ec1b7 sharing: Add TLS certificate generation implementation
This copies TLS certificate generation implementation from
https://gitlab.gnome.org/chergert/bonsai. No changes were made other
than ones required for making it build as part of gnome-control-center's
sharing panel. It's currently not suitable to depend on libbonsai, as it
will likely see big changes before seeing a release.
2022-02-26 18:19:14 +00:00
Felipe Borges
0ae59467fb sharing: Port Screen Sharing dialog to RDP
Also following the guidelines at
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/raw/master/remote-desktop/remote-desktop.png

Fixes #1413
2022-02-26 18:19:14 +00:00
Piotr Drąg
abbf8f0734 Update POTFILES.in 2022-02-26 13:19:11 +01: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
Brandon Nielsen
18b7f6f026 Simplify callback logic in ppd_selection_cb.
This ensures user_callback does not get called twice when cancelling out
of the ppd selection dialog. Fixes #1599, introduced with 179bda1b / MR: 1011.
2022-02-25 11:44:14 +00:00
Hugo Carvalho
a0845c4eaf Update Portuguese translation 2022-02-24 18:53:46 +00:00
Ana Cabral
43bb1d9200 network: Fix OWE settings
Enhanced Open (OWE) is not being saved properly from connection-editor.
When we create a Wi-Fi connection using Enhanced Open (OWE) Security
from nm-connection-editor and save it, it was not being saved and the
security was being set as "None", with Wireless Security Setting
being discarded. This is fixed by this commit. The fix is also being
done in libnma (implementing OWE in libnma,
https://gitlab.gnome.org/GNOME/libnma/-/issues/9), but this commit
fixes meanwhile it gets ready.

It was solved by adding treatment for the case in which owe was set.
OWE is not treated anymore in the same case as None.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1521
2022-02-24 12:56:43 +01:00
Daniel Mustieles
55a9ee1511 Updated Spanish translation 2022-02-24 12:52:42 +01:00
Bastien Nocera
cbdb489fc4 build: Check run_command() return value
As recommended by newer versions of meson:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
2022-02-24 10:14:05 +01:00
Luming Zh
d75b46b71b Update Chinese (China) translation 2022-02-23 18:38:06 +00:00
Felipe Borges
28edca0f16 sound: Connect to "clicked" signal for the sound alert buttons
The sound alert buttons are grouped GtkToggleButtons, and for some
reason they won't get activated in the right order when tapping to
the "toggled" event. Connecting to "clicked" makes the signal order
emission correctly.

Fixes #1655
2022-02-23 11:17:50 +01:00
Yosef Or Boczko
ee4a5e4635 Update Hebrew translation 2022-02-22 20:17:14 +00:00
Marek Kasik
f7bd51e812 printers: Remove authentication-dialog.ui
The dialog was removed in 2016 but we forgot to remove the UI file.

Fixes #1650
2022-02-22 12:44:12 +01:00
Jordi Mas
14e690f9c1 Update Catalan translation 2022-02-22 07:40:46 +01:00
Yaron Shahrabani
2b58b47fda Update Hebrew translation 2022-02-21 14:28:48 +00:00
Jordi Mas
e70d9e205e Update Catalan translation 2022-02-20 20:25:59 +01:00
Quentin PAGÈS
052e274121 Update Occitan translation 2022-02-20 18:33:24 +00:00
Aurimas Černius
7b9a723c68 Updated Lithuanian translation 2022-02-20 15:21:58 +02:00
Danial Behzadi
cd7f67a183 Update Persian translation 2022-02-20 11:36:05 +00:00
Alan Mortensen
86fda01fd9 Updated Danish translation 2022-02-19 18:37:09 +01:00
Andre Klapper
1042f538d7 Fix invalid markup in Bulgarian UI translation 2022-02-18 23:11:15 +01:00
Aleksandr Melman
33bac7fcf2 Update Russian translation 2022-02-18 19:31:35 +00:00
Kukuh Syafaat
0727474539 Update Indonesian translation 2022-02-18 02:10:42 +00:00
Bastien Nocera
0947ae2557 power: Fix scenario tester running upowerd under jhbuild
A logic error meant that the systemd upowerd would always be used.
2022-02-17 14:55:13 +00:00
Jordi Mas
e19d64a5fb Update Catalan translation 2022-02-16 19:56:36 +01:00
Emin Tufan Çetin
b23bea4f99 Update Turkish translation 2022-02-16 18:26:57 +00:00
Hugo Carvalho
26578110f3 Update Portuguese translation 2022-02-15 22:17:46 +00:00
Hugo Carvalho
9dd96d78c8 Update Portuguese translation 2022-02-15 21:50:56 +00:00
Yosef Or Boczko
494f0d6bcb Update Hebrew translation 2022-02-15 20:57:04 +00:00
Georges Basile Stavracas Neto
cedb115d26 42.beta 2022-02-15 17:37:52 -03:00
Fran Dieguez
1c9cb2d171 Update Galician translation 2022-02-15 20:16:23 +00:00
Georges Basile Stavracas Neto
dddd3f62c3 display: Box Night Light temperature vertically
Instead of being in the horizontal end of the row, move
the temperature scale to a second row.

Related: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-02-15 19:35:18 +00:00
Georges Basile Stavracas Neto
8b05bc91d3 display: Remove labels from Night Light temperature scale
As per mockups.
2022-02-15 19:35:18 +00:00
Mohammed Sadiq
8dc39c8831 wwan: Remove a never reached code
Since we return early, the code followed is never run.
Also, the password for GSM APNs are not actually sensitive
secrets.  So Remove the lines that are never reached.
2022-02-15 16:34:30 +00:00
Alessandro Bono
10489fb208 net-vpn: Don't append VPN in the title of the editor dialog
We don't do anything similar for other connections editors (wired and WiFi).
We alredy know that we are modifying a VPN, no need to repeat ourself.
2022-02-15 14:42:13 +00:00
Alessandro Bono
ce1c00be5d net-vpn: Don't append VPN to each row
We don't do anything similar for other connections rows (wired and WiFi).
All the rows are VPNs. No need to repeat ourself.
2022-02-15 14:42:13 +00:00
Alexander Shopov
e262a87a44 Update Bulgarian translation 2022-02-15 14:40:28 +00:00
Pablo Correa Gómez
fcbe0c039b user-accounts: Try non TRANSLIT conversion if TRANSLIT conversion fails
This fixes a crash in musl-based systems, where TRANSLIT is not
implemented. I followed musl-maintainer recommendation[1] of doing
a run-time check to verify the behavior under these circumstances.

[1] https://github.com/akrennmair/newsbeuter/issues/364#issuecomment-250208235
2022-02-15 14:08:04 +00:00
Felipe Borges
1f693be757 user-accounts: Reset avatar widget when changing user pages
Otherwise the same source image is going to be used for other users
that don't have their own avatar image set.
2022-02-15 13:57:55 +00:00
Pablo Correa Gómez
c5ca6717e5 wwan: Make sure secrets are set when querying connection APN password
Otherwise the comparison in wwan_data_apn_are_same will always be False
due to nm_setting_gsm_get_password always returning NULL.

Helps #1468
Relates !1059
2022-02-15 13:46:48 +00:00
Hugo Carvalho
ede39f210a Update Portuguese translation 2022-02-15 13:44:13 +00:00
Alexander Shopov
dc8b0225ac Update Bulgarian translation 2022-02-15 13:44:01 +00:00
Alexander Shopov
ce9aaf20f7 Update Bulgarian translation 2022-02-15 13:43:15 +00:00
Alexander Shopov
6d89d65b00 Update Bulgarian translation 2022-02-15 13:43:02 +00:00
Alexander Shopov
1bc2bfc316 Update Bulgarian translation 2022-02-15 13:42:51 +00:00
Alexander Shopov
6bd3311dc2 Update Bulgarian translation 2022-02-15 13:42:39 +00:00
Alexander Shopov
f69ac88e69 Update Bulgarian translation 2022-02-15 13:42:27 +00:00
Matej Urbančič
cf7ccca7f3 Update Slovenian translation 2022-02-15 13:42:16 +00:00
Marek Černocký
1a8a7c4ca1 Updated Czech translation 2022-02-14 20:49:20 +01:00
Marek Černocký
06a694235a Updated Czech translation 2022-02-14 19:03:59 +01:00
Christopher Davis
9a2cd1b5d2 keyboard: Don't dim input chooser icons
We generally don't dim icons in rows anymore.
2022-02-13 13:33:25 +00:00
Christopher Davis
4ccf6e670b keyboard: Adjust input chooser widgetry
Adjusts the widgetry of the input chooser to clamp
the list and add a separator between the search bar
and the list.

The list's shadow is no longer clipped, and keyboard
navigation now scrolls.
2022-02-13 13:33:25 +00:00
Christopher Davis
cd4dd18f52 keyboard: Handle keynav-failed on input source list
Fixes keynav with arrows between the input list
group and other groups.
2022-02-13 13:33:25 +00:00
Christopher Davis
1a3971fdbe keyboard: Allow input list rows to manage their own size
Using GtkSizeGroup causes weird jumping,
and size groups generally should not be used for
boxed list rows.
2022-02-13 13:33:25 +00:00
Christopher Davis
ced8c1cb99 keyboard: Use GAction and GMenuModel for input row popovers
Gives these menus proper styling without having to
roll our own widgets.

Also removes the Remove button when the action is
disabled.
2022-02-13 13:33:25 +00:00
Christopher Davis
530fbac68e keyboard: Subclass AdwActionRow for InputRow 2022-02-13 13:33:25 +00:00
Christopher Davis
485dd456bb keyboard: Use AdwActionRow for input switch rows 2022-02-13 13:33:25 +00:00
Christopher Davis
84becfbd80 keyboard: Use AdwPreferences{Page,Group} 2022-02-13 13:33:25 +00:00
Christopher Davis
328da2fa14 diagnostics: Use AdwPreferences{Page,Group}, AdwActionRow 2022-02-13 13:26:43 +00:00
Jordi Mas i Hernandez
640295023d Update Catalan translation 2022-02-13 10:07:58 +00:00
Asier Sarasua Garmendia
5e2bae4206 Update Basque translation 2022-02-13 09:15:36 +00:00
Yuri Chornoivan
a199c5d22b Update Ukrainian translation 2022-02-13 07:32:35 +00:00
Rafael Fontenelle
55f366b48e Update Brazilian Portuguese translation 2022-02-13 00:53:15 +00:00
Rafael Fontenelle
fafd093fbd usage: fix typo 2022-02-12 23:27:05 +00:00
Rafael Fontenelle
ba3410f380 microphone: remove extra newline and spaces
The extra line was causing newline chars and whitespaces to be added
to translation strings
2022-02-12 22:37:31 +00:00
Mohammed Sadiq
0452e9eb4d network: Fix a possible memory leak in QR code
It's possible that the QR code for the same text has been requested,
but for a different size.  Fix a memory leak that would happen
in those cases.
2022-02-12 21:47:07 +00:00
Christopher Davis
7c9c42fb65 usage: Use AdwComboRow for "File History Duration" 2022-02-12 13:32:22 -08:00
Christopher Davis
a95b57061b usage: Use AdwComboRow for "Automatically Delete Period" 2022-02-12 13:32:22 -08:00
Christopher Davis
a3c31fcda3 usage: Use AdwPreferences{Page,Group}, AdwActionRow
Uses AdwPreferencesPage and AdwPreferencesGroup for
consistency with the rest of the application. The
combo rows now use AdwActionRow so they can be
included in the AdwPreferencesGroup without
a custom list box.
2022-02-12 13:32:22 -08:00
Fran Dieguez
fc9c2f9245 Update Galician translation 2022-02-12 20:50:39 +00:00
Yuri Chornoivan
7d249bebea Update Ukrainian translation 2022-02-12 16:24:02 +00:00
Carlos Garnacho
7371dbb35c wacom: Explicitly discard input from touchscreens
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1612
2022-02-12 16:03:37 +00:00
Carlos Garnacho
57e5144f41 wacom: Avoid reset on spurious size changes
This is a possible reason for undesired calibration resets.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1613
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3f12a7d2cb wacom: Allow NULL monitors in calibration
Unfortunately, this may be the case, it is better to show wonky UI
than no UI at all.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6c6499e23e wacom: Pass GdkMonitor directly to calibrator object
Instead of figuring out a monitor number from a GdkMonitor, and
look the GdkMonitor back up, pass the GdkMonitor directly.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6756710996 wacom: Make calibrator retrieve dimensions from window
So we can fullscreen on a monitor and forget.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
ec5ad4d3e4 wacom: Turn CcCalibArea into a window subclass
Modernize a bit the code, since it will be easier to do some things
as a window subclass.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
fce8b631cc wacom: Rename calibrator API
Add "Cc" prefix so it's more consistent with the rest of the project.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
1777a42aef wacom: Update/unbreak calibrator
It got to a building state in the GTK4 port, but was broken at
runtime. Update event handlers and builder objects so it works again.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
e26ea4e6d1 wacom: Drop dead code
These dimensions are no longer used.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3d4d785588 wacom: Drop unused API
This function was only used for logging purposes, we can do
without it.
2022-02-12 16:03:37 +00:00
Ivan Molodetskikh
3ecc151061 keyboard: Remove 01-screenshot.xml
Move this to gnome-shell where it belongs. See
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107
2022-02-12 12:18:29 +00:00
Christopher Davis
3f851bd793 microphone: Use AdwActionRow 2022-02-12 11:51:21 +00:00
Christopher Davis
ab950bbfb5 microphone: Use AdwPreferences{Page,Group} 2022-02-12 11:51:21 +00:00
Christopher Davis
c2c9334a59 microphone: Use AdwStatusPage 2022-02-12 11:51:21 +00:00
Asier Sarasua Garmendia
b0b7b966e0 Update Basque translation 2022-02-12 07:07:29 +00:00
Leônidas Araújo
368c001dc9 Update Brazilian Portuguese translation 2022-02-12 00:23:02 +00:00
Hugo Carvalho
adb9808841 Update Portuguese translation 2022-02-11 22:56:51 +00:00
Alexander Mikhaylenko
c932168462 background: Trigger screen transition when changing style
See https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2070
2022-02-11 22:12:49 +00:00
Mohammed Sadiq
15df3bc494 network: Fix QR code with dark theme
Explicitly set white background for the image so that white border
is shown around the QR code in dark themes too.
2022-02-11 17:24:52 +00:00
Marek Kasik
8fe87ac6ef printers: Use bold font for title of details dialog
All other dialogs have bold titles, this should too.

Issue #1587
2022-02-11 13:18:15 +01:00
Marek Kasik
2a2d7ec111 printers: Make search entry symetric
Allow search entry of new printer dialog to expand so that it fills
the available area. It does not fill it now so there is more free
space on the right than on the left.

Issue #1587
2022-02-11 13:18:15 +01:00
Marek Kasik
cc75a07a69 printers: Fix blurred icons of printers
Change align of the printers icons to CENTER from FILL so that the icons
are not stretched.

Issue #1587
2022-02-11 13:18:15 +01:00
Yuri Chornoivan
596e432adc Update Ukrainian translation 2022-02-11 07:46:16 +00:00
Kukuh Syafaat
4a95383137 Update Indonesian translation 2022-02-11 07:19:00 +00:00
Christopher Davis
4f2aa07ff5 thunderbolt: Use AdwStatusPage for empty state
Make use of libadwaita's provided widget for status pages
instead of rolling our own.
2022-02-10 14:01:18 -08:00
Luming Zh
cb75c0591a Update Chinese (China) translation 2022-02-10 15:30:07 +00:00
Felipe Borges
37ee555c44 network: Show configuration button only for active/connecting connections
In commit c7bd442839 we started to
show the configuration button for all rows, which fixes the original
issue of not being able to tweak a connection during association but
also introduces a regression of not having connection data to show
for other connections in the list. This way, the configuration
button will fail to create a net_connection_editor interface for
rows that aren't associated with an active connection.

Let's only show the configuration button when the NMActiveConnectionState
is either NM_ACTIVE_CONNECTION_STATE_ACTIVATING or
NM_ACTIVE_CONNECTION_STATE_ACTIVATED.

Fixes #1494
2022-02-10 15:05:08 +00:00
Hugo Carvalho
57d2fd98e3 Update Portuguese translation 2022-02-10 13:32:21 +00:00
Daniel Mustieles
c3f4a91f24 Updated Spanish translation 2022-02-10 13:47:49 +01:00
Kukuh Syafaat
00b69e09ab Update Indonesian translation 2022-02-10 02:49:05 +00:00
Alexander Mikhaylenko
eca4c0a370 background-paintable: Clip light wallpapers as well
Turns out drawing the whole light wallpaper and then half of the dark
wallpaper on top of it is leading to a case of
https://gitlab.gnome.org/GNOME/gtk/-/issues/3840

Draw half of each instead, so they don't overlap.
2022-02-10 05:11:30 +05:00
Marek Černocký
acbb8092a8 Updated Czech translation 2022-02-09 21:38:45 +01:00
Yosef Or Boczko
8f9e2bcf52 Update Hebrew translation 2022-02-09 20:30:16 +00:00
Felipe Borges
26cc82c754 user-accounts: Always populate other users list
We were not re-populating the list when switching panels.

Related #1631
2022-02-09 15:04:32 +00:00
Yuri Chornoivan
9f2d7c25b8 Update Ukrainian translation 2022-02-09 14:54:08 +00:00
Christopher Davis
770da3788a notifications: Remove redundant haligns 2022-02-09 14:33:17 +00:00
Christopher Davis
a8bc1a222e notifications: Make dialog resizeable, adjust default size
We can't use flat headerbars here because we need to
be able to scroll the dialog at smaller sizes. We
also need for the dialog to be able to reach smaller
sizes.
2022-02-09 14:33:17 +00:00
Christopher Davis
17d3a297ae notifications: Handle keynav-failed on app list
Fixes keyboard navigation with arrow keys
2022-02-09 14:33:17 +00:00
Christopher Davis
2f00725af8 notifications: Remove options_listbox
Since CcListRow is now an AdwActionRow subclass,
we don't need to have a custom listbox for the top
group.
2022-02-09 14:33:17 +00:00
Alexander Mikhaylenko
24311b6ebd background-chooser: Remove a leftover binding
GtkWidget:text-direction doesn't exist. That's why we connect to the
::direction-changed signal instead, and this property binding was
just a leftover from c5792cfb00.
2022-02-09 14:23:29 +00:00
Alessandro Bono
5ecc569014 flatpak: Don't rename desktop file
No more needed since commit acd59aec65.
2022-02-09 14:06:35 +00:00
Christopher Davis
0e2531f500 search: Activate results row switch on click 2022-02-09 13:53:17 +00:00
Christopher Davis
e14847b73f search: Search group fixups
* Set the right accessibility relations, as
AdwPreferencesGroup does not manage it
for custom listboxes

* Handle `keynav-failed` for proper behavior with arrow keys

* Set `selection-mode` to none
2022-02-09 13:53:17 +00:00
Christopher Davis
b4e74d58be search: Use AdwActionRow for locations dialog rows
Gives us consistent styling without needing to set
margins, as well as simple row activation.
2022-02-09 13:53:17 +00:00
Christopher Davis
ddb979abfd search: Use AdwPreferences{Window,Page,Group} for location dialog
Gives us more modern styling for the search locations
window.
2022-02-09 13:53:17 +00:00
Felipe Borges
0bf91ed4d6 user-accounts: Fix crash while cancelling user rename
Fixes #1632
2022-02-09 10:51:45 +01:00
Kukuh Syafaat
b75daf84c1 Update Indonesian translation 2022-02-09 02:45:09 +00:00
Fran Dieguez
380235d983 Update Galician translation 2022-02-08 22:02:13 +00:00
Yuri Chornoivan
5338d6c4bb Update Ukrainian translation 2022-02-08 20:44:23 +00:00
Georges Basile Stavracas Neto
59e3c32825 users: Set the activatable-widget property of various rows
It makes it slightly more convenient to interact with them,
since they become activatable.
2022-02-08 11:10:37 -03:00
Georges Basile Stavracas Neto
55072f54db users: Hide enterprise group in new users dialog
Otherwise we get a strange shadow at the bottom.
2022-02-08 11:05:51 -03:00
Georges Basile Stavracas Neto
998db79732 users: Cleanup and modernize CcLoginHistoryDialog
- Remove all 'can-focus' properties, rely on GTK defaults
 - Use AdwPreferencesPage internally
 - Make dialog resizable
 - Set 'icon-name' in header buttons instead of a GtkImage
2022-02-08 10:53:55 -03:00
Felipe Borges
7f8e90a966 user-accounts: Port to gtk4/libadwaita implementing the new design
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/raw/master/users/users.png
2022-02-08 13:29:56 +00:00
Hugo Carvalho
961c013f0a Update Portuguese translation 2022-02-08 12:33:28 +00:00
Boyuan Yang
65b2e655fb Update Chinese (China) translation 2022-02-07 21:11:18 +00:00
Boyuan Yang
1a1c936aa4 Update Chinese (China) translation 2022-02-07 20:40:16 +00:00
Yosef Or Boczko
fe97726bac Update Hebrew translation 2022-02-07 18:40:21 +00:00
Aleksandr Melman
1be997f0ec Update Russian translation 2022-02-07 18:32:53 +00:00
Matej Urbančič
c731a21f63 Update Slovenian translation 2022-02-07 18:23:04 +00:00
Yosef Or Boczko
3f08458094 Update Hebrew translation 2022-02-07 17:28:17 +00:00
Daniel Mustieles
a1dd24135d Updated Spanish translation 2022-02-07 13:51:40 +01:00
Yuri Chornoivan
d0a557cf34 Update Ukrainian translation 2022-02-07 12:47:48 +00:00
Alexander Mikhaylenko
ca5bdd07de background: Refine background chooser layout
Make thumbnails smaller, add margin on the sides.
2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
c5792cfb00 background: Support dark wallpapers 2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
303cc2176e background-preview: Add a missing break 2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
1e2069e748 background: Don't expand the background list
It looks weird when there are few wallpapers.
2022-02-07 10:50:10 +00:00
Georges Basile Stavracas Neto
85199430cb region: Fix format chooser leaflet page
We need to go back to region_box, not region_list.
2022-02-07 07:03:42 -03: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
Georges Basile Stavracas Neto
eaa62700f6 region: Various small improvements to CcFormatChooser 2022-02-07 07:03:42 -03:00
Georges Basile Stavracas Neto
6f2875e467 region: Replace "Login Screen" toggle button by section
Rework the panel to have 2 groups: the user's language and
format; and the login screen's language and format. Remove
the now unused bottom label explainig the login screen.

Special-casing of single user systems is still present.

Related: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-02-07 07:03:42 -03:00
Georges Basile Stavracas Neto
53b31dd753 region: Merge language and formats into a single group
As per mockups. We'll be adding another pair for the login
screen soon.
2022-02-07 07:03:42 -03:00
Georges Basile Stavracas Neto
6ed208221f region: Switch formats row to AdwActionRow 2022-02-07 07:03:42 -03:00
Georges Basile Stavracas Neto
ae93012543 region: Switch language row to AdwActionRow 2022-02-07 07:03:42 -03:00
Georges Basile Stavracas Neto
01e7544827 region: Move logout message to an infobar
As per mockups. Also adjust the wording of the info bar label.
2022-02-07 07:03:37 -03:00
Georges Basile Stavracas Neto
72742f9580 region: Switch to AdwPreferencesPage and AdwPreferencesGroup
This cleans up all the manual label shenanigans we've been
doing.
2022-02-07 07:01:30 -03:00
Fran Dieguez
97a1e8a3c1 Update Galician translation 2022-02-07 06:29:08 +00:00
Hugo Carvalho
83a0eea6cc Update Portuguese translation 2022-02-06 22:29:18 +00:00
Aurimas Černius
28f82fe516 Updated Lithuanian translation 2022-02-06 16:58:57 +02:00
Leônidas Araújo
1b66da8645 Update Brazilian Portuguese translation 2022-02-06 13:49:04 +00:00
Luming Zh
b86fe046ed Update Chinese (China) translation 2022-02-05 15:20:31 +00:00
sicklylife
df34648cdd Update Japanese translation 2022-02-05 13:11:25 +00:00
Mohammed Sadiq
703725e93f wwan: apn-dialog: Ellipsize apn row
ellipsize the apn row so that the window won't grow too long.
2022-02-05 04:15:16 +00:00
Mohammed Sadiq
7da8101446 wwan: apn-dialog: Use AdwPreferencesPage
This fixes the listbox content being cut of with the scrolled window.
2022-02-05 04:15:16 +00:00
Christopher Davis
fc8817380d network: Center connection-editor spinner
Prevents the spinner from taking up a large amount
of space.
2022-02-05 00:11:21 +00:00
Yuri Chornoivan
1bb6b1d508 Update Ukrainian translation 2022-02-04 20:50:22 +00:00
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Felipe Borges
9c593c5d7b sound: Remove CcSoundButton in favor of a simple GtkToggleButton
Without the custom image allocation, we can simply use a simple
button instead.

Fixes #1583
2022-02-04 18:03:38 +00:00
Jakub Steiner
d85111f3f1 sound: remove noisy icon
- remove the oversized repeating icon, use only labels

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1583
2022-02-04 18:03:38 +00:00
Christopher Davis
41cc608721 network: Use AdwPreferences{Page,Group} for network panel
Uses AdwPreferences{Page,Group} where possible.
net-device-ethernet has been changed into an
AdwPreferencesGroup subclass itself.
2022-02-04 17:54:25 +00:00
Christopher Davis
e7f89a49d5 network: Clean up ethernet details row
* Remove placeholder text
* Remove redundant haligns
* Remove redundant `selectable=False`
* Set activatable widget
2022-02-04 17:54:25 +00:00
Christopher Davis
fcc1cb9da7 network: Adjust list styling and use GtkStack for ethernet
Previously we used an unstyled list for the network
connections, and we switched lists by using
GtkWidget:visbile.

This commit makes the connection list use boxed-list
styling, and adds a GtkStack.
2022-02-04 17:54:25 +00:00
Christopher Davis
ffeec81f0e network: Use AdwActionRow for NetDeviceBluetooth
Similar to the last commit, we can use a regular
GtkListBox and make the device widget an AdwActionRow.
2022-02-04 17:54:25 +00:00
Christopher Davis
de16d7bb39 network: Use AdwActionRow and GtkListBox for vpn list
Previously the widget was using a hack to show
separators and had a row nested in a listbox,
nested in a box. Instead of having a custom setup
to work around not haveing a listbox, we can use a
listbox.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-02-04 17:54:25 +00:00
Felipe Borges
e03000bd73 universal-access: Add "animations" to desktop file keywords
In commit a825ded085 we added the option
to enable/disable animations in the desktop as an accessibility feature.

Adding the keyword makes it possible to find the Accessibility
settings while searching for "animations" in the shell or in
gnome-control-center.

Fixes #1620
2022-02-04 17:23:56 +00:00
Marek Kasik
20adb5632f printers: Remove redundant UI properties
Remove redundant UI properties from PPDSelectionDialog's UI file.
2022-02-04 17:50:04 +01:00
Marek Kasik
613a2d8b5b printers: Fix UI file of PPDSelectionDialog
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
52fdf0435e printers: Expand PpPrinterEntry when window resizes
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
e7a1501d13 printers: Do not ellipsize title of details dialog
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Marek Kasik
634d622c7a printers: Show file chooser dialog when selecting PPD
A regression from the GTK4 port.
2022-02-04 17:15:53 +01:00
Aleksandr Melman
1f32b147fc Update Russian translation 2022-02-04 13:15:00 +00:00
Fran Dieguez
1c7480ceac Update Galician translation 2022-02-03 18:34:08 +00:00
Yuri Chornoivan
5909063867 Update Ukrainian translation 2022-02-03 18:33:16 +00:00
Asier Sarasua Garmendia
b9ff4bb5d1 Update Basque translation 2022-02-03 18:20:24 +00:00
Piotr Drąg
ee093c58ec Update POTFILES.in 2022-02-03 18:22:47 +01:00
Philip Withnall
d46601d590 user-accounts: Make malcontent-control optional
Hide the button to open the parental controls UI if it’s not installed.
This will allow distributions to split the dependency, making
gnome-control-center suggest (rather than require) malcontent-ui, while
still requiring libmalcontent.

In turn, this will allow malcontent-ui to be uninstalled without
requiring gnome-control-center to be uninstalled, which will satisfy
users who feel the need to uninstall it because it’s not useful to them.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-03 14:18:25 +00:00
Jakub Steiner
a46359595a flatpak: Build gnome-backgrounds form main branch 2022-02-02 13:09:59 +01:00
Felipe Borges
0efc505518 flatpak: Build gnome-bluetooth from "master" branch 2022-02-02 12:32:05 +01:00
Felipe Borges
f5ceb5b79e flatpak: Don't build tests for libwacom
Otherwise we need some python dependencies and all.

Fixes #1617
2022-02-02 12:13:01 +01:00
Jakub Steiner
dab3d43ec2 flatpak: update manifest
- colord no longer has master branch
- gnome-desktop no longer needs ebassi/update-for-gtk4 branch
- libwacom uses meson now

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1617
2022-02-02 11:53:09 +01:00
Mohammed Sadiq
5855b661fe wifi: Fix to use the updated details to create hotspot
Let the callback to "response" signal run after the default
so that we use the updated details to create hotspot.
Otherwise, the changes made won't be used.

This is required as the default handler updates the connection
details in cc-wifi-hotspot-dialog.
2022-02-01 17:29:54 +00:00
Felipe Borges
1cca8708c7 thunderbolt: Use AdwPreferencesGroup for devices list
Related: #1587
2022-02-01 16:16:39 +00:00
Felipe Borges
12b940d411 thunderbolt: Wrap "Direct access" UI into a AdwActionRow
This allows for simplifying the logic of the states of this row
too.
2022-02-01 16:16:39 +00:00
Felipe Borges
f3122f10b1 thunderbolt: Port CcBoltDeviceEntry to AdwActionRow 2022-02-01 16:16:39 +00:00
Christopher Davis
3250b3fab5 applications: Use AdwPreferences{Page,Group} for Built-in Permissions dialog, make it resizable 2022-02-01 14:56:14 +00:00
Christopher Davis
f2d7f5de40 applications: Make handler dialog resizable 2022-02-01 14:56:14 +00:00
Christopher Davis
65b939ad38 applications: make storage dialog resizable and use AdwPreferences{Page,Group}
The dialog needs to be resizeable in order to work on mobile.
For that reason, it also needs scrolling. Because it needs
scrolling, we can't have the flat headerbar without custom
behavior.

For now, use a regular headerbar and AdwPreferences{Group,Page}
2022-02-01 14:56:14 +00:00
Georges Basile Stavracas Neto
ea7012d9a9 online-accounts: Hide accounts group by default
We show it whenever an account is added, and it needs to
start hidden to not break style.

Related: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-02-01 11:42:13 -03:00
Carlos Garnacho
a9127145d3 wacom: Move tablet/stylus sections to AdwPreferencesGroup
There is now the header-suffix property that makes it possible to add
tablet/stylus icons besides the title/description, so we can simply
use this widget.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
653d66b7a7 wacom: Add description subtitles to tablet devices 2022-02-01 14:18:53 +00:00
Carlos Garnacho
04bb70a5b3 wacom: Add description subtitles to styli 2022-02-01 14:18:53 +00:00
Carlos Garnacho
9bd0b94527 wacom: Use right function to find whether stylus has eraser tip
We are looking for paired styli that act as standalone erasers, this is
not what we are looking for here.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
2bbc1fd2bb wacom: Update tablet images
These had some additional padding that is undesirable in the new
UI. Drop that so things are nicely aligned.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
0379531980 wacom: Restore stylus icons
These images needed updating, this is done separately in this commit.
With this, stylus sections also get a nice icon.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
7806b88460 wacom: Refresh UI
Use libadwaita widgets, and follow recent mockups for this panel.
2022-02-01 14:18:53 +00:00
Christopher Davis
200e524aab color: Don't update toolbar buttons when the toolbar is in destruction
GtkListBox's dispose function removes all rows, and
`gtk_list_box_remove ()` sends `row-selected`. In turn,
as we listen to row-selected, we end up calling
functions on our toolbar while it may be in the
process of disposing. This causes a crash.

This commit introduces an early return if the toolbar is
being destroyed.
2022-02-01 14:06:18 +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
Mohammed Sadiq
ebab3214ca wifi: Avoid padding in hotspot QR code
The padding is now handled by CSS, so we no longer have to set padding
in expense of QR pixel quality
2022-02-01 18:25:23 +05:30
Aleksandr Melman
de5e3ada93 Update Russian translation 2022-02-01 06:49:04 +00:00
Hugo Carvalho
84fd24da86 Update Portuguese translation 2022-01-31 23:40:07 +00:00
Fran Dieguez
6b8af44fd3 Update Galician translation 2022-01-31 23:35:59 +00:00
Matej Urbančič
23cde17c7b Update Slovenian translation 2022-01-31 21:29:31 +00:00
Christopher Davis
8347e01453 background: Use AdwPreferences{Page,Group}
Now that AdwPreferencesGroup has support for
header suffixes, we can cut out a lot of widgetry
by using it and AdwPreferencesPage directly.
2022-01-31 12:15:43 -08:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Luming Zh
57ce84ada7 Update Chinese (China) translation 2022-01-31 03:12:32 +00:00
sicklylife
e12d215a32 Update Japanese translation 2022-01-29 14:24:28 +00:00
sicklylife
adec1aa8cf Update Japanese translation 2022-01-29 13:23:50 +00:00
sicklylife
b6374d7151 Update Japanese translation 2022-01-29 13:17:50 +00:00
Piotr Drąg
e09fb73cf6 Update POTFILES.in 2022-01-29 14:09:59 +01:00
Norbert Pfeiler
c340798b5c info-overview: Remove trailing space after CPU name
It was apparent when selecting the text, as the text is right aligned.

»AMD® Ryzen threadripper 1950x 16-core processor × 32 «
↓
»AMD® Ryzen threadripper 1950x 16-core processor × 32«
2022-01-29 12:39:12 +01:00
Luming Zh
7397bc7d80 Update Chinese (China) translation 2022-01-29 01:50:22 +00:00
Rafael Fontenelle
073494d8dc Update Brazilian Portuguese translation 2022-01-28 15:41:22 +00:00
Aleksandr Melman
b7e34e1198 Update Russian translation 2022-01-28 11:08:45 +00:00
Daniel Mustieles
f1db267387 Updated Spanish translation 2022-01-28 11:00:55 +01:00
Yuri Chornoivan
6db60435b4 Update Ukrainian translation 2022-01-28 06:45:11 +00:00
Ivan Molodetskikh
03299794a6 keyboard: Update screenshot key bindings
They moved from g-s-d to gnome-shell.
2022-01-27 23:00:05 +00:00
Yuri Chornoivan
be89062cc7 Update Ukrainian translation 2022-01-27 14:50:44 +00:00
Rafael Fontenelle
8b9cc4531f Update Brazilian Portuguese translation 2022-01-27 14:34:47 +00:00
Hugo Carvalho
8bb91aa8d6 Update Portuguese translation 2022-01-27 13:00:31 +00:00
Aleksandr Melman
d5717c6357 Update Russian translation 2022-01-27 10:48:55 +00:00
Bastien Nocera
25518a6bca info: Use udev to get the hardware RAM size
libgtop gets the RAM size as is visible to the OS, so the physical RAM
size minus all the reserved areas listed at the top of your usual Linux
dmesg output.

Use systemd 248's MEMORY_ARRAY_* properties attached to the pseudo-DMI
device to get the size of the RAM sticks/chips as the user expects.

Closes: #1540
2022-01-27 10:08:37 +01:00
Bastien Nocera
a079eba2a7 info: Split code that fetches RAM amount 2022-01-27 10:07:41 +01: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
25b71f6101 search: Adjust row and search group text
Changes the copy of the panel to match the latest mockups.

See d08607e03b/search/search.png
2022-01-26 19:26:49 -08:00
Christopher Davis
b1a17ad10e search: Use GMenuModel and GActions for row menu
GtkModelButton is an implementation detail of GTK.
It should not be used by applications. Instead, we
should use menu models to create menus, which are
consistently styled by libadwaita.
2022-01-26 19:26:49 -08:00
Christopher Davis
41c9d956ae search: Subclass AdwActionRow for CcSearchPanelRow
Also set the `icon-size` to large
2022-01-26 19:26:45 -08:00
Christopher Davis
95c5d443ae search: Move header controls to action rows
Inspired by the bluetooth mockups. According to the
designers, we should move away from switches in header
bars.
2022-01-26 19:02:56 -08:00
Christopher Davis
e5a2281dbe search: Use AdwPreferences{Page,Group} 2022-01-26 19:02:56 -08:00
Bastien Nocera
fa01d3f10a power: Add scenario for a 2nd non-charging laptop battery 2022-01-27 02:52:20 +00:00
Bastien Nocera
6c6d9f4f38 power: Fix launching upower from scenario tester
Not everyone would have upower built under jhbuild, so use the system
one if we can't find it.
2022-01-27 02:52:20 +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
Matej Urbančič
9568bad4cd Update Slovenian translation 2022-01-26 20:45:01 +00:00
Rafael Fontenelle
06401da755 Update Brazilian Portuguese translation 2022-01-26 19:15:53 +00:00
Fran Dieguez
ce28e92aa6 Update Galician translation 2022-01-26 19:07:56 +00:00
Leônidas Araújo
e98c72ed3f Update Brazilian Portuguese translation 2022-01-26 18:46:11 +00:00
Yuri Chornoivan
a19233257f Update Ukrainian translation 2022-01-25 21:08:38 +00:00
Hugo Carvalho
9620da8442 Update Portuguese translation 2022-01-25 19:31:40 +00:00
Jonas Ådahl
21862c3e48 display: Only display configuration options if apply is allowed
org.gnome.Mutter.DisplayConfig contains a new property that tells
whether apply will be allowed to be called or not. Whether it is true or
not depends on policy stored in any of its monitors.xml configuration
files.

In order to make it clearer that configuration is not possible, except
for night light, make sure to hide the unconfigurable parts, leaving
only night light.
2022-01-25 16:43:26 +00: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
Fran Dieguez
a557382579 Update Galician translation 2022-01-25 01:33:06 +00:00
Fran Dieguez
c04df68f96 Update Galician translation 2022-01-25 01:31:45 +00:00
Christopher Davis
fdf5841b8e lock: Remove redundant haligns
AdwActionRow handles horizontal alignment for us.
2022-01-24 21:33:47 +00:00
Christopher Davis
847f1ea584 lock: Use AdwComboRow for blank screen delay 2022-01-24 21:33:47 +00:00
Christopher Davis
0c5d3fb50d lock: Use AdwComboRow for screen lock delay 2022-01-24 21:33:47 +00:00
Christopher Davis
848224ea57 lock: Use AdwPreferences{Page,Group} 2022-01-24 21:33:47 +00:00
Sam Hewitt
b0bc4f4a76 network: Minimize small symbolic icons 2022-01-24 20:07:52 +00:00
Boyuan Yang
3e710d6ee2 Update Chinese (China) translation 2022-01-24 19:12:23 +00:00
Aleksandr Melman
a1a0b066b3 Update Russian translation 2022-01-24 13:02:41 +00:00
Danial Behzadi
4f5f39b94c Update Persian translation 2022-01-23 07:46:22 +00:00
Christopher Davis
05187608f5 info-overview: Fix Software Updates row
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-22 13:16:37 -08:00
Piotr Drąg
0a218e76fb Update POTFILES.in 2022-01-22 14:25:59 +01:00
Hui Wang
aa0adcaa36 sound: clear the value on level_bar when stream is empty
We met an Input Device level_bar display issue on a machine which has
no internal mic. At first there is no external mic plugged, so the
Input Device list is empty and level_bar is gray color, after we plug
an external mic, the level_bar has red color ripples, then we unplug
the external mic, the Input Device list changes to empty and we
expect the level_bar changes back to gray color, but some bars are
still red color.

Here clear the self->value to 0 if the stream is empty, then the
level_bar will change back to gray color when Input/Output device
list is empty.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2022-01-21 18:38:30 +00:00
Georges Basile Stavracas Neto
4cd8c05e0a region: Remove title buttons from format chooser dialog
A regression from the GTK4 port.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
17c25a18d2 region: Hide login label by default
A regression from the GTK4 port.
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
fbee78874f region: Add go-next-symbolic to rows
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +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
bc686f7b14 accessibility: Add go-next-symbolic icon to various rows
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
07e3f5c3f3 power: Add go-next-symbolic icon to automatic suspend row
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
1ef843583d sound: Add boxed list around system volume
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
0831e41fb0 notifications: Use AdwActionRow in the dialog
Reduces code and makes it more consistent with other panels.
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
f23d876dc2 notifications: Adjust style of notifications dialog
Add margins around it, make the titlebar flat.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Georges Basile Stavracas Neto
ca7ba70047 notifications: Add go-next-symbolic icon to rows
As per design feedback.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1587
2022-01-21 16:13:21 +00:00
Yaron Shahrabani
5a5389b886 Update Hebrew translation 2022-01-21 15:41:33 +00:00
Hugo Carvalho
4194722bef Update Portuguese translation 2022-01-21 14:56:40 +00:00
Georges Basile Stavracas Neto
07acd70c62 po: Adjust files after the great renaming 2022-01-21 13:08:50 +00:00
Georges Basile Stavracas Neto
acd59aec65 Rename app-id to org.gnome.Settings
Rename the app-id to org.gnome.Settings since this is what
we've been calling it for many years now. Adjust all files
that derive from the app-id, such as the desktop file, D-Bus
service file names, search providers, GSettings schemas, to
match that.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/344
2022-01-21 13:08:50 +00:00
Yuri Chornoivan
5fbb9dfc6b Update Ukrainian translation 2022-01-21 10:05:08 +00:00
Daniel Mustieles
7cdc93f7f6 Updated Spanish translation 2022-01-21 10:27:31 +01:00
Georges Basile Stavracas Neto
77b1821a1d applications: Switch to g_spawn_check_wait_status()
It's the undeprecated version of g_spawn_check_exit_status().
2022-01-20 18:55:44 -03:00
Georges Basile Stavracas Neto
00cb6386e4 applications: Properly protect against NULL app_id
The 'app_id' variable can be NULL, and g_str_has_prefix() does
not particularly enjoy that.
2022-01-20 18:55:03 -03:00
Georges Basile Stavracas Neto
de26f9a8f5 applications: Remove CcActionRow
This class is now unused.
2022-01-20 17:30:45 -03:00
Georges Basile Stavracas Neto
750c4fc5a6 applications: Add descriptions to permission rows
As per mockups.
2022-01-20 17:30:45 -03:00
Georges Basile Stavracas Neto
53d3b9a70e applications: Merge permissions and integration sections
As per mockups
2022-01-20 17:30:45 -03:00
Georges Basile Stavracas Neto
25e0605f54 applications: Polish the Storage dialog
As per mockups, make the headerbar flat, add more spacings
and margins.
2022-01-20 17:30:45 -03:00
Georges Basile Stavracas Neto
4bd4a6e1fe applications: Split file & link handlers
As per mockups, split file and link handlers in the dialog.
2022-01-20 17:30:45 -03:00
Georges Basile Stavracas Neto
28212c77a7 applications: Move handlers section into a dialog
Add a new row in the usage section, like Built-in and Disk
Usage. Move the file handler widgetry into this new dialog.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
e1088495d0 applications: Remove integration_list and usage_list
Now that the rows are derivated from AdwPreferencesRow, we can
add them directly into the corresponding preferences groups.

Other groups can't benefit from this cleanup yet because they
have custom widgets.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
795cdfd06d applications: Remove section titles
Latest  mockups don't have them. There's still some more
shuffling to do, so let's remove the titles now to help
with that.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
1b0d1566c6 applications: Add header with app icon, name, and buttons
This moves the header button into the Applications panel itself,
and adds some fancy header information.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
c6b35b7732 applications: Set subtitle of storage row
Set the subtitle of the storage row, instead of the secondary
label, as per latest designs.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
187a6f6d48 applications: Set subtitle in built-in row
As per latest design.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
dc4d8e262f applications: Group built-in row with storage
As per latest mockup
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
9e38b89752 applications: Make CcInfoRow subclass AdwActionRow
Same case as previous commit
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
0bab8a6217 applications: Make CcToggleRow subclass AdwActionRow
Makes paddings, margins, behavior consistent with other panels.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
1b42b854c2 applications: Remove CSS file
It is now unused
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
20bb6d8046 applications: Switch to AdwPreferencesPage & family
This brings a good cleanup in the UI file.
2022-01-20 17:24:25 -03:00
Georges Basile Stavracas Neto
f7d6c102c9 applications: Use AdwStatusPage for the empty page
Make it streamlined with other panels
2022-01-20 17:24:25 -03:00
Yosef Or Boczko
0b0b699c20 Update Hebrew translation 2022-01-20 19:13:08 +00:00
Mohammed Sadiq
99d4947c63 wifi: Use Paintables for QR code
This fixes showing qr code when the window is scaled.
2022-01-20 19:06:22 +05:30
Georges Basile Stavracas Neto
45c7207cc3 window: Improve transition between panels
Moving the headerbar to the panels accentuated a pre-existing
problem: transitioning between panels is flickery because we
immediately remove the old panel, while the new panel fades
in.

Improve this transition by delaying the removal of the old
panel to after the stack transition finishes.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
b11ea45a95 window: Remove unnecessary calls to gtk_widget_show
Widgets are visible by default on GTK4, and we certainly don't
hide panels by default, so remove them.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
2c3477176c applications: Switch ti AdwWindowTitle
It's generally a better widget to use in the headerbar, as
it takes care of styling for us.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
82c87578cd window: Install action to navigate main leaflet
This allows implementing the back button of panel titlebars
trivially, which is also done in this commit.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
4209c510da window: Remove panel headerbar widgetry
Now that panels handle their own titlebars, remove the corresponding
widgetry from CcWindow.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
bcd969f052 shell: Remove cc_shell_set_custom_titlebar
This is now unused.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
5017f3b21e shell: Remove cc_shell_embed_widget_in_header
It is now unused.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
4073c881d1 panel: Remove cc_panel_get_title_widget
This is now unused.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
b756f1e07a display: Rework titlebar handling entirely
Move all titlebars to the panel itself. Add an overlay with
the apply titlebar, which shows the apply / cancel titlebar
above whatever current titlebar is visible.

Add titlebars to the Night Light, and display settings pages.
2022-01-20 02:23:42 +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
Georges Basile Stavracas Neto
d2d3669d34 panel: Add titlebar to panels
Make CcPanel override GtkBuildable, and special-case two types
of children: "content" for the main content, and "titlebar" for
the titlebar. Those two child types exist merely for convenience,
since it's still possible to override the entire panel with
adw_bin_set_child().

For now, no panel is using any of these conveniences.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
3d06a71b38 panel: Add empty UI template file
The UI file currently has nothing, but we'll increment it soon
with the headerbar.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
48a9141bed panel: Add "title" property
Will be used by the panel titlebar to have the proper title.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
7476bef815 panel: Add 'folded' property
This property keeps track of whether the panel is folded
into the main leaflet. Will be used when moving headerbars
into the panel themselves.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
11d721b29d window: Cleanup UI file
Remove visible=True properties, receives-default, and an
outdated GTK version declaration.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
e225f8042f window: Remove unused struct field
We don't use panel_box anywhere.
2022-01-20 02:23:42 +00:00
Aleksandr Melman
1c8d819948 Update Russian translation 2022-01-19 17:24:35 +00:00
Hugo Carvalho
866ee64f0e Update Portuguese translation 2022-01-19 15:44:34 +00:00
Bastien Nocera
38cb514d56 ci: Rebuild CI image for gnome-bluetooth library changes
The gnome-bluetooth libraries got split in
https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/103
so we need to rebuild the CI image to integrate those changes.
2022-01-19 13:46:43 +01:00
Bastien Nocera
701de89ef3 bluetooth: Use the new Bluetooth UI library
Which only exports the Settings widget and nothing else.

See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/103
2022-01-19 13:46:43 +01:00
Kukuh Syafaat
ca89ccf747 Update Indonesian translation 2022-01-19 09:34:02 +00:00
Robert Mader
375bbc333c display: Always show refresh rate
Refresh rates are an important information for users, even if they
can't change them.
This is especially true for cases where knowledge of the refresh
rate may influence the decission about the resolution to use.
Consider the example where a display may support `3840x2160@60Hz`
and `2560x1440@144Hz`. When choosing `3840x2160` as resolution,
the refresh rate will likely get hidden, making the user unaware
of the fact that they will maybe not get what they want (potentially
144Hz).

So follow the example of e.g. the sound panel where input and output
devices are listed in dropdowns, even if they are the only options
selectable.

Note: while this is a design change, for a big group of users this
won't actually change the default experience as Mutter until recently
had a bug to duplicate 60Hz modes in many cases. So most laptop users
already saw the refresh rate panel in previous Gnome versions,
dispite it having little use.

See also:
fb9564b87b
2022-01-18 23:48:42 +01:00
Yuri Chornoivan
68e9dbd447 Update Ukrainian translation 2022-01-18 21:24:58 +00:00
Georges Basile Stavracas Neto
9d324452c5 display: Use AdwLeaflet in CcDisplayPanel
This makes the transition between the main page, night light,
and display preferences more inline with other GNOME apps
using GTK4.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
06caebd0ba display: Remove SINGLE mode
We control monitors individually now, making the SINGLE mode
unnecessary.

Remove the SINGLE monitor mode, and replace it with JOIN if
required.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
1d6bab12cf display: Add enabled switch to CcDisplaySettings
This allow enabling and disabling each display individually.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
ec2632de92 display: Make CcDisplaySettings subclass GtkBox
We'll need more widgets under it soon.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
de758cc962 display: Show monitor settings in main page when single
When there's only one display, there's no need to redirect
users to another page. In this case, simply move the settings
widget to the main page.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
67e8c7f5c6 display: Add monitor rows to display settings group
They allow selecting a monitor to config, and navigating to
the monitor settings page.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
9ca9877520 fixup! display: Move display settings to a separate page 2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
7091ddee49 display: Remove display section from main page
We'll soon replace this by rows, so let's remove these widgets
now. They accounted for a lot of the complexity of the panel!
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
da599ec252 display: Move display settings to a separate page
Right now there's no way to reach this page, but we'll add
ways in the next commits.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
8c8e123690 display: Add row to switch to Night Light page
This adds a new listbox with a single row, as per
mockups, to switch to the Night Light page; and
also adds a back button to switch back to the main
page.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
c5f984c247 display: Adjust styling of arrangement widget
Use the "card" style class to make it visually similar to
other elements of the panel.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
f05fe78a98 display: Move display arrangement to the top
As per mockups. No functional changes.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
07c4e0f6d3 display: Rename variable
The config_type_switcher_group preferences group now handles
more than config_type_switcher_row, so adjust the naming to
match that.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
2a838f8684 display: Move primary display row to display type group
As per mockup. Over the next commits, more parts of the
display panel will be moved to this group.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
dd1817f5b8 display: Move config type toggles into a row
Fortunately for us, AdwPreferencesGroup makes that trivial.
Move the linked box into an AdwActionRow, and remove the icon
and the margins from the toggle buttons.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
8a353c0cdd display: Remove arrangement group description
As per mockups.
2022-01-18 17:03:14 +00:00
Georges Basile Stavracas Neto
983ac203e0 display: Remove "Display Mode" title
As per mockups. In preparation for future changes.
2022-01-18 17:03:14 +00:00
Bastien Nocera
76b5b2d542 ci: Rebuild image to get newer gnome-bluetooth
The API is new.
2022-01-18 16:25:25 +01:00
Bastien Nocera
e9f0160731 bluetooth: Fix wedged state
Fix a state where toggling the main Bluetooth switch in the header will
always show "Bluetooth turned off", whichever state it's in.

To reproduce, with Bluetooth enabled and working, run
"hciconfig hci0 down" as root, and launch the Bluetooth panel.

See https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/102
2022-01-18 16:25:25 +01:00
Bastien Nocera
769142784c bluetooth: Add helper to launch the Bluetooth Settings in scenarios 2022-01-18 16:18:19 +01:00
Bastien Nocera
595f04ea12 power: Remove ad-hoc UI debugging ifdef's
Remove the static UI debugging tools in the power panel code, and use
the scenario tester instead.
2022-01-18 16:06:15 +01:00
Bastien Nocera
bcf2d54772 power: Add helper to launch the Power Settings in scenarios
This helper tool launches the Power Settings panel in a fake
environment, making it easy to test the UI in different scenarios. The
tool allows:
- cycling through power-profiles-daemon degraded performance reasons
- adding and removing a laptop battery, keyboard, mouse or UPS

UPS support needs umockdev 0.17.4 to work correctly
2022-01-18 16:06:15 +01:00
Hugo Carvalho
b2023eb802 Update Portuguese translation 2022-01-18 13:50:56 +00:00
Christopher Davis
7aae515cf6 mouse: Use AdwPreferencesGroup's listboxes
We don't need our own listboxes, because our rows
here aren't dynamic.
2022-01-18 09:51:01 +00:00
Christopher Davis
d99269182d mouse: Remove useless GtkGrid
Also move the margins to the box itself and remove the
horizontal margins.
2022-01-18 09:51:01 +00:00
Christopher Davis
891d745302 mouse: Remove all haligns
We can rely on the alignment of AdwActionRow suffixes.
2022-01-18 09:51:01 +00:00
Christopher Davis
a066efd14c mouse: Remove activatable=False
ActionRows aren't activatable by default.
2022-01-18 09:51:01 +00:00
Christopher Davis
0d79f99ae6 mouse: Remove width request and halign from scales
The width request prevented this panel from getting smaller,
and the halign caused the scales to use the minimum possible
width.
2022-01-18 09:51:01 +00:00
Georges Basile Stavracas Neto
e38949aeed online-accounts: Adjust style of symbolic provider icons
As per design feedback, make symbolic icons have a rounded
background.
2022-01-17 19:42:10 -03:00
Georges Basile Stavracas Neto
946417990c online-accounts: Port to GTK4
This is a massive rewrite of the panel. Because we can't have
nice things and WebKit2GTK for GTK4 won't be ready in time,
rework the panel to spawn a new subprocess with a dialog that
handles online accounts - both creation and editing.
2022-01-17 19:42:10 -03:00
Christopher Davis
fdda3e77f6 bluetooth: Use AdwStatusPage
libadwaita provides a widget for empty pages that we
should use in all previous places where we rolled our own.
2022-01-17 19:21:49 +00:00
Hugo Carvalho
85c3ca6ada Update Portuguese translation 2022-01-17 14:25:58 +00:00
Aleksandr Melman
06b432b125 Update Russian translation 2022-01-17 12:24:26 +00:00
Felipe Borges
c15fb46c42 applications: Fix typo in key name in the desktop file
Regression introduced by commit 9a3cb6ab4.

Reported at 9a3cb6ab44 (note_1356724)
2022-01-17 10:52:38 +01:00
Yuri Chornoivan
6b3075ceab Update Ukrainian translation 2022-01-16 14:24:20 +00:00
Danial Behzadi
07e99e4f46 Update Persian translation 2022-01-16 14:16:03 +00:00
Christopher Davis
aa41cdbfe2 camera: Use AdwActionRow for application rows 2022-01-16 12:17:45 +00:00
Christopher Davis
cd8c1db3aa camera: Use AdwPreferences{Page,Group} 2022-01-16 12:17:45 +00:00
Christopher Davis
72e9ace169 camera: Use AdwStatusPage 2022-01-16 12:17:45 +00:00
Christopher Davis
2f9ed9e2a6 location: Use AdwActionRow for application rows 2022-01-14 22:58:19 -08:00
Christopher Davis
cd440893d2 location: Use AdwPreferences{Page, Group} 2022-01-14 22:58:19 -08:00
Christopher Davis
9e81c4e741 location: Use AdwStatusPage 2022-01-14 20:09:11 -08:00
Bastien Nocera
bd4c27e7ab power: Remove support for power-profiles-daemon < 0.9.0 2022-01-14 13:46:50 +00:00
Felipe Borges
9a3cb6ab44 applications: Set the Icon key in desktop file to a icon that exists
While we dynamically append --symbolic to the icons while creating
the sidebar model in
https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/master/shell/cc-shell-model.c#L270
There are automation tools (such as rpmdiff) that parse desktop files
and verify whether their Icon= matches to an existing file in the
icon theme package.

preferences-desktop-apps doesn't exist in adwaita-icon-theme but
preferences-desktop-apps-symbolic does.
2022-01-14 13:28:24 +01:00
Yaron Shahrabani
3622e967e3 Update Hebrew translation 2022-01-12 12:22:10 +00:00
Kukuh Syafaat
c667f3dcba Update Indonesian translation 2022-01-12 04:40:13 +00:00
Fran Dieguez
936c3c0218 Update Galician translation 2022-01-11 14:28:09 +00:00
Bastien Nocera
84e0db96fa build: Bump g-s-d req for new GSettings key
Commit 1144db552e added new UI which
required a GSettings key that's only available in more recent versions
of gnome-settings-daemon. Require the first stable version which
included this key.

Closes: #1450
2022-01-10 19:44:24 +01:00
Bastien Nocera
e5bf16d65e ci: Build gnome-settings-daemon in CI
As we usually need g-c-c and g-s-d to be upgraded in lockstep.
2022-01-10 19:44:24 +01:00
Aleksandr Melman
5bb00e9aa9 Update Russian translation 2022-01-10 17:45:29 +00:00
Mohammed Sadiq
14181fbbbd wwan: Port to use AdwPreferencesPage
And adapt to changes.

This helps avoid using widgets like AdwClamp as it will be
handled by AdwPreferencesPage and AdwPreferencesGroup.
2022-01-10 12:41:56 +00:00
Danial Behzadi
6fe20f3962 Update Persian translation 2022-01-10 11:46:02 +00:00
Quentin PAGÈS
03af6951d7 Update Occitan translation 2022-01-09 15:28:59 +00:00
Dz Chen
582ef12ec1 Update Chinese (China) translation 2022-01-09 14:47:30 +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
12fefbc0d7 cc-multitasking-panel: Fix initial state for "all workspaces" setting 2022-01-07 13:50:39 +00:00
Christopher Davis
257557d660 cc-multitasking-panel: Remove can-focus
The default should be used, and the way we were
using it was redundant.
2022-01-07 13:50:39 +00:00
Christopher Davis
736150b035 multitasking: Use AdwPreferences{Page,Group} 2022-01-07 13:50:39 +00:00
Christopher Davis
617341591b cc-window: Use AdwLeaflet's navigation API
This should be preferred over `set_visible_child ()`
2022-01-07 13:43:50 +00:00
Christopher Davis
494f8a0f14 cc-window: Enable leaflet navigation
This enables touchpad/touchscreen gestures, alt+arrows,
and mouse buttons.
2022-01-07 13:43:50 +00:00
Aleksandr Melman
6691ba9b76 Update Russian translation 2022-01-07 11:47:08 +00:00
Hugo Carvalho
5f1ed40692 Update Portuguese translation 2022-01-06 22:51:31 +00:00
Christopher Davis
88027fc310 info-overview: Vertically clamp OS Logo
Otherwise it would grow as large as the page would let
it.
2022-01-06 22:15:30 +00:00
Christopher Davis
96ecd3acdf info-overview: Use AdwPreferences{Page,Group} 2022-01-06 22:15:30 +00:00
Christopher Davis
079bf51086 network: Fix wifi icon loading
GTK4 changes how icons are loaded - only icons that are
set up to follow icon theme paths are recolored. The way
the network panel loaded icons wasn't compatible with this,
causing icons to stay dark in dark mode.

This commit adjusts the gresource so that icons are
in `$RESOURCE_BASE_PATH/icons/scalable/actions`. Since
GTK knows how to handle that automatically, we can
simply use `icon-name` instead of loading a full
icon path.
2022-01-06 12:42:34 -08: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
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
Mohammed Sadiq
81a5390c30 wwan: Use button icon-name property to set button image
This simplifies setting button image and improves the way they
are presented as the css will then be handled better this way.
2022-01-06 15:04:28 +00:00
Mohammed Sadiq
fbb2f98c44 wwan: Port to GTK4 2022-01-06 15:04:28 +00:00
Yuri Chornoivan
3357491a31 Update Ukrainian translation 2022-01-06 08:50:09 +00:00
Jordi Mas
62612eb93d Update Catalan translation 2022-01-06 08:40:50 +01:00
Christopher Davis
161e096667 cc-notifications-panel: Use AdwActionRow
AdwActionRow handles most of what we were building
a custom row for, and what it doesn't handle we
can simply use its API for.
2022-01-06 00:51:36 +00:00
Christopher Davis
d61b5bb0b0 cc-notifications-panel: Use AdwPreferences{Page,Group}
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:51:36 +00:00
Christopher Davis
e216f7f2db cc-sound-panel: Use AdwPreferencesPage and PreferencesGroup
libadwaita provides nice pre-built widgets for preferences
pages and groups. We should use them where possible.
2022-01-06 00:38:31 +00:00
Benjamin Berg
6f825cd486 network: Fix saving passwords for non-wifi connections
When validating security settings for non-wifi connections, we
temporarily create a wireless connection. Unfortunately, when this
connection is destroyed, it'll clear the stored password from the 802.1x
settings object.

Avoid this by removing the setting before the temporary connection is
destroyed.

Closes: #337
2022-01-05 23:09:45 +00:00
Christopher Davis
4e2706fc6f cc-window: Re-enable type-to-search
This was lost in the GTK4 port. This commit uses
GtkSearchBar's API to capture events.

See https://gnome.pages.gitlab.gnome.org/gtk/gtk4/method.SearchBar.set_key_capture_widget.html
2022-01-05 22:31:17 +00:00
Christopher Davis
f1d5a0e71e cc-window: Enable scroll-to-focus on panel list
GTK4 doesn't do this by default, so we need to make sure
to specify it on our GtkViewport.
2022-01-05 22:31:17 +00:00
Jakub Steiner
8ba134fbce multitasking: make graphics work in dark mode
- more of a workaround than a solution. Getting rid of the white fills
  at the expense of clarity and style.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1565
2022-01-05 22:22:57 +00:00
Robert Mader
6a4652bd35 display-config: Do not invert order when constructing modes
Mutter sends modes in descending order of preference. By reverting
the order via `g_list_prepend`, we get unintended side effects
such as choosing the least preferred refresh rate by default (if
the selected mode is not marked as preferred).

Instead of adding complex logic in several places, make sure that
the assumption of descending preference is kept by simply not
inverting the order.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1562
2022-01-05 22:12:13 +00:00
Christopher Davis
0af1937d4d universal-access: Inline Sound Keys dialog
This can also be replaced with a simple switch
in an AdwActionRow.
2022-01-05 22:06:37 +00:00
Christopher Davis
f4b0ac5318 universal-access: Inline Screen Reader dialog
The dialog can easily be replaced by an
AdwActionRow with a switch and a subtitle.
2022-01-05 22:06:37 +00:00
Christopher Davis
9982f30008 cc-ua-panel: Remove custom listboxes
No longer needed now that all rows handle
activation.
2022-01-05 22:06:37 +00:00
Christopher Davis
997fadf8fb cc-ua-panel: Handle row activation on individual rows
The custom listboxes serve another purpose: to handle
row activation. Instead of using a custom listbox, we
can simply listen to the `activated` signal on the
rows that don't have a switch.
2022-01-05 22:06:37 +00:00
Christopher Davis
02b9f29c44 cc-ua-panel: Use AdwActionRow for all rows
AdwActionRow simplifies activation handling for
switches, provides consistent styling and sizing,
and mnemonic handling.
2022-01-05 22:06:37 +00:00
Christopher Davis
a58fa42e1d cc-ua-panel: Use AdwPreferencesPage/AdwPreferencesGroup
The individual groups still use their own listboxes,
as the custom rows they use won't be added to
AdwPreferencesGroup's list.

See https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.PreferencesGroup.html#adwpreferencesgroup-as-gtkbuildable
2022-01-05 22:06:37 +00:00
Christopher Davis
6a525c861e cc-ua-panel: Remove custom keynav handling
We were using this to move between groups and scroll
the page, but that's not necessary. All we need
to do is set `scroll-to-focus` on our GtkViewport.

This commit removes the keynav-failed callback
and all associated plumbing.
2022-01-05 22:06:37 +00:00
Bastien Nocera
003a5182b9 ci: Rebuild image with newer gsettings-desktop-schemas 2022-01-05 11:24:04 +01:00
Bastien Nocera
6234e16712 build: Fix Bluetooth panel build
API version got bumped, see:
https://gitlab.gnome.org/GNOME/gnome-bluetooth/-/merge_requests/92
2022-01-05 11:02:45 +01:00
Bastien Nocera
d8719a627e build: Bump required gsettings-desktop-schemas version
For the colour scheme option.
2022-01-05 11:02:45 +01:00
Daniel Mustieles
e99221e5d2 Updated Spanish translation 2022-01-04 12:17:51 +01:00
Aurimas Černius
cc4d27b70f Updated Lithuanian translation 2022-01-03 22:26:40 +02:00
Sophie Herold
ef9428d983 icon: Remove circle outside of drawing area 2022-01-01 18:26:49 +00:00
Christopher Davis
3ee642e421 net-device-bluetooth: Use AdwActionRow and .boxed-list
This makes both the row and the list fit in better
with the rest of the page.
2021-12-29 23:28:44 -08:00
Yosef Or Boczko
1b45b633ae Update Hebrew translation 2021-12-29 16:34:33 +00:00
Quentin PAGÈS
ef1342def1 Update Occitan translation 2021-12-27 20:03:53 +00:00
Aleksandr Melman
714dde080f Update Russian translation 2021-12-25 13:01:03 +00:00
Asier Sarasua Garmendia
b84a53405a Update Basque translation 2021-12-23 21:49:04 +00:00
Fabio Tomat
2a97dbff29 Update Friulian translation 2021-12-23 06:54:04 +00:00
Kukuh Syafaat
f7f5ceb962 Update Indonesian translation 2021-12-23 03:26:40 +00:00
Sebastian Keller
dfc504409f search-provider: Don't escape result description as markup
Only the shell can know how the description string will be used and if
or when it should be escaped. Previously the shell did not escape the
description before displaying it with markup to highlight search hits,
but now it does. For gnome-control-center this however means without
this change the string will be escaped twice causing markup to show up
in the description text.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2033
2021-12-22 23:55:15 +01:00
Yaron Shahrabani
d64590de38 Update Hebrew translation 2021-12-22 20:32:54 +00:00
Fabio Tomat
3a52bdac68 Update Friulian translation 2021-12-22 20:29:59 +00:00
Hugo Carvalho
c1c61cd4f2 Update Portuguese translation 2021-12-22 20:29:41 +00:00
Alexander Mikhaylenko
5c903af015 background: Polish wallpaper thumbnails
Make corners rounded.

Replace selected style with an overlay check, make the close button
smaller to match. Move slideshow indicator to the lower left corner.

Set margins in css.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
88879951cf background: Clean up the slideshow icon
Update the unused symbolic to match the svg with a baked-in shadow,
actually use it. Bundle it in gresources instead of installing, fix the
style class name. Fix margins - the close button was overriding them.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
3fea98b151 background: Rename to Appearance 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
ecd6124b91 background: Add a light/dark style switcher 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
0aaa6f296d background: Redo the layout to match the new mockups 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
f89976ff54 ua: Stop setting high contrast WM theme
That key is deprecated.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
c1f8e93636 ua: Use the new high contrast key
Keep setting gtk theme, but use the new boolean as the source of truth.
2021-12-20 19:51:46 +00:00
Yuri Chornoivan
4a5c41b384 Update Ukrainian translation 2021-12-18 16:38:40 +00:00
Hugo Carvalho
c362118d7b Update Portuguese translation 2021-12-18 14:00:11 +00:00
Piotr Drąg
8ce7722702 Update POTFILES.in 2021-12-18 13:25:53 +01:00
Christopher Davis
58e3d7873a cc-panel-list: Adjust margins for sidebar rows
This matches the mockups and Patterns.
2021-12-17 21:36:54 +00:00
Christopher Davis
7f601f4698 applications: Remove use of sidebar-icon style 2021-12-17 21:36:54 +00:00
Christopher Davis
d72d23a1cd cc-panel-list: Remove use of sidebar-icon style
Generally sidebar icons aren't dimmed anymore.
2021-12-17 21:36:54 +00:00
Christopher Davis
6aa1361a5d cc-window.ui: Remove .view from sidebar
Sidebars should be the same color as window content
now.
2021-12-17 21:36:54 +00:00
Sebastian Keller
b3a7a16d23 keyboard: Use gtk4 translations instead of gtk3 ones for shortcut search
Otherwise looking up shortcuts with "ctrl" in non-English locales would
fail without gtk3 installed.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1546
2021-12-17 19:27:03 +01: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
Victor Toso
8355404ed4 keyboard-shortcut-editor: fix leak of accel string
==31571== 120 bytes in 8 blocks are definitely lost in loss record 17,034 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4D9816A: gtk_accelerator_name (gtkaccelgroup.c:1577)
==31571==    by 0x4A82D1: setup_custom_shortcut (cc-keyboard-shortcut-editor.c:364)
==31571==    by 0x4A92DF: cc_keyboard_shortcut_editor_key_press_event (cc-keyboard-shortcut-editor.c:745)
2021-12-17 09:53:41 +01:00
Victor Toso
365fb19957 keyboard-item: fix leak on unused CcKeyCombo
==31571== 288 bytes in 24 blocks are definitely lost in loss record 18,138 of 19,290
==31571==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==31571==    by 0x4AF77A8: g_malloc (gmem.c:106)
==31571==    by 0x4A4119: variant_get_key_combos (cc-keyboard-item.c:475)
==31571==    by 0x4A41FD: settings_get_key_combos (cc-keyboard-item.c:498)
==31571==    by 0x4A46BE: cc_keyboard_item_load_from_gsettings (cc-keyboard-item.c:574)
==31571==    by 0x4A5BBB: append_section (cc-keyboard-manager.c:315)
==31571==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==31571==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==31571==    by 0x4A6D68: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:707)
==31571==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==31571==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==31571==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:53:41 +01:00
Victor Toso
7741dc1abe keyboard-manager: fix leak of section list store
==25729== 1,058 (40 direct, 1,018 indirect) bytes in 1 blocks are definitely lost in loss record 20,104 of 20,657
==25729==    at 0x484086F: malloc (vg_replace_malloc.c:380)
==25729==    by 0x4AF77A8: g_malloc (gmem.c:106)
==25729==    by 0x4B0F1E4: g_slice_alloc (gslice.c:1072)
==25729==    by 0x4B09060: UnknownInlinedFun (gsequence.c:1609)
==25729==    by 0x4B09060: g_sequence_insert_before (gsequence.c:527)
==25729==    by 0x4ED2FE7: gtk_list_store_insert (gtkliststore.c:1271)
==25729==    by 0x4A5DCE: append_section (cc-keyboard-manager.c:363)
==25729==    by 0x4A605D: append_sections_from_file (cc-keyboard-manager.c:431)
==25729==    by 0x4A6766: reload_sections (cc-keyboard-manager.c:568)
==25729==    by 0x4A6D33: cc_keyboard_manager_load_shortcuts (cc-keyboard-manager.c:706)
==25729==    by 0x4A2FA4: cc_keyboard_shortcut_dialog_init (cc-keyboard-shortcut-dialog.c:841)
==25729==    by 0x4A7A288: g_type_create_instance (gtype.c:1929)
==25729==    by 0x4A61CAC: g_object_new_internal (gobject.c:1945)
2021-12-17 09:50:57 +01: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
Christopher Davis
897c641549 panels: Replace .view.frame with .boxed-list 2021-12-16 16:32:21 -08: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
Sveinn í Felli
8d5e16737f Update Icelandic translation 2021-12-16 19:25:12 +00:00
Sveinn í Felli
2f8cf24997 Update Icelandic translation 2021-12-16 19:19:02 +00:00
Quentin PAGÈS
6cbb4db198 Update Occitan translation 2021-12-16 11:22:47 +00:00
Hugo Carvalho
5033565414 Update Portuguese translation 2021-12-15 23:15:24 +00:00
Yuri Chornoivan
39f7bb0347 Update Ukrainian translation 2021-12-15 19:06:46 +00:00
Michael Catanzaro
c180aa660c network: fix critical when opening VPN details page
I was seeing this critical when opening the VPN details page:

(gnome-control-center:78888): nm-CRITICAL **: 16:26:21.689: ((src/libnm-client-impl/nm-device.c:1299)): assertion '<dropped>' failed

It probably broke in 551d72280b. The code
above and below expects self->device may be NULL, so let's add a
NULL check here.
2021-12-15 16:33:00 +00: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
b3b86894e9 ci: Update image with new GTK4 dependencies
Build gnome-bluetooth, gnome-desktop, and colord-gtk from
their master/main branches, which should include support for
GTK4.
2021-12-14 22:34:21 -03:00
Alexander Mikhaylenko
04e3497fa6 background-preview: Fix a measure() infloop 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
efbad6eb50 network: Port to GTK4
Boy this was hard.

To ease the pain of porting wireless-security to GTK4, add
a new WsFileChooserButton class that mimics the behavior of
a button that triggers a filechooser, as per the migration
guide suggests.

There were lots of GtkGrids, so the diff is particularly
horrendous. Sorry.

This needs serious testing before landing.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d189a67000 flatpak: Update dependencies to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
816e6203e3 wacom: Port to GTK4
Many part of this commit were made by Carlos
Garnacho <carlosg@gnome.org>

WIP wacom: Port to GTK4

Lots of stuff missing and probably broken.

wacom: Port CcDrawingArea input to gestures

We have a handy GtkGestureStylus to use here, which avoids direct
handling of GdkEvents.

wacom: Update current stylus tracking to GtkGestureStylus

Use the ::proximity signal to notice when we are being hovered with
a tablet stylus, and look up the tool from there.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f598fb3ed6 display: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3f322e8553 shell: Allow panels set custom titlebars
This will be used by the Display panel to add a different
titlebar when confirming a new display configuration.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d00cc3929e [WIP] color: Port to GTK4
This is very rough still. The calibration code
is entirely untested.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
d9d670328b background: Port to GTK4
CcBackgroundPreview required some layout changes, but
overall a pretty easy port.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
ddf6ca9952 region: Port to GTK4
An uneventful port.
2021-12-14 22:34:21 -03: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
d7e794e7ab keyboard: Port to GTK4
Drop the wm-common insanity.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
8141af469c printers: Port to GTK4
Fortunately for us GtkTreeView still operates pretty
much exactly like in GTK3. Other than that, it's a
dense junction of all that we've done so far to port
other panels.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2b11900b0c bluetooth: Port to GTK4
This needs libgnome-bluetooth-2.0, which was recently merged.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b81a180c4f thunderbolt: Port to GTK4
The C code of this panel is just so. damn. good. Porting it was
a breeze.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3b6b678db9 diagnostics: Port to GTK4
A trivial one.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f043ca3680 sharing: Port to GTK4
Again, it was easier to just switch some of the code to use
AdwActionRow, and that's what I've done in this commit.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
25edfb4a4b mouse: Port to GTK4
This one is an interesting case. It was easier to simply switch
to AdwPreferencesPage than actually port all the GtkFrames in
there.

In addition to that, the mouse test page now uses a GtkPicture
instead of a GtkImage, and the GtkDrawingArea API changes are
reflected in the code.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
2d762680d2 usage: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
696ed350bb applications: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
6cfd6e0652 multitasking: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
a0d49cb3a8 power: Port to GTK4
Extra care was needed for the combo boxes, and the way we currently
use GtkStringList is kind of hacky, but overall things seem to be
working fine.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
800cab08bf microphone: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b965f7cf50 lock: Port to GTK4
This one was even more trivial than the previous one!
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
449c55be3a location: Port to GTK4
An almost trivial port too.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
26630338ba search: Port to GTK4
This one was the first panel ported that used Drag n' Drop, and
we can see how much of an improvement GTK4 is compared to GTK3
when handling DnD.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
c43eeea954 removable-media: Port to GTK4
A pretty boring, regular port again. No new challenges here.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
b9064cf2f6 default-apps: Port to GTK4
An easy one, mostly removing code from the UI file.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
9995a3bb79 universal-access: Port to GTK4
This was quite a huge port, but fortunately it mostly involved
removing tons of deprecated widgets (without replacement; just
drop them) and adjusting packing properties.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
a719008403 sound: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
eff96c4cb1 camera: Port to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
75f6566a91 notifications: Port to GTK4
This one was relatively easy, since most of the brokenness came
from using deprecated properties that can just be dropped, and
packaging that can also just be dropped.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
3c8a0aa0b1 info-overview: Port to GTK4
- Remove visible=True properties from the UI file
 - Use GtkPicture for the OS logo
 - Drop gtk_dialog_run()
 - Port gnome-control-center-print-renderer to GTK4
   by using GdkSurface to create the GL context
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
30dcd1f973 window: Port to GTK4
- Inherit AdwApplicationWindow
 - GtkHeaderBar → AdwHeaderBar
 - Simplify the widget tree structure [1]
 - Drop custom key handler, use bindings instead

[1] It used to have a big messy chain of leaflets, headers,
and whatnot. Now it's simplified as:

 AdwLeaflet
 + ---------------- + --------------------------------- +
 |   AdwHeaderBar   |           AdwHeaderBar            |
 + ---------------- + --------------------------------- +
 |   GtkSearchBar   |                                   |
 + ---------------- +                                   |
 |                  |                                   |
 |                  |                                   |
 |                  |                                   |
 |                  |             GtkStack              |
 |   CcPanelList    |                                   |
 |                  |                                   |
 |                  |                                   |
 |                  |                                   |
 |                  |                                   |
 + ---------------- + --------------------------------- +
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
0818bf469c panel: Port to GTK4
Inherit AdwBin.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
521ea3a635 panel-list: Port to GTK4
- Inherit AdwBin since GtkStack is a final class now
 - Replace GtkContainer APIs by their widget-specific ones
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
15a67221a0 application: Add CSS provider on startup
GTK isn't fully initialized on init, so move that to startup.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
e42a819723 application: Subclass AdwApplication
It'll handle setting up various things for us.
2021-12-14 22:34:21 -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
Georges Basile Stavracas Neto
5ca53a0a78 Drop Cheese dependency
Cheese is not ready for GTK4, and probably won't ever be, so just
drop the dependency. We'll reimplement webcam support using PipeWire
later.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
5303a977b1 Switch to GTK4 & libadwaita
Nothing builds now.
2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
f41ab920b3 Disable all panels and tests
We'll start the transition by disabling all panels and tests, so that
we can go through them one by one, which should make the review process
significantly less painful.
2021-12-14 22:34:21 -03:00
Aurimas Černius
15e351a314 Updated Lithuanian translation 2021-12-14 13:47:41 +02:00
Aleksandr Melman
23243534da Update Russian translation 2021-12-13 11:27:11 +00:00
Felipe Borges
8c1d7a726c flatpak: Use "gnome-3-34" branch for gnome-bluetooth
gnome-bluetooth got its API version bumped for the GTK4 port.
Let's pin the old stable version for now (until g-c-c ports to
GTK4).
2021-12-06 12:59:27 +01:00
Fabio Tomat
38c7d50092 Update Friulian translation 2021-12-03 11:00:25 +00:00
Stéphane Travostino
a650940bda flatpak: fix flatpak build by pulling the correct branch 2021-11-30 15:38:56 +00:00
Daniel Mustieles
c56d2f0d06 Updated Spanish translation 2021-11-26 17:42:17 +01:00
Danial Behzadi
8802857f60 Update Persian translation 2021-11-24 08:56:10 +00:00
Rafael Fontenelle
8ee6e6583d Update Brazilian Portuguese translation
(cherry picked from commit 7b2765ad8e)
2021-11-23 07:33:27 +00:00
Fabio Tomat
bba99ec100 Update Friulian translation 2021-11-22 13:44:18 +00:00
Fran Dieguez
ef0bdef4a7 Update Galician translation 2021-11-19 22:39:09 +00:00
Goran Vidović
3c270948eb Update Croatian translation 2021-11-19 16:09:55 +00:00
Bastien Nocera
a9c398e5d9 color: Remove profile upload feature
As it was already removed in colord itself:
98f83acc91 (diff-cb19db05cc548372b27ebee7d47bc00b6788ad05da6f5d7fff107c45bbfba38f)

This removes the only direct libsoup 2.x dependency in
gnome-control-center.
2021-11-18 16:39:44 +01:00
Bastien Nocera
4b1f7011c4 wacom: Add scenario tester
Running the helper will launch gnome-control-center with a mocked Wacom
Cintiq tablet through umockdev when one isn't present or easily available.

The Cintiq was selected as it will trigger showing all the different
buttons Wacom tablets can make the panel spawn.
2021-11-18 14:57:22 +00:00
Bastien Nocera
8ac36f479e wacom: Add a fake stylus when mocking a tablet 2021-11-18 14:57:22 +00:00
Bastien Nocera
a93a023229 wacom: Split off notebook switching for detected stylus
This will reduce code duplication for mocking styli.
2021-11-18 14:57:22 +00:00
Bastien Nocera
d47b9be08a wacom: Print errors for libwacom_new_from_*() calls
This helps with debugging.
2021-11-18 14:57:22 +00:00
Selyan Slimane AMIRI
69ea0be29b Add Kabyle translation 2021-11-18 08:17:04 +00:00
Daniel Mustieles
e4f2df9180 Updated Spanish translation 2021-11-16 15:39:29 +01:00
Changwoo Ryu
b60b980c9e Update Korean translation
(cherry picked from commit a1f01da3e0)
2021-11-13 18:02:18 +00:00
Hugo Carvalho
5925da263c Update Portuguese translation 2021-11-13 15:40:16 +00:00
Goran Vidović
61d74f200a Update Croatian translation 2021-11-12 11:20:41 +00:00
Goran Vidović
35c496cea5 Update Croatian translation 2021-11-12 11:19:39 +00:00
Yaron Shahrabani
b2e2fa1da8 Update Hebrew translation 2021-11-11 20:51:36 +00:00
Quentin PAGÈS
505e11cbae Update Occitan translation 2021-11-10 17:13:58 +00:00
Yuri Chornoivan
8b131f9d79 Update Ukrainian translation 2021-11-10 15:47:40 +00:00
zhuyaliang
51760441b3 printers: Add adjust printer task priority button
Add a new  button to the 'PpJobRow',This button can adjust the priority of tasks in the print queue to the highest
2021-11-10 15:10:20 +00:00
Jordi Mas
1a9540c94a Update Catalan translation 2021-11-08 21:50:31 +01:00
Hugo Carvalho
6f12d13c93 Update Portuguese translation 2021-11-08 10:42:29 +00:00
Hugo Carvalho
f75f87a106 Update Portuguese translation 2021-11-07 22:45:39 +00:00
Quentin PAGÈS
59113e73b1 Update Occitan translation 2021-11-07 19:28:19 +00:00
Fabio Tomat
1944749c9e Update Friulian translation 2021-11-07 12:58:33 +00:00
Yaron Shahrabani
473f274468 Update Hebrew translation 2021-11-06 21:52:25 +00:00
Yuri Chornoivan
77da0efd0f Update Ukrainian translation 2021-11-05 18:49:51 +00:00
tejal30palwankar
00ada31bce software: Added missing screenshots in software
Updated appdata.xml

Fixes #588
2021-11-04 09:22:49 +00:00
Tejal Palwankar
dfd0e38f3b wifi: Fixed plural handling for different languages
Fixes #1463
2021-11-04 09:12:44 +00:00
Rafael Fontenelle
f87370cd6e Update Brazilian Portuguese translation
(cherry picked from commit e848034be7)
2021-11-03 15:34:18 +00:00
Jordi Mas
39b9e0f8ac Update Catalan translation 2021-10-30 10:40:19 +02:00
Chingkai Chu
3b6acb1867 user-accounts: Make autologin_switch a activatable_widget
If we don't add this property for autologin_row, the shortcut to
toggle the GtkSwitch won't work.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1501
2021-10-29 11:21:45 +00:00
Quentin PAGÈS
95672e466d Update Occitan translation 2021-10-28 15:57:25 +00:00
Rūdolfs Mazurs
fe5d48e142 Update Latvian translation
(cherry picked from commit f27b5c0ab0)
2021-10-27 18:04:52 +00:00
Jordi Mas
f8dce5a9af Update Catalan translation 2021-10-27 14:29:28 +02:00
Jordi Mas
bd1db82804 Update Catalan translation 2021-10-26 13:01:57 +02:00
eshagh shahidani
3c8f9cf6e9 Update Persian translation 2021-10-20 16:22:35 +00:00
Bastien Nocera
76e7f6b80e build: Check for polkit supplementary files
Which are shipped in newer versions of polkit, as well as backported in
older versions of Ubuntu, rather than hardcoding a newer version of
polkit and expecting newcomers to know to downgrade the version
requirement.

Fixes: 9ebcd17236
2021-10-20 14:25:30 +00:00
Bastien Nocera
53f493e326 Revert "build: Bump build-dependency on polkit"
This reverts commit 9ebcd17236.
2021-10-20 14:25:30 +00:00
Bastien Nocera
3b7e081ae2 build: Add script to detect files in XDG_DATA_DIRS
meson doesn't have support for doing this, so use Python and just the
stdlib to find files under XDG_DATA_DIRS and XDG_DATA_HOME.
2021-10-20 14:25:30 +00:00
eshagh shahidani
41c613f4b4 Update Persian translation
(cherry picked from commit fff8c0ba69)
2021-10-19 15:41:22 +00:00
Sveinn í Felli
c304849e83 Update Icelandic translation
(cherry picked from commit 29299d16fc)
2021-10-12 22:36:37 +00:00
Andre Klapper
be31481fe5 Fix broken markup in Vietnamese UI translation 2021-10-10 19:23:41 +02:00
Marek Černocký
d763f00174 Updated Czech translation 2021-10-10 17:16:01 +02:00
Goran Vidović
c03863bce1 Update Croatian translation
(cherry picked from commit 24e916ec82)
2021-10-06 17:05:03 +00:00
Felipe Borges
305fc2e26e multitasking: Expand row subtitles to a second line
Depending on the language used, the label could get long and
unreadable (ellipsized).

Fixes #1486
2021-10-06 12:39:08 +02:00
Felipe Borges
a932bea7f3 lock: Expand row subtitles to a second line
The HdyActionRow subtitle usually contains a longer description
of the preference/option relative to the widget. Depending on the
language used, the label could get long and unreadable (ellipsized).

https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/643 added
the "subtitle-lines" property to tackle this specific issue.

Fixes #1358
Fixes #1486
2021-10-06 12:39:00 +02:00
Dušan Kazik
d18ab3fd96 Update Slovak translation
(cherry picked from commit f40a2dcf16)
2021-10-01 08:44:29 +00:00
Dz Chen
48dcfce824 Update Chinese (China) translation 2021-09-30 17:59:50 +00:00
Frédéric Péters
667af4f521 power: Use translated strings for power button action behaviors
Fixes: #1476
2021-09-29 17:58:46 +00:00
Yuri Chornoivan
b060e05968 Update Ukrainian translation 2021-09-29 12:56:15 +00:00
grumpey
f8e0558ebd Use proper unicode ellipses in strings
Fixes: #1458
2021-09-28 09:15:00 -04:00
Yosef Or Boczko
1d62581d92 Update Hebrew translation 2021-09-26 16:42:43 +00:00
Yosef Or Boczko
eca6c09c16 Update Hebrew translation
(cherry picked from commit f55ac98a98)
2021-09-26 16:40:15 +00:00
Jeremy Bicha
496c719d7b wwan: Remove duplicate line from .desktop 2021-09-26 12:50:37 +00:00
Emin Tufan Çetin
c65f09ced8 Update Turkish translation 2021-09-26 12:15:44 +00:00
Мирослав Николић
25b8d3db78 Update Serbian translation
(cherry picked from commit 0196f55368)
2021-09-26 06:24:05 +00:00
Guido Günther
8868510e33 display: Use ComboBox when folded
On small window sizes the ButtonBox can overflow the panel. This is
especially true in single display mode when no other elemnts prevent
shrinking to e.g. 360px width on phones. Use the ComboBox introduced in
632cb3c907 in these cases.

For that we introduce cc_display_settings_refresh_layout() to refresh
the layout when the folded state changes. This can later on be used for
more tweaks to shrink to smaller sizes.
2021-09-25 19:05:28 +00:00
Guido Günther
a4ab41194b shell: Mirror the main leaflet's 'folded' property
This makes it simpler for panels to check whether g-c-c
is in folded state.
2021-09-25 19:05:28 +00:00
Dušan Kazik
4bec4354e2 Update Slovak translation
(cherry picked from commit 59fac91bdf)
2021-09-25 09:27:57 +00:00
1pav
f89a48a980 window: Save application window state
Currently the window state (width, height, maximized) is not preserved
across application restarts.

These changes implement window state saving/restoring by leveraging the
GSettings API.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1293
2021-09-24 20:42:06 -03:00
Sophie Herold
c1cfe52527 metainfo: Align app name with .desktop name 2021-09-24 22:34:28 +00:00
Marek Černocký
7f009b9be7 Updated Czech translation 2021-09-24 17:21:31 +02:00
Jakub Steiner
c4034c8498 fingerprinting: out of style graphics
- use the geometric shapes of the [illustration
  style](https://gitlab.gnome.org/Teams/Design/app-illustrations/)
  for the graphical assets.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1424
2021-09-24 11:42:29 +00:00
Ngọc Quân Trần
b5a530f5b0 Update Vietnamese translation 2021-09-24 02:05:41 +00:00
Yaron Shahrabani
166b02174c Update Hebrew translation 2021-09-23 07:58:27 +00:00
Philipp Kiemle
6b11ab42ef Update German translation 2021-09-22 20:28:35 +00:00
Goran Vidović
7d62de905d Update Croatian translation 2021-09-22 15:59:20 +00:00
Alexey Rubtsov
f81e5c2b65 Update Russian translation 2021-09-22 15:34:18 +00:00
Jordi Mas
40fffb25ad Update Catalan translation 2021-09-21 22:13:51 +02:00
Alexander Shopov
47cdac1ea4 Update Bulgarian translation 2021-09-21 09:03:11 +00:00
Марко Костић
b172bd1cc6 Update Serbian translation 2021-09-20 05:05:41 +00:00
Matej Urbančič
f0bddaf08c Update Slovenian translation 2021-09-19 18:25:36 +00:00
Aman Alam
513077f1eb Update Punjabi translation 2021-09-18 23:32:26 +00:00
Źmicier Turok
b1c039623e Update Belarusian translation 2021-09-18 09:54:41 +00:00
Mohammed Sadiq
d762d93f38 wwan: Fix enabling data after APN is set
Since we don't use gtk_dialog_run(), the dialog was shown in a non-blocking
way.  So instead of handling the APN details immidiately after the APN
dialog is shown, handle them in a signal callback.

Fixes #1465
2021-09-17 21:18:55 +00:00
Jakub Steiner
72380627b5 mouse: avoid cropping illustration
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1466
2021-09-17 21:14:19 +00:00
Georges Basile Stavracas Neto
a318fd544c Post-release version bump 2021-09-17 17:52:35 -03:00
Georges Basile Stavracas Neto
7e95c34f68 41.0 2021-09-17 17:41:09 -03:00
Quentin PAGÈS
f0ed184b13 Update Occitan translation 2021-09-17 17:26:31 +00:00
Bastien Nocera
863b093c36 flatpak: Remove 11 modules that aren't needed to build udisks
udisks doesn't build the daemon anymore, so doesn't need all those
daemon modules.
2021-09-15 18:40:30 +02:00
Bastien Nocera
f81eb41d6c flatpak: Don't build udisks' daemon
We only use the client library.
2021-09-15 18:38:30 +02:00
Bastien Nocera
de6db7e96c flatpak: Switch upower to meson
UPower switched to meson at the beginning of September.
2021-09-15 18:36:07 +02:00
Danial Behzadi
deac23fc99 Update Persian translation 2021-09-15 07:30:52 +00:00
Daniel Mustieles
43f038762e Updated Spanish translation 2021-09-15 08:28:43 +02:00
Boyuan Yang
bd4be61277 Update Chinese (China) translation 2021-09-14 17:57:47 +00:00
Piotr Drąg
15bb0fa966 Update Polish translation 2021-09-14 19:35:48 +02:00
Jiri Grönroos
bbd2b8926a Update Finnish translation 2021-09-14 10:17:50 +00:00
Alan Mortensen
de1810ba4b Updated Danish translation 2021-09-13 20:48:49 +02:00
Alexandre Franke
f28909f093 Update French translation 2021-09-13 15:52:18 +00:00
Nathan Follens
d1e6a4a9da Update Dutch translation 2021-09-13 15:09:40 +00:00
Nathan Follens
bd298bb331 Update Dutch translation 2021-09-13 14:59:29 +00:00
Changwoo Ryu
0c60c16749 Update Korean translation 2021-09-13 00:22:26 +00:00
Aurimas Černius
785b6a795b Updated Lithuanian translation 2021-09-12 20:54:16 +03:00
Tim Sabsch
91ca88d82b Update German translation 2021-09-12 16:26:09 +00:00
Piotr Drąg
7a130fa29e Update Polish translation 2021-09-12 15:00:17 +02:00
Balázs Úr
6d088c2aa7 Update Hungarian translation 2021-09-12 06:26:03 +00:00
Goran Vidović
e32b67e5c0 Update Croatian translation 2021-09-10 11:14:04 +00:00
Goran Vidović
97e87e2dac Update Croatian translation 2021-09-10 11:02:39 +00:00
Emin Tufan Çetin
8607a9feef Update Turkish translation 2021-09-09 19:33:13 +00:00
Jordi Mas
b04f84c73e Update Catalan translation 2021-09-09 21:31:59 +02:00
Jordi Mas
099790aff3 Update Catalan translation 2021-09-09 19:07:15 +02:00
Quentin PAGÈS
a799c5f90f Update Occitan translation 2021-09-09 16:09:36 +00:00
Daniel Șerbănescu
d2bc4a68a0 Update Romanian translation 2021-09-09 11:25:48 +00:00
Aman Alam
11f2651050 Update Punjabi translation 2021-09-09 04:00:32 +00:00
Kukuh Syafaat
e65dd64eec Update Indonesian translation 2021-09-09 01:11:04 +00:00
Enrico Nicoletto
0900daf4b8 Update Brazilian Portuguese translation 2021-09-08 22:40:42 +00:00
Luna Jernberg
67ffeaca41 Update Swedish translation 2021-09-08 18:16:51 +00:00
Quentin PAGÈS
3184aefef4 Update Occitan translation 2021-09-08 16:56:16 +00:00
Jiri Grönroos
6fe22eec92 Update Finnish translation 2021-09-08 16:18:02 +00:00
Daniel Mustieles
19597f1b13 Updated Spanish translation 2021-09-08 18:00:16 +02:00
Hugo Carvalho
27426a605a Update Portuguese translation 2021-09-08 14:28:44 +00:00
Asier Sarasua Garmendia
f347c05d4d Update Basque translation 2021-09-08 14:23:55 +00:00
Baurzhan Muftakhidinov
04080bae1e Update Kazakh translation 2021-09-08 10:35:54 +00:00
Yuri Chornoivan
3fe28a1891 Update Ukrainian translation 2021-09-08 09:58:09 +00:00
Fran Dieguez
eafa38ac9b Update Galician translation 2021-09-08 09:44:19 +00:00
Marek Černocký
b008d52f80 Updated Czech translation 2021-09-08 10:45:32 +02:00
Bastien Nocera
c239bce3e9 user-accounts: Add Parental Controls keywords
As designers did not like the presence of a separate parental controls
application in the launchers duplicating launching the management app
through the users panel, we should add the keywords usually associated
with the parental controls app to the panel's keywords so functionality
can still be accessed this way.

See https://gitlab.freedesktop.org/pwithnall/malcontent/-/merge_requests/119#note_1052271
2021-09-08 08:23:31 +00:00
Asier Sarasua Garmendia
3a930c896a Update Basque translation 2021-09-08 06:59:03 +00:00
Quentin PAGÈS
54840d4727 Update Occitan translation 2021-09-07 22:10:43 +00:00
Quentin PAGÈS
f9b1e6cc29 Update Occitan translation 2021-09-07 22:07:24 +00:00
Hugo Carvalho
9cb0ea99f5 Update Portuguese translation 2021-09-07 21:01:47 +00:00
Matej Urbančič
85e7ae2a8d Update Slovenian translation 2021-09-07 19:19:43 +00:00
Luna Jernberg
ce0414b15d Update Swedish translation 2021-09-07 17:04:26 +00:00
Baurzhan Muftakhidinov
a39ce2b77f Update Kazakh translation 2021-09-07 16:24:28 +00:00
Daniel Șerbănescu
cf4768769e Update Romanian translation 2021-09-07 15:46:25 +00:00
Yuri Chornoivan
e8350f1508 Update Ukrainian translation 2021-09-07 13:53:35 +00:00
Marek Černocký
70e680acbc Updated Czech translation 2021-09-07 14:09:49 +02:00
Enrico Nicoletto
08e7a25b7a Update Brazilian Portuguese translation 2021-09-07 11:26:42 +00:00
Daniel Mustieles
e012cf5f3a Update Spanish translation 2021-09-07 10:16:04 +00:00
Andre Klapper
54a360811c Update keyboard related panel descriptions
Input Sources moved from Region & Language to Keyboard section in 40

Fixes #1447
2021-09-07 07:48:15 +00:00
Baurzhan Muftakhidinov
8971d7c7a7 Update Kazakh translation 2021-09-07 07:42:30 +00:00
Jordi Mas
d3037f8829 Update Catalan translation 2021-09-06 22:08:50 +02:00
Fran Dieguez
c6903211a0 Update Galician translation 2021-09-06 18:27:49 +00:00
Hugo Carvalho
a414efb8cb Update Portuguese translation 2021-09-06 15:44:14 +00:00
Danial Behzadi
4866119949 Update Persian translation 2021-09-06 12:10:40 +00:00
Daniel Mustieles
c724e0a4cd Update Spanish translation 2021-09-06 11:14:17 +00:00
Aurimas Černius
54f9eff102 Updated Lithuanian translation 2021-09-06 13:55:57 +03:00
Asier Sarasua Garmendia
5b391877ac Update Basque translation 2021-09-06 09:30:46 +00:00
Andika Triwidada
f8a7839df2 Update Indonesian translation 2021-09-06 06:27:28 +00:00
Yuri Chornoivan
3d4ce4f016 Update Ukrainian translation 2021-09-06 05:19:05 +00:00
Marek Černocký
b59822afa1 Updated Czech translation 2021-09-06 07:07:49 +02:00
Changwoo Ryu
c98fbd4ac5 Update Korean translation 2021-09-06 00:52:31 +00:00
Boyuan Yang
62a4f5d05c Update Chinese (China) translation 2021-09-06 00:50:23 +00:00
Anders Jonsson
e70a6400aa Update Swedish translation 2021-09-05 23:56:49 +00:00
Georges Basile Stavracas Neto
2d99f8661f Post-release version bump 2021-09-05 19:38:39 -03:00
Georges Basile Stavracas Neto
4e5cef0917 41.rc1 2021-09-05 19:24:58 -03:00
Rafael Fontenelle
ba0b675a50 Update Brazilian Portuguese translation 2021-09-05 22:23:12 +00:00
Mohammed Sadiq
191a179612 wwan-device: Fix network mode strings to be translatable
creating the mode strings by simply concating them
blindly can result in hard to translate strings.

Fixes #1446
2021-09-05 22:01:52 +00:00
Bastien Nocera
51500e38a8 user-accounts: Add debug when launching malcontent-control 2021-09-05 21:55:06 +00:00
Bastien Nocera
3e26f594fc user-accounts: Avoid double password prompt
Don't require a password to be typed just to be able to launch the
parental controls app which itself will ask for a password to be typed.
2021-09-05 21:55:06 +00:00
Bastien Nocera
97e858d697 user-accounts: Hide parental controls row if unavailable
Don't show the parental controls line for administrator accounts.
2021-09-05 21:55:06 +00:00
Vojtěch Perník
1e9ad39c5e Updated Czech translation 2021-09-05 22:16:58 +02:00
Vojtěch Perník
60462d705f Updated Czech translation 2021-09-05 22:15:51 +02:00
Boyuan Yang
af5037265a Update Chinese (China) translation 2021-09-04 17:06:49 +00:00
Hugo Carvalho
439e022c2f Update Portuguese translation 2021-09-03 23:15:31 +00:00
Aurimas Černius
7d7fa1a0e9 Updated Lithuanian translation 2021-09-02 14:21:29 +03:00
Matej Urbančič
d3eab22481 Update Slovenian translation 2021-08-31 19:57:15 +00:00
Felipe Borges
c7bd442839 network: Show configuration button during wifi association
While connecting to a Wifi network g-c-c would hide the button that
launches the connection preferences dialog. This is inconvenient
when network manager keeps on attempting to reconnect to a
misconfigured network.

These changes rework the logic of the buttons by always presenting
the configuration button and toggling the visibility of the spinner
accordingly.

Fixes #493
2021-08-30 13:13:40 +00:00
Anders Jonsson
af4ad7ade2 Update Swedish translation 2021-08-29 18:41:31 +00:00
Jiri Grönroos
e49a7856ee Update Finnish translation 2021-08-28 11:29:05 +00:00
Baurzhan Muftakhidinov
c8d063e244 Update Kazakh translation 2021-08-28 09:24:11 +00:00
Jordi Mas
906b876ae7 Update Catalan translation 2021-08-28 08:22:47 +02:00
Andika Triwidada
159a412ec9 Update Indonesian translation 2021-08-28 02:05:07 +00:00
Emin Tufan Çetin
387f79d6f1 Update Turkish translation 2021-08-27 22:12:46 +00:00
Źmicier Turok
c455e98371 Update Belarusian translation 2021-08-27 09:06:46 +00:00
Kalev Lember
e65a4ba77b user-accounts: Fix spurious underscore in front of "Parental Controls" label 2021-08-26 16:34:04 +02:00
Philipp Kiemle
5948eb9e4e Update German translation 2021-08-25 20:15:29 +00:00
Daniel Mustieles
7a3b65cf77 Updated Spanish translation 2021-08-25 17:21:41 +02:00
Fran Dieguez
0108136379 Update Galician translation 2021-08-25 05:59:09 +00:00
Mohammed Sadiq
d975f56e66 wwan: Avoid translation of some strings
Many strings are not shown in the UI. Let's not overwhelm translators
2021-08-24 15:40:49 +00:00
Quentin PAGÈS
39e937ff69 Update Occitan translation 2021-08-23 17:31:41 +00:00
Bastien Nocera
43b40b3b4a info-overview: Make sure -dark non-text logo variant is handled
gtk_image_set_from_icon_name() would fallback from $LOGO-text-dark to
$LOGO-text to $LOGO, leaving out $LOGO-dark which might be available.

Make sure it's in the list of possibilities by using
g_themed_icon_new_from_names() and listing it explicitly as a possible
icon name instead.

Fixes: a3b8964a19
Closes: #1415
2021-08-23 18:39:34 +02:00
Danial Behzadi
b5cd1832e0 Update Persian translation 2021-08-21 09:06:56 +00:00
Quentin PAGÈS
246da0ed8e Update Occitan translation 2021-08-20 20:44:00 +00:00
Philip Withnall
a9d7b085df applications: Fix selecting an app using the command line
If I run `gnome-control-center applications org.freedesktop.Bustle`
while g-c-c is already running and a different app is shown, Bustle will
be selected in the list box, but the details panel won’t be updated to
show it.

Fix that by emitting the `activate` signal on the row, as is done
everywhere else in `cc-applications-panel.c` when selecting a row.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-08-18 12:48:49 +00:00
Jordi Mas
7b126a46a5 Update Catalan translation 2021-08-18 13:37:06 +02:00
Daniel Mustieles
76c26eba79 Updated Spanish translation 2021-08-17 13:31:43 +02:00
Asier Sarasua Garmendia
18e0394618 Update Basque translation 2021-08-17 11:27:16 +00:00
Jordi Mas
13a04e071f Update Catalan translation 2021-08-15 22:33:56 +02:00
Nishal Kulkarni
7bd8a4e50c keyboard: deprecation fix
Change `g_binding_get_source` to `g_binding_dup_source` in keyboard
2021-08-15 11:29:19 +00:00
Nishal Kulkarni
7054d8b050 display: deprecation fix
Change g_memdup to g_memdup2 in display.

https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538
2021-08-15 11:29:19 +00:00
Enrico Nicoletto
af576a4758 Update Brazilian Portuguese translation 2021-08-14 19:29:00 +00:00
Hugo Carvalho
5b5a379f83 Update Portuguese translation 2021-08-14 18:41:02 +00:00
Mohammed Sadiq
b3f4f9cafd wwan: Fix a typo
Fixes dc840f0aec (note_1249116)
2021-08-14 12:34:04 +00:00
Alexey Rubtsov
31e6adac86 Update Russian translation 2021-08-14 11:56:14 +00:00
Yuri Chornoivan
2e1a3ca4b7 Update Ukrainian translation 2021-08-14 06:08:46 +00:00
Georges Basile Stavracas Neto
71533005ea Post-release version bump 2021-08-13 19:21:04 -03:00
Georges Basile Stavracas Neto
6e6451feb2 41.beta 2021-08-13 19:13:48 -03:00
Georges Basile Stavracas Neto
0fc6ba5d0a Update POTFILES.in 2021-08-13 18:47:21 -03:00
Georges Basile Stavracas Neto
ee355ee727 multitasking: Use Mutter settings for dynamic workspaces
The overrides weren't meant to be used like that.
2021-08-13 18:39:57 -03:00
Sebastian Krzyszkowiak
6e5169ad4d wwan: Fix signal strength display when extended signal retrieval is disabled
MMModemSignal interface is used to retrieve extended signal information that
requires periodic polling. Therefore, it needs to be manually enabled in order
to use. There if a fallback to use mm_modem_get_signal_quality when MMModemSignal
interface is unavailable, but it didn't check whether it's actually enabled,
leaving the UI with empty label.
2021-08-13 19:25:41 +00:00
Kyle Rankin
585fe8c94a Lower WWAN DNS Priority
The current DNS priority settings for WWAN were set far too low. Most
connections (including WiFi) do not set DNS priority (set to 0) and per
https://developer.gnome.org/NetworkManager/stable/nm-settings.html :

"A lower value is better (higher priority). Zero selects a globally
configured default value. If the latter is missing or zero too, it
defaults to 50 for VPNs and 100 for other connections."

By setting both the "low" and "high" settings to 15 and 20 respectively,
the WWAN DNS servers were always appearing above WiFi, even though WiFi
had routing priority. This caused latency and other problems when the
wwan connection was slow because the system would query those DNS
servers before WiFi ones. Beyond that, it would even cause WWAN to
override VPN DNS settings which isn't what we want.

This change puts the "low priority" setting above the default 100 that
connections get when they don't otherwise set a priority, and the "high
priority" slightly below 100. I did this instead of setting the values
to 0 because I noticed that NM doesn't seem to be aware it should
prioritize WiFi in that case so WWAN DNS servers were still sometimes
taking precedence.
2021-08-13 19:25:41 +00:00
Mohammed Sadiq
169f537e4b network: Don't show modems supported by cellular panel
Cellular panel is already handling it
2021-08-13 19:25:41 +00:00
Mohammed Sadiq
dc840f0aec wwan: Add new panel for modem management
The panel supports 2G/3G/4G GSM/LTE modems. CDMA2000 Modems are not supported.
If a supported modem is present, the panel will be shown and the modem will be
handled, else, network-panel shall manage the modem as it did in the past.

If more than one modem with data enabled is present, the user is allowed to set
priority of one SIM over the other (the priority is for SIM, not modem).

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/132
2021-08-13 19:25:41 +00:00
Mohammed Sadiq
f3f4f13fe4 common: Add polkit rules for modem management 2021-08-13 19:25:41 +00:00
Jakub Steiner
a0fa4d0ff5 multitasking: adjust image assets 2021-08-13 18:17:36 +00:00
Georges Basile Stavracas Neto
0f0845172f Introduce the Multitasking panel
The Multitasking panel brings some additional settings
from Tweaks that are relevant to the general platform.

Related: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/558
2021-08-13 18:17:36 +00:00
Georges Basile Stavracas Neto
b7ff6aa2d5 Revert "location: Fix permission store table/id"
This reverts commit 996e46c620.

Turns out, it was GNOME Shell who should have switched to the location table
we were using. This was done at [1], so let's revert this change for GNOME 41.

[1] https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1945
2021-08-13 12:01:16 -03:00
Hugo Carvalho
e17dac9561 Update Portuguese translation 2021-08-13 10:06:29 +00:00
Quentin PAGÈS
c8c3a76251 Update Occitan translation 2021-08-12 21:29:45 +00:00
Mohammed Sadiq
5ba4bc0fa9 info: Initialize autoptr variables with NULL
So as to avoid invalid free
2021-08-12 15:02:12 +00:00
Matej Urbančič
374309ff88 Update Slovenian translation 2021-08-12 07:39:26 +00:00
Rafael Fontenelle
1f4ba7bc84 Update Brazilian Portuguese translation 2021-08-10 12:39:14 +00:00
Yuri Chornoivan
7b1863c4ba Update Ukrainian translation 2021-08-09 14:41:01 +00:00
Bastien Nocera
2b7cccf13b power: Update power profile labels
Use "Balanced" instead of "Balanced Power", and make sure to add a
context for all the profiles for translators.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1243075
2021-08-09 13:31:12 +00:00
Alexey Rubtsov
bbf22d4919 Update Russian translation 2021-08-07 16:51:15 +00:00
Yaron Shahrabani
fa04738b96 Update Hebrew translation 2021-08-07 16:48:50 +00:00
Danial Behzadi
c510c64cd0 Update Persian translation 2021-08-07 14:50:43 +00:00
Emin Tufan Çetin
c63011f9bc Update Turkish translation 2021-08-06 20:48:19 +00:00
Yuri Chornoivan
1a1572fcfe Update Ukrainian translation 2021-08-06 17:51:19 +00:00
Hugo Carvalho
e60b568056 Update Portuguese translation 2021-08-06 13:48:46 +00:00
Rafael Fontenelle
9ff34d8b18 Update Brazilian Portuguese translation 2021-08-06 11:31:13 +00:00
Jordan Petridis
f5d5d1ce98 ci: Refactor ci-template setup
Instead of building the image on a schedule, use a user-incrementable
tag and try to build the image on each pipeline.

If the image tag does not exist, a new one is built and pushed.
If its already built the job is a no-op and the existing image
is used.
2021-08-05 23:22:14 +00:00
Bastien Nocera
e4c496158e power: Change "Balanced" power profile label
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4530#note_1241985
2021-08-05 15:28:02 +02:00
Allan Day
8fb8a340bf power: Align power profile info boxes with profiles text
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
19fb4e4a0c power: Remove icons from power profiles
They were originally included was to educate users about what the icons
mean, for when they appeared in the top bar. However, since we no
longer plan on showing the status icon in the top bar, it's not so
important that people learn the meaning of the icons.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Bastien Nocera
7b21494774 power: Dim the info box icon
This brings less focus to the icon and more to the text.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1421
2021-08-05 15:28:02 +02:00
Rafael Fontenelle
534dd99f47 Update Brazilian Portuguese translation 2021-08-04 23:26:09 +00:00
Alexey Rubtsov
90a3743d94 Update Russian translation 2021-08-03 20:44:59 +00:00
Boyuan Yang
066e183c7a Update Chinese (China) translation 2021-08-02 20:44:39 +00:00
Hugo Carvalho
f9b41c1dd7 Update Portuguese translation 2021-08-02 14:00:17 +00:00
Aliaksiej Razumaŭ
2dd1847b37 Update Belarusian translation 2021-08-02 13:05:57 +00:00
Danial Behzadi
f4251c4b81 Update Persian translation 2021-08-02 08:55:24 +00:00
Fran Dieguez
4c2c78976a Update Galician translation 2021-08-02 06:17:53 +00:00
Yuri Chornoivan
b402b59134 Update Ukrainian translation 2021-08-02 06:07:49 +00:00
Felipe Erias Morandeira
1d952d4ebd region: replace the "Login Screen" button
...on the title bar with joined toggles (like in Background panel) for a
clearer UI.

Note 2020-08-26: This patch has been in Endless OS since 2014. It seems
  like a good UX change, so I'm proposing it upstream with some minor
  changes. - mwleeds
2021-08-02 12:03:40 +12:00
Hui Wang
0f18a662be sound: update the volume-slider after getting a valid stream
In the ubuntu 20.04, we met an issue about the output volume-slider
on the machine with the legacy HDA audio driver, the output device
is the Speaker first (analog-stereo pa sink), then we connect a hdmi
monitor, the HDMI audio is in the output combo-box, we select the
hdmi audio (hdmi-stereo pa sink) from the combo-box, the hdmi audio
becomes the active output device now, we adjust the output volume from
the volume-slider, the slider UI is changed, but the output sound
is not changed with the UI.

The root cause is when the speaker is active, the pulseaudio only
keeps the analog-stereo sink, the sink hdmi-stereo is unlinked, when
users select the hdmi audio from UI, the pulseaudio will unlink
analo-stereo sink and create hdmi-stereo sink, but before hdmi-stereo
is created, the output_device_changed_cb() is called and
gvc_mixer_control_get_stream_from_device() returns a NULL since the
hdmi-stereo sink is not created yet in the pulseaudio. Because stream
is NULL, the output_volume_slider->stream is NULL, users can't change
the output volume via the volume-slider.

To fix it, we add a output_volume_slider->stream check in the
device_update_cb(), if it is NULL, get the stream and set it to
volume-slider. In this function, the sink hdmi-stereo is created
already, so the stream is not NULL. And this change also applies to
input as well.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
2021-08-01 22:12:11 +00:00
Hugo Carvalho
28ae06207d Update Portuguese translation 2021-07-31 21:31:42 +00:00
Alexey Rubtsov
e444fa8ead Update Russian translation 2021-07-31 17:33:58 +00:00
Quentin PAGÈS
cdf4273648 Update Occitan translation 2021-07-31 13:54:11 +00:00
Jordi Mas
d4133fb256 Update Catalan translation 2021-07-31 15:14:46 +02:00
Fabio Tomat
2cef7bc95b Update Friulian translation 2021-07-30 10:50:36 +00: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
Benjamin Berg
75c3e11708 bluetooth: Fix bluetooth switch transitions
This commit changes the switch to do a proper delayed state change using
the state-set signal. Also changed is that we always update the switch
state rather than avoiding an update when it is not powered.

Avoiding this update was introduced in commit 4a009da483 (bluetooth:
Don't change the switch status when transitioning), however, the current
implementation causes us to get stuck in the wrong visual state
sometimes. Also, with this patch I am unable to see any visual glitch on
hardware that should be affected, and even if there was a glitch,
getting the final state right is more important.

Closes: #607, #1272
2021-07-29 23:10:46 +00:00
Georges Basile Stavracas Neto
9c8f097a38 Post-release version bump 2021-07-29 19:29:11 -03:00
Georges Basile Stavracas Neto
8a9f7a04a5 41.alpha 2021-07-29 18:58:13 -03:00
Benjamin Berg
9d14644caf display: Prevent snapping unmodified display
Rebuilding the UI would trigger the scale to be re-applied. This in turn
would cause the monitor to be snapped and possibly changing a correct
configuration.

Note that this really is a bug in the snapping code. But that code is a
mess and not fireing the signal is a good thing either way.

Closes: #1412
2021-07-29 16:59:13 +02:00
Yuri Chornoivan
9a2fe54933 Update Ukrainian translation 2021-07-29 10:09:37 +00:00
Felipe Borges
a825ded085 universal-access: Add "Enable Animations" option
Fixes #1388
2021-07-28 19:12:12 +02:00
Rafael Fontenelle
3e8de6627d Update Brazilian Portuguese translation 2021-07-28 13:54:21 +00:00
Yuri Chornoivan
90c3dfe59a Update Ukrainian translation 2021-07-28 12:17:02 +00:00
Bastien Nocera
dafbd54fe0 power: Update and add subtitle to automatic brightness row
As per:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1020#note_1210702
2021-07-28 11:55:34 +00:00
Bastien Nocera
3a289fe502 power: Remove unused CcBrightnessScale 2021-07-28 11:55:34 +00:00
Bastien Nocera
bb30b04ed6 power: Remove Brightness scales
From https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1020#note_1211728
"
They are out of place - fine-grained control over brightness isn't what the
power settings are for. As a result, they confuse the settings overall.

In both cases we have alternative controls, through keyboard hot keys or
through the shell's screen brightness slider.
"
2021-07-28 11:55:34 +00:00
Bastien Nocera
fd53f569f1 power: Tweak labels in "Power Saving Options" section
To match the latest mockups.

The lack of subtitles for most of the items in that section made the
section look pretty bizarre.
2021-07-28 11:55:34 +00:00
Bastien Nocera
f03cf178dd power: Remove Bluetooth power switch button
See previous commit.
2021-07-28 11:55:34 +00:00
Bastien Nocera
2f2ea3aed6 power: Remove Wi-Fi and WWAN "power saving" toggles
It's pretty clear from their experiences on smartphones that our users
know that Wi-Fi and other wireless technologies use enough battery that
turning them off is a power saving move.

The switches and text were also pretty confusing as we would be turning
"off" the devices to turn "on" the power saving.
2021-07-28 11:55:34 +00:00
Guido Günther
a2cfd2b341 applications: Ellipsize title label
This makes long appliation names fit on narrow displays without pushing
the "Open in Software" button out.
2021-07-28 11:34:02 +00:00
Alexey Rubtsov
36b671956f Update Russian translation 2021-07-28 10:31:59 +00:00
Jordan Petridis
5cd6efef09 flatpak: Use meson for gsound 2021-07-28 04:48:13 +03:00
Jordan Petridis
f6e122420c flatpak: build libblockdev without werror 2021-07-28 04:48:13 +03:00
Jordan Petridis
5b75200cfb flatpak: bundle popt for cryptsetup
Starting with GNOME 41, popt is no longer part of the runtime
2021-07-28 04:48:13 +03:00
Jordan Petridis
5a843f350f flatpak: update samba
Samba 4.12 complains loudly about a perl yapp driver module. Some
fiddling with the PERL5LIB and PRL_MM_OPT was required in order
to get perl to look into the /app prefix after bundling the module.
2021-07-28 04:46:54 +03:00
Bastien Nocera
93cf2405ee power: Fix logic when showing profile holds
A logic error meant that the power profiles info boxes container
would not be shown if there wasn't a "degraded" performance as well.

Spotted by Allan Day
2021-07-27 15:49:26 +02:00
Jordi Mas
4e6d2cb8f4 Update Catalan translation 2021-07-27 10:23:43 +02:00
Yuri Chornoivan
f485003fc7 Update Ukrainian translation 2021-07-26 17:35:48 +00:00
Bastien Nocera
1144db552e power: Add UI for "power-saver profile when battery is low"
See https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/247
2021-07-26 18:53:20 +02:00
Brandon Nielsen
c3c58aae38 Code cleanup based on feedback. 2021-07-26 16:03:05 +00:00
Brandon Nielsen
a73a095d76 ppd_list is not a copy, don't free it.
Both consumers of PpPPDSelectionDialog (PpNewPrinterDialog,
PpDetailsDialog) free the PPDList they pass to
pp_ppd_selection_dialog_set_ppd_list and they do not pass a copy, so
PpPPDSelectionDialog should not free the pointer on dispose.

This fixes a racy segfault when closing a PpDetailsDialog after PPD
selection (introduced with this series), did not appear with
PpNewPrinterDialog for some reason.
2021-07-26 16:03:05 +00:00
Brandon Nielsen
b19325167d gtk_widget_show over gtk_widget_show_all. 2021-07-26 16:03:05 +00:00
Brandon Nielsen
6223858c5e Formatting cleanup. 2021-07-26 16:03:05 +00:00
Brandon Nielsen
16aa95bdc8 Return a PpNewPrinter instead of PpPrintDevice, use gtk_show_all
pp_new_printer_dialog_get_new_print_device is replaced with
pp_new_printer_dialog_get_new_printer which returns a PpNewPrinter.

gtk_show_all is used instead of gtk_dialog_run for PpNewPrinterDialog
and PpPPDSelectionDialog.

This is in response to feedback:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/930#note_1202114
2021-07-26 16:03:05 +00:00
Brandon Nielsen
179bda1b64 Make PpNewPrinterDialog a GtkDialog instead of GObject
This is accomplished by moving the calls to pp_printer_add_async
directly to CcPrintersPanel. pp_printer_delete_async calls are already
done directly in the CcPrintersPanel so there is consistency gained by
this implementation in addition to PpNewPrinterDialog actually being a
GtkDialog.

A pp_new_printer_dialog_get_new_print_device method has been added to
PpNewPrinterDialog to allow getting the PpPrintDevice selected by the
user to add. This can be called anytime after a response callback
with a GTK_RESPONSE_OK reponse_id.

PpNewPrinterDialog still does asynchronous operations to populate the
dialog, but the create dialog -> receive signal -> destroy dialog flow
can all be handled like a traditional GtkDialog without additional
callbacks or signalling.
2021-07-26 16:03:05 +00:00
Fabio Tomat
aceaa40432 Update Friulian translation 2021-07-24 07:28:33 +00:00
Rafael Fontenelle
7f9d7b5f01 Update Brazilian Portuguese translation 2021-07-23 14:58:20 +00:00
Quentin PAGÈS
2964368759 Update Occitan translation 2021-07-22 17:55:05 +00:00
Jordi Mas
48c45c121b Update Catalan translation 2021-07-22 13:45:12 +02:00
Hugo Carvalho
f79b6e02bf Update Portuguese translation 2021-07-22 10:28:21 +00:00
Bastien Nocera
738c15be66 power: Fix D-Bus proxy leak 2021-07-21 13:53:59 +00:00
Bastien Nocera
f644b37887 ci: Fix gnome-40 CI
Commit f85750274c removed grilo-devel from
the dependency list, but the images generated by the CI on the
development branch are also the ones used for older branches.

This can be seen by all the CI jobs on the gnome-40 branch:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/commits/gnome-40
failing the day after the grilo dep was removed:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/981
2021-07-21 12:48:40 +02:00
Alexey Rubtsov
b74d9456c1 Update Russian translation 2021-07-21 10:21:47 +00:00
Kukuh Syafaat
5b2a622a0d Update Indonesian translation 2021-07-20 13:33:45 +00:00
Yuri Chornoivan
b054bf9194 Update Ukrainian translation 2021-07-20 12:05:48 +00:00
Bastien Nocera
98b921b46f power: Reword lap mode info message
Reword the lap mode info message slightly as the performance mode might
not have been what the user requested, but the warning should stay until
cleared nonetheless.
2021-07-20 00:51:48 +02:00
Bastien Nocera
06d110a3d0 power: Tweak power profile info boxes horizontal spacing
A bit too much whitespace around the info icon.
2021-07-20 00:51:48 +02:00
Bastien Nocera
c0ce1e53ab power: Show power profile info boxes for profile holds
Applications can request that power-profiles-daemon "hold" a particular
power profile for the duration of a task or event, such as launching a
taxing application, or saving power because of low battery.

Show those holds in the same type of info boxes we already use to show
"degraded" performance.

See https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/46
2021-07-20 00:51:48 +02:00
Bastien Nocera
05997b424c power: Move variant_lookup_string() helper function 2021-07-20 00:51:48 +02:00
Bastien Nocera
eda473f0d6 power: Prepare for adding more power profile info boxes
Rename and re-indent the code that adds the power profile info boxes to
prepare for adding more info boxes when needed.
2021-07-20 00:51:48 +02:00
Kukuh Syafaat
0552098a5c Update Indonesian translation 2021-07-17 14:54:53 +00:00
Bastien Nocera
9724d3ef59 power: Handle new power-profiles-daemon API
Handle the new PerformanceDegraded property to replace
PerformanceInhibited.
2021-07-15 22:14:06 +02:00
Bastien Nocera
e5bbe4d7c6 power: Add new power profile info row widget 2021-07-15 22:14:06 +02:00
Bastien Nocera
0f86d4d754 power: Simplify emptying listbox
We do that in a few places.
2021-07-15 14:57:49 +02:00
Bastien Nocera
d35c816508 power: Fix keynav not working
gnome-control-center/panels/power/cc-power-panel.c: In function ‘keynav_failed_cb’:
gnome-control-center/panels/power/cc-power-panel.c:892:50: warning: statement with no effect [-Wunused-value]
  892 |   direction == GTK_DIR_UP ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
2021-07-15 13:12:36 +02:00
Philipp Kiemle
e113e51003 Update German translation 2021-07-13 20:57:22 +00:00
Alexander Shopov
fa85528833 Update Bulgarian translation 2021-07-10 15:48:31 +00:00
Alexey Rubtsov
cb26d22afa Update Russian translation 2021-07-05 07:19:23 +00:00
Rafael Fontenelle
6e9e2726f0 Update Brazilian Portuguese translation 2021-07-03 16:10:59 +00:00
Ian Douglas Scott
996e46c620 location: Fix permission store table/id
Updates to match
https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/status/location.js

Should fix
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/885.
2021-07-02 19:18:21 +00:00
Florentina Mușat
5edbf17b4d Update Romanian translation 2021-07-02 16:10:33 +00:00
Matej Urbančič
4fafecf738 Update Slovenian translation 2021-07-02 12:51:17 +00:00
Matej Urbančič
4f49002163 Update Slovenian translation 2021-07-02 12:50:01 +00:00
Hugo Carvalho
ab8e8e01dc Update Portuguese translation 2021-06-25 18:22:12 +00:00
Quentin PAGÈS
3140459a26 Update Occitan translation 2021-06-24 20:12:20 +00:00
Felipe Borges
1b6c8ca55d mouse: Overlay mouse test button on top of the artwork 2021-06-24 16:16:14 +02:00
Jakub Steiner
3a0fb47373 mouse: test panel graphic
- update graphic to follow illustration style -- https://gitlab.gnome.org/Teams/Design/app-illustrations

Fixes Teams/Design/initiatives#82
2021-06-24 16:11:48 +02:00
Muhammet Kara
860d953e99 Update Turkish translation 2021-06-20 05:33:01 +00:00
Pawan Chitrakar
920bcbdcd6 Update Nepali translation 2021-06-16 13:42:49 +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
Marco Trevisan (Treviño)
632cb3c907 display-settings: Show scaling values using a combo-box when more than buttons limit
In case fractional scaling is enabled, depending on the resolution,
mutter may advertise many fractional scaling values which are way more
than MAX_SCALE_BUTTONS, making impossible to use higher fractional
scaling values in high dpi setups.

So, in case scaling is possible, show them as buttons if they fit the
buttons limit, otherwise fallback to a combo box that is consistent with
the rest of the UI and will allow to use any valid scaling value.
2021-06-15 17:30:36 +00:00
Marco Trevisan (Treviño)
266622e99e display-config: Filter invalid modes and scales when setting minimum size
In the front-end we define a minimum size and then we check every time
we iterate through resolutions or scales if such mode is valid.

Since the configuration won't change, we can just filter the invalid
values once when the minimum allowed size is set, so that we can be sure
that the returned scales list is always matching the ones appliable for
the current mode.

The only edge case is when using a cloned configuration, as in this case
the values need to be applied to all the monitors.
However, since we already return a reffed GArray we can just create a
temporary one in this case where unappliable scales are skipped.

As per this we can just use around the scales array length as the number
of visible buttons.
2021-06-15 17:30:36 +00:00
Marco Trevisan (Treviño)
a3392176a9 display-config: Expose the supported scales as a reffed GArray
It's just a nicer api and allows us to avoid having to count all the
elements around or to expose the size via an out value.

Given this is a private API anyway there's no risk for modifying the
array, so it's something safe to use anyways.
2021-06-15 17:30:36 +00:00
Marco Trevisan (Treviño)
89cb1d99cb display-config: Use G_APPROX_VALUE to compare scale doubles
It's not safe to compare double values directly, use G_APPROX_VALUE with
DBL_EPSILON instead.
2021-06-15 17:30:36 +00:00
Marco Trevisan (Treviño)
ca884dc666 display-panel: Clear the variant builder if not showing an OSD
When we've only one monitor active we are not showing the OSD but we're
leaking the variant used to request the shell to show the OSDs.
2021-06-15 17:30:36 +00:00
Felipe Borges
bdc0368bd0 flatpak: Bundle clutter (and friends) for cheese dependency
Cheese depends on clutter, which has been recently removed from our
Flatpak runtime. See https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/1092

Fixes #1380
2021-06-15 12:46:09 +00:00
Daniel Mustieles
ff8839682d Updated Spanish translation 2021-06-15 13:05:35 +02:00
Danial Behzadi
4923a48547 Update Persian translation 2021-06-15 00:54:22 +00:00
Dušan Kazik
66c455d120 Update Slovak translation 2021-06-11 06:37:51 +00:00
Dušan Kazik
4bb44051c9 Update Slovak translation
(cherry picked from commit d8caedd80e)
2021-06-11 06:28:58 +00:00
Yuri Chornoivan
609babfeb9 Update Ukrainian translation 2021-06-09 16:12:03 +00:00
Eric
1fc8b772a4 printers: Make "Add…" button consistent with user accounts panel
The "Add..." toolbar button on the printers panel is currently hidden until the panel is unlocked.
This commit makes the button visible but insensitive when the panel is locked (becoming sensitive when unlocked),
as suggested in #1213. It also changes the text from "Add..." to "Add Printer..."
and updates the subtitle in the infobar to "Unlock to Add Printers and Change Settings."
These changes make the button's UI consistent with the Accounts panel's "Add User..." toolbar button.

Closes #1213
2021-06-09 13:34:01 +00:00
Hugo Carvalho
b61522b612 Update Portuguese translation 2021-06-08 20:51:45 +00:00
Emin Tufan Çetin
b3e14cf5c5 Update Turkish translation 2021-06-08 13:22:09 +00:00
Danial Behzadi
cb3f93c294 Update Persian translation 2021-06-07 22:59:15 +00:00
Marco Trevisan (Treviño)
ed46af7f24 build: Depend on gsettings-desktop-schemas 40
g-c-c requires now org.gnome.desktop.peripherals schemas that have been
added on schemas 40.alpha, so let's depend on that.
2021-06-07 22:40:20 +02:00
Jordi Mas
d9e892ce4b Update Catalan translation 2021-06-03 21:23:55 +02:00
Cheng-Chia Tseng
9e00fe8cb6 Update Chinese (Taiwan) translation
(cherry picked from commit c30358bea1)
2021-06-03 01:51:25 +00:00
Petr Kovář
2caeccc523 Update Czech translation 2021-05-30 10:45:38 +00:00
Felipe Borges
6c816e79e8 flatpak: Stop bundling libhandy
It is now included in the Nightly SDK by default.
2021-05-27 15:50:14 +02:00
Jiri Grönroos
1caadd3639 Update Finnish translation
(cherry picked from commit f2e1dfd161)
2021-05-26 06:51:33 +00:00
Philipp Kiemle
03225766bd Update German translation
(cherry picked from commit 3bfc5f71d0)
2021-05-22 20:59:13 +00:00
1pav
0f6394d609 flatpak: Fix NetworkManager branch name
Upstream branch of NetworkManager module has been renamed
from 'master' to 'main'. This caused NetworkManager build
to fail.
2021-05-21 17:48:15 +00:00
Bastien Nocera
fdd629293d info-overview: Make logo non-square
Make the logo non-square by setting its pixel size to -1. If (or when)
scaling the logo down is needed, we should instead use GtkIconTheme to
load the backing pixbuf, and use it to populate the GtkImage.
2021-05-21 15:00:20 +00:00
Bastien Nocera
df4857d960 info-overview: Simplify GNOME logo setting
Use the same code path for setting the GNOME logo as for setting the
distribution logo.
2021-05-21 15:00:20 +00:00
Bastien Nocera
a3b8964a19 info-overview: Look for -text and -dark logo variants
When loading the LOGO icon name from /etc/os-release, append -text to
prefer a textual variant of the logo if it exists, and -dark if the
theme variant is dark.

This allows distributors to ship textual and dark variants of their
logos without adding more fields to /etc/os-release, or more code
specific to logo handling for specific distributions.

$LOGO: default icon
$LOGO-dark: default icon when dark theme is used
$LOGO-text: icon with text
$LOGO-text-dark: icon with text when dark theme is used
2021-05-21 15:00:20 +00:00
Yuri Chornoivan
f3312c6577 Update Ukrainian translation 2021-05-20 07:35:09 +00:00
Mohammed Sadiq
453eb3adaf search: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
7f4703d7ad notifications: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
1fa95b5fc5 keyboard: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
bb6b3fbbcb wifi: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
7c575b8ccf sound: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
e09ecc41aa mouse: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
179d6aeb2d user: Use content style for listboxes 2021-05-19 03:25:47 +00:00
Mohammed Sadiq
ea821e5c3a datetime: Use content style for listbox 2021-05-19 03:25:47 +00:00
Ian Douglas Scott
edffd1b295 keyboard: Create CcXkbModifierDialog only when used
This should avoid issues where this setting is changed just by opening
Gnome Control Center, as reported in
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/918

This should also mean someone can tweak the settings as desired outside
Gnome Control Center, and not have them clobbered unless they open the
dialog in g-c-c.
2021-05-19 03:20:41 +00:00
Ian Douglas Scott
e224e5177a keyboard: Rename XkbOption and XkbModifier with Cc prefix 2021-05-19 03:20:41 +00:00
treysis
5a9fa905bc network: display IPv6 gateway 2021-05-19 02:43:39 +00:00
Ian Douglas Scott
1e917d0033 mouse: Use HdyActionRow
More consistent styling with other panels, and removes a lot of xml.
2021-05-12 04:05:30 +00:00
Mohammed Sadiq
092c77b0c1 user: Allow activating rows
HdyActionRow are not activatable by default. Explicitly enable them.
2021-05-12 03:18:35 +00:00
treysis
5a18b369c6 Network: Show all IPv6 addresses for an interface
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1300
2021-05-12 14:17:52 +12:00
Aurimas Černius
25a5a8e6f2 Updated Lithuanian translation 2021-05-10 22:11:38 +03:00
Daniel Șerbănescu
ba110fc43f Update Romanian translation
(cherry picked from commit 3e9d08287c)
2021-05-08 21:25:38 +00:00
Carlos Garnacho
6524c9a529 network: Make IPv4/v6 pages drive the scrolledwindow adjustments
Those 2 pages in the connection editor dialog are scrollable, but don't
hook focus changes so they drive the adjustments. Make them do so.
2021-05-07 04:06:35 +00:00
Felipe Borges
93bbd53bca network/connection-editor: Fix focus chain to allow keyboard navigation
Otherwise tabbing will never focus in the inner widgets.
2021-05-07 04:06:35 +00:00
Felipe Borges
afe1c35c57 network: Indicate the maximum password length accepted for wifi hotspots
The Wifi Hotspot setup dialog will error "Must have a minimum of 8 characters"
for all the situations in which nm_utils_wpa_psk_valid and nm_utils_wep_key_valid
report a given password to be invalid.

The case when this error is most obvious is when you enter a very lengthy password
and the dialog shows the very same error about the minimum password length.

These changes make the dialog account for the Maximum password length as well. It
assumes 16 characters for WEP and 63 characters for WPA/WPA2.
2021-05-07 04:02:51 +00:00
Jan Kot
df9c4d726f info-overview: Hide software_updates_row when allow-updates is false. 2021-05-07 03:56:48 +00:00
Mohammed Sadiq
8318d94e2f info: Use 'content' style for listboxes
Which results in rounded corners for the list box, which matches
the latest design.
2021-05-07 03:52:37 +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
Nishal Kulkarni
df8eb92efc cc-avatar-chooser.c: Enable remote file selection
Currently user can choose avatar only from local files.

This prevents users from loading a file at a remote location.

Changes made include:

1. Setting local-only property to false in `cc_avatar_chooser_select_file`
2. Getting file uri and creating a GFile from it.
3. Reading the GFile into an input stream.
4. Loading image from this stream.

Closes: #813
2021-05-07 03:37:01 +00:00
Ian Douglas Scott
5e858826c5 user-accounts: Use HdyClamp 2021-05-07 03:23:31 +00:00
Ian Douglas Scott
aff0b446bc user-accounts: Use HdyActionRow 2021-05-07 03:23:31 +00:00
Ian Douglas Scott
e30c6a9130 Bump libhandy to 1.2.0 2021-05-07 03:23:31 +00:00
Ian Douglas Scott
3a50deb431 keyboard: Update panel layout with descriptions for sections
Changes based on mockup by @aday:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1222#note_1017128
2021-05-07 03:08:11 +00:00
Adrien Plazas
2e2b794b45 flatpak: Pin libblockdev down
Compilation doesn't work after the pinned commit.
2021-05-07 02:50:40 +00:00
Adrien Plazas
2925509472 power: Ellipsize the labels of the battery row
This helps the window fit any size, including the narrow one of phones.
2021-05-07 02:50:40 +00:00
Adrien Plazas
97ba14e002 power: Hide the icon of the battery row when unused
This gives more room to the label.
2021-05-07 02:50:40 +00:00
Adrien Plazas
a75a0f0384 power: Fix the indentation
The indentation was purposefully left incorrect in the previous commits
to ease the review of the actual changes, this fixes it.
2021-05-07 02:50:40 +00:00
Adrien Plazas
a5c0934b4d power: Use HdyPreferencesGroup 2021-05-07 02:50:40 +00:00
Adrien Plazas
6c8307faf4 power: Use HdyActionRow to simplify the code 2021-05-07 02:50:40 +00:00
Adrien Plazas
4cc4b91b4e power: Use HdyComboRow for the Power Button Behavior row
This simplifies the code a bit and modernizes the UI.
2021-05-07 02:50:40 +00:00
Adrien Plazas
3069dc84c8 power: Use HdyComboRow for the Blank Screen row
This simplifies the code a bit and modernizes the UI.
2021-05-07 02:50:40 +00:00
Adrien Plazas
f986fedf49 power: Don't set the vadjustment
This is useless as GtkScrolledwindow already does it on the viewport it
creates.
2021-05-07 02:50:40 +00:00
Adrien Plazas
5168e924cf power: Simplifies keyboard navigation
This drops the ability to loop through the page but significantly
simplifies the code. I think this is a good tradeoff as looping is a
rather unexpected behavior.
2021-05-07 02:50:40 +00:00
Jordi Mas
8677645ed0 Update Catalan translation 2021-05-05 09:11:45 +02:00
Pawan Chitrakar
d0fda0f5d6 Update Nepali translation
(cherry picked from commit 815ed9169d)
2021-05-01 13:04:52 +00:00
Pawan Chitrakar
334eb3f194 Update Nepali translation
(cherry picked from commit c4a91dc613)
2021-05-01 04:45:55 +00:00
Pawan Chitrakar
9033b1ba93 Update Nepali translation
(cherry picked from commit 7c04266599)
2021-04-23 17:42:01 +00:00
Bastien Nocera
2052c91f8f bluetooth: Add debug for rfkill calls 2021-04-22 12:47:24 +02:00
Carlos Garnacho
7196e8aaea shell: Avoid handling map events from other windows
The CcWindow tries to unset the focus when first mapping the window.
However this pretty wide check intercepts mapping events from other
windows than the toplevel (e.g. subsurfaces, for popovers). This
causes the focus to move away from the popover, overriding its
modality.

Check that the event received is addressed to the CcWindow's
GDK window before unsetting the focus, so we don't mess with popover
focus.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1327
2021-04-21 20:54:06 +02:00
Andre Klapper
4650983352 Fix broken markup in Vietnamese UI translation 2021-04-21 15:23:19 +02:00
Debarshi Ray
f85750274c background: Drop the unused build dependency on Grilo
The code that uses Grilo to fetch the user's Flickr photos isn't
actually used by the Background panel, to the extent that the final
binary doesn't even link against Grilo. Getting rid of this unused code
will ensure that distributors aren't needlessly pulling in this
dependency.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1345
2021-04-20 23:04:10 +02:00
Ian Douglas Scott
b804fdb01a shell: Fix bug when multiple panels use custom sidebar widget
This is not currently a problem because the feature is only used in the
Applications panel, but this fixes the behavior if a custom sidebar is used
in more than one panel.
2021-04-19 14:31:44 +00:00
Hugo Carvalho
e9cc111854 Update Portuguese translation
(cherry picked from commit 0da2ef8b0b)
2021-04-15 09:59:57 +00:00
Hugo Carvalho
3772b23111 Update Portuguese translation
(cherry picked from commit b5f191894c)
2021-04-14 17:57:35 +00:00
Jordi Mas
d6d3cab8d7 Update Catalan translation 2021-04-13 22:19:24 +02:00
Georges Basile Stavracas Neto
b1134f3dca Post-branching version bump
The GNOME 41 merge window is open now.
2021-04-13 08:02:52 -03:00
Felipe Borges
d980e0ffee mouse: Prevent direction change for primary mouse button box
In Right-to-left locales GNOME Settings presents a button on the
left with the translated label "Right" and a button on the right
with the translated label "Left".

These changes prevent the flip of the direction buttons in RTL
locales.

Fixes #1101
2021-04-13 10:36:10 +02:00
Yuri Chornoivan
3eef196381 Update Ukrainian translation 2021-04-13 05:44:40 +00:00
Enrico Nicoletto
a4bec06e37 Update Brazilian Portuguese translation 2021-04-13 01:46:05 +00:00
Claude Paroz
d0d44dd6cd keyboard: Use g_dngettext to allow pluralized 'modified' string 2021-04-13 01:31:13 +00:00
Kalev Lember
a64bb833ee info-overview: Don't show GNOME micro version
With the new versioning scheme, GNOME just has major.minor versions
(e.g. 40.rc, 40.0) and micro versions are no longer used. Even if
gnome-desktop happens to get a micro version to fix a bug, it's not
something we should show in the UI.
2021-04-13 01:26:22 +00:00
Ngọc Quân Trần
56845415d3 Update Vietnamese translation 2021-04-11 07:24:11 +00:00
Fabio Tomat
ff574e2bdc Update Friulian translation 2021-04-08 22:31:08 +00:00
Felipe Borges
4fa6852cdc online-accounts: Present all supported providers at once
Instead of having the "more" button which reveals more items to the
providers list.

We still list branded providers above non-branded providers in the
list.

Fixes #1072
2021-04-08 12:34:44 +00:00
1273 changed files with 1 additions and 1270687 deletions

3
.gitignore vendored
View File

@@ -1,3 +0,0 @@
__pycache__
_build/
**/*~

View File

@@ -1,331 +0,0 @@
include:
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/5888c7388134cbe4661600222fe9befb10441f6e/templates/fedora.yml'
variables:
FDO_DISTRIBUTION_TAG: latest
FDO_DISTRIBUTION_VERSION: rawhide
FDO_UPSTREAM_REPO: gnome/gnome-control-center
# Expiry sets fdo.expires on the image
FDO_EXPIRES_AFTER: 8w
FEDORA_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG"
# NOTES:
# - gobject-introspection-devel is needed for gsettings-desktop-schemas
FEDORA_DEPENDENCIES: >
@c-development @development-tools
git
llvm clang libasan libtsan libubsan gcovr
meson
accountsservice-devel
cheese-libs-devel
chrpath
colord-devel colord-gtk-devel
cups-devel
desktop-file-utils
docbook-style-xsl
flatpak-devel
gdk-pixbuf2-devel
gettext
glib2-devel
gobject-introspection-devel
gnome-bluetooth-libs-devel
gnome-desktop3-devel
gnome-online-accounts-devel
gnome-settings-daemon-devel
grilo-devel
gsettings-desktop-schemas-devel
gsound-devel
gtk3-devel ibus-devel
intltool
libcanberra-devel
libgtop2-devel
libgudev-devel
libnma-devel
libpwquality-devel
libsmbclient-devel
libsoup-devel
libudisks2-devel
libwacom-devel
libX11-devel
libXi-devel
libxml2-devel
libxslt
ModemManager-glib-devel
NetworkManager-libnm-devel
polkit-devel
pulseaudio-libs-devel
upower-devel
python3-dbusmock
xorg-x11-server-Xvfb
mesa-dri-drivers
libsecret-devel
GIT_SUBMODULE_STRATEGY: normal
image: "$FEDORA_IMAGE"
stages:
- build
- test
- manual
- deploy
.Log files: &log_files [./*.log, _build/meson-logs/]
.Build logs: &save_build_logs
artifacts:
name: log
when: always
paths: *log_files
.Git Untracked files: &save_untracked_files
artifacts:
name: untracked
paths: [$(pwd)]
expire_in: 3h30min
.Show Info: &environment_information
build-aux/ci/ci-helper.sh "INFO" &&
build-aux/ci/ci-helper.sh "GIT_INFO"
.Build procedure: &build_procedure
echo "== Building ==" &&
rm -rf _build/ &&
meson . _build ${BUILD_OPTS} -Dprofile=development &&
ninja -C _build 2>&1 | tee compilation.log
.Run Tests: &run_tests
echo "== Testing ==" &&
meson test -C _build --verbose --no-stdsplit
##
# Stage: Build
#
# Checks if GNOME Control Center is properly building and installing. This is the
# most important stage of the CI, and no MR should ever be merged if it breaks
# any of them.
##
build:
<<: *save_untracked_files
stage: build
script:
- *environment_information
- *build_procedure
- echo "== Installing =="
- ninja -C _build install
- echo "== Report =="
- build-aux/ci/ci-helper.sh "WARNINGS"
# Save all but git-related files
- rm -rf .git .gitignore .gitmodules
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
##
# Stage: Test
#
# Runs the unit tests.
##
test:
<<: *save_build_logs
stage: test
dependencies:
- build
script:
- *environment_information
- *run_tests
- |
if [[ -n "${CI_COMMIT_TAG}" ]]; then
echo "== Distro Test =="
ninja dist -C _build
fi
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
# Runs the coverage test.
coverage:
<<: *save_build_logs
stage: test
variables:
BUILD_OPTS: "-Db_coverage=true"
coverage: '/^Lines:.\d+.\d+.(\d+\.\d+\%)/'
only:
- master@GNOME/gnome-control-center
script:
- *environment_information
- *build_procedure
- *run_tests
- ninja -C _build coverage-html
# Parse the report to get the coverage result
- |
echo == Coverage ==
sed -e 's/<[^>]*>//g' _build/meson-logs/coveragereport/index.html | tr -d ' \t' | grep -A3 -P '^Lines:$' | tr '\n' ' '; echo
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
# Runs the address sanitizer.
# - below, at the "sanitizers section"
##
# Stage: Deploy
#
# Publishes the Coverage Report generated above
##
pages:
stage: deploy
dependencies:
- coverage
script:
- mv _build/meson-logs/coveragereport/ public/
artifacts:
paths:
- public
only:
- master@GNOME/gnome-control-center
except:
variables:
- $CRON_TASK == "BUILD_CI_IMAGES"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
##
# Stage: Manual
#
# Creates a flatpak
##
flatpak:
stage: manual
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
artifacts:
name: package
paths:
- $(pwd)/*.flatpak
expire_in: 7 days
variables:
OLD_APPID: "org.gnome.Settings"
APPID: "org.gnome.SettingsDevel"
BUNDLE: "org.gnome.SettingsDevel.flatpak"
MANIFEST_PATH: "org.gnome.Settings.json"
PATCHES: "build-aux/flatpak/*.patch"
PROJECT_FILE: "build-aux/flatpak/org.gnome.Settings.json"
PROJECT_ID: "org.gnome.Settings"
PROJECT_NAME: "gnome-control-center.git"
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
script:
- echo "== Flatpak packaging =="
# Move needed files to the root folder
- cp ${PATCHES} . || true
- cp ${PROJECT_FILE} ${MANIFEST_PATH}
# Make it a develoment manifest
- sed -i -n "p; s/$PROJECT_NAME//p" ${MANIFEST_PATH}
- >
sed -i "s,\"app-id\" : \"$PROJECT_ID\",\"app-id\" : \"<<ID>>\",g" ${MANIFEST_PATH}
- >
sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/$PROJECT_NAME\",\"branch\" : \"<<current>>\"\,,g" ${MANIFEST_PATH}
- >
sed -i "s,\"url\" : \"https://gitlab.gnome.org/GNOME/\",\"path\" : \".\",g" ${MANIFEST_PATH}
# Adjust the manifest to HEAD
- sed -i "s,<<ID>>,$APPID,g" ${MANIFEST_PATH}
- sed -i "s,<<current>>,origin/$CI_COMMIT_REF_NAME,g" ${MANIFEST_PATH}
# Update the icon name
- mv data/icons/hicolor/scalable/apps/$OLD_APPID.svg data/icons/hicolor/scalable/apps/$APPID.svg
- mv data/icons/hicolor/symbolic/apps/$OLD_APPID-symbolic.svg data/icons/hicolor/symbolic/apps/$APPID-symbolic.svg
- flatpak-builder --bundle-sources --repo=devel build ${MANIFEST_PATH}
- flatpak build-bundle devel ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APPID}
cache:
paths:
- .flatpak-builder/cache
when: manual
except:
- tags
- gnome-3-.*
- master@GNOME/gnome-control-center
# Runs the sanitizers [address, thread, undefined, and memory].
.sanitizer: &sanitizer
<<: *save_build_logs
stage: manual
when: manual
script:
- *environment_information
- *build_procedure
- *run_tests
except:
variables:
- $CI_PIPELINE_SOURCE == "schedule"
- $CI_COMMIT_TITLE =~ /^Update.*translation$/
asan:
<<: *sanitizer
# ASAN requires debugging capabilities
tags: [ asan ]
stage: manual
when: manual
variables:
BUILD_OPTS: "-Db_sanitize=address"
LSAN_OPTIONS: "suppressions=${CI_PROJECT_DIR}/build-aux/ci/lsan.supp"
tsan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=thread"
ubsan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=undefined"
msan:
<<: *sanitizer
variables:
BUILD_OPTS: "-Db_sanitize=memory"
CC: "clang"
#############################################
# Create CI Docker Images #
#############################################
# See also https://gitlab.freedesktop.org/freedesktop/ci-templates
container_fedora_build:
extends: .fdo.container-build@fedora
# The templates reference the local registry, but we need the fdo one
only:
variables:
- $CI_PIPELINE_SOURCE == "schedule" && $CRON_TASK == "BUILD_CI_IMAGES"
variables:
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
FDO_FORCE_REBUILD: 1 # Force rebuilding the image
FDO_DISTRIBUTION_PACKAGES: $FEDORA_DEPENDENCIES
FDO_DISTRIBUTION_EXEC: |
git clone https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git && \
cd gsettings-desktop-schemas && \
meson . _build --prefix=/usr && \
ninja -C _build && \
ninja -C _build install && \
cd ..

View File

@@ -1,18 +0,0 @@
<!--
Not following the communication guidelines [1] will mean your issue or comment
will be removed. Read it carefully before submitting this issue.
[1] https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guideline
-->
Detailed description of the issue. Put as much information as you can, potentially
with images showing the issue.
Steps to reproduce:
1. Open GNOME Settings
2. Change X to something else
3. ...

View File

@@ -1,41 +0,0 @@
# Current problems
<!--
What are the problems that the current project has?
For example:
* User cannot use the keyboard to perform most common actions
or
* User cannot see documents from cloud services
-->
# Goals & use cases
<!--
What are the use cases that this proposal will cover? What are the end goals?
For example:
* User needs to share a file with their friends.
or
* It should be easy to edit a picture within the app.
-->
# Requirements
<!--
What does the solution needs to ensure for being succesful?
For example:
* Work on small form factors and touch
or
* Use the Meson build system and integrate with it
-->
# Relevant art
<!--
Is there any product that has implemented something similar? Put links to other
projects, pictures, links to other code, etc.
-->
# Proposal & plan
<!-- What's the solution and how should be achieved? It can be split in smaller
tasks of minimum change, so they can be delivered across several releases. -->
/label ~"1. Epic"

View File

@@ -1,27 +0,0 @@
<!--
Not following the communication guidelines [1] will mean your issue or comment
will be removed. Read it carefully before submitting this issue.
[1] https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guideline
-->
Detailed description of the feature. Put as much information as you can.
Proposed Mockups:
(Add mockups of the proposed feature)
## Design Tasks
* [ ] design tasks
## Development Tasks
* [ ] development tasks
## QA Tasks
* [ ] qa (quality assurance) tasks

6
.gitmodules vendored
View File

@@ -1,6 +0,0 @@
[submodule "subprojects/gvc"]
path = subprojects/gvc
url = https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
[submodule "subprojects/libhandy"]
path = subprojects/libhandy
url = https://gitlab.gnome.org/GNOME/libhandy.git

340
COPYING
View File

@@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

10043
NEWS

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +1 @@
[![Build Status](https://gitlab.gnome.org/GNOME/gnome-control-center/badges/master/pipeline.svg)](https://gitlab.gnome.org/GNOME/gnome-control-center/pipelines)
[![Coverage report](https://gitlab.gnome.org/GNOME/gnome-control-center/badges/master/coverage.svg)](https://gnome.pages.gitlab.gnome.org/gnome-control-center/)
[![License](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/COPYING)
GNOME Settings
====================
GNOME Settings is GNOME's main interface for configuration of various aspects of your desktop.
## Contributing
See `docs/CONTRIBUTING.md` for details on the contribution process, and `docs/HACKING.md`
for the coding style guidelines.
## Reporting Bugs
Before reporting any bugs or opening feature requests, [read the communication guidelines][communication-guidelines].
Bugs should be reported to the GNOME bug tracking system under the product
gnome-control-center. It is available at [GitLab Issues](https://gitlab.gnome.org/GNOME/gnome-control-center/issues).
In the report please include the following information:
* Operating system and version
* For Linux, version of the C library
* Exact error message
* Steps to reproduce the bug
* If the bug is a visual defect, attach a screenshot
* If the bug is a crash, attach a backtrace if possible [see below]
### How to get a backtrace
If the crash is reproducible, follow the steps to obtain a
backtrace:
Install debug symbols for gnome-control-center.
Run the program in gdb [the GNU debugger] or any other debugger.
gdb gnome-control-center
Start the program.
(gdb) run
Reproduce the crash and when the program exits to (gdb) prompt, get the backtrace.
(gdb) bt full
Once you have the backtrace, copy and paste it into the 'Comments' field or attach it as
a file to the bug report.
## Testing Unstable Settings
It is quite easy to test and give feedback about the development version of GNOME
Settings. Just access https://gitlab.gnome.org/GNOME/gnome-control-center/environments,
get the latest version, download it, double-click the file, install and run.
Note that GNOME Settings Flatpak will only work if you are running
the latest GNOME version in your host system.
[communication-guidelines]: https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/CONTRIBUTING.md#communication-guidelines
This branch is now unused. Please use the `main` branch for development.

View File

@@ -1,61 +0,0 @@
#!/bin/bash -e
function do_print_labels(){
if [[ -n "${1}" ]]; then
label_len=${#1}
span=$(((54 - $label_len) / 2))
echo
echo "= ======================================================== ="
printf "%s %${span}s %s %${span}s %s\n" "=" "" "$1" "" "="
echo "= ======================================================== ="
else
echo "= ========================= Done ========================= ="
echo
fi
}
function do_show_info(){
local compiler=gcc
echo -n "Processors: "; grep -c ^processor /proc/cpuinfo
grep ^MemTotal /proc/meminfo
id; uname -a
printenv
echo '-----------------------------------------'
cat /etc/*-release
echo '-----------------------------------------'
if [[ ! -z $CC ]]; then
compiler=$CC
fi
echo 'Compiler version'
$compiler --version
echo '-----------------------------------------'
$compiler -dM -E -x c /dev/null
echo '-----------------------------------------'
}
function do_check_warnings(){
cat compilation.log | grep "warning:" | awk '{total+=1}END{print "Total number of warnings: "total}'
}
# ----------- -----------
if [[ $1 == "INFO" ]]; then
do_print_labels 'Build environment '
do_show_info
do_print_labels
elif [[ $1 == "GIT_INFO" ]]; then
do_print_labels 'Commit'
git log --pretty=format:"%h %cd %s" -1; echo
do_print_labels
elif [[ $1 == "WARNINGS" ]]; then
do_print_labels 'Warning Report '
do_check_warnings
do_print_labels
fi

View File

@@ -1,19 +0,0 @@
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
leak:libfontconfig.so.1
# Unknown and unreported bugs
leak:__GI___vasprintf_chk
leak:__interceptor_malloc
leak:__alloc_dir
leak:libglib-2.0.so.0
# Needing attention
leak:<unknown module>
leak:test_timezone_gfx
########
# __GI___vasprintf_chk /usr/src/debug/glibc-2.27.9000-432-g104502102c/debug/vasprintf_chk.c:80
# __alloc_dir ../sysdeps/posix/opendir.c:118
# g_malloc (/lib64/libglib-2.0.so.0+0x523c5)
# g_realloc (/lib64/libglib-2.0.so.0+0x5247d)
########

View File

@@ -1,22 +0,0 @@
From ba5e0451b51c983e40afd123b6e0d3eddb55e610 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sat, 24 Mar 2018 17:37:02 +0000
Subject: linux: Include <sys/sysmacros.h> for major() macro.
Since glibc 2.27 this header is required.
---
libparted/arch/linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 31b98ab..7e86b51 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -41,6 +41,7 @@
#include <sys/utsname.h> /* for uname() */
#include <scsi/scsi.h>
#include <assert.h>
+#include <sys/sysmacros.h>
#ifdef ENABLE_DEVICE_MAPPER
#include <libdevmapper.h>
#endif

View File

@@ -1,820 +0,0 @@
{
"app-id" : "org.gnome.Settings",
"runtime" : "org.gnome.Sdk",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "gnome-control-center",
"rename-desktop-file" : "gnome-control-center.desktop",
"tags" : [
"devel"
],
"desktop-file-name-prefix" : "(Development) ",
"finish-args" : [
"--device=dri",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
"--filesystem=host",
"--own-name=org.gnome.ControlCenter",
"--own-name=org.gnome.SessionManager",
"--share=ipc",
"--share=network",
"--socket=x11",
"--socket=pulseaudio",
"--socket=session-bus",
"--socket=system-bus",
"--socket=wayland"
],
"build-options" : {
"cflags" : "-O2 -g",
"cxxflags" : "-O2 -g",
"env" : {
"V" : "1"
}
},
"x-run-args" : [
"--verbose"
],
"cleanup" : [
"/include",
"/share/aclocal",
"/man",
"/share/man",
"/share/gtk-doc",
"/share/vala",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "pwquality",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-python-bindings"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/libpwquality/libpwquality.git"
}
]
},
{
"name": "intltool",
"cleanup": [ "*" ],
"sources": [
{
"type": "archive",
"url": "https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz",
"sha256": "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
}
]
},
{
"name" : "polkit",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-polkitd",
"--disable-man-pages",
"--disable-introspection",
"--disable-examples",
"--disable-gtk-doc",
"--disable-libelogind",
"--disable-libsystemd-login",
"--with-systemdsystemunitdir=no",
"--with-authdb=dummy",
"--with-authfw=none"
],
"rm-configure" : true,
"cleanup" : [
"/bin/*",
"/etc/pam.d",
"/etc/dbus-1",
"/share/dbus-1/system-services/*",
"/share/polkit-1",
"/lib/polkit-1"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.freedesktop.org/software/polkit/releases/polkit-0.116.tar.gz",
"sha256" : "88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1"
},
{
"type" : "patch",
"path" : "polkit-build-Add-option-to-build-without-polkitd.patch"
},
{
"type" : "file",
"path" : "polkit-autogen",
"dest-filename" : "autogen.sh"
}
]
},
{
"name" : "accountservice",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocbook=false",
"-Delogind=false",
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dsystemd=false",
"-Dsystemdsystemunitdir=no"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/accountsservice"
}
]
},
{
"name" : "libusb1",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-udev"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/libusb/libusb.git"
}
]
},
{
"name" : "gusb",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocs=false",
"-Dtests=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/libgusb.git"
}
]
},
{
"name" : "udev",
"config-opts" : [
"--disable-hwdb",
"--disable-logging",
"--disable-gudev",
"--disable-introspection",
"--disable-keymap",
"--disable-mtd_probe"
],
"cleanup" : [
"/include",
"/etc",
"/libexec",
"/sbin",
"/lib/pkgconfig",
"/man",
"/share/aclocal",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/gentoo/eudev.git"
}
]
},
{
"name" : "gudev",
"buildsystem" : "meson",
"config-opts" : [
"-Dtests=disabled",
"-Dintrospection=disabled"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgudev.git"
}
]
},
{
"name" : "colord",
"buildsystem" : "meson",
"config-opts" : [
"-Dargyllcms_sensor=false",
"-Dbash_completion=false",
"-Dman=false",
"-Dudev_rules=false",
"-Dsystemd=false",
"-Dvapi=false",
"-Ddocs=false",
"-Dtests=false",
"-Dinstalled_tests=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/colord.git"
}
]
},
{
"name" : "colord-gtk",
"buildsystem" : "meson",
"config-opts" : [
"-Dman=false"
],
"sources" : [
{
"type" : "git",
"url" : "git://github.com/hughsie/colord-gtk.git"
}
]
},
{
"name" : "rest",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"branch" : "librest-0-7",
"url" : "https://gitlab.gnome.org/GNOME/librest.git"
}
]
},
{
"name" : "gnome-online-accounts",
"buildsystem" : "meson",
"build-options" : {
"cflags" : "-Wno-error"
},
"config-opts" : [
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-online-accounts.git"
}
]
},
{
"name" : "gnome-desktop",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-desktop.git"
}
]
},
{
"name" : "geocode-glib",
"buildsystem" : "meson",
"config-opts" : [
"-Denable-gtk-doc=false",
"-Denable-introspection=false",
"-Denable-installed-tests=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/geocode-glib.git"
}
]
},
{
"name" : "libgweather",
"buildsystem" : "meson",
"config-opts" : [
"-Dglade_catalog=false",
"-Denable_vala=false",
"-Dgtk_doc=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgweather.git"
}
]
},
{
"name" : "upower",
"buildsystem" : "autotools",
"config-opts" : [
"--prefix=/app",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--disable-gtk-doc",
"--disable-man-pages",
"--disable-tests"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/upower"
}
]
},
{
"name" : "libwacom",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://github.com/linuxwacom/libwacom.git"
}
]
},
{
"name" : "libndp",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : " http://libndp.org/files/libndp-1.6.tar.gz",
"sha256" : "0c7dfa84e013bd5e569ef2c6292a6f72cfaf14f4ff77a77425e52edc33ffac0e"
}
]
},
{
"name" : "NetworkManager",
"buildsystem" : "meson",
"build-options" : {
"cflags" : "-ltinfo",
"cxxflags" : "-ltinfo"
},
"config-opts" : [
"-Dlibaudit=no",
"-Ddbus_conf_dir=/app/etc/dbus-1/system.d",
"-Ddbus_ifaces_dir=/app/share/dbus-1/interfaces",
"-Ddbus_sys_dir=/app/share/dbus-1/system.d",
"-Ddnsmasq=/usr/bin/true",
"-Ddocs=false",
"-Dintrospection=false",
"-Diptables=/usr/bin/true",
"-Djson_validation=false",
"-Dlibnm_glib=false",
"-Dlibpsl=false",
"-Dmodem_manager=false",
"-Dnmtui=false",
"-Dovs=false",
"-Dppp=false",
"-Dqt=false",
"-Dselinux=false",
"-Dsession_tracking=no",
"-Dsystemdsystemunitdir='no'",
"-Dsystemd_journal=false",
"-Dtests=no",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git"
}
]
},
{
"name" : "mobile-broadband-provider-info",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info.git"
}
]
},
{
"name" : "libnma",
"buildsystem" : "meson",
"config-opts" : [
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libnma.git"
}
]
},
{
"name" : "network-manager-applet",
"buildsystem" : "meson",
"config-opts" : [
"-Dappindicator=no",
"-Dgtk_doc=false",
"-Dintrospection=false",
"-Dlibnm_gtk=false",
"-Dselinux=false",
"-Dteam=false",
"-Dwwan=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/network-manager-applet.git"
}
]
},
{
"name" : "ModemManager",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection",
"--disable-vala",
"--with-udev-base-dir=/app/lib",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--without-mbim",
"--without-qmi"
],
"sources" : [
{
"type" : "git",
"url" : "git://anongit.freedesktop.org/ModemManager/ModemManager"
}
]
},
{
"name" : "gnome-settings-daemon",
"buildsystem" : "meson",
"config-opts" : [
"-Dsystemd=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-settings-daemon.git"
}
],
"modules": [
{
"name": "libcanberra",
"sources": [
{
"type": "archive",
"url": "http://0pointer.de/lennart/projects/libcanberra/libcanberra-0.30.tar.xz",
"sha256": "c2b671e67e0c288a69fc33dc1b6f1b534d07882c2aceed37004bf48c601afa72"
}
],
"config-opts": [
"--disable-alsa",
"--disable-null",
"--disable-oss"
]
}
]
},
{
"name" : "gnome-bluetooth",
"buildsystem" : "meson",
"config-opts" : [
"-Dintrospection=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-bluetooth.git"
}
]
},
{
"name" : "grilo",
"buildsystem" : "meson",
"config-opts" : [
"-Denable-grl-pls=false",
"-Denable-gtk-doc=false",
"-Denable-introspection=false",
"-Denable-test-ui=false",
"-Denable-vala=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/grilo.git"
}
]
},
{
"name" : "openldap",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-slapd"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.46.tgz",
"sha256" : "9a90dcb86b99ae790ccab93b7585a31fbcbeec8c94bf0f7ab0ca0a87ea0c4b2d"
}
]
},
{
"name" : "libtirpc",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://downloads.sourceforge.net/sourceforge/libtirpc/libtirpc-1.2.6.tar.bz2",
"sha256" : "4278e9a5181d5af9cd7885322fdecebc444f9a3da87c526e7d47f7a12a37d1cc"
}
]
},
{
"name" : "rpcsvc-proto",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/thkukuk/rpcsvc-proto/archive/v1.4.tar.gz",
"sha256" : "eaa227686b84e8ae20181d2119c0ccac29d82371441844008019a134dafe3613"
}
]
},
{
"name" : "lmdb",
"buildsystem" : "simple",
"build-commands" : [
"cd libraries/liblmdb/ && make prefix=/app install"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/LMDB/lmdb/archive/LMDB_0.9.23.tar.gz",
"sha256" : "abf42e91f046787ed642d9eb21812a5c473f3ba5854124484d16eadbe0aa9c81"
}
]
},
{
"name" : "samba",
"buildsystem" : "autotools",
"config-opts" : [
"--without-json",
"--without-ad-dc",
"--without-pam"
],
"sources" : [
{
"type" : "archive",
"url" : "https://download.samba.org/pub/samba/stable/samba-4.11.0.tar.gz",
"sha256" : "6adf1c74afff1f3f7e14060cc5a36111a6721d644ea51ed1b22da46051e48e9c"
}
]
},
{
"name" : "libgtop2",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgtop.git"
}
]
},
{
"name" : "cheese",
"buildsystem" : "meson",
"config-opts" : [
"-Dintrospection=false",
"-Dgtk_doc=false",
"-Dman=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/cheese.git"
}
]
},
{
"name" : "libhandy",
"buildsystem" : "meson",
"config-opts" : [
"-Dexamples=false",
"-Dglade_catalog=disabled",
"-Dintrospection=disabled",
"-Dtests=false",
"-Dvapi=false"
],
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libhandy.git"
}
]
},
{
"name" : "gsound",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gsound.git"
}
]
},
{
"name" : "libkmod",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kmod/kmod-25.tar.xz",
"sha256" : "7165e6496656159dcb909a91ed708a0fe273a4b128b4b1dc997ccb5189eef1cd"
}
]
},
{
"name" : "lvm2",
"buildsystem" : "autotools",
"config-opts" : [
"--prefix=/app",
"--enable-cmdlib",
"--enable-dmeventd",
"--enable-pkgconfig",
"--with-usrlibdir=/app/lib",
"--with-usrbindir=/app/bin",
"--with-staticdir=/app/bin"
],
"sources" : [
{
"type" : "archive",
"url" : "https://www.sourceware.org/pub/lvm2/LVM2.2.02.177.tgz",
"sha256" : "4025a23ec9b15c2cb7486d151c29dc953b75efc4d452cfe9dbbc7c0fac8e80f2"
}
],
"post-install" : [
"chmod 755 /app/sbin/dm*",
"chmod 755 /app/sbin/lvm*",
"chmod 755 /app/lib/libdevmapper-event-lvm2.so.2.02",
"chmod 755 /app/lib/libdevmapper-event-lvm2mirror.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2raid.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2snapshot.so",
"chmod 755 /app/lib/libdevmapper-event-lvm2thin.so",
"chmod 755 /app/lib/libdevmapper-event.so.1.02",
"chmod 755 /app/lib/libdevmapper.so.1.02",
"chmod 755 /app/lib/liblvm2cmd.so.2.02"
]
},
{
"name" : "parted",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://ftp.gnu.org/gnu/parted/parted-3.2.tar.xz",
"sha256" : "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
},
{
"type" : "patch",
"path" : "libparted-include.patch"
}
]
},
{
"name" : "mpfr",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.xz",
"sha256" : "1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a"
}
]
},
{
"name" : "bytesize",
"buildsystem" : "autotools",
"config-opts" : [
"--with-gtk-doc=no"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/libbytesize.git"
}
]
},
{
"name" : "cryptsetup",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-1.7.5.tar.xz",
"sha256" : "2b30cd1d0dd606a53ac77b406e1d37798d4b0762fa89de6ea546201906a251bd"
}
]
},
{
"name" : "swig",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "git",
"url" : "https://github.com/swig/swig.git"
}
]
},
{
"name" : "volume-key",
"buildsystem" : "simple",
"build-commands" : [
"autoreconf -i",
"./configure --prefix=/app",
"make install"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/felixonmars/volume_key/archive/volume_key-0.3.11.tar.gz",
"sha256" : "92250506756eca19a0b6f50c16d3502eb5566ea4725645d7c5d87eb5cc8f3fd8"
}
]
},
{
"name" : "libblockdev",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-tests",
"--with-btrfs=no",
"--with-dm=no",
"--with-gtk-doc=no",
"--with-kbd=no",
"--with-lvm=no",
"--with-lvm-dbus=no",
"--with-mpath=no",
"--with-nvdimm=no",
"--with-tools=no",
"--with-vdo=no"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/libblockdev.git"
}
]
},
{
"name" : "atasmart",
"buildsystem" : "autotools",
"sources" : [
{
"type" : "archive",
"url" : "http://0pointer.de/public/libatasmart-0.19.tar.xz",
"sha256" : "61f0ea345f63d28ab2ff0dc352c22271661b66bf09642db3a4049ac9dbdb0f8d"
}
]
},
{
"name" : "udisks",
"buildsystem" : "autotools",
"config-opts" : [
"--disable-introspection",
"--disable-lvm2",
"--with-systemdsystemunitdir=/app/lib/systemd/system",
"--with-tmpfilesdir=/app/lib/tmpfiles.d"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/storaged-project/udisks.git"
}
]
},
{
"name" : "gnome-backgrounds",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-backgrounds.git"
}
]
},
{
"name" : "gnome-control-center",
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gnome-control-center.git"
}
],
"config-opts" : [
"-Dtracing=true",
"-Dprofile=development"
]
}
]
}

View File

@@ -1,4 +0,0 @@
#!/bin/sh
gtkdocize --flavour no-tmpl
autoreconf -if

View File

@@ -1,132 +0,0 @@
From 1073a44277316348d40d86ecec908f1d4812f360 Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Mon, 27 May 2019 11:49:09 -0700
Subject: [PATCH] flatpak: make polkit suitable for use within flatpak
This is based on patches from Patrick Griffis with additional fixes
to allow us to disable use of PAM within Flaptak.
---
configure.ac | 20 ++++++++++++++++----
src/Makefile.am | 6 +++++-
src/polkitagent/Makefile.am | 5 +++++
test/Makefile.am | 6 +++++-
4 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5cedb4e..729d78d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,11 +79,13 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
-PKG_CHECK_MODULES(LIBJS, [mozjs-60])
+AS_IF([test x${enable_polkitd} = yes], [
+ PKG_CHECK_MODULES(LIBJS, [mozjs-60])
-AC_SUBST(LIBJS_CFLAGS)
-AC_SUBST(LIBJS_CXXFLAGS)
-AC_SUBST(LIBJS_LIBS)
+ AC_SUBST(LIBJS_CFLAGS)
+ AC_SUBST(LIBJS_CXXFLAGS)
+ AC_SUBST(LIBJS_LIBS)
+])
EXPAT_LIB=""
AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
@@ -236,6 +238,15 @@ if test "x$with_systemdsystemunitdir" != "xno"; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
+dnl ---------------------------------------------------------------------------
+dnl - Disable polkitd when using library alone
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_ENABLE([polkitd],
+ [AS_HELP_STRING([--disable-polkitd], [Do not build polkitd])],
+ [enable_polkitd=$enableval], [enable_polkitd=yes])
+AM_CONDITIONAL(BUILD_POLKITD, [test x${enable_polkitd} = yes])
+
dnl ---------------------------------------------------------------------------
dnl - User for running polkitd
dnl ---------------------------------------------------------------------------
@@ -579,6 +590,7 @@ echo "
Session tracking: ${SESSION_TRACKING}
PAM support: ${have_pam}
systemdsystemunitdir: ${systemdsystemunitdir}
+ polkitd: ${enable_polkitd}
polkitd user: ${POLKITD_USER}"
if test "$have_pam" = yes ; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 09fc7b3..c6fe91b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,9 @@
-SUBDIRS = polkit polkitbackend polkitagent programs
+SUBDIRS = polkit polkitagent programs
+
+if BUILD_POLKITD
+SUBDIRS += polkitbackend
+endif
if BUILD_EXAMPLES
SUBDIRS += examples
diff --git a/src/polkitagent/Makefile.am b/src/polkitagent/Makefile.am
index 49720db..633f9d4 100644
--- a/src/polkitagent/Makefile.am
+++ b/src/polkitagent/Makefile.am
@@ -79,6 +79,7 @@ libpolkit_agent_1_la_LIBADD = \
libpolkit_agent_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)'
+if !POLKIT_AUTHFW_NONE
libprivdir = $(prefix)/lib/polkit-1
libpriv_PROGRAMS = polkit-agent-helper-1
@@ -113,6 +114,8 @@ polkit_agent_helper_1_LDFLAGS = \
$(AM_LDFLAGS) \
$(NULL)
+endif # !POLKIT_AUTHFW_NONE
+
if HAVE_INTROSPECTION
girdir = $(INTROSPECTION_GIRDIR)
@@ -142,6 +145,7 @@ include $(INTROSPECTION_MAKEFILE)
endif # HAVE_INTROSPECTION
+if !POLKIT_AUTHFW_NONE
# polkit-agent-helper-1 need to be setuid root because it's used to
# authenticate not only the invoking user, but possibly also root
# and/or other users.
@@ -149,6 +153,7 @@ endif # HAVE_INTROSPECTION
install-data-hook:
-chown root $(DESTDIR)$(libprivdir)/polkit-agent-helper-1
-chmod 4755 $(DESTDIR)$(libprivdir)/polkit-agent-helper-1
+endif # !POLKIT_AUTHFW_NONE
EXTRA_DIST = polkitagentmarshal.list polkitagentenumtypes.h.template polkitagentenumtypes.c.template
CLEANFILES = $(gir_DATA) $(typelibs_DATA)
diff --git a/test/Makefile.am b/test/Makefile.am
index 59d0680..d43b0fe 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,11 @@
-SUBDIRS = mocklibc . polkit polkitbackend
+SUBDIRS = mocklibc . polkit
AM_CFLAGS = $(GLIB_CFLAGS)
+if BUILD_POLKITD
+SUBDIRS += polkitbackend
+endif
+
noinst_LTLIBRARIES = libpolkit-test-helper.la
libpolkit_test_helper_la_SOURCES = polkittesthelper.c polkittesthelper.h
libpolkit_test_helper_la_LIBADD = $(GLIB_LIBS)
--
2.21.0

View File

@@ -1 +0,0 @@
meson.add_install_script('meson/meson_post_install.py', control_center_datadir)

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
gsettingsschemadir = os.path.join(sys.argv[1], 'glib-2.0', 'schemas')
icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', gsettingsschemadir])
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="64" x2="64" y1="262.5" y2="232">
<stop offset="0" stop-color="#9a9996"/>
<stop offset="1" stop-color="#77767b"/>
</linearGradient>
<radialGradient id="b" cx="-243.066583" cy="-74.599978" gradientUnits="userSpaceOnUse" r="28.266656">
<stop offset="0" stop-color="#d5d3cf"/>
<stop offset="1" stop-color="#949390"/>
</radialGradient>
<linearGradient id="c" gradientUnits="userSpaceOnUse" x1="203.999985" x2="267.999985" y1="-64" y2="-64">
<stop offset="0" stop-color="#d5d3cf"/>
<stop offset="1" stop-color="#f6f5f4"/>
</linearGradient>
<clipPath id="d">
<rect height="128" width="128"/>
</clipPath>
<clipPath id="e">
<rect height="128" width="128"/>
</clipPath>
<filter id="f" height="100%" width="100%" x="0%" y="0%">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
</filter>
<mask id="g">
<g clip-path="url(#e)" filter="url(#f)">
<g clip-path="url(#d)">
<path d="m 667 292 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(1 0 0 1 -600 -170)"/>
<path d="m 661 180 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(1 0 0 1 -600 -170)"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 667 292 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(1 0 0 1 -600 -172)"/>
<path d="m 661 180 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(1 0 0 1 -600 -172)"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="8" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
<path d="m 100 238 c 0 19.882812 -16.117188 36 -36 36 s -36 -16.117188 -36 -36 s 16.117188 -36 36 -36 s 36 16.117188 36 36 z m 0 0" fill="none" stroke="url(#a)" stroke-width="24" transform="matrix(1 0 0 1 0 -172)"/>
<path d="m 102 236 c 0 20.988281 -17.011719 38 -38 38 s -38 -17.011719 -38 -38 s 17.011719 -38 38 -38 s 38 17.011719 38 38 z m 0 0" fill="none" stroke="#f6f5f4" stroke-width="20" transform="matrix(1 0 0 1 0 -172)"/>
<path d="m -209.5 -64 c 0 14.636719 -11.863281 26.5 -26.5 26.5 s -26.5 -11.863281 -26.5 -26.5 s 11.863281 -26.5 26.5 -26.5 s 26.5 11.863281 26.5 26.5 z m 0 0" fill="none" stroke="url(#b)" stroke-linecap="square" stroke-linejoin="round" stroke-width="5" transform="matrix(0 -1 -1 0 0 -172)"/>
<path d="m 268 -64 c 0 17.671875 -14.328125 32 -32 32 s -32 -14.328125 -32 -32 s 14.328125 -32 32 -32 s 32 14.328125 32 32 z m 0 0" fill="none" stroke="url(#c)" stroke-linecap="square" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 0 -172)"/>
</g>
</g>
</mask>
<mask id="h">
<g filter="url(#f)">
<rect fill-opacity="0.8" height="128" width="128"/>
</g>
</mask>
<linearGradient id="i" gradientTransform="matrix(0 0.37 -0.98462 0 295.38501 -30.360001)" gradientUnits="userSpaceOnUse" x1="300" x2="428" y1="235" y2="235">
<stop offset="0" stop-color="#f9f06b"/>
<stop offset="1" stop-color="#f5c211"/>
</linearGradient>
<clipPath id="j">
<rect height="128" width="128"/>
</clipPath>
<clipPath id="k">
<rect height="128" width="128"/>
</clipPath>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="8">
<path d="m 67 122 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996"/>
<path d="m 61 10 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 67 120 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4"/>
<path d="m 61 8 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
</g>
<path d="m 100 238 c 0 19.882812 -16.117188 36 -36 36 s -36 -16.117188 -36 -36 s 16.117188 -36 36 -36 s 36 16.117188 36 36 z m 0 0" fill="none" stroke="url(#a)" stroke-width="24" transform="matrix(1 0 0 1 0 -172)"/>
<path d="m 102 64 c 0 20.988281 -17.011719 38 -38 38 s -38 -17.011719 -38 -38 s 17.011719 -38 38 -38 s 38 17.011719 38 38 z m 0 0" fill="none" stroke="#f6f5f4" stroke-width="20"/>
<path d="m -209.5 -64 c 0 14.636719 -11.863281 26.5 -26.5 26.5 s -26.5 -11.863281 -26.5 -26.5 s 11.863281 -26.5 26.5 -26.5 s 26.5 11.863281 26.5 26.5 z m 0 0" fill="none" stroke="url(#b)" stroke-linecap="square" stroke-linejoin="round" stroke-width="5" transform="matrix(0 -1 -1 0 0 -172)"/>
<path d="m 268 -64 c 0 17.671875 -14.328125 32 -32 32 s -32 -14.328125 -32 -32 s 14.328125 -32 32 -32 s 32 14.328125 32 32 z m 0 0" fill="none" stroke="url(#c)" stroke-linecap="square" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 0 -172)"/>
<g clip-path="url(#k)" mask="url(#g)">
<g clip-path="url(#j)" mask="url(#h)">
<path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#i)"/>
<path d="m 13.308594 80.640625 l 47.355468 47.359375 h 21.214844 l -47.359375 -47.359375 z m 42.421875 0 l 47.363281 47.359375 h 21.214844 l -47.363282 -47.359375 z m 42.429687 0 l 29.839844 29.839844 v -21.210938 l -8.628906 -8.628906 z m -98.160156 7.90625 v 21.214844 l 18.238281 18.238281 h 21.214844 z m 0 0"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="64" x2="64" y1="262.5" y2="232">
<stop offset="0" stop-color="#9a9996"/>
<stop offset="1" stop-color="#77767b"/>
</linearGradient>
<radialGradient id="b" cx="-243.066583" cy="-74.599978" gradientUnits="userSpaceOnUse" r="28.266656">
<stop offset="0" stop-color="#d5d3cf"/>
<stop offset="1" stop-color="#949390"/>
</radialGradient>
<linearGradient id="c" gradientUnits="userSpaceOnUse" x1="203.999985" x2="267.999985" y1="-64" y2="-64">
<stop offset="0" stop-color="#d5d3cf"/>
<stop offset="1" stop-color="#f6f5f4"/>
</linearGradient>
<g stroke-width="8">
<path d="m 67 122 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m 61 10 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0 1 -1 0 299.999908 -598.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -391.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -61.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -470.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#9a9996" stroke="#9a9996" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -627.040914)"/>
<path d="m 67 120 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m 61 8 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m 667.000092 291.999908 h -6 l -2 -16 h 10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 661.000092 179.999908 h 6 l 2 16 h -10 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0 1 -1 0 299.999908 -600.000092)"/>
<path d="m 666.999051 291.998922 l -5.999272 -0.00042 l -2.001544 -15.998026 l 9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 661.001107 180.000804 l 5.999273 0.000419 l 2.001544 15.998026 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.5 0.866025 -0.866025 -0.5 600.381916 -393.041005)"/>
<path d="m 667.000347 291.998468 l -5.999273 0.00042 l -2.002482 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 660.999745 180.00119 l 5.999273 -0.00042 l 2.002481 16.00035 l -10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(-0.866025 0.5 -0.5 -0.866025 757.040822 -63.618176)"/>
<path d="m 666.999018 291.999047 l -5.999273 -0.00042 l -2.001544 -15.998026 l 10.003298 -0.001904 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 661.001074 180.000929 l 5.999273 0.00042 l 2.001543 15.998025 l -10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.866025 0.5 -0.5 0.866025 -393.040914 -472.382008)"/>
<path d="m 667.00038 291.998593 l -5.999273 0.00042 l -2.002481 -16.00035 l 10.003298 0.001905 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
<path d="m 660.999779 180.001315 l 5.999272 -0.00042 l 1.999099 15.998397 l -9.999915 0.000049 z m 0 0" fill="#f6f5f4" stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" transform="matrix(0.5 0.866025 -0.866025 0.5 -63.618084 -629.040914)"/>
</g>
<path d="m 100 238 c 0 19.882812 -16.117188 36 -36 36 s -36 -16.117188 -36 -36 s 16.117188 -36 36 -36 s 36 16.117188 36 36 z m 0 0" fill="none" stroke="url(#a)" stroke-width="24" transform="matrix(1 0 0 1 0 -172)"/>
<path d="m 102 64 c 0 20.988281 -17.011719 38 -38 38 s -38 -17.011719 -38 -38 s 17.011719 -38 38 -38 s 38 17.011719 38 38 z m 0 0" fill="none" stroke="#f6f5f4" stroke-width="20"/>
<path d="m -209.5 -64 c 0 14.636719 -11.863281 26.5 -26.5 26.5 s -26.5 -11.863281 -26.5 -26.5 s 11.863281 -26.5 26.5 -26.5 s 26.5 11.863281 26.5 26.5 z m 0 0" fill="none" stroke="url(#b)" stroke-linecap="square" stroke-linejoin="round" stroke-width="5" transform="matrix(0 -1 -1 0 0 -172)"/>
<path d="m 268 -64 c 0 17.671875 -14.328125 32 -32 32 s -32 -14.328125 -32 -32 s 14.328125 -32 32 -32 s 32 14.328125 32 32 z m 0 0" fill="none" stroke="url(#c)" stroke-linecap="square" stroke-linejoin="round" stroke-width="8" transform="matrix(0 1 -1 0 0 -172)"/>
</svg>

Before

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="64" x2="64" y1="262.5" y2="232">
<stop offset="0" stop-color="#9a9996"/>
<stop offset="1" stop-color="#77767b"/>
</linearGradient>
<path d="m 7.480469 0.015625 h 1.066406 c 0.589844 0 1.066406 0.476563 1.066406 1.066406 v 1.066407 c 0 0.589843 -0.476562 1.066406 -1.066406 1.066406 h -1.066406 c -0.589844 0 -1.066407 -0.476563 -1.066407 -1.066406 v -1.066407 c 0 -0.589843 0.476563 -1.066406 1.066407 -1.066406 z m 0 12.796875 h 1.066406 c 0.589844 0 1.066406 0.476562 1.066406 1.070312 v 1.0625 c 0 0.59375 -0.476562 1.070313 -1.066406 1.070313 h -1.066406 c -0.589844 0 -1.066407 -0.476563 -1.066407 -1.070313 v -1.0625 c 0 -0.59375 0.476563 -1.070312 1.066407 -1.070312 z m -5.5 -10.078125 l 0.753906 -0.753906 c 0.199219 -0.199219 0.46875 -0.3125 0.753906 -0.3125 c 0.28125 0 0.554688 0.113281 0.753907 0.3125 l 0.753906 0.753906 c 0.417968 0.417969 0.417968 1.089844 0 1.507813 l -0.753906 0.753906 c -0.199219 0.203125 -0.472657 0.316406 -0.753907 0.316406 c -0.285156 0 -0.554687 -0.113281 -0.753906 -0.316406 l -0.753906 -0.753906 c -0.203125 -0.199219 -0.316407 -0.46875 -0.316407 -0.753907 c 0 -0.28125 0.113282 -0.554687 0.316407 -0.753906 z m 9.050781 9.050781 l 0.753906 -0.753906 c 0.199219 -0.199219 0.472656 -0.3125 0.753906 -0.3125 c 0.285157 0 0.554688 0.113281 0.753907 0.3125 l 0.753906 0.753906 c 0.417969 0.417969 0.417969 1.089844 0 1.507813 l -0.753906 0.753906 c -0.199219 0.203125 -0.46875 0.316406 -0.753907 0.316406 c -0.28125 0 -0.554687 -0.113281 -0.753906 -0.316406 l -0.753906 -0.753906 c -0.203125 -0.199219 -0.3125 -0.46875 -0.3125 -0.753907 c 0 -0.28125 0.109375 -0.554687 0.3125 -0.753906 z m -11.015625 -3.238281 v -1.066406 c 0 -0.589844 0.472656 -1.066407 1.066406 -1.066407 h 1.066407 c 0.589843 0 1.066406 0.476563 1.066406 1.066407 v 1.066406 c 0 0.589844 -0.476563 1.066406 -1.066406 1.066406 h -1.066407 c -0.59375 0 -1.066406 -0.476562 -1.066406 -1.066406 z m 12.796875 0 v -1.066406 c 0 -0.589844 0.476562 -1.066407 1.066406 -1.066407 h 1.066406 c 0.59375 0 1.070313 0.476563 1.070313 1.066407 v 1.066406 c 0 0.589844 -0.476563 1.066406 -1.070313 1.066406 h -1.066406 c -0.589844 0 -1.066406 -0.476562 -1.066406 -1.066406 z m -10.078125 5.5 l -0.753906 -0.753906 c -0.203125 -0.199219 -0.316407 -0.46875 -0.316407 -0.753907 c 0 -0.28125 0.113282 -0.554687 0.316407 -0.753906 l 0.753906 -0.753906 c 0.199219 -0.199219 0.46875 -0.3125 0.753906 -0.3125 c 0.28125 0 0.554688 0.113281 0.753907 0.3125 l 0.753906 0.753906 c 0.417968 0.417969 0.417968 1.089844 0 1.507813 l -0.753906 0.753906 c -0.199219 0.203125 -0.472657 0.316406 -0.753907 0.316406 c -0.285156 0 -0.554687 -0.113281 -0.753906 -0.316406 z m 9.050781 -9.050781 l -0.753906 -0.753906 c -0.203125 -0.199219 -0.3125 -0.46875 -0.3125 -0.753907 c 0 -0.28125 0.109375 -0.554687 0.3125 -0.753906 l 0.753906 -0.753906 c 0.199219 -0.199219 0.472656 -0.3125 0.753906 -0.3125 c 0.285157 0 0.554688 0.113281 0.753907 0.3125 l 0.753906 0.753906 c 0.417969 0.417969 0.417969 1.089844 0 1.507813 l -0.753906 0.753906 c -0.199219 0.203125 -0.46875 0.316406 -0.753907 0.316406 c -0.28125 0 -0.554687 -0.113281 -0.753906 -0.316406 z m 0 0" fill="#241f31"/>
<path d="m 8.015625 1.515625 c -3.574219 0 -6.5 2.925781 -6.5 6.5 c 0 3.570313 2.925781 6.5 6.5 6.5 c 3.570313 0 6.5 -2.929687 6.5 -6.5 c 0 -3.574219 -2.929687 -6.5 -6.5 -6.5 z m 0 3 c 1.949219 0 3.5 1.546875 3.5 3.5 c 0 1.949219 -1.550781 3.5 -3.5 3.5 c -1.953125 0 -3.5 -1.550781 -3.5 -3.5 c 0 -1.953125 1.546875 -3.5 3.5 -3.5 z m 0 0" fill="#241f31"/>
<g fill="none">
<path d="m 100 238 c 0 19.882812 -16.117188 36 -36 36 s -36 -16.117188 -36 -36 s 16.117188 -36 36 -36 s 36 16.117188 36 36 z m 0 0" stroke="url(#a)" stroke-width="24" transform="matrix(1 0 0 1 -160 -172)"/>
<path d="m -58 64 c 0 20.988281 -17.011719 38 -38 38 s -38 -17.011719 -38 -38 s 17.011719 -38 38 -38 s 38 17.011719 38 38 z m 0 0" stroke="#f6f5f4" stroke-width="20"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -1,13 +0,0 @@
install_subdir(
'hicolor',
install_dir : control_center_icondir
)
if get_option('profile') == 'development'
icondir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(icondir, 'org.gnome.Settings.Devel.svg'),
install_dir: join_paths(control_center_icondir, icondir),
rename: 'org.gnome.Settings.svg'
)
endif

View File

@@ -1,212 +0,0 @@
# Contributing
When contributing to the development of GNOME Settings, please first discuss the change you wish to
make via issue, email, or any other method with the maintainers before making a change.
Please note we have a Code of Conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Create a fork in GitLab and push your work to there
2. Open a Merge Request
1. Always allow maintainer edits
2. Mark the Merge Request as WIP if your work is not ready to be reviewed
3. Assign the correct maintainer to the Merge Request (see [`MAINTAINERS.md`][maintainers] to select
the correct maintainer)
4. Format commit messages as follows:
```
component: <summary>
A paragraph explaining the problem and its context.
Another one explaining how you solved that.
<link to the issue>
```
4. You may merge the pull request in once you have the sign-off of the maintainers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
## Code of Conduct
GNOME Settings is a project developed based on GNOME Code of Conduct and GitHub's community
guidelines. You can read it below:
### Summary
GNOME creates software for a better world. We achieve this by behaving well towards
each other.
Therefore this document suggests what we consider ideal behaviour, so you know what
to expect when getting involved in GNOME. This is who we are and what we want to be.
There is no official enforcement of these principles, and this should not be interpreted
like a legal document.
### Advice
* **Be respectful and considerate**: Disagreement is no excuse for poor behaviour or personal
attacks. Remember that a community where people feel uncomfortable is not a productive one.
* **Be patient and generous**: If someone asks for help it is because they need it. Do politely
suggest specific documentation or more appropriate venues where appropriate, but avoid
aggressive or vague responses such as "RTFM".
* **Assume people mean well**: Remember that decisions are often a difficult choice between
competing priorities. If you disagree, please do so politely. If something seems outrageous,
check that you did not misinterpret it. Ask for clarification, but do not assume the worst.
* **Try to be concise**: Avoid repeating what has been said already. Making a conversation larger
makes it difficult to follow, and people often feel personally attacked if they receive multiple
messages telling them the same thing.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Communication Guideline
It is of ultimate importance to maintain a community in which everyone feels free to express
themselves, review, and comment on each others ideas, both technical and otherwise. Correspondingly,
an environment in which individuals are silenced, berated, or are otherwise afraid to speak up is
unlikely to foster fruitful dialog.
Everyone interacting with members of the community should always keep in mind the asymmetry of
communication: while your interaction with community members (and in particular, maintainers and
long-term contributors) may be singular and fleeting, these members generally interact with a high
volume of individuals each day. Before writing a comment, opening a new issue, or engaging as part
of any forum or IRC discussion, please take a moment to appreciate that fact.
While communicating, it is expected that all involved participants be respectful and civil at all
times and refrain from personal attacks.
#### Communication Rules
The following behavior will not be tolerated on any occasion:
* **Threats of violence**: You may not threaten violence towards others or use the site to organize,
promote, or incite acts of real-world violence or terrorism. Think carefully about the words you
use, the images you post, and even the software you write, and how they may be interpreted by
others. Even if you mean something as a joke, it might not be received that way. If you think
that someone else might interpret the content you post as a threat or as promoting violence or
terrorism, stop. Don't post it. In extraordinary cases, we may report threats of violence to law
enforcement if we think there may be a genuine risk of physical harm or a threat to public safety.
* **Hate speech and discrimination**: While it is not forbidden to broach topics such as age, body
size, disability, ethnicity, gender identity and expression, level of experience, nationality,
personal appearance, race, religion, or sexual identity and orientation, we do not tolerate speech
that attacks a person or group of people on the basis of who they are. When approached in an
aggressive or insulting manner these (and other) sensitive topics can make others feel unwelcome,
or perhaps even unsafe. While there's always the potential for misunderstandings, we expect our
community members to remain respectful and civil when discussing sensitive topics.
* **Bullying and harassment**: We do not tolerate bullying, harassment, or any other means of
habitual badgering or intimidation targeted at a specific person or group of people. In general,
if your actions are unwanted and you cease to terminate this form of engagement, there is a good
chance that your behavior will be classified as bullying or harassment.
* **Impersonation**: You may not seek to mislead others as to your identity by copying another
person's avatar, posting content under their email address, using a similar username, or otherwise
posing as someone else. Impersonation and identity theft is a form of harassment.
* **Doxxing and invasion of privacy**: Don't post other people's personal information, such as phone
numbers, private email addresses, physical addresses, credit card numbers, Social Security/National
Identity numbers, or passwords. Depending on the context, we may consider such behavior to be an
invasion of privacy, with particularly egregious examples potentially escalating to the point of
legal action, such as when the released material presents a safety risk to the subject.
* **Obscene content**: In essence, do not post pornography, gore, or any other depiction of violence.
#### General Advice
The following advice will help to increase the efficiency of communication with community members:
* Do not post "me too" comments. Use the GitLab reactions instead, e.g. “thumbs up” or “thumbs down”.
* Avoid adding priority, time, or relevance hints if you are not involved with the development of
the application. For example, `“This is an urgent issue”`, or `“This should be fixed now”`, or
even `“The majority of users need this feature”`.
* Do not use passive-aggressive communication tactics.
* When reporting technical problems with the application, such as misbehavior or crashes, focus on
sharing as many details as possible and avoid adding non-technical information to it.
An example of a **good** issue report:
```
GNOME Settings crashes when opening the Wi-Fi panel with 3+ Wi-Fi adapters
Steps to reproduce (assuming 3+ Wi-Fi adapters are present):
1. Open GNOME Settings
2. Select the Wi-Fi panel
3. Observe the crash
This does not happen with 2 or less adapters. Here is a backtrace of the
crash: backtrace.txt
```
In contrast, here is an example of a **bad** issue report:
```
GNOME Settings crashed while I was trying to connect to the internet. How can such
a thing happen and nobody notice? Did you not test it before releasing it?
This should be fixed as quick as possible!
```
* When asking for new features, try and add as much information as possible to justify its relevance,
why should it not be implemented as an auxiliary program, what problems it would solve, and offer
suggestions about how you think it should be implemented.
Example of a **good** feature request:
```
GNOME Settings needs to expose IPv6 options
As of now, the connection editor dialog does not allow editing various IPv6
options. This is relevant because without some of these options, it is not
possible to have a valid IPv6 configuration and, consequently, not have access
to various websites and services.
The list of missing configurations that are essential is:
* <Feature A>
* <Feature B>
Optionally, the following configurations can also be added:
* <Feature C>
* <Feature D>
Here is a quick sketch I have made showing how I think these options
should be exposed as a user interface: sketch.png.
```
Example of a **bad** feature request:
```
Merge GNOME Tweaks in GNOME Settings
The options in GNOME Tweaks are absolutely essential to the majority of us
users. Why was it not merged already? This is an urgent issue and should
have been addressed years ago. You should allocate all your resources on
merging those two applications.
```
#### What happens if someone breaks these rules or guidelines?
Actions that may be taken in response to an abusive comment include but are not limited to:
* Content removal (when breaking any of the guidelines or rules)
* Content blocking (when breaking any of the guidelines or rules)
* Formal report to the Code of Conduct Committee (when breaking any of the rules)
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[maintainers]: https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/docs/MAINTAINERS.md

View File

@@ -1,291 +0,0 @@
# Style
GNOME Settings has a coding style based on GTK Coding Style, but with a few more
rules. Please read them carefully and, if in doubt, ask a maintainer for directions.
## General
The most important rule is: **see the surrounding code, and copy its style**.
That said, GNOME Settings assumes:
* 2 spaces of indentation
* 120 columns of line width
* Newline before `{`
Another rule that applies to function declarations is that all parameters are
aligned by the last '*'. There are plenty of examples below.
## Comments
Comment blocks should be formatted as following:
```c
/* Single line comment */
/* Multiline comments start at the first line of the comment block,
* but have the closing slash a line after. Every line starts with
* an asterisk that is aligned with every the rest of the block.
*/
```
## Conditionals
Conditionals should either be all in one line, or one per line. Newlines inside
conditionals are aligned by the last parenthesis.
Some examples below:
```c
// Single line if
if (a || b || (c && d))
return;
// Multiline if with nested parenthesis
if (long_boolean_variable_used_in_this_condition_a ||
long_boolean_variable_used_in_this_condition_b ||
(long_boolean_variable_used_in_this_condition_c &&
long_boolean_variable_used_in_this_condition_d))
{
return;
}
// Another single line example with do {} while (...)
do
{
/* something */
}
while (a || b || (c && d));
```
## Structs and Enums
Structures and enums are formatted as following:
```c
struct _FooBar
{
guint32 field_one;
gchar *text;
};
typedef struct
{
FooParent parent;
guint32 field_one;
gchar *text;
struct
{
CustomType *something;
guint something_else;
} inner_struct;
gboolean flag : 1;
} FooBar;
enum
{
FIRST,
SECOND,
LAST,
};
typedef enum
{
FOO_BAR_FIRST,
FOO_BAR_SECOND,
FOO_BAR_LAST,
} FooEnumBar;
```
## Header (.h) files
It is organized by the following structure:
1. GPL header
2. Local includes
3. System includes
4. `G_BEGIN_DECLS`
5. `#defines`
6. `G_DECLARE_{FINAL,DERIVABLE}_TYPE`
7. Public API
8. `G_END_DECLS`
The following style rules apply:
* The '*' and the type come together, without any spaces in between.
* Function names are aligned by the widest return value.
* Parenthesis after function name is aligned by the widest function name
* The last '*' in parameters are aligned by the widest parameter type
* No new line at the end of the file
As an example, this is how a header file should look like (extracted from
the `cc-object-storage.h` file):
```c
/* cc-object-storage.h
*
* Copyright 2018 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <glib-object.h>
#include <gio/gio.h>
G_BEGIN_DECLS
/* Default storage keys */
#define CC_OBJECT_NMCLIENT "CcObjectStorage::nm-client"
#define CC_TYPE_OBJECT_STORAGE (cc_object_storage_get_type())
G_DECLARE_FINAL_TYPE (CcObjectStorage, cc_object_storage, CC, OBJECT_STORAGE, GObject)
gboolean cc_object_storage_has_object (const gchar *key);
void cc_object_storage_add_object (const gchar *key,
gpointer object);
gpointer cc_object_storage_get_object (const gchar *key);
gpointer cc_object_storage_create_dbus_proxy_sync (GBusType bus_type,
GDBusProxyFlags flags,
const gchar *name,
const gchar *path,
const gchar *interface,
GCancellable *cancellable,
GError **error);
void cc_object_storage_create_dbus_proxy (GBusType bus_type,
GDBusProxyFlags flags,
const gchar *name,
const gchar *path,
const gchar *interface,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
G_END_DECLS
```
## Source code
The source file keeps an order of methods. The order will be as following:
1. GPL header
2. Structures
3. Function prototypes
4. G_DEFINE_TYPE()
5. Enums
6. Static variables
7. Auxiliary methods
8. Callbacks
9. Interface implementations
10. Parent class overrides
11. class_init and init
12. Public API
### Structures
The structures must have the first pointer asterisk aligned one space after the
widest type name. For example:
```c
typedef struct
{
GBusType bus_type;
GDBusProxyFlags flags;
gchar *name;
gchar *path;
gchar *interface;
gboolean cached;
} TaskData;
```
### Function Prototypes
Function prototypes must be formatted just like in header files.
### Auxiliary Methods
Auxiliary method names must have a verb in the dictionary form, and should always
perform an action over something. They don't have the `cc_` prefix. For example:
```c
static void
execute_something_on_data (Foo *data,
Bar *bar)
{
/* ... */
}
```
### Callbacks
* Callbacks always have the `_cb` suffix
* Signal callbacks always have the `on_<object_name>` prefix
* Callback names must have the name of the signal in the past
For example:
```c
static void
on_foo_size_allocated_cb (GtkWidget *widget,
GtkAllocation *allocation,
gpointer user_data)
{
/* ... */
}
```
### Line Splitting
Line splitting works following the GTK code style, but legibility comes over above
all. If a function call looks unbalanced following the GTK style, it is fine to
slightly escape the rules.
For example, this feels extremelly unbalanced:
```c
foo_bar_do_somthing_sync (a,
1,
object,
data,
something
cancellable,
&error);
```
Notice the empty space before the arguments, and how empty and odd it looks. In
comparison, it will look better if written like this:
```c
foo_bar_do_somthing_sync (a, 1, object, data,
something
cancellable,
&error);
```
# Contributing guidelines
See CONTRIBUTIONS.md file for the contribution guidelines, and the Code of Conduct
that contributors are expected to follow.

View File

@@ -1,62 +0,0 @@
This document describes how maintainership works on GNOME Settings. It is intended to be a guideline
for future reference.
The list of current maintainers can be found at the [gnome-control-center.doap][doap] DOAP file.
# General Rules
The purpose of the shared maintainership model in GNOME Settings is to avoid as much as possible
pushing unreviewed code in the main repository. Not only it is a good engineering practice, but it
also increases the code quality and reduces the number of bugs.
GNOME Settings has two types of maintainers:
* **General Maintainer**: take care of the whole codebase and of panels without a specific maintainer.
* **Panel Maintainer**: take care of a specific panel with a stronger authority over General
Maintainers.
## For Contributors
Panel Maintainers have a stronger authority over their panels than a General Maintainer. If you are
contributing to a specific panel, and that panel has a dedicate maintainer, they should be the main
point of contact.
In the rare case of Panel Maintainers not being responsive, it is allowed to contact General
Maintainers.
## For Maintainers
If you are a Panel Maintainer, your merge requests will be reviewed by General Maintainer. The
opposite is true as well - General Maintainers contributing to a specific panel will have their
merge requests reviewed by the Panel Maintainer of that panel.
If you are a General Maintainer contributing to an unmaintained panel, or to the main codebase, your
merge requests will be reviewed by another General Maintainer.
Avoid pushing commits without an explicit review, except in the following cases:
* The commit is a translation commit
* The commit is trivial
* The commit is urgent and no reviewers were available in time
When accepting a merge request and allowing the other maintainer to merge, avoid misunderstandings
by being explicit. Suggested acceptance phrase:
`I approve this merge request. You are allowed to merge it.`
### Urgency Commits
Urgency commits should never happen, but in case they're needed, they are defined by the following
criteria:
* On stable branches (or master right after a stable release)
* Symptoms:
* Always OR often reproducible; AND
* Crash; OR
* Data loss; OR
* System corruption
* Quickly followed by an emergency release (at most 2 days after the commit)
[doap]: https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/gnome-control-center.doap

View File

@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<its:rules xmlns:its="http://www.w3.org/2005/11/its"
xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0"
version="2.0">
<its:translateRule selector="/KeyListEntries" translate="no"/>
<its:translateRule selector="/KeyListEntries/@name" translate="yes"/>
<its:translateRule selector="//KeyListEntry" translate="yes"/>
<its:translateRule selector="//KeyListEntry/@description" translate="yes"/>
<gt:contextRule selector="//KeyListEntry[@msgctxt]" contextPointer="@msgctxt"/>
<!-- Extracted strings are consumed by the library and are never
merged back; we don't want to escape special characters. -->
<gt:escapeRule selector="/KeyListEntries" escape="no"/>
</its:rules>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="GnomeKeybindings" pattern="*.xml">
<documentRule localName="KeyListEntries" target="gnome-keybindings.its"/>
</locatingRule>
</locatingRules>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0"?>
<its:rules xmlns:its="http://www.w3.org/2005/11/its"
version="2.0">
<its:translateRule selector="/sounds" translate="no"/>
<its:translateRule selector="//name" translate="yes"/>
</its:rules>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="sounds" pattern="*.xml">
<documentRule localName="sounds" target="sounds.its"/>
</locatingRule>
</locatingRules>

View File

@@ -1,95 +0,0 @@
<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:gnome="http://api.gnome.org/doap-extensions#"
xmlns="http://usefulinc.com/ns/doap#">
<name xml:lang="en">GNOME Settings</name>
<shortdesc xml:lang="en">GNOME's main interface to configure various aspects of the desktop</shortdesc>
<description xml:lang="en">GNOME's main interface to configure various aspects of the desktop</description>
<mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gnomecc-list" />
<download-page rdf:resource="http://download.gnome.org/sources/gnome-control-center/" />
<bug-database rdf:resource="http://gitlab.gnome.org/GNOME/gnome-control-center/issues" />
<category rdf:resource="http://api.gnome.org/doap-extensions#core" />
<programming-language>C</programming-language>
<!-- General -->
<maintainer>
<foaf:Person>
<foaf:name>Georges Basile Stavracas Neto</foaf:name>
<foaf:mbox rdf:resource="mailto:gbsneto@gnome.org" />
<gnome:userid>gbsneto</gnome:userid>
</foaf:Person>
</maintainer>
<!-- General, Region & Language -->
<maintainer>
<foaf:Person>
<foaf:name>Robert Ancell</foaf:name>
<foaf:mbox rdf:resource="mailto:rancell@gnome.org" />
<gnome:userid>rancell</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Bluetooth -->
<maintainer>
<foaf:Person>
<foaf:name>Bastien Nocera</foaf:name>
<foaf:mbox rdf:resource="mailto:hadess@gnome.org" />
<gnome:userid>hadess</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Display -->
<maintainer>
<foaf:Person>
<foaf:name>Benjamin Berg</foaf:name>
<foaf:mbox rdf:resource="mailto:bberg@gnome.org" />
<gnome:userid>bberg</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Mouse & Touchpad, Printers -->
<maintainer>
<foaf:Person>
<foaf:name>Felipe Borges</foaf:name>
<foaf:mbox rdf:resource="mailto:felipeborges@gnome.org" />
<gnome:userid>felipeborges</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Online Accounts -->
<maintainer>
<foaf:Person>
<foaf:name>Debarshi Ray</foaf:name>
<foaf:mbox rdf:resource="mailto:debarshir@gnome.org" />
<gnome:userid>debarshir</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Printers -->
<maintainer>
<foaf:Person>
<foaf:name>Marek Kašík</foaf:name>
<foaf:mbox rdf:resource="mailto:mkasik@gnome.org" />
</foaf:Person>
</maintainer>
<!-- Thunderbolt -->
<maintainer>
<foaf:Person>
<foaf:name>Christian Kellner</foaf:name>
<foaf:mbox rdf:resource="mailto:gicmo@gnome.org" />
<gnome:userid>gicmo</gnome:userid>
</foaf:Person>
</maintainer>
<!-- Wacom -->
<maintainer>
<foaf:Person>
<foaf:name>Carlos Garnacho</foaf:name>
<foaf:mbox rdf:resource="mailto:carlosg@gnome.org" />
<gnome:userid>carlosg</gnome:userid>
</foaf:Person>
</maintainer>
</Project>

View File

@@ -1,361 +0,0 @@
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="gnome-control-center">
<refentryinfo>
<title>gnome-control-center</title>
<productname>GNOME</productname>
<authorgroup>
<author>
<contrib>Maintainer</contrib>
<firstname>Bastien</firstname>
<surname>Nocera</surname>
<email>hadess@hadess.net</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>gnome-control-center</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gnome-control-center</refname>
<refpurpose>Configure GNOME settings</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>gnome-control-center <arg choice="opt" rep="repeat">OPTION</arg> <arg choice="opt">PANEL</arg> <arg choice="opt" rep="repeat">ARG</arg></command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><command>gnome-control-center</command> is a graphical
user interface to configure various aspects of GNOME.</para>
<para>When run without arguments, the shell displays the
<firstterm>overview</firstterm>, which shows all available
configuration panels. The overview allows to open individual
panels by clicking on them. It also has a search entry
to find panels by searching keywords.</para>
<para>It is also possible to specify a panel name
as commandline argument to go directly to that panel.
Individual panels may accept further arguments to specify
which tab to open (for multi-tabbed panels) or which
item to display (for panels with lists).</para>
<para>Note that <command>gnome-control-center</command>
is not meant to expose each and every setting that is
available. The settings that can be found here represent
what is considered useful and commonly needed options.
For more exotic or uncommon options, you can look at
<command>gnome-tweak-tool</command> or the
<command>gsettings</command> commandline utility.</para>
</refsect1>
<refsect1>
<title>Panels</title>
<para>The following panel names can be specified:</para>
<variablelist>
<varlistentry>
<term><option>background</option></term>
<listitem><para>The background panel lets you
set your desktop background.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>bluetooth</option></term>
<listitem><para>The bluetooth panel lets you
configure your computer's Bluetooth adapter,
and pair the computer with Bluetooth keyboards,
phones, etc.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>color</option></term>
<listitem><para>The color panel can calibrate
monitors, web cams and printers for accurate
color reproduction.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>datetime</option></term>
<listitem><para>The datetime panel lets you
set the timezone and time format.</para>
<para>Some operations in this panel
affect all user accounts on the computer
and require privieges.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>display</option></term>
<listitem><para>The display panel configures
the resolution and arrangement of monitors
and laptop panels. Note that monitors can be
rearranged by drag-and-drop, and you can change
which monitor is your main display by dragging
the black bar.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>info-overview</option></term>
<listitem><para>The info-overview panel shows a general
overview of the system configuration. It also
lets you change the default applications for
various tasks and the handling of removable
media.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>keyboard</option></term>
<listitem><para>The keyboard panel can
change how the keyboard reacts to key
presses and lets you change keyboard
shortcuts or create custom shortcuts.</para>
<para>You can open this panel on a
specific tab by passing <option>typing</option>
or <option>shortcuts</option> as extra
argument.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>mouse</option></term>
<listitem><para>The mouse panel can change
how mice and touchpads react to user
input.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>network</option></term>
<listitem><para>The network panel provides
a view of available network devices (wired,
wireless or mobile) and their current
configuration. It also provides a way to
create new VPN connections and configure
proxy settings.</para>
<para>You can open this panel on a
specific dialog by passing
<option>create-wifi</option>,
<option>connect-hidden-wifi</option>,
<option>connect-3g</option>,
<option>connect-8021x-wifi</option> or
<option>show-device</option> as extra
argument. The last three parameters
require an additional extra argument for
the network object in the form
<replaceable>/org/freedesktop/NetworkManager/Devices/0</replaceable>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>notifications</option></term>
<listitem><para>The notifications panel provides
a way to control the display of notifications.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>online-accounts</option></term>
<listitem><para>The online-accounts panel
shows your configured online accounts and
lets you add or remove accounts.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>power</option></term>
<listitem><para>The power panel shows
the fill level of batteries and can
configure what happens when the computer
is idle or runs out of battery.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>printers</option></term>
<listitem><para>The printers panel shows
all known printers and their status. It is
possible to inspect queued print jobs and
add new printers.</para>
<para>Some operations in this panel require
privileges.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>privacy</option></term>
<listitem><para>The privacy panel allows
to control visible file usage history, temporary
files, and name.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>region</option></term>
<listitem><para>The region panel
contains regional settings such as
the display language, formatting for
times, dates, numbers, and input sources.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>search</option></term>
<listitem><para>The search panel controls
the results visible in the overview, and the
files and folders to be indexed.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>screen</option></term>
<listitem><para>The screen panel contains
settings that control the screen brightness
and screen lock behavior.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>sharing</option></term>
<listitem><para>The sharing panel contains
settings that control what is shared over the
network.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>sound</option></term>
<listitem><para>The sound panel shows
all known sound devices and their configuration,
including volume and balance settings.</para>
<para>You can open this panel on a
specific tab by passing
<option>output</option>,
<option>input</option>,
<option>hardware</option>,
<option>effects</option> or
<option>applications</option> as extra
argument.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>universal-access</option></term>
<listitem><para>The universal-access panel
contains settings for accessible technologies
such as the screen reader, magnifier, screen
keyboard and AccessX options.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>user-accounts</option></term>
<listitem><para>The user-accounts panel
shows all user accounts that exist on the
computer and allows to change them in some
ways, such as changing the user name, password
or permissions. It also allows to create
or remove accounts.</para>
<para>Some operations in this panel require
privileges.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>wacom</option></term>
<listitem><para>the wacom panel shows
connected Wacom graphics tablets and lets
you calibrate and configure such devices.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>-?</option>, <option>--help</option></term>
<listitem><para>Prints a short help
text and exits.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--version</option></term>
<listitem><para>Prints the program version
and exits.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option>, <option>--verbose</option></term>
<listitem><para>Enables verbose mode.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-l</option>, <option>--list</option></term>
<listitem><para>Lists the available panels
and exits.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option>, <option>--overview</option></term>
<listitem><para>Opens the overview.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option> <replaceable>term</replaceable>, <option>--search</option> <replaceable>term</replaceable></term>
<listitem><para>Sets the following search term.</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Exit status</title>
<para>On success 0 is returned, a non-zero failure
code otherwise.</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>gsettings</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

View File

@@ -1,26 +0,0 @@
xsltproc = find_program('xsltproc', required: false)
assert(xsltproc.found(), 'xsltproc is required to build documentation')
xsltproc_cmd = [
xsltproc,
'--output', '@OUTPUT@',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
'@INPUT@'
]
output = meson.project_name() + '.1'
custom_target(
output,
input : meson.project_name() + '.xml',
output : output,
command : xsltproc_cmd,
install : true,
install_dir : join_paths(control_center_mandir, 'man1')
)

View File

@@ -1,314 +0,0 @@
project(
'gnome-control-center', 'c',
version : '40.1',
license : 'GPL2+',
meson_version : '>= 0.53.0'
)
control_center_prefix = get_option('prefix')
control_center_bindir = join_paths(control_center_prefix, get_option('bindir'))
control_center_datadir = join_paths(control_center_prefix, get_option('datadir'))
control_center_libexecdir = join_paths(control_center_prefix, get_option('libexecdir'))
control_center_localedir = join_paths(control_center_prefix, get_option('localedir'))
control_center_mandir = join_paths(control_center_prefix, get_option('mandir'))
control_center_sysconfdir = join_paths(control_center_prefix, get_option('sysconfdir'))
control_center_pkgdatadir = join_paths(control_center_datadir, meson.project_name())
control_center_desktopdir = join_paths(control_center_datadir, 'applications')
control_center_icondir = join_paths(control_center_datadir, 'icons')
control_center_schemadir = join_paths (control_center_datadir, 'glib-2.0', 'schemas')
control_center_gettext = meson.project_name() + '-2.0'
host_is_linux = host_machine.system().contains('linux')
host_is_linux_not_s390 = host_is_linux and not host_machine.cpu().contains('s390')
cc = meson.get_compiler('c')
# Tracing
enable_tracing = get_option('tracing')
config_h = configuration_data()
py = import('python')
python = py.find_installation('python3')
config_h.set_quoted('TEST_NM_PYTHON', python.path())
# defines
set_defines = [
# package
['PACKAGE', meson.project_name()],
['PACKAGE_VERSION', meson.project_version()],
['VERSION', meson.project_version()],
['PROFILE', get_option('profile')],
# i18n
['GETTEXT_PACKAGE', control_center_gettext]
]
foreach define: set_defines
config_h.set_quoted(define[0], define[1])
endforeach
# meson does not support octal values, so it must be handled as a
# string. See: https://github.com/mesonbuild/meson/issues/2047
config_h.set('USER_DIR_MODE', '0700',
description: 'Permissions for creating the user\'s config, cache and data directories')
# compiler flags
common_flags = ['-DHAVE_CONFIG_H']
# Only add this when optimizing is enabled (default)
optimized_src = '''
#if __OPTIMIZE__ == 0
#error No optimization
#endif
'''
control_center_optimized = get_option('buildtype').contains('optimized') and cc.compiles(optimized_src)
if control_center_optimized
common_flags += '-Wp,-D_FORTIFY_SOURCE=2'
endif
if get_option('buildtype').contains('debug')
test_cflags = [
'-Wcast-align',
'-Wmissing-field-initializers',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wno-strict-aliasing',
'-Wno-sign-compare'
]
common_flags += cc.get_supported_arguments(test_cflags)
endif
add_project_arguments(common_flags, language: 'c')
# Check that we meet the dependencies
libgvc = subproject(
'gvc',
default_options: [
'static=true',
'alsa=false',
'package_name=' + control_center_gettext,
'package_version=' + meson.project_version(),
]
)
libgvc_dep = libgvc.get_variable('libgvc_dep')
libhandy_dep = dependency('libhandy-1', version: '>= 1.0.0', required: false)
if not libhandy_dep.found()
libhandy = subproject(
'libhandy',
default_options: [
'examples=false',
'glade_catalog=disabled',
'introspection=disabled',
'tests=false',
'vapi=false',
]
)
libhandy_dep = libhandy.get_variable('libhandy_dep')
endif
goa_req_version = '>= 3.25.3'
pulse_req_version = '>= 2.0'
accounts_dep = dependency('accountsservice', version: '>= 0.6.39')
colord_dep = dependency('colord', version: '>= 0.1.34')
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.23.0')
gio_dep = dependency('gio-2.0')
glib_dep = dependency('glib-2.0', version: '>= 2.56.0')
gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 3.33.4')
gnome_settings_dep = dependency('gnome-settings-daemon', version: '>= 3.27.90')
goa_dep = dependency('goa-1.0', version: goa_req_version)
gsettings_desktop_dep = dependency('gsettings-desktop-schemas', version: '>= 3.37.1')
libxml_dep = dependency('libxml-2.0')
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.114')
pulse_dep = dependency('libpulse', version: pulse_req_version)
pulse_mainloop_dep = dependency('libpulse-mainloop-glib', version: pulse_req_version)
upower_glib_dep = dependency('upower-glib', version: '>= 0.99.8')
gudev_dep = dependency('gudev-1.0', version: '>= 232')
x11_dep = dependency('x11')
xi_dep = dependency('xi', version: '>= 1.2')
epoxy_dep = dependency('epoxy')
m_dep = cc.find_library('m')
common_deps = [
gio_dep,
glib_dep,
gsettings_desktop_dep,
libhandy_dep,
dependency('gio-unix-2.0'),
dependency('gthread-2.0'),
dependency('gtk+-3.0', version: '>= 3.22.20')
]
# Check for CUPS 1.4 or newer
cups_dep = dependency('cups', version : '>= 1.4', required: false)
assert(cups_dep.found(), 'CUPS 1.4 or newer not found')
# https://bugzilla.gnome.org/show_bug.cgi?id=696766
cups_cflags = []
if cups_dep.version().version_compare('>= 1.6')
cups_cflags += '-D_PPD_DEPRECATED='
endif
# cups headers
check_headers = [
['HAVE_CUPS_CUPS_H', 'cups/cups.h'],
['HAVE_CUPS_PPD_H', 'cups/ppd.h']
]
foreach header: check_headers
assert(cc.has_header(header[1], args: cups_cflags), 'CUPS headers not found: ' + header[1])
endforeach
config_h.set10('HAVE_CUPS_HTTPCONNECT2',
cc.has_function('httpConnect2', dependencies: cups_dep),
description: 'Define if httpConnect2() is available in CUPS')
# Optional dependency for the user accounts panel
enable_cheese = get_option('cheese')
if enable_cheese
cheese_deps = [
dependency('cheese', version: '>= 3.28.0'),
dependency('cheese-gtk', version: '>= 3.5.91')
]
endif
config_h.set('HAVE_CHEESE', enable_cheese,
description: 'Define to 1 to enable cheese webcam support')
# IBus support
enable_ibus = get_option('ibus')
if enable_ibus
ibus_dep = dependency('ibus-1.0', version: '>= 1.5.2')
endif
config_h.set('HAVE_IBUS', enable_ibus,
description: 'Defined if IBus support is enabled')
# thunderbolt
config_h.set10('HAVE_FN_EXPLICIT_BZERO',
cc.has_function('explicit_bzero', prefix: '''#include <string.h>'''),
description: 'Define if explicit_bzero is available')
# Snap support
enable_snap = get_option('snap')
if enable_snap
snapd_glib_deps = [
dependency('snapd-glib', version: '>= 1.57')
]
endif
config_h.set('HAVE_SNAP', enable_snap,
description: 'Define to 1 if Snap support is enabled')
# malcontent support
enable_malcontent = get_option('malcontent')
if enable_malcontent
malcontent_dep = dependency('malcontent-0', version: '>= 0.7.0')
config_h.set('HAVE_MALCONTENT_0_10', malcontent_dep.version().version_compare('>= 0.10.0'),
description: 'Define to 1 if malcontent ≥ 0.10.0')
endif
config_h.set('HAVE_MALCONTENT', enable_malcontent,
description: 'Define to 1 if malcontent support is enabled')
if host_is_linux
# network manager
network_manager_deps = [
dependency('libnm', version: '>= 1.24.0'),
dependency('libnma', version: '>= 1.8.0'),
dependency('mm-glib', version: '>= 0.7')
]
endif
config_h.set('BUILD_NETWORK', host_is_linux,
description: 'Define to 1 to build the Network panel')
config_h.set('HAVE_NETWORK_MANAGER', host_is_linux,
description: 'Define to 1 if NetworkManager is available')
if host_is_linux_not_s390
# gnome-bluetooth
gnome_bluetooth_dep = dependency('gnome-bluetooth-1.0', version: '>= 3.18.2')
libwacom_dep = dependency('libwacom', version: '>= 0.7')
wacom_deps = [
libwacom_dep,
]
config_h.set('HAVE_WACOM_3D_STYLUS', libwacom_dep.version().version_compare('>= 0.27'),
description: 'Define to 1 if libwacom provides definition for 3D styli')
else
message('Bluetooth and Wacom panels will not be built (no USB support on this platform)')
message('Thunderbolt panel will not be built (not supported on this platform)')
endif
config_h.set('BUILD_BLUETOOTH', host_is_linux_not_s390,
description: 'Define to 1 to build the Bluetooth panel')
config_h.set('HAVE_BLUETOOTH', host_is_linux_not_s390,
description: 'Define to 1 if bluetooth support is available')
config_h.set('BUILD_WACOM', host_is_linux_not_s390,
description: 'Define to 1 to build the Wacom panel')
config_h.set('HAVE_WACOM', host_is_linux_not_s390,
description: 'Define to 1 if Wacom is supportted')
config_h.set('BUILD_THUNDERBOLT', host_is_linux_not_s390,
description: 'Define to 1 to build the Thunderbolt panel')
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
desktop_conf = configuration_data()
desktop_conf.set('VERSION', meson.project_version())
po_dir = join_paths(meson.source_root(), 'po')
its_dir = join_paths(meson.source_root(), 'gettext')
install_subdir(
'gettext',
install_dir: control_center_datadir
)
top_inc = include_directories('.')
shell_inc = include_directories('shell')
subdir('build-aux')
subdir('data/icons')
subdir('po')
subdir('panels')
subdir('shell')
subdir('search-provider')
if get_option('tests')
subdir('tests')
endif
if get_option('documentation')
subdir('man')
endif
configure_file(
output: 'config.h',
configuration: config_h
)
summary({
'Documentation': get_option('documentation'),
'Tests': get_option('tests'),
'Tracing': enable_tracing,
'Optimized': control_center_optimized,
})
summary({
'GNOME Bluetooth': host_is_linux_not_s390,
'NetworkManager': host_is_linux,
'Wacom': host_is_linux_not_s390,
}, section: 'Dependencies')
summary({
'Cheese': enable_cheese,
'IBus': enable_ibus,
'Snap': enable_snap,
'Malcontent': enable_malcontent,
}, section: 'Optional Dependencies')

View File

@@ -1,10 +0,0 @@
option('cheese', type: 'boolean', value: true, description: 'build with cheese webcam support')
option('documentation', type: 'boolean', value: false, description: 'build documentation')
option('ibus', type: 'boolean', value: true, description: 'build with IBus support')
option('privileged_group', type: 'string', value: 'wheel', description: 'name of group that has elevated permissions')
option('snap', type: 'boolean', value: false, description: 'build with Snap support')
option('tests', type: 'boolean', value: true, description: 'build tests')
option('tracing', type: 'boolean', value: false, description: 'add extra debugging information')
option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')
option('profile', type: 'combo', choices: ['default','development'], value: 'default')
option('malcontent', type: 'boolean', value: false, description: 'build with malcontent support')

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/applications">
<file preprocess="xml-stripblanks">cc-action-row.ui</file>
<file preprocess="xml-stripblanks">cc-applications-panel.ui</file>
<file preprocess="xml-stripblanks">cc-applications-row.ui</file>
<file preprocess="xml-stripblanks">cc-info-row.ui</file>
<file preprocess="xml-stripblanks">cc-snap-row.ui</file>
<file preprocess="xml-stripblanks">cc-toggle-row.ui</file>
<file>cc-applications-panel.css</file>
</gresource>
</gresources>

View File

@@ -1,218 +0,0 @@
/* cc-action-row.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include <glib/gi18n.h>
#include "cc-action-row.h"
#include "cc-applications-resources.h"
struct _CcActionRow
{
GtkListBoxRow parent;
GtkWidget *title;
GtkWidget *subtitle;
GtkWidget *button;
};
G_DEFINE_TYPE (CcActionRow, cc_action_row, GTK_TYPE_LIST_BOX_ROW)
static int activated_signal;
enum
{
PROP_0,
PROP_TITLE,
PROP_SUBTITLE,
PROP_ACTION,
PROP_ENABLED,
PROP_DESTRUCTIVE
};
static void
clicked_cb (CcActionRow *row)
{
g_signal_emit (row, activated_signal, 0);
}
static void
cc_action_row_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CcActionRow *row = CC_ACTION_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->title)));
break;
case PROP_SUBTITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->subtitle)));
break;
case PROP_ACTION:
g_value_set_string (value, gtk_button_get_label (GTK_BUTTON (row->button)));
break;
case PROP_ENABLED:
g_value_set_boolean (value, gtk_widget_get_sensitive (row->button));
break;
case PROP_DESTRUCTIVE:
g_value_set_boolean (value,
gtk_style_context_has_class (gtk_widget_get_style_context (row->button), "destructive-action"));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_action_row_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
CcActionRow *row = CC_ACTION_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
gtk_label_set_label (GTK_LABEL (row->title), g_value_get_string (value));
break;
case PROP_SUBTITLE:
gtk_label_set_label (GTK_LABEL (row->subtitle), g_value_get_string (value));
gtk_widget_set_visible (row->subtitle, strlen (g_value_get_string (value)) > 0);
break;
case PROP_ACTION:
gtk_button_set_label (GTK_BUTTON (row->button), g_value_get_string (value));
break;
case PROP_ENABLED:
gtk_widget_set_sensitive (row->button, g_value_get_boolean (value));
break;
case PROP_DESTRUCTIVE:
if (g_value_get_boolean (value))
gtk_style_context_add_class (gtk_widget_get_style_context (row->button), "destructive-action");
else
gtk_style_context_remove_class (gtk_widget_get_style_context (row->button), "destructive-action");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_action_row_class_init (CcActionRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = cc_action_row_get_property;
object_class->set_property = cc_action_row_set_property;
g_object_class_install_property (object_class,
PROP_TITLE,
g_param_spec_string ("title", "title", "title",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SUBTITLE,
g_param_spec_string ("subtitle", "subtitle", "subtitle",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ACTION,
g_param_spec_string ("action", "action", "action",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ENABLED,
g_param_spec_boolean ("enabled", "enabled", "enabled",
TRUE, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_DESTRUCTIVE,
g_param_spec_boolean ("destructive", "destructive", "destructive",
FALSE, G_PARAM_READWRITE));
activated_signal = g_signal_new ("activated",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
0,
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-action-row.ui");
gtk_widget_class_bind_template_child (widget_class, CcActionRow, title);
gtk_widget_class_bind_template_child (widget_class, CcActionRow, subtitle);
gtk_widget_class_bind_template_child (widget_class, CcActionRow, button);
gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
}
static void
cc_action_row_init (CcActionRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcActionRow *
cc_action_row_new (void)
{
return CC_ACTION_ROW (g_object_new (CC_TYPE_ACTION_ROW, NULL));
}
void
cc_action_row_set_title (CcActionRow *row,
const gchar *name)
{
gtk_label_set_label (GTK_LABEL (row->title), name);
}
void
cc_action_row_set_subtitle (CcActionRow *row,
const gchar *name)
{
gtk_label_set_label (GTK_LABEL (row->subtitle), name);
gtk_widget_set_visible (row->subtitle, strlen (name) > 0);
}
void
cc_action_row_set_action (CcActionRow *row,
const gchar *action,
gboolean sensitive)
{
gtk_button_set_label (GTK_BUTTON (row->button), action);
gtk_widget_set_sensitive (row->button, sensitive);
}

View File

@@ -1,42 +0,0 @@
/* cc-action-row.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_ACTION_ROW (cc_action_row_get_type())
G_DECLARE_FINAL_TYPE (CcActionRow, cc_action_row, CC, ACTION_ROW, GtkListBoxRow)
CcActionRow* cc_action_row_new (void);
void cc_action_row_set_title (CcActionRow *row,
const gchar *label);
void cc_action_row_set_subtitle (CcActionRow *row,
const gchar *label);
void cc_action_row_set_action (CcActionRow *row,
const gchar *action,
gboolean sensitive);
G_END_DECLS

View File

@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcActionRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="border-width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="title">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<property name="ellipsize">end</property>
</object>
<packing>
<property name="expand">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="subtitle">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<property name="ellipsize">end</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="button">
<property name="visible">1</property>
<property name="valign">center</property>
<signal name="clicked" handler="clicked_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
</template>
</interface>

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +0,0 @@
.section-title {
font-weight: bold;
}
.section-subtitle {
opacity: 0.55;
}
.sidebar-icon.fullcolor {
opacity: 1;
}

View File

@@ -1,30 +0,0 @@
/* cc-applications-panel.h
*
* Copyright 2018 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <shell/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_APPLICATIONS_PANEL (cc_applications_panel_get_type())
G_DECLARE_FINAL_TYPE (CcApplicationsPanel, cc_applications_panel, CC, APPLICATIONS_PANEL, CcPanel)
G_END_DECLS

View File

@@ -1,610 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcApplicationsPanel" parent="CcPanel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkScrolledWindow" id="main_scroll">
<property name="visible">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<property name="margin_top">32</property>
<property name="margin_bottom">32</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">1</property>
<child>
<object class="GtkBox" id="empty_box">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="valign">center</property>
<child>
<object class="GtkImage">
<property name="visible">1</property>
<property name="valign">start</property>
<property name="pixel-size">80</property>
<property name="icon-name">org.gnome.Software-symbolic</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="fill">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="margin-bottom">15</property>
<property name="label" translatable="yes">No applications</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="install_button">
<property name="label" translatable="yes">Install some…</property>
<property name="visible">1</property>
<property name="can-focus">1</property>
<property name="receives-default">1</property>
<property name="halign">center</property>
<signal name="clicked" handler="open_software_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
<packing>
<property name="fill">0</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="settings_box">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<property name="hexpand">1</property>
<child>
<object class="GtkBox" id="permission_section">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="section"/>
</style>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Permissions &amp; Access</property>
<style>
<class name="section-title"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">Data and services that this app has asked for access to and permissions that it requires.</property>
<style>
<class name="section-subtitle"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="permission_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="permission_row_activated_cb" object="CcApplicationsPanel" swapped="yes"/>
<child>
<object class="CcToggleRow" id="camera">
<property name="title" translatable="yes">Camera</property>
<signal name="notify::allowed" handler="camera_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcInfoRow" id="no_camera">
<property name="title" translatable="yes">Camera</property>
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcToggleRow" id="microphone">
<property name="title" translatable="yes">Microphone</property>
<signal name="notify::allowed" handler="microphone_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcInfoRow" id="no_microphone">
<property name="title" translatable="yes">Microphone</property>
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcToggleRow" id="location">
<property name="title" translatable="yes">Location Services</property>
<signal name="notify::allowed" handler="location_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcInfoRow" id="no_location">
<property name="title" translatable="yes">Location Services</property>
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="builtin">
<property name="title" translatable="yes">Built-in Permissions</property>
<property name="info" translatable="yes">Cannot be changed</property>
<property name="has-expander">True</property>
<property name="is-link">True</property>
</object>
</child>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">Individual permissions for applications can be reviewed in the &lt;a href=&quot;privacy&quot;&gt;Privacy&lt;/a&gt; Settings.</property>
<property name="use-markup">1</property>
<signal name="activate-link" handler="privacy_link_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="integration_section">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="section"/>
</style>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Integration</property>
<style>
<class name="section-title"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">System features used by this application.</property>
<style>
<class name="section-subtitle"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="integration_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<child>
<object class="CcToggleRow" id="search">
<property name="title" translatable="yes">Search</property>
<signal name="notify::allowed" handler="search_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcInfoRow" id="no_search">
<property name="title" translatable="yes">Search</property>
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcToggleRow" id="notification">
<property name="title" translatable="yes">Notifications</property>
<signal name="notify::allowed" handler="notification_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcToggleRow" id="background">
<property name="title" translatable="yes">Run in background</property>
<signal name="notify::allowed" handler="background_cb" swapped="yes"/>
</object>
</child>
<child>
<object class="CcToggleRow" id="wallpaper">
<property name="title" translatable="yes">Set Desktop Background</property>
<signal name="notify::allowed" handler="wallpaper_cb" swapped="yes"/>
</object>
</child>
<child>
<object class="CcToggleRow" id="sound">
<property name="title" translatable="yes">Sounds</property>
<signal name="notify::allowed" handler="sound_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
<child>
<object class="CcInfoRow" id="no_sound">
<property name="title" translatable="yes">Sounds</property>
<property name="info" translatable="yes">Disabled</property>
</object>
</child>
<child>
<object class="CcToggleRow" id="shortcuts">
<property name="title" translatable="yes">Inhibit system keyboard shortcuts</property>
<signal name="notify::allowed" handler="shortcuts_cb" swapped="yes"/>
</object>
</child>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="handler_section">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="section"/>
</style>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Default Handlers</property>
<style>
<class name="section-title"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">Types of files and links that this application opens.</property>
<style>
<class name="section-subtitle"/>
</style>
</object>
</child>
</object>
<packing>
<property name="expand">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="handler_reset">
<property name="visible">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Reset</property>
<signal name="clicked" handler="handler_reset_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="handler_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="handler_row_activated_cb" object="CcApplicationsPanel" swapped="yes"/>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="usage_section">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<style>
<class name="section"/>
</style>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Usage</property>
<style>
<class name="section-title"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">How much resources this application is using.</property>
<style>
<class name="section-subtitle"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="usage_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<signal name="row-activated" handler="storage_row_activated_cb" object="CcApplicationsPanel" swapped="yes"/>
<child>
<object class="CcInfoRow" id="storage">
<property name="title" translatable="yes">Storage</property>
<property name="info">unknown</property>
<property name="has-expander">1</property>
<property name="is-link">1</property>
</object>
</child>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkLabel" id="title_label">
<property name="visible">1</property>
<property name="label" translatable="yes">Applications</property>
<style>
<class name="title"/>
</style>
</object>
<object class="GtkButton" id="header_button">
<property name="visible">1</property>
<property name="label" translatable="yes">Open in Software</property>
</object>
<!-- Sidebar -->
<object class="GtkBox" id="sidebar_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSearchEntry" id="sidebar_search_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="margin">12</property>
<property name="margin-bottom">6</property>
<signal name="activate" handler="on_sidebar_search_entry_activated_cb" object="CcApplicationsPanel" swapped="yes" />
<signal name="search-changed" handler="on_sidebar_search_entry_search_changed_cb" object="CcApplicationsPanel" swapped="yes" />
<signal name="stop-search" handler="on_sidebar_search_entry_search_stopped_cb" object="CcApplicationsPanel" swapped="yes" />
</object>
</child>
<child>
<object class="GtkListBox" id="sidebar_listbox">
<property name="visible">True</property>
<property name="vexpand">True</property>
<property name="selection-mode">browse</property>
<child type="placeholder">
<object class="GtkBox" id="empty_search_placeholder">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="expand">True</property>
<property name="border_width">18</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">64</property>
<property name="icon_name">edit-find-symbolic</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">No results found</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.44"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Try a different search</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<!-- Built-in Permissions dialog -->
<object class="GtkDialog" id="builtin_dialog">
<property name="title" translatable="yes">Built-in Permissions</property>
<property name="modal">1</property>
<property name="type-hint">dialog</property>
<property name="use-header-bar">1</property>
<property name="resizable">0</property>
<property name="border-width">24</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="builtin_label">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label">Yadda Yadda</property>
</object>
</child>
<child>
<object class="GtkListBox" id="builtin_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
</object>
</child>
</object>
<!-- Storage dialog -->
<object class="GtkDialog" id="storage_dialog">
<property name="title" translatable="yes">Storage</property>
<property name="modal">1</property>
<property name="type-hint">dialog</property>
<property name="use-header-bar">1</property>
<property name="resizable">0</property>
<property name="border-width">24</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
<child internal-child="vbox">
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="wrap">1</property>
<property name="max-width-chars">50</property>
<property name="label" translatable="yes">How much disk space this application is occupying with app data and caches.</property>
</object>
</child>
<child>
<object class="GtkListBox" id="storage_list">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<child>
<object class="CcInfoRow" id="app">
<property name="title" translatable="yes">Application</property>
<property name="info">Unknown</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="data">
<property name="title" translatable="yes">Data</property>
<property name="info">Unknown</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="cache">
<property name="title" translatable="yes">Cache</property>
<property name="info">Unknown</property>
</object>
</child>
<child>
<object class="CcInfoRow" id="total">
<property name="title" translatable="yes">&lt;b&gt;Total&lt;/b&gt;</property>
<property name="use-markup">1</property>
<property name="info">Unknown</property>
</object>
</child>
<style>
<class name="view"/>
<class name="frame"/>
</style>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<child>
<object class="GtkButton" id="clear_cache_button">
<property name="visible">1</property>
<property name="label" translatable="yes">Clear Cache…</property>
<signal name="clicked" handler="clear_cache_cb" object="CcApplicationsPanel" swapped="yes"/>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@@ -1,108 +0,0 @@
/* cc-applications-row.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include <glib/gi18n.h>
#include "cc-applications-row.h"
#include "cc-applications-resources.h"
struct _CcApplicationsRow
{
GtkListBoxRow parent;
GAppInfo *info;
gchar *sortkey;
GtkWidget *box;
GtkWidget *image;
GtkWidget *label;
};
G_DEFINE_TYPE (CcApplicationsRow, cc_applications_row, GTK_TYPE_LIST_BOX_ROW)
static void
cc_applications_row_finalize (GObject *object)
{
CcApplicationsRow *self = CC_APPLICATIONS_ROW (object);
g_object_unref (self->info);
g_free (self->sortkey);
G_OBJECT_CLASS (cc_applications_row_parent_class)->finalize (object);
}
static void
cc_applications_row_class_init (CcApplicationsRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = cc_applications_row_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-applications-row.ui");
gtk_widget_class_bind_template_child (widget_class, CcApplicationsRow, box);
gtk_widget_class_bind_template_child (widget_class, CcApplicationsRow, image);
gtk_widget_class_bind_template_child (widget_class, CcApplicationsRow, label);
}
static void
cc_applications_row_init (CcApplicationsRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcApplicationsRow *
cc_applications_row_new (GAppInfo *info)
{
CcApplicationsRow *self;
g_autofree gchar *key = NULL;
GIcon *icon;
self = g_object_new (CC_TYPE_APPLICATIONS_ROW, NULL);
self->info = g_object_ref (info);
key = g_utf8_casefold (g_app_info_get_display_name (info), -1);
self->sortkey = g_utf8_collate_key (key, -1);
icon = g_app_info_get_icon (info);
if (icon != NULL)
gtk_image_set_from_gicon (GTK_IMAGE (self->image), g_app_info_get_icon (info), GTK_ICON_SIZE_BUTTON);
else
gtk_image_set_from_icon_name (GTK_IMAGE (self->image), "application-x-executable", GTK_ICON_SIZE_BUTTON);
gtk_label_set_label (GTK_LABEL (self->label), g_app_info_get_display_name (info));
return self;
}
GAppInfo *
cc_applications_row_get_info (CcApplicationsRow *self)
{
return self->info;
}
const gchar *
cc_applications_row_get_sort_key (CcApplicationsRow *self)
{
return self->sortkey;
}

View File

@@ -1,36 +0,0 @@
/* cc-applications-row.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_APPLICATIONS_ROW (cc_applications_row_get_type())
G_DECLARE_FINAL_TYPE (CcApplicationsRow, cc_applications_row, CC, APPLICATIONS_ROW, GtkListBoxRow)
CcApplicationsRow* cc_applications_row_new (GAppInfo *info);
GAppInfo* cc_applications_row_get_info (CcApplicationsRow *row);
const gchar* cc_applications_row_get_sort_key (CcApplicationsRow *row);
G_END_DECLS

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcApplicationsRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="box">
<property name="visible">1</property>
<property name="border-width">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="image">
<property name="visible">1</property>
<property name="pixel-size">32</property>
<style>
<class name="sidebar-icon"/>
<class name="fullcolor"/>
<class name="lowres-icon"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="ellipsize">end</property>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,215 +0,0 @@
/* cc-info-row.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include <glib/gi18n.h>
#include "cc-info-row.h"
#include "cc-applications-resources.h"
struct _CcInfoRow
{
GtkListBoxRow parent;
GtkWidget *title;
GtkWidget *info;
GtkWidget *expander;
gboolean expanded;
gboolean link;
};
G_DEFINE_TYPE (CcInfoRow, cc_info_row, GTK_TYPE_LIST_BOX_ROW)
enum
{
PROP_0,
PROP_TITLE,
PROP_USE_MARKUP,
PROP_INFO,
PROP_HAS_EXPANDER,
PROP_IS_LINK,
PROP_EXPANDED
};
static void
cc_info_row_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CcInfoRow *row = CC_INFO_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->title)));
break;
case PROP_INFO:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->info)));
break;
case PROP_HAS_EXPANDER:
g_value_set_boolean (value, gtk_widget_get_visible (row->expander));
break;
case PROP_USE_MARKUP:
g_value_set_boolean (value, gtk_label_get_use_markup (GTK_LABEL (row->title)));
break;
case PROP_IS_LINK:
g_value_set_boolean (value, row->link);
break;
case PROP_EXPANDED:
g_value_set_boolean (value, cc_info_row_get_expanded (row));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
update_expander (CcInfoRow *row)
{
if (row->link)
gtk_image_set_from_icon_name (GTK_IMAGE (row->expander), "go-next-symbolic", GTK_ICON_SIZE_BUTTON);
else if (row->expanded)
gtk_image_set_from_icon_name (GTK_IMAGE (row->expander), "pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
else
gtk_image_set_from_icon_name (GTK_IMAGE (row->expander), "pan-end-symbolic", GTK_ICON_SIZE_BUTTON);
}
static void
cc_info_row_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
CcInfoRow *row = CC_INFO_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
gtk_label_set_label (GTK_LABEL (row->title), g_value_get_string (value));
break;
case PROP_INFO:
gtk_label_set_label (GTK_LABEL (row->info), g_value_get_string (value));
break;
case PROP_HAS_EXPANDER:
gtk_widget_set_visible (row->expander, g_value_get_boolean (value));
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), g_value_get_boolean (value));
break;
case PROP_USE_MARKUP:
gtk_label_set_use_markup (GTK_LABEL (row->title), g_value_get_boolean (value));
break;
case PROP_IS_LINK:
row->link = g_value_get_boolean (value);
update_expander (row);
break;
case PROP_EXPANDED:
cc_info_row_set_expanded (row, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_info_row_class_init (CcInfoRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = cc_info_row_get_property;
object_class->set_property = cc_info_row_set_property;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-info-row.ui");
g_object_class_install_property (object_class,
PROP_TITLE,
g_param_spec_string ("title", "title", "title",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_INFO,
g_param_spec_string ("info", "info", "info",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_USE_MARKUP,
g_param_spec_boolean ("use-markup", "use-markup", "use-markup",
FALSE, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_HAS_EXPANDER,
g_param_spec_boolean ("has-expander", "has-expander", "has-expander",
FALSE, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_EXPANDED,
g_param_spec_boolean ("expanded", "expanded", "expanded",
FALSE, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_IS_LINK,
g_param_spec_boolean ("is-link", "is-link", "is-link",
FALSE, G_PARAM_READWRITE));
gtk_widget_class_bind_template_child (widget_class, CcInfoRow, title);
gtk_widget_class_bind_template_child (widget_class, CcInfoRow, info);
gtk_widget_class_bind_template_child (widget_class, CcInfoRow, expander);
}
static void
cc_info_row_init (CcInfoRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcInfoRow *
cc_info_row_new (void)
{
return CC_INFO_ROW (g_object_new (CC_TYPE_INFO_ROW, NULL));
}
gboolean
cc_info_row_get_expanded (CcInfoRow *row)
{
return row->expanded;
}
void
cc_info_row_set_expanded (CcInfoRow *row,
gboolean expanded)
{
if (row->expanded == expanded)
return;
row->expanded = expanded;
update_expander (row);
g_object_notify (G_OBJECT (row), "expanded");
}

View File

@@ -1,37 +0,0 @@
/* cc-info-row.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_INFO_ROW (cc_info_row_get_type())
G_DECLARE_FINAL_TYPE (CcInfoRow, cc_info_row, CC, INFO_ROW, GtkListBoxRow)
CcInfoRow* cc_info_row_new (void);
void cc_info_row_set_expanded (CcInfoRow *row,
gboolean expanded);
gboolean cc_info_row_get_expanded (CcInfoRow *row);
G_END_DECLS

View File

@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcInfoRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="border-width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="title">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<property name="ellipsize">end</property>
</object>
</child>
<child>
<object class="GtkLabel" id="info">
<property name="visible">1</property>
<property name="valign">center</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkImage" id="expander">
<property name="valign">center</property>
<property name="icon-name">pan-end-symbolic</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,316 +0,0 @@
/* cc-snap-row.c
*
* Copyright 2019 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include <glib/gi18n.h>
#include "cc-snap-row.h"
#include "cc-applications-resources.h"
struct _CcSnapRow
{
GtkListBoxRow parent;
GtkLabel *title_label;
GtkSwitch *slot_toggle;
GtkComboBox *slots_combo;
GtkListStore *slots_combo_model;
GCancellable *cancellable;
SnapdPlug *plug;
SnapdSlot *connected_slot;
GPtrArray *slots;
};
G_DEFINE_TYPE (CcSnapRow, cc_snap_row, GTK_TYPE_LIST_BOX_ROW)
typedef struct
{
CcSnapRow *self;
SnapdSlot *slot;
} ConnectData;
static void
update_state (CcSnapRow *self)
{
gboolean have_single_option;
GtkTreeIter iter;
have_single_option = self->slots->len == 1;
gtk_widget_set_visible (GTK_WIDGET (self->slot_toggle), have_single_option);
gtk_widget_set_visible (GTK_WIDGET (self->slots_combo), !have_single_option);
gtk_switch_set_active (self->slot_toggle, self->connected_slot != NULL);
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (self->slots_combo_model), &iter))
{
do
{
SnapdSlot *slot;
gtk_tree_model_get (GTK_TREE_MODEL (self->slots_combo_model), &iter, 0, &slot, -1);
if (slot == self->connected_slot)
gtk_combo_box_set_active_iter (self->slots_combo, &iter);
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (self->slots_combo_model), &iter));
}
}
static void
disable_controls (CcSnapRow *self)
{
gtk_widget_set_sensitive (GTK_WIDGET (self->slot_toggle), FALSE);
gtk_widget_set_sensitive (GTK_WIDGET (self->slots_combo), FALSE);
}
static void
enable_controls (CcSnapRow *self)
{
gtk_widget_set_sensitive (GTK_WIDGET (self->slot_toggle), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (self->slots_combo), TRUE);
}
static ConnectData *
connect_data_new (CcSnapRow *self, SnapdSlot *slot)
{
ConnectData *data;
data = g_new0 (ConnectData, 1);
data->self = self;
data->slot = g_object_ref (slot);
return data;
}
static void
connect_data_free (ConnectData *data)
{
g_clear_object (&data->slot);
g_free (data);
}
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectData, connect_data_free)
static void
connect_interface_cb (GObject *client, GAsyncResult *result, gpointer user_data)
{
g_autoptr(ConnectData) data = user_data;
CcSnapRow *self = data->self;
SnapdSlot *slot = data->slot;
g_autoptr(GError) error = NULL;
if (snapd_client_connect_interface_finish (SNAPD_CLIENT (client), result, &error))
{
g_clear_object (&self->connected_slot);
self->connected_slot = g_object_ref (slot);
}
else
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
g_warning ("Failed to connect interface: %s", error->message);
}
update_state (self);
enable_controls (self);
}
static void
connect_plug (CcSnapRow *self, SnapdSlot *slot)
{
g_autoptr(SnapdClient) client = NULL;
/* already connected */
if (self->connected_slot == slot)
return;
disable_controls (self);
client = snapd_client_new ();
snapd_client_connect_interface_async (client,
snapd_plug_get_snap (self->plug), snapd_plug_get_name (self->plug),
snapd_slot_get_snap (slot), snapd_slot_get_name (slot),
NULL, NULL,
self->cancellable,
connect_interface_cb, connect_data_new (self, slot));
}
static void
disconnect_interface_cb (GObject *client, GAsyncResult *result, gpointer user_data)
{
CcSnapRow *self = user_data;
g_autoptr(GError) error = NULL;
if (snapd_client_disconnect_interface_finish (SNAPD_CLIENT (client), result, &error))
{
g_clear_object (&self->connected_slot);
}
else
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
g_warning ("Failed to disconnect interface: %s", error->message);
}
update_state (self);
enable_controls (self);
}
static void
disconnect_plug (CcSnapRow *self)
{
g_autoptr(SnapdClient) client = NULL;
/* already disconnected */
if (self->connected_slot == NULL)
return;
disable_controls (self);
client = snapd_client_new ();
snapd_client_disconnect_interface_async (client,
snapd_plug_get_snap (self->plug), snapd_plug_get_name (self->plug),
NULL, NULL,
NULL, NULL,
self->cancellable,
disconnect_interface_cb, self);
}
static void
switch_changed_cb (CcSnapRow *self)
{
if (gtk_switch_get_active (self->slot_toggle))
{
if (self->slots->len == 1)
connect_plug (self, g_ptr_array_index (self->slots, 0));
}
else
{
disconnect_plug (self);
}
}
static void
combo_changed_cb (CcSnapRow *self)
{
GtkTreeIter iter;
SnapdSlot *slot = NULL;
if (!gtk_combo_box_get_active_iter (self->slots_combo, &iter))
return;
gtk_tree_model_get (GTK_TREE_MODEL (self->slots_combo_model), &iter, 0, &slot, -1);
if (slot != NULL)
connect_plug (self, slot);
else
disconnect_plug (self);
}
static void
cc_snap_row_finalize (GObject *object)
{
CcSnapRow *self = CC_SNAP_ROW (object);
g_clear_object (&self->cancellable);
g_clear_object (&self->plug);
g_clear_pointer (&self->slots, g_ptr_array_unref);
G_OBJECT_CLASS (cc_snap_row_parent_class)->finalize (object);
}
static void
cc_snap_row_class_init (CcSnapRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = cc_snap_row_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-snap-row.ui");
gtk_widget_class_bind_template_child (widget_class, CcSnapRow, title_label);
gtk_widget_class_bind_template_child (widget_class, CcSnapRow, slot_toggle);
gtk_widget_class_bind_template_child (widget_class, CcSnapRow, slots_combo);
gtk_widget_class_bind_template_child (widget_class, CcSnapRow, slots_combo_model);
gtk_widget_class_bind_template_callback (widget_class, combo_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, switch_changed_cb);
}
static void
cc_snap_row_init (CcSnapRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcSnapRow *
cc_snap_row_new (GCancellable *cancellable, SnapdInterface *interface, SnapdPlug *plug, GPtrArray *slots)
{
CcSnapRow *self;
GPtrArray *connected_slots;
g_autofree gchar *label = NULL;
GtkTreeIter iter;
g_return_val_if_fail (SNAPD_IS_PLUG (plug), NULL);
self = CC_SNAP_ROW (g_object_new (CC_TYPE_SNAP_ROW, NULL));
self->cancellable = g_object_ref (cancellable);
self->plug = g_object_ref (plug);
self->slots = g_ptr_array_ref (slots);
connected_slots = snapd_plug_get_connected_slots (plug);
if (connected_slots->len > 0)
{
SnapdSlotRef *connected_slot_ref = g_ptr_array_index (connected_slots, 0);
for (int i = 0; i < slots->len; i++)
{
SnapdSlot *slot = g_ptr_array_index (slots, i);
if (g_strcmp0 (snapd_slot_get_snap (slot), snapd_slot_ref_get_snap (connected_slot_ref)) == 0 &&
g_strcmp0 (snapd_slot_get_name (slot), snapd_slot_ref_get_slot (connected_slot_ref)) == 0)
self->connected_slot = slot;
}
}
if (interface != NULL)
label = snapd_interface_make_label (interface);
else
label = g_strdup (snapd_plug_get_interface (plug));
gtk_label_set_label (self->title_label, label);
/* Add option into combo box */
gtk_list_store_append (self->slots_combo_model, &iter);
gtk_list_store_set (self->slots_combo_model, &iter, 1, "--", -1);
for (int i = 0; i < slots->len; i++)
{
SnapdSlot *slot = g_ptr_array_index (slots, i);
g_autofree gchar *label = NULL;
label = g_strdup_printf ("%s:%s", snapd_slot_get_snap (slot), snapd_slot_get_name (slot));
gtk_list_store_append (self->slots_combo_model, &iter);
gtk_list_store_set (self->slots_combo_model, &iter, 0, slot, 1, label, -1);
}
update_state (self);
return self;
}

View File

@@ -1,36 +0,0 @@
/* cc-snap-row.h
*
* Copyright 2019 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
#include <snapd-glib/snapd-glib.h>
G_BEGIN_DECLS
#define CC_TYPE_SNAP_ROW (cc_snap_row_get_type())
G_DECLARE_FINAL_TYPE (CcSnapRow, cc_snap_row, CC, SNAP_ROW, GtkListBoxRow)
CcSnapRow* cc_snap_row_new (GCancellable *cancellable,
SnapdInterface *interface,
SnapdPlug *plug,
GPtrArray *slots);
G_END_DECLS

View File

@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkListStore" id="slots_combo_model">
<columns>
<!-- column-name slot -->
<column type="GObject"/>
<!-- column-name label -->
<column type="gchararray"/>
</columns>
</object>
<template class="CcSnapRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="border-width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<property name="ellipsize">end</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="slot_toggle">
<property name="visible">True</property>
<property name="valign">center</property>
<signal name="notify::active" handler="switch_changed_cb" swapped="yes"/>
</object>
</child>
<child>
<object class="GtkComboBox" id="slots_combo">
<property name="visible">True</property>
<property name="valign">center</property>
<property name="model">slots_combo_model</property>
<signal name="changed" handler="combo_changed_cb" swapped="yes"/>
<child>
<object class="GtkCellRendererText">
<property name="ellipsize">end</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,144 +0,0 @@
/* cc-toggle-row.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include <glib/gi18n.h>
#include "cc-toggle-row.h"
#include "cc-applications-resources.h"
struct _CcToggleRow
{
GtkListBoxRow parent;
GtkWidget *title;
GtkWidget *toggle;
};
G_DEFINE_TYPE (CcToggleRow, cc_toggle_row, GTK_TYPE_LIST_BOX_ROW)
enum
{
PROP_0,
PROP_TITLE,
PROP_ALLOWED
};
static void
changed_cb (CcToggleRow *row)
{
g_object_notify (G_OBJECT (row), "allowed");
}
static void
cc_toggle_row_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CcToggleRow *row = CC_TOGGLE_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (row->title)));
break;
case PROP_ALLOWED:
g_value_set_boolean (value, cc_toggle_row_get_allowed (row));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_toggle_row_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
CcToggleRow *row = CC_TOGGLE_ROW (object);
switch (prop_id)
{
case PROP_TITLE:
gtk_label_set_label (GTK_LABEL (row->title), g_value_get_string (value));
break;
case PROP_ALLOWED:
cc_toggle_row_set_allowed (row, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_toggle_row_class_init (CcToggleRowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = cc_toggle_row_get_property;
object_class->set_property = cc_toggle_row_set_property;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/applications/cc-toggle-row.ui");
g_object_class_install_property (object_class,
PROP_TITLE,
g_param_spec_string ("title", "title", "title",
NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ALLOWED,
g_param_spec_boolean ("allowed", "allowed", "allowed",
FALSE, G_PARAM_READWRITE));
gtk_widget_class_bind_template_child (widget_class, CcToggleRow, title);
gtk_widget_class_bind_template_child (widget_class, CcToggleRow, toggle);
gtk_widget_class_bind_template_callback (widget_class, changed_cb);
}
static void
cc_toggle_row_init (CcToggleRow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
CcToggleRow *
cc_toggle_row_new (void)
{
return CC_TOGGLE_ROW (g_object_new (CC_TYPE_TOGGLE_ROW, NULL));
}
void
cc_toggle_row_set_allowed (CcToggleRow *self,
gboolean allowed)
{
gtk_switch_set_active (GTK_SWITCH (self->toggle), allowed);
}
gboolean
cc_toggle_row_get_allowed (CcToggleRow *self)
{
return gtk_switch_get_active (GTK_SWITCH (self->toggle));
}

View File

@@ -1,37 +0,0 @@
/* cc-toggle-row.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_TOGGLE_ROW (cc_toggle_row_get_type())
G_DECLARE_FINAL_TYPE (CcToggleRow, cc_toggle_row, CC, TOGGLE_ROW, GtkListBoxRow)
CcToggleRow* cc_toggle_row_new (void);
void cc_toggle_row_set_allowed (CcToggleRow *row,
gboolean allowed);
gboolean cc_toggle_row_get_allowed (CcToggleRow *row);
G_END_DECLS

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcToggleRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="border-width">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="title">
<property name="visible">1</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
<property name="ellipsize">end</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="toggle">
<property name="visible">1</property>
<property name="valign">center</property>
<signal name="notify::active" handler="changed_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,62 +0,0 @@
/* globs.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include "globs.h"
/* parse mime/globs and return a string->string hash table */
GHashTable *
parse_globs (void)
{
GHashTable *globs;
const gchar * const *dirs;
gint i;
globs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
{
g_autofree gchar *file = g_build_filename (dirs[i], "mime", "globs", NULL);
g_autofree gchar *contents = NULL;
if (g_file_get_contents (file, &contents, NULL, NULL))
{
g_auto(GStrv) strv = NULL;
int i;
strv = g_strsplit (contents, "\n", 0);
for (i = 0; strv[i]; i++)
{
g_auto(GStrv) parts = NULL;
if (strv[i][0] == '#' || strv[i][0] == '\0')
continue;
parts = g_strsplit (strv[i], ":", 2);
g_hash_table_insert (globs, g_strdup (parts[0]), g_strdup (parts[1]));
}
}
}
return globs;
}

View File

@@ -1,29 +0,0 @@
/* globs.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gio/gio.h>
G_BEGIN_DECLS
GHashTable* parse_globs (void);
G_END_DECLS

View File

@@ -1,16 +0,0 @@
[Desktop Entry]
Name=Applications
Comment=Control various application permissions and settings
Exec=gnome-control-center applications
# FIXME
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=preferences-desktop-apps
Terminal=false
Type=Application
NoDisplay=true
StartupNotify=true
Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-AccountSettings;
OnlyShowIn=GNOME;Unity;
# Translators: Search terms to find the Privacy panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=application;flatpak;permission;setting;
X-GNOME-ControlCenter-HasSidebar=true

View File

@@ -1,58 +0,0 @@
panels_list += cappletname
desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
desktop_in = configure_file(
input : desktop + '.in.in',
output : desktop + '.in',
configuration : desktop_conf
)
i18n.merge_file(
desktop,
type : 'desktop',
input : desktop_in,
output : desktop,
po_dir : po_dir,
install : true,
install_dir : control_center_desktopdir
)
sources = files(
'cc-applications-panel.c',
'cc-applications-row.c',
'cc-toggle-row.c',
'cc-info-row.c',
'cc-action-row.c',
'globs.c',
'search.c',
'utils.c',
)
resource_data = files('cc-applications-panel.ui')
sources += gnome.compile_resources(
'cc-' + cappletname + '-resources',
cappletname + '.gresource.xml',
c_name : 'cc_' + cappletname,
dependencies : resource_data,
export : true
)
deps = common_deps
if enable_snap
deps += snapd_glib_deps
sources += files('cc-snap-row.c')
endif
if enable_malcontent
deps += malcontent_dep
endif
panels_libs += static_library(
cappletname,
sources : sources,
include_directories : [ top_inc, common_inc ],
dependencies : deps,
c_args : cflags
)

View File

@@ -1,133 +0,0 @@
/* search.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <config.h>
#include "search.h"
#define SHELL_PROVIDER_GROUP "Shell Search Provider"
static void
add_one_provider (GHashTable *search_providers,
GFile *file)
{
g_autoptr(GKeyFile) keyfile = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *app_id = NULL;
g_autofree gchar *path = NULL;
gboolean default_disabled;
path = g_file_get_path (file);
keyfile = g_key_file_new ();
g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, &error);
if (error != NULL)
{
g_warning ("Error loading %s: %s - search provider will be ignored",
path, error->message);
return;
}
if (!g_key_file_has_group (keyfile, SHELL_PROVIDER_GROUP))
{
g_debug ("Shell search provider group missing from '%s', ignoring", path);
return;
}
app_id = g_key_file_get_string (keyfile, SHELL_PROVIDER_GROUP, "DesktopId", &error);
if (error != NULL)
{
g_warning ("Unable to read desktop ID from %s: %s - search provider will be ignored",
path, error->message);
return;
}
if (g_str_has_suffix (app_id, ".desktop"))
app_id[strlen (app_id) - strlen (".desktop")] = '\0';
default_disabled = g_key_file_get_boolean (keyfile, SHELL_PROVIDER_GROUP, "DefaultDisabled", NULL);
g_hash_table_insert (search_providers, g_strdup (app_id), GINT_TO_POINTER (default_disabled));
}
static void
parse_search_providers_one_dir (GHashTable *search_providers,
const gchar *system_dir)
{
g_autoptr(GFileEnumerator) enumerator = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GFile) providers_location = NULL;
g_autofree gchar *providers_path = NULL;
providers_path = g_build_filename (system_dir, "gnome-shell", "search-providers", NULL);
providers_location = g_file_new_for_path (providers_path);
enumerator = g_file_enumerate_children (providers_location,
"standard::type,standard::name,standard::content-type",
G_FILE_QUERY_INFO_NONE,
NULL, &error);
if (error != NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error opening %s: %s - search provider configuration won't be possible",
providers_path, error->message);
return;
}
while (TRUE)
{
GFile *provider = NULL;
if (!g_file_enumerator_iterate (enumerator, NULL, &provider, NULL, &error))
{
g_warning ("Error while reading %s: %s - search provider configuration won't be possible",
providers_path, error->message);
return;
}
if (provider == NULL)
break;
add_one_provider (search_providers, provider);
}
}
/* parse gnome-shell/search-provider files and return a string->boolean hash table */
GHashTable *
parse_search_providers (void)
{
GHashTable *search_providers;
const gchar * const *dirs;
gint i;
search_providers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
parse_search_providers_one_dir (search_providers, dirs[i]);
return search_providers;
}

View File

@@ -1,29 +0,0 @@
/* globs.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gio/gio.h>
G_BEGIN_DECLS
GHashTable* parse_search_providers (void);
G_END_DECLS

View File

@@ -1,268 +0,0 @@
/* utils.c
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
#include <config.h>
#include <glib/gi18n.h>
#ifdef HAVE_SNAP
#include <snapd-glib/snapd-glib.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <ftw.h>
#include "utils.h"
static gint
ftw_remove_cb (const gchar *path,
const struct stat *sb,
gint typeflags,
struct FTW *ftwbuf)
{
remove (path);
return 0;
}
static void
file_remove_thread_func (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
GFile *file = source_object;
g_autofree gchar *path = g_file_get_path (file);
nftw (path, ftw_remove_cb, 20, FTW_DEPTH);
if (g_task_set_return_on_cancel (task, FALSE))
g_task_return_boolean (task, TRUE);
}
void
file_remove_async (GFile *file,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer data)
{
g_autoptr(GTask) task = g_task_new (file, cancellable, callback, data);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread (task, file_remove_thread_func);
}
gboolean
file_remove_finish (GFile *file,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, file), FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
static GPrivate size_key = G_PRIVATE_INIT (g_free);
static gint
ftw_size_cb (const gchar *path,
const struct stat *sb,
gint typeflags,
struct FTW *ftwbuf)
{
guint64 *size = (guint64*)g_private_get (&size_key);
if (typeflags == FTW_F)
*size += sb->st_size;
return 0;
}
static void
file_size_thread_func (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
GFile *file = source_object;
g_autofree gchar *path = g_file_get_path (file);
guint64 *total;
g_private_replace (&size_key, g_new0 (guint64, 1));
nftw (path, ftw_size_cb, 20, FTW_DEPTH);
total = g_new0 (guint64, 1);
*total = *(guint64*)g_private_get (&size_key);
if (g_task_set_return_on_cancel (task, FALSE))
g_task_return_pointer (task, total, g_free);
}
void
file_size_async (GFile *file,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer data)
{
g_autoptr(GTask) task = g_task_new (file, cancellable, callback, data);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread (task, file_size_thread_func);
}
gboolean
file_size_finish (GFile *file,
GAsyncResult *result,
guint64 *size,
GError **error)
{
g_autofree guint64 *data = NULL;
g_return_val_if_fail (g_task_is_valid (result, file), FALSE);
data = g_task_propagate_pointer (G_TASK (result), error);
if (data == NULL)
return FALSE;
if (size != NULL)
*size = *data;
return TRUE;
}
void
container_remove_all (GtkContainer *container)
{
g_autoptr(GList) children = NULL;
GList *l;
children = gtk_container_get_children (container);
for (l = children; l; l = l->next)
gtk_widget_destroy (GTK_WIDGET (l->data));
}
static gchar *
get_output_of (const gchar **argv)
{
g_autofree gchar *output = NULL;
int status;
if (!g_spawn_sync (NULL,
(gchar**) argv,
NULL,
G_SPAWN_SEARCH_PATH,
NULL, NULL,
&output, NULL,
&status, NULL))
return NULL;
if (!g_spawn_check_exit_status (status, NULL))
return NULL;
return g_steal_pointer (&output);
}
GKeyFile *
get_flatpak_metadata (const gchar *app_id)
{
const gchar *argv[5] = { "flatpak", "info", "-m", "app", NULL };
g_autofree gchar *data = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GKeyFile) keyfile = NULL;
argv[3] = app_id;
data = get_output_of (argv);
if (data == NULL)
return NULL;
keyfile = g_key_file_new ();
if (!g_key_file_load_from_data (keyfile, data, -1, 0, &error))
{
g_warning ("%s", error->message);
return NULL;
}
return g_steal_pointer (&keyfile);
}
guint64
get_flatpak_app_size (const gchar *app_id)
{
const gchar *argv[5] = { "flatpak", "info", "-s", "app", NULL };
g_autofree gchar *data = NULL;
guint64 factor;
double val;
argv[3] = app_id;
data = get_output_of (argv);
if (data == NULL)
return 0;
data = g_strstrip (data);
if (g_str_has_suffix (data, "kB") || g_str_has_suffix (data, "kb"))
factor = 1000;
else if (g_str_has_suffix (data, "MB") || g_str_has_suffix (data, "Mb"))
factor = 1000 * 1000;
else if (g_str_has_suffix (data, "GB") || g_str_has_suffix (data, "Gb"))
factor = 1000 * 1000 * 1000;
else if (g_str_has_suffix (data, "KiB") || g_str_has_suffix (data, "Kib"))
factor = 1024;
else if (g_str_has_suffix (data, "MiB") || g_str_has_suffix (data, "Mib"))
factor = 1024 * 1024;
else if (g_str_has_suffix (data, "GiB") || g_str_has_suffix (data, "Gib"))
factor = 1024 * 1024 * 1024;
else
factor = 1;
val = g_ascii_strtod (data, NULL);
return (guint64)(val * factor);
}
guint64
get_snap_app_size (const gchar *snap_name)
{
#ifdef HAVE_SNAP
g_autoptr(SnapdClient) client = NULL;
g_autoptr(SnapdSnap) snap = NULL;
g_autoptr(GError) error = NULL;
client = snapd_client_new ();
snap = snapd_client_get_snap_sync (client, snap_name, NULL, &error);
if (snap == NULL)
{
g_warning ("Failed to get snap size: %s", error->message);
return 0;
}
return snapd_snap_get_installed_size (snap);
#else
return 0;
#endif
}
char *
get_app_id (GAppInfo *info)
{
gchar *app_id = g_strdup (g_app_info_get_id (info));
if (g_str_has_suffix (app_id, ".desktop"))
app_id[strlen (app_id) - strlen (".desktop")] = '\0';
return app_id;
}

View File

@@ -1,57 +0,0 @@
/* utils.h
*
* Copyright 2018 Matthias Clasen <matthias.clasen@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gio/gio.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
void file_remove_async (GFile *file,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer data);
gboolean file_remove_finish (GFile *file,
GAsyncResult *result,
GError **error);
void file_size_async (GFile *file,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer data);
gboolean file_size_finish (GFile *file,
GAsyncResult *result,
guint64 *size,
GError **error);
void container_remove_all (GtkContainer *container);
GKeyFile* get_flatpak_metadata (const gchar *app_id);
guint64 get_flatpak_app_size (const gchar *app_id);
guint64 get_snap_app_size (const gchar *snap_name);
gchar* get_app_id (GAppInfo *info);
G_END_DECLS

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/background">
<file preprocess="xml-stripblanks">cc-background-chooser.ui</file>
<file preprocess="xml-stripblanks">cc-background-panel.ui</file>
<file preprocess="xml-stripblanks">cc-background-preview.ui</file>
<file>preview.css</file>
</gresource>
</gresources>

View File

@@ -1,219 +0,0 @@
/* bg-colors-source.c */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include "bg-colors-source.h"
#include "cc-background-item.h"
#include <cairo-gobject.h>
#include <glib/gi18n-lib.h>
#include <gdesktop-enums.h>
struct _BgColorsSource
{
BgSource parent_instance;
};
G_DEFINE_TYPE (BgColorsSource, bg_colors_source, BG_TYPE_SOURCE)
struct {
GDesktopBackgroundShading type;
int orientation;
const char *pcolor;
} items[] = {
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#000000" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#db5d33" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#008094" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#5d479d" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#ab2876" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#fad166" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#437740" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#d272c4" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#ed9116" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#ff89a9" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#7a8aa2" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#888888" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#475b52" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#425265" },
{ G_DESKTOP_BACKGROUND_SHADING_SOLID, -1, "#7a634b" },
};
static gchar *
get_colors_path (void)
{
return g_build_filename (g_get_user_config_dir (), "gnome-control-center", "backgrounds", "colors.ini", NULL);
}
static char *
get_colors_dir (void)
{
return g_build_filename (g_get_user_config_dir (), "gnome-control-center", "backgrounds", NULL);
}
static void
bg_colors_source_add_color (BgColorsSource *self,
GListStore *store,
const char *color)
{
CcBackgroundItemFlags flags;
g_autoptr(CcBackgroundItem) item = NULL;
item = cc_background_item_new (NULL);
flags = CC_BACKGROUND_ITEM_HAS_PCOLOR |
CC_BACKGROUND_ITEM_HAS_SCOLOR |
CC_BACKGROUND_ITEM_HAS_SHADING |
CC_BACKGROUND_ITEM_HAS_PLACEMENT |
CC_BACKGROUND_ITEM_HAS_URI;
/* It does have a URI, it's "none" */
g_object_set (G_OBJECT (item),
"uri", "file:///" DATADIR "/gnome-control-center/pixmaps/noise-texture-light.png",
"primary-color", color,
"secondary-color", color,
"shading", G_DESKTOP_BACKGROUND_SHADING_SOLID,
"placement", G_DESKTOP_BACKGROUND_STYLE_WALLPAPER,
"flags", flags,
NULL);
cc_background_item_load (item, NULL);
/* insert the item into the liststore */
g_list_store_append (store, item);
}
static void
bg_colors_source_constructed (GObject *object)
{
BgColorsSource *self = BG_COLORS_SOURCE (object);
guint i;
GListStore *store;
g_autoptr(GKeyFile) keyfile = NULL;
g_autofree gchar *path = NULL;
G_OBJECT_CLASS (bg_colors_source_parent_class)->constructed (object);
store = bg_source_get_liststore (BG_SOURCE (self));
for (i = 0; i < G_N_ELEMENTS (items); i++)
bg_colors_source_add_color (self, store, items[i].pcolor);
keyfile = g_key_file_new ();
path = get_colors_path ();
if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))
{
g_auto(GStrv) colors = NULL;
colors = g_key_file_get_string_list (keyfile, "Colors", "custom-colors", NULL, NULL);
for (i = 0; colors != NULL && colors[i] != NULL; i++)
bg_colors_source_add_color (self, store, colors[i]);
}
}
gboolean
bg_colors_source_add (BgColorsSource *self,
GdkRGBA *rgba,
GtkTreeRowReference **ret_row_ref)
{
GListStore *store;
g_autofree gchar *c = NULL;
g_auto(GStrv) colors = NULL;
gsize len;
g_autoptr(GKeyFile) keyfile = NULL;
g_autoptr(GError) error = NULL;
g_autofree gchar *dir = NULL;
g_autofree gchar *path = NULL;
c = g_strdup_printf ("#%02x%02x%02x",
(int)(255*rgba->red),
(int)(255*rgba->green),
(int)(255*rgba->blue));
store = bg_source_get_liststore (BG_SOURCE (self));
bg_colors_source_add_color (self, store, c);
/* Save to the keyfile */
dir = get_colors_dir ();
g_mkdir_with_parents (dir, 0700);
path = get_colors_path ();
colors = NULL;
len = 0;
keyfile = g_key_file_new ();
if (g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, NULL))
colors = g_key_file_get_string_list (keyfile, "Colors", "custom-colors", &len, NULL);
if (len == 0 && colors != NULL)
g_clear_pointer (&colors, g_strfreev);
if (colors == NULL)
{
colors = g_new0 (char *, 2);
colors[0] = g_steal_pointer (&c);
len = 1;
}
else
{
char **new_colors;
guint i;
new_colors = g_new0 (char *, len + 2);
for (i = 0; colors[i] != NULL; i++)
{
new_colors[i] = colors[i];
colors[i] = NULL;
}
new_colors[len] = g_steal_pointer (&c);
len++;
g_strfreev (colors);
colors = new_colors;
}
g_key_file_set_string_list (keyfile, "Colors", "custom-colors", (const gchar * const*) colors, len);
if (!g_key_file_save_to_file (keyfile, path, &error))
g_warning ("Could not save custom color: %s", error->message);
return TRUE;
}
static void
bg_colors_source_init (BgColorsSource *self)
{
}
static void
bg_colors_source_class_init (BgColorsSourceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = bg_colors_source_constructed;
}
BgColorsSource *
bg_colors_source_new (GtkWidget *widget)
{
return g_object_new (BG_TYPE_COLORS_SOURCE, "widget", widget, NULL);
}

View File

@@ -1,38 +0,0 @@
/* bg-colors-source.h */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#pragma once
#include <gtk/gtk.h>
#include "bg-source.h"
G_BEGIN_DECLS
#define BG_TYPE_COLORS_SOURCE (bg_colors_source_get_type ())
G_DECLARE_FINAL_TYPE (BgColorsSource, bg_colors_source, BG, COLORS_SOURCE, BgSource)
BgColorsSource *bg_colors_source_new (GtkWidget *widget);
gboolean bg_colors_source_add (BgColorsSource *self,
GdkRGBA *rgba,
GtkTreeRowReference **ret_row_ref);
G_END_DECLS

View File

@@ -1,855 +0,0 @@
/* bg-pictures-source.c */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include "bg-pictures-source.h"
#include "cc-background-grilo-miner.h"
#include "cc-background-item.h"
#include <string.h>
#include <cairo-gobject.h>
#include <gio/gio.h>
#include <grilo.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include <gdesktop-enums.h>
#define ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_NAME "," \
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \
G_FILE_ATTRIBUTE_TIME_MODIFIED
struct _BgPicturesSource
{
BgSource parent_instance;
GCancellable *cancellable;
CcBackgroundGriloMiner *grl_miner;
GFileMonitor *picture_dir_monitor;
GFileMonitor *cache_dir_monitor;
GHashTable *known_items;
};
G_DEFINE_TYPE (BgPicturesSource, bg_pictures_source, BG_TYPE_SOURCE)
const char * const content_types[] = {
"image/png",
"image/jp2",
"image/jpeg",
"image/bmp",
"image/svg+xml",
"image/x-portable-anymap",
NULL
};
const char * const screenshot_types[] = {
"image/png",
NULL
};
static char *bg_pictures_source_get_unique_filename (const char *uri);
static void picture_opened_for_read (GObject *source_object, GAsyncResult *res, gpointer user_data);
static void
bg_pictures_source_dispose (GObject *object)
{
BgPicturesSource *source = BG_PICTURES_SOURCE (object);
if (source->cancellable)
{
g_cancellable_cancel (source->cancellable);
g_clear_object (&source->cancellable);
}
g_clear_object (&source->grl_miner);
G_OBJECT_CLASS (bg_pictures_source_parent_class)->dispose (object);
}
static void
bg_pictures_source_finalize (GObject *object)
{
BgPicturesSource *bg_source = BG_PICTURES_SOURCE (object);
g_clear_pointer (&bg_source->known_items, g_hash_table_destroy);
g_clear_object (&bg_source->picture_dir_monitor);
g_clear_object (&bg_source->cache_dir_monitor);
G_OBJECT_CLASS (bg_pictures_source_parent_class)->finalize (object);
}
static void
bg_pictures_source_class_init (BgPicturesSourceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = bg_pictures_source_dispose;
object_class->finalize = bg_pictures_source_finalize;
}
static void
remove_placeholder (BgPicturesSource *bg_source,
CcBackgroundItem *item)
{
GListStore *store;
guint i;
store = bg_source_get_liststore (BG_SOURCE (bg_source));
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (store)); i++)
{
g_autoptr(CcBackgroundItem) item_n = NULL;
item_n = g_list_model_get_item (G_LIST_MODEL (store), i);
if (item_n == item)
{
g_list_store_remove (store, i);
break;
}
}
}
static gboolean
picture_needs_rotation (GdkPixbuf *pixbuf)
{
const gchar *str;
str = gdk_pixbuf_get_option (pixbuf, "orientation");
if (str == NULL)
return FALSE;
if (*str == '5' || *str == '6' || *str == '7' || *str == '8')
return TRUE;
return FALSE;
}
static GdkPixbuf *
swap_rotated_pixbuf (GdkPixbuf *pixbuf)
{
GdkPixbuf *tmp_pixbuf;
tmp_pixbuf = gdk_pixbuf_apply_embedded_orientation (pixbuf);
if (tmp_pixbuf == NULL)
return pixbuf;
g_object_unref (pixbuf);
return tmp_pixbuf;
}
static int
sort_func (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
CcBackgroundItem *item_a;
CcBackgroundItem *item_b;
guint64 modified_a;
guint64 modified_b;
int retval;
item_a = (CcBackgroundItem *) a;
item_b = (CcBackgroundItem *) b;
modified_a = cc_background_item_get_modified (item_a);
modified_b = cc_background_item_get_modified (item_b);
retval = modified_b - modified_a;
return retval;
}
static void
picture_scaled (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
BgPicturesSource *bg_source;
CcBackgroundItem *item;
g_autoptr(GError) error = NULL;
g_autoptr(GdkPixbuf) pixbuf = NULL;
const char *software;
const char *uri;
GListStore *store;
cairo_surface_t *surface = NULL;
int scale_factor;
gboolean rotation_applied;
item = g_object_get_data (source_object, "item");
pixbuf = gdk_pixbuf_new_from_stream_finish (res, &error);
if (pixbuf == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_warning ("Failed to load image: %s", error->message);
remove_placeholder (BG_PICTURES_SOURCE (user_data), item);
}
return;
}
/* since we were not cancelled, we can now cast user_data
* back to BgPicturesSource.
*/
bg_source = BG_PICTURES_SOURCE (user_data);
store = bg_source_get_liststore (BG_SOURCE (bg_source));
uri = cc_background_item_get_uri (item);
if (uri == NULL)
uri = cc_background_item_get_source_url (item);
/* Ignore screenshots */
software = gdk_pixbuf_get_option (pixbuf, "tEXt::Software");
if (software != NULL &&
g_str_equal (software, "gnome-screenshot"))
{
g_debug ("Ignored URL '%s' as it's a screenshot from gnome-screenshot", uri);
remove_placeholder (BG_PICTURES_SOURCE (user_data), item);
return;
}
/* Process embedded orientation */
rotation_applied = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "rotation-applied"));
if (!rotation_applied && picture_needs_rotation (pixbuf))
{
/* the width and height of pixbuf we requested are wrong for EXIF
* orientations 5, 6, 7 and 8. the file has to be reloaded. */
g_autoptr(GFile) file = NULL;
file = g_file_new_for_uri (uri);
g_object_set_data (G_OBJECT (item), "needs-rotation", GINT_TO_POINTER (TRUE));
g_object_set_data_full (G_OBJECT (file), "item", g_object_ref (item), g_object_unref);
g_file_read_async (G_FILE (file), G_PRIORITY_DEFAULT,
bg_source->cancellable,
picture_opened_for_read, bg_source);
return;
}
pixbuf = swap_rotated_pixbuf (pixbuf);
scale_factor = bg_source_get_scale_factor (BG_SOURCE (bg_source));
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale_factor, NULL);
cc_background_item_load (item, NULL);
/* insert the item into the liststore */
g_list_store_insert_sorted (store, item, sort_func, bg_source);
g_hash_table_insert (bg_source->known_items,
bg_pictures_source_get_unique_filename (uri),
GINT_TO_POINTER (TRUE));
g_clear_pointer (&surface, cairo_surface_destroy);
}
static void
picture_opened_for_read (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
BgPicturesSource *bg_source;
CcBackgroundItem *item;
g_autoptr(GFileInputStream) stream = NULL;
g_autoptr(GError) error = NULL;
gint thumbnail_height;
gint thumbnail_width;
gboolean needs_rotation;
item = g_object_get_data (source_object, "item");
stream = g_file_read_finish (G_FILE (source_object), res, &error);
if (stream == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_autofree gchar *filename = g_file_get_path (G_FILE (source_object));
g_warning ("Failed to load picture '%s': %s", filename, error->message);
remove_placeholder (BG_PICTURES_SOURCE (user_data), item);
}
return;
}
/* since we were not cancelled, we can now cast user_data
* back to BgPicturesSource.
*/
bg_source = BG_PICTURES_SOURCE (user_data);
needs_rotation = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "needs-rotation"));
if (needs_rotation)
{
/* swap width and height for EXIF orientations that need it */
thumbnail_width = bg_source_get_thumbnail_height (BG_SOURCE (bg_source));
thumbnail_height = bg_source_get_thumbnail_width (BG_SOURCE (bg_source));
g_object_set_data (G_OBJECT (item), "rotation-applied", GINT_TO_POINTER (TRUE));
}
else
{
thumbnail_width = bg_source_get_thumbnail_width (BG_SOURCE (bg_source));
thumbnail_height = bg_source_get_thumbnail_height (BG_SOURCE (bg_source));
}
g_object_set_data_full (G_OBJECT (stream), "item", g_object_ref (item), g_object_unref);
gdk_pixbuf_new_from_stream_at_scale_async (G_INPUT_STREAM (stream),
thumbnail_width, thumbnail_height,
TRUE,
bg_source->cancellable,
picture_scaled, bg_source);
}
static void
picture_copied_for_read (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
BgPicturesSource *bg_source;
CcBackgroundItem *item;
g_autoptr(GError) error = NULL;
GFile *thumbnail_file = G_FILE (source_object);
GFile *native_file;
if (!g_file_copy_finish (thumbnail_file, res, &error))
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
{
g_autofree gchar *uri = NULL;
uri = g_file_get_uri (thumbnail_file);
g_warning ("Failed to download '%s': %s", uri, error->message);
return;
}
}
bg_source = BG_PICTURES_SOURCE (user_data);
native_file = g_object_get_data (G_OBJECT (thumbnail_file), "native-file");
item = g_object_get_data (G_OBJECT (thumbnail_file), "item");
g_object_set_data_full (G_OBJECT (native_file), "item", g_object_ref (item), g_object_unref);
g_file_read_async (native_file,
G_PRIORITY_DEFAULT,
bg_source->cancellable,
picture_opened_for_read,
bg_source);
}
static gboolean
in_content_types (const char *content_type)
{
guint i;
for (i = 0; content_types[i]; i++)
if (g_str_equal (content_types[i], content_type))
return TRUE;
return FALSE;
}
static GFile *
bg_pictures_source_get_cache_file (void)
{
g_autofree gchar *path = NULL;
GFile *file;
path = bg_pictures_source_get_cache_path ();
file = g_file_new_for_path (path);
return file;
}
static gboolean
add_single_file (BgPicturesSource *bg_source,
GFile *file,
const gchar *content_type,
guint64 mtime)
{
g_autoptr(CcBackgroundItem) item = NULL;
CcBackgroundItemFlags flags = 0;
g_autofree gchar *source_uri = NULL;
g_autofree gchar *uri = NULL;
gboolean needs_download;
gboolean retval = FALSE;
const gchar *pictures_path;
g_autoptr(GFile) pictures_dir = NULL;
g_autoptr(GFile) cache_dir = NULL;
GrlMedia *media;
/* find png and jpeg files */
if (!content_type)
goto out;
if (!in_content_types (content_type))
goto out;
/* create a new CcBackgroundItem */
uri = g_file_get_uri (file);
pictures_path = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
if (pictures_path == NULL)
pictures_path = g_get_home_dir ();
pictures_dir = g_file_new_for_path (pictures_path);
cache_dir = bg_pictures_source_get_cache_file ();
needs_download = !g_file_has_parent (file, pictures_dir) &&
!g_file_has_parent (file, cache_dir);
if (!needs_download)
{
source_uri = g_strdup (uri);
flags |= CC_BACKGROUND_ITEM_HAS_URI;
}
else
{
source_uri = g_steal_pointer (&uri);
}
item = cc_background_item_new (uri);
flags |= CC_BACKGROUND_ITEM_HAS_SHADING | CC_BACKGROUND_ITEM_HAS_PLACEMENT;
g_object_set (G_OBJECT (item),
"flags", flags,
"shading", G_DESKTOP_BACKGROUND_SHADING_SOLID,
"placement", G_DESKTOP_BACKGROUND_STYLE_ZOOM,
"modified", mtime,
"needs-download", needs_download,
"source-url", source_uri,
NULL);
media = g_object_get_data (G_OBJECT (file), "grl-media");
if (media == NULL)
{
g_object_set_data_full (G_OBJECT (file), "item", g_object_ref (item), g_object_unref);
g_file_read_async (file, G_PRIORITY_DEFAULT,
bg_source->cancellable,
picture_opened_for_read, bg_source);
}
else
{
g_autoptr(GFile) native_file = NULL;
g_autoptr(GFile) thumbnail_file = NULL;
g_autofree gchar *native_dir = NULL;
g_autofree gchar *native_path = NULL;
const gchar *title;
const gchar *thumbnail_uri;
title = grl_media_get_title (media);
g_object_set (G_OBJECT (item), "name", title, NULL);
thumbnail_uri = grl_media_get_thumbnail (media);
thumbnail_file = g_file_new_for_uri (thumbnail_uri);
native_path = gnome_desktop_thumbnail_path_for_uri (source_uri, GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
native_file = g_file_new_for_path (native_path);
native_dir = g_path_get_dirname (native_path);
g_mkdir_with_parents (native_dir, USER_DIR_MODE);
g_object_set_data_full (G_OBJECT (thumbnail_file), "item", g_object_ref (item), g_object_unref);
g_object_set_data_full (G_OBJECT (thumbnail_file),
"native-file",
g_object_ref (native_file),
g_object_unref);
g_file_copy_async (thumbnail_file,
native_file,
G_FILE_COPY_ALL_METADATA,
G_PRIORITY_DEFAULT,
bg_source->cancellable,
NULL,
NULL,
picture_copied_for_read,
bg_source);
}
retval = TRUE;
out:
return retval;
}
static gboolean
add_single_file_from_info (BgPicturesSource *bg_source,
GFile *file,
GFileInfo *info)
{
const gchar *content_type;
guint64 mtime;
content_type = g_file_info_get_content_type (info);
mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
return add_single_file (bg_source, file, content_type, mtime);
}
static gboolean
add_single_file_from_media (BgPicturesSource *bg_source,
GFile *file,
GrlMedia *media)
{
GDateTime *mtime;
const gchar *content_type;
gint64 mtime_unix;
content_type = grl_media_get_mime (media);
/* only GRL_METADATA_KEY_CREATION_DATE is implemented in the Flickr
* plugin, GRL_METADATA_KEY_MODIFICATION_DATE is not
*/
mtime = grl_media_get_creation_date (media);
if (!mtime)
mtime = grl_media_get_modification_date (media);
if (mtime)
mtime_unix = g_date_time_to_unix (mtime);
else
mtime_unix = g_get_real_time () / G_USEC_PER_SEC;
return add_single_file (bg_source, file, content_type, (guint64) mtime_unix);
}
gboolean
bg_pictures_source_add (BgPicturesSource *bg_source,
const char *uri,
GtkTreeRowReference **ret_row_ref)
{
g_autoptr(GFile) file = NULL;
GFileInfo *info;
gboolean retval;
file = g_file_new_for_uri (uri);
info = g_file_query_info (file, ATTRIBUTES, G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (info == NULL)
return FALSE;
retval = add_single_file_from_info (bg_source, file, info);
return retval;
}
gboolean
bg_pictures_source_remove (BgPicturesSource *bg_source,
const char *uri)
{
GListStore *store;
gboolean retval;
guint i;
retval = FALSE;
store = bg_source_get_liststore (BG_SOURCE (bg_source));
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (store)); i++)
{
g_autoptr(CcBackgroundItem) tmp_item = NULL;
const char *tmp_uri;
tmp_item = g_list_model_get_item (G_LIST_MODEL (store), i);
tmp_uri = cc_background_item_get_uri (tmp_item);
if (g_str_equal (tmp_uri, uri))
{
char *uuid;
uuid = bg_pictures_source_get_unique_filename (uri);
g_hash_table_insert (bg_source->known_items,
uuid, NULL);
g_list_store_remove (store, i);
retval = TRUE;
break;
}
}
return retval;
}
static int
file_sort_func (gconstpointer a,
gconstpointer b)
{
GFileInfo *file_a = G_FILE_INFO (a);
GFileInfo *file_b = G_FILE_INFO (b);
guint64 modified_a, modified_b;
modified_a = g_file_info_get_attribute_uint64 (file_a, G_FILE_ATTRIBUTE_TIME_MODIFIED);
modified_b = g_file_info_get_attribute_uint64 (file_b, G_FILE_ATTRIBUTE_TIME_MODIFIED);
return modified_b - modified_a;
}
static void
file_info_async_ready (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
BgPicturesSource *bg_source;
GList *files, *l;
g_autoptr(GError) err = NULL;
GFile *parent;
files = g_file_enumerator_next_files_finish (G_FILE_ENUMERATOR (source),
res,
&err);
if (err)
{
if (!g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Could not get pictures file information: %s", err->message);
g_list_foreach (files, (GFunc) g_object_unref, NULL);
g_list_free (files);
return;
}
bg_source = BG_PICTURES_SOURCE (user_data);
parent = g_file_enumerator_get_container (G_FILE_ENUMERATOR (source));
files = g_list_sort (files, file_sort_func);
/* iterate over the available files */
for (l = files; l; l = g_list_next (l))
{
GFileInfo *info = l->data;
g_autoptr(GFile) file = NULL;
file = g_file_get_child (parent, g_file_info_get_name (info));
add_single_file_from_info (bg_source, file, info);
}
g_list_foreach (files, (GFunc) g_object_unref, NULL);
g_list_free (files);
}
static void
dir_enum_async_ready (GObject *s,
GAsyncResult *res,
gpointer user_data)
{
BgPicturesSource *source = (BgPicturesSource *) user_data;
g_autoptr(GFileEnumerator) enumerator = NULL;
g_autoptr(GError) err = NULL;
enumerator = g_file_enumerate_children_finish (G_FILE (s), res, &err);
if (err)
{
if (!g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Could not fill pictures source: %s", err->message);
return;
}
/* get the files */
g_file_enumerator_next_files_async (enumerator,
G_MAXINT,
G_PRIORITY_LOW,
source->cancellable,
file_info_async_ready,
user_data);
}
char *
bg_pictures_source_get_cache_path (void)
{
return g_build_filename (g_get_user_cache_dir (),
"gnome-control-center",
"backgrounds",
NULL);
}
static char *
bg_pictures_source_get_unique_filename (const char *uri)
{
g_autoptr(GChecksum) csum = NULL;
char *ret;
csum = g_checksum_new (G_CHECKSUM_SHA256);
g_checksum_update (csum, (guchar *) uri, -1);
ret = g_strdup (g_checksum_get_string (csum));
return ret;
}
char *
bg_pictures_source_get_unique_path (const char *uri)
{
g_autoptr(GFile) parent = NULL;
g_autoptr(GFile) file = NULL;
g_autofree gchar *cache_path = NULL;
g_autofree gchar *filename = NULL;
cache_path = bg_pictures_source_get_cache_path ();
parent = g_file_new_for_path (cache_path);
filename = bg_pictures_source_get_unique_filename (uri);
file = g_file_get_child (parent, filename);
return g_file_get_path (file);
}
gboolean
bg_pictures_source_is_known (BgPicturesSource *bg_source,
const char *uri)
{
g_autofree gchar *uuid = NULL;
uuid = bg_pictures_source_get_unique_filename (uri);
return GPOINTER_TO_INT (g_hash_table_lookup (bg_source->known_items, uuid));
}
static void
file_info_ready (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
GFileInfo *info;
GError *error = NULL;
GFile *file = G_FILE (object);
info = g_file_query_info_finish (file, res, &error);
if (!info)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Problem looking up file info: %s", error->message);
g_clear_error (&error);
return;
}
add_single_file_from_info (BG_PICTURES_SOURCE (user_data), file, info);
}
static void
file_added (GFile *file,
BgPicturesSource *self)
{
g_autofree gchar *uri = NULL;
uri = g_file_get_uri (file);
if (!bg_pictures_source_is_known (self, uri))
{
g_file_query_info_async (file,
ATTRIBUTES,
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_LOW,
NULL,
file_info_ready,
self);
}
}
static void
files_changed_cb (BgPicturesSource *self,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type)
{
g_autofree gchar *uri = NULL;
switch (event_type)
{
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
file_added (file, self);
break;
case G_FILE_MONITOR_EVENT_DELETED:
uri = g_file_get_uri (file);
bg_pictures_source_remove (self, uri);
break;
default:
return;
}
}
static GFileMonitor *
monitor_path (BgPicturesSource *self,
const char *path)
{
GFileMonitor *monitor;
g_autoptr(GFile) dir = NULL;
g_mkdir_with_parents (path, USER_DIR_MODE);
dir = g_file_new_for_path (path);
g_file_enumerate_children_async (dir,
ATTRIBUTES,
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_LOW, self->cancellable,
dir_enum_async_ready, self);
monitor = g_file_monitor_directory (dir,
G_FILE_MONITOR_NONE,
self->cancellable,
NULL);
if (monitor)
g_signal_connect_object (monitor,
"changed",
G_CALLBACK (files_changed_cb),
self, G_CONNECT_SWAPPED);
return monitor;
}
static void
media_found_cb (BgPicturesSource *self, GrlMedia *media)
{
g_autoptr(GFile) file = NULL;
const gchar *uri;
uri = grl_media_get_url (media);
file = g_file_new_for_uri (uri);
g_object_set_data_full (G_OBJECT (file), "grl-media", g_object_ref (media), g_object_unref);
add_single_file_from_media (self, file, media);
}
static void
bg_pictures_source_init (BgPicturesSource *self)
{
const gchar *pictures_path;
g_autofree gchar *cache_path = NULL;
self->cancellable = g_cancellable_new ();
self->known_items = g_hash_table_new_full (g_str_hash,
g_str_equal,
(GDestroyNotify) g_free,
NULL);
pictures_path = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
if (pictures_path == NULL)
pictures_path = g_get_home_dir ();
self->picture_dir_monitor = monitor_path (self, pictures_path);
cache_path = bg_pictures_source_get_cache_path ();
self->cache_dir_monitor = monitor_path (self, cache_path);
self->grl_miner = cc_background_grilo_miner_new ();
g_signal_connect_object (self->grl_miner, "media-found", G_CALLBACK (media_found_cb), self, G_CONNECT_SWAPPED);
cc_background_grilo_miner_start (self->grl_miner);
}
BgPicturesSource *
bg_pictures_source_new (GtkWidget *widget)
{
return g_object_new (BG_TYPE_PICTURES_SOURCE, "widget", widget, NULL);
}
const char * const *
bg_pictures_get_support_content_types (void)
{
return content_types;
}

View File

@@ -1,46 +0,0 @@
/* bg-pictures-source.h */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#pragma once
#include <gtk/gtk.h>
#include "bg-source.h"
#include "cc-background-item.h"
G_BEGIN_DECLS
#define BG_TYPE_PICTURES_SOURCE (bg_pictures_source_get_type ())
G_DECLARE_FINAL_TYPE (BgPicturesSource, bg_pictures_source, BG, PICTURES_SOURCE, BgSource)
BgPicturesSource *bg_pictures_source_new (GtkWidget *widget);
char *bg_pictures_source_get_cache_path (void);
char *bg_pictures_source_get_unique_path(const char *uri);
gboolean bg_pictures_source_add (BgPicturesSource *bg_source,
const char *uri,
GtkTreeRowReference **ret_row_ref);
gboolean bg_pictures_source_remove (BgPicturesSource *bg_source,
const char *uri);
gboolean bg_pictures_source_is_known (BgPicturesSource *bg_source,
const char *uri);
const char * const * bg_pictures_get_support_content_types (void);
G_END_DECLS

View File

@@ -1,470 +0,0 @@
/* bg-recent-source.c
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "bg-recent-source"
#include "bg-recent-source.h"
#include "cc-background-item.h"
#define ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_NAME "," \
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," \
G_FILE_ATTRIBUTE_TIME_MODIFIED
struct _BgRecentSource
{
BgSource parent;
GFile *backgrounds_folder;
GFileMonitor *monitor;
GCancellable *cancellable;
GHashTable *items;
};
G_DEFINE_TYPE (BgRecentSource, bg_recent_source, BG_TYPE_SOURCE)
static const gchar * const content_types[] = {
"image/png",
"image/jp2",
"image/jpeg",
"image/bmp",
"image/svg+xml",
"image/x-portable-anymap",
NULL
};
static int
sort_func (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
CcBackgroundItem *item_a;
CcBackgroundItem *item_b;
guint64 modified_a;
guint64 modified_b;
int retval;
item_a = (CcBackgroundItem *) a;
item_b = (CcBackgroundItem *) b;
modified_a = cc_background_item_get_modified (item_a);
modified_b = cc_background_item_get_modified (item_b);
retval = modified_b - modified_a;
return retval;
}
static void
add_file_from_info (BgRecentSource *self,
GFile *file,
GFileInfo *info)
{
g_autoptr(CcBackgroundItem) item = NULL;
CcBackgroundItemFlags flags = 0;
g_autofree gchar *source_uri = NULL;
g_autofree gchar *uri = NULL;
GListStore *store;
const gchar *content_type;
guint64 mtime;
content_type = g_file_info_get_content_type (info);
mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
if (!content_type || !g_strv_contains (content_types, content_type))
return;
uri = g_file_get_uri (file);
item = cc_background_item_new (uri);
flags |= CC_BACKGROUND_ITEM_HAS_SHADING | CC_BACKGROUND_ITEM_HAS_PLACEMENT;
g_object_set (G_OBJECT (item),
"flags", flags,
"shading", G_DESKTOP_BACKGROUND_SHADING_SOLID,
"placement", G_DESKTOP_BACKGROUND_STYLE_ZOOM,
"modified", mtime,
"needs-download", FALSE,
"source-url", source_uri,
NULL);
store = bg_source_get_liststore (BG_SOURCE (self));
g_list_store_insert_sorted (store, item, sort_func, self);
g_hash_table_insert (self->items, g_strdup (uri), g_object_ref (item));
}
static void
remove_item (BgRecentSource *self,
CcBackgroundItem *item)
{
GListStore *store;
const gchar *uri;
guint i;
g_return_if_fail (BG_IS_RECENT_SOURCE (self));
g_return_if_fail (CC_IS_BACKGROUND_ITEM (item));
uri = cc_background_item_get_uri (item);
store = bg_source_get_liststore (BG_SOURCE (self));
g_debug ("Removing wallpaper %s", uri);
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (store)); i++)
{
g_autoptr(CcBackgroundItem) tmp = NULL;
tmp = g_list_model_get_item (G_LIST_MODEL (store), i);
if (tmp == item)
{
g_list_store_remove (store, i);
break;
}
}
g_hash_table_remove (self->items, cc_background_item_get_uri (item));
}
static void
query_info_finished_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
BgRecentSource *self;
g_autoptr(GFileInfo) file_info = NULL;
g_autoptr(GError) error = NULL;
GFile *file = NULL;
file = G_FILE (source);
file_info = g_file_query_info_finish (file, result, &error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Could not get pictures file information: %s", error->message);
return;
}
self = BG_RECENT_SOURCE (user_data);
g_debug ("Adding wallpaper %s (%d)",
g_file_info_get_name (file_info),
G_IS_FILE (self->backgrounds_folder));
add_file_from_info (self, file, file_info);
}
static void
on_file_changed_cb (BgRecentSource *self,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type)
{
g_autofree gchar *uri = NULL;
switch (event_type)
{
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
g_file_query_info_async (file,
ATTRIBUTES,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
G_PRIORITY_DEFAULT,
self->cancellable,
query_info_finished_cb,
self);
break;
case G_FILE_MONITOR_EVENT_DELETED:
uri = g_file_get_uri (file);
remove_item (self, g_hash_table_lookup (self->items, uri));
break;
default:
return;
}
}
static int
file_sort_func (gconstpointer a,
gconstpointer b)
{
GFileInfo *file_a = G_FILE_INFO (a);
GFileInfo *file_b = G_FILE_INFO (b);
guint64 modified_a, modified_b;
modified_a = g_file_info_get_attribute_uint64 (file_a, G_FILE_ATTRIBUTE_TIME_MODIFIED);
modified_b = g_file_info_get_attribute_uint64 (file_b, G_FILE_ATTRIBUTE_TIME_MODIFIED);
return modified_b - modified_a;
}
static void
file_info_async_ready_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
BgRecentSource *self;
g_autolist(GFileInfo) file_infos = NULL;
g_autoptr(GError) error = NULL;
GFile *parent = NULL;
GList *l;
file_infos = g_file_enumerator_next_files_finish (G_FILE_ENUMERATOR (source),
result,
&error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Could not get pictures file information: %s", error->message);
return;
}
self = BG_RECENT_SOURCE (user_data);
parent = g_file_enumerator_get_container (G_FILE_ENUMERATOR (source));
file_infos = g_list_sort (file_infos, file_sort_func);
for (l = file_infos; l; l = l->next)
{
g_autoptr(GFile) file = NULL;
GFileInfo *info;
info = l->data;
file = g_file_get_child (parent, g_file_info_get_name (info));
g_debug ("Found recent wallpaper %s", g_file_info_get_name (info));
add_file_from_info (self, file, info);
}
g_file_enumerator_close (G_FILE_ENUMERATOR (source), self->cancellable, &error);
if (error)
g_warning ("Error closing file enumerator: %s", error->message);
}
static void
enumerate_children_finished_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
BgRecentSource *self;
g_autoptr(GFileEnumerator) enumerator = NULL;
g_autoptr(GError) error = NULL;
enumerator = g_file_enumerate_children_finish (G_FILE (source), result, &error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Could not fill pictures source: %s", error->message);
return;
}
self = BG_RECENT_SOURCE (user_data);
g_file_enumerator_next_files_async (enumerator,
G_MAXINT,
G_PRIORITY_DEFAULT,
self->cancellable,
file_info_async_ready_cb,
self);
}
static void
load_backgrounds (BgRecentSource *self)
{
g_autofree gchar *backgrounds_path = NULL;
g_autoptr(GError) error = NULL;
if (!g_file_make_directory_with_parents (self->backgrounds_folder, self->cancellable, &error) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
{
g_critical ("Failed to create local background directory: %s", error->message);
return;
}
backgrounds_path = g_file_get_path (self->backgrounds_folder);
g_debug ("Enumerating wallpapers under %s", backgrounds_path);
g_file_enumerate_children_async (self->backgrounds_folder,
ATTRIBUTES,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
G_PRIORITY_DEFAULT,
self->cancellable,
enumerate_children_finished_cb,
self);
self->monitor = g_file_monitor_directory (self->backgrounds_folder,
G_FILE_MONITOR_WATCH_MOVES,
self->cancellable,
&error);
if (!self->monitor)
{
g_critical ("Failed to monitor background directory: %s", error->message);
return;
}
g_signal_connect_object (self->monitor, "changed", G_CALLBACK (on_file_changed_cb), self, G_CONNECT_SWAPPED);
}
/* Callbacks */
static void
on_file_copied_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
g_autoptr(BgRecentSource) self = BG_RECENT_SOURCE (user_data);
g_autofree gchar *original_file = NULL;
g_autoptr(GError) error = NULL;
g_file_copy_finish (G_FILE (source), result, &error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_critical ("Failed to copy file: %s", error->message);
return;
}
original_file = g_file_get_path (G_FILE (source));
g_debug ("Successfully copied wallpaper: %s", original_file);
}
static void
on_file_deleted_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
g_autoptr(BgRecentSource) self = BG_RECENT_SOURCE (user_data);
g_autofree gchar *original_file = NULL;
g_autoptr(GError) error = NULL;
g_file_delete_finish (G_FILE (source), result, &error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_critical ("Failed to delete wallpaper: %s", error->message);
return;
}
original_file = g_file_get_path (G_FILE (source));
g_debug ("Successfully deleted wallpaper: %s", original_file);
}
/* GObject overrides */
static void
bg_recent_source_finalize (GObject *object)
{
BgRecentSource *self = (BgRecentSource *)object;
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
g_clear_object (&self->monitor);
G_OBJECT_CLASS (bg_recent_source_parent_class)->finalize (object);
}
static void
bg_recent_source_class_init (BgRecentSourceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = bg_recent_source_finalize;
}
static void
bg_recent_source_init (BgRecentSource *self)
{
g_autofree gchar *backgrounds_path = NULL;
backgrounds_path = g_build_filename (g_get_user_data_dir (), "backgrounds", NULL);
self->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
self->cancellable = g_cancellable_new ();
self->backgrounds_folder = g_file_new_for_path (backgrounds_path);
load_backgrounds (self);
}
BgRecentSource*
bg_recent_source_new (GtkWidget *widget)
{
return g_object_new (BG_TYPE_RECENT_SOURCE,
"widget", widget,
NULL);
}
void
bg_recent_source_add_file (BgRecentSource *self,
const gchar *path)
{
g_autoptr(GDateTime) now = NULL;
g_autofree gchar *destination_name = NULL;
g_autofree gchar *formatted_now = NULL;
g_autofree gchar *basename = NULL;
g_autoptr(GFile) destination = NULL;
g_autoptr(GFile) file = NULL;
g_return_if_fail (BG_IS_RECENT_SOURCE (self));
g_return_if_fail (path && *path);
g_debug ("Importing wallpaper %s", path);
now = g_date_time_new_now_local ();
formatted_now = g_date_time_format (now, "%Y-%m-%d-%H-%M-%S");
file = g_file_new_for_path (path);
basename = g_file_get_basename (file);
destination_name = g_strdup_printf ("%s-%s", formatted_now, basename);
destination = g_file_get_child (self->backgrounds_folder, destination_name);
g_file_copy_async (file,
destination,
G_FILE_COPY_NONE,
G_PRIORITY_DEFAULT,
self->cancellable,
NULL, NULL,
on_file_copied_cb,
g_object_ref (self));
}
void
bg_recent_source_remove_item (BgRecentSource *self,
CcBackgroundItem *item)
{
g_autoptr(GFile) file = NULL;
const gchar *uri;
g_return_if_fail (BG_IS_RECENT_SOURCE (self));
g_return_if_fail (CC_IS_BACKGROUND_ITEM (item));
uri = cc_background_item_get_uri (item);
file = g_file_new_for_uri (uri);
g_file_delete_async (file,
G_PRIORITY_DEFAULT,
self->cancellable,
on_file_deleted_cb,
g_object_ref (self));
}

View File

@@ -1,39 +0,0 @@
/* bg-recent-source.h
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include "bg-source.h"
#include "cc-background-item.h"
G_BEGIN_DECLS
#define BG_TYPE_RECENT_SOURCE (bg_recent_source_get_type())
G_DECLARE_FINAL_TYPE (BgRecentSource, bg_recent_source, BG, RECENT_SOURCE, BgSource)
BgRecentSource* bg_recent_source_new (GtkWidget *widget);
void bg_recent_source_add_file (BgRecentSource *self,
const gchar *path);
void bg_recent_source_remove_item (BgRecentSource *self,
CcBackgroundItem *item);
G_END_DECLS

View File

@@ -1,213 +0,0 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include "bg-source.h"
#include "cc-background-item.h"
#include <cairo-gobject.h>
#define THUMBNAIL_WIDTH 154
#define THUMBNAIL_HEIGHT (THUMBNAIL_WIDTH * 3 / 4)
typedef struct
{
GnomeDesktopThumbnailFactory *thumbnail_factory;
GListStore *store;
GtkWidget *widget;
gint thumbnail_height;
gint thumbnail_width;
} BgSourcePrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (BgSource, bg_source, G_TYPE_OBJECT)
enum
{
PROP_LISTSTORE = 1,
PROP_WIDGET
};
static void
bg_source_calculate_thumbnail_dimensions (BgSource *source)
{
BgSourcePrivate *priv = bg_source_get_instance_private (source);
gint scale_factor;
priv->thumbnail_height = THUMBNAIL_HEIGHT;
priv->thumbnail_width = THUMBNAIL_WIDTH;
if (priv->widget == NULL)
return;
scale_factor = gtk_widget_get_scale_factor (priv->widget);
if (scale_factor > 1)
{
priv->thumbnail_height *= scale_factor;
priv->thumbnail_width *= scale_factor;
}
}
static void
bg_source_constructed (GObject *object)
{
G_OBJECT_CLASS (bg_source_parent_class)->constructed (object);
bg_source_calculate_thumbnail_dimensions (BG_SOURCE (object));
}
static void
bg_source_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
BgSource *source = BG_SOURCE (object);
switch (property_id)
{
case PROP_LISTSTORE:
g_value_set_object (value, bg_source_get_liststore (source));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
bg_source_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
BgSource *source = BG_SOURCE (object);
BgSourcePrivate *priv = bg_source_get_instance_private (source);
switch (property_id)
{
case PROP_WIDGET:
priv->widget = GTK_WIDGET (g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
bg_source_dispose (GObject *object)
{
BgSource *source = BG_SOURCE (object);
BgSourcePrivate *priv = bg_source_get_instance_private (source);
g_clear_object (&priv->thumbnail_factory);
g_clear_object (&priv->store);
G_OBJECT_CLASS (bg_source_parent_class)->dispose (object);
}
static void
bg_source_class_init (BgSourceClass *klass)
{
GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = bg_source_constructed;
object_class->get_property = bg_source_get_property;
object_class->set_property = bg_source_set_property;
object_class->dispose = bg_source_dispose;
pspec = g_param_spec_object ("liststore",
"Liststore",
"Liststore used in the source",
G_TYPE_LIST_STORE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_LISTSTORE, pspec);
pspec = g_param_spec_object ("widget",
"Widget",
"Widget used to view the source",
GTK_TYPE_WIDGET,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_WIDGET, pspec);
}
static void
bg_source_init (BgSource *self)
{
BgSourcePrivate *priv = bg_source_get_instance_private (self);
priv->store = g_list_store_new (CC_TYPE_BACKGROUND_ITEM);
priv->thumbnail_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
}
GListStore*
bg_source_get_liststore (BgSource *source)
{
BgSourcePrivate *priv;
g_return_val_if_fail (BG_IS_SOURCE (source), NULL);
priv = bg_source_get_instance_private (source);
return priv->store;
}
gint
bg_source_get_scale_factor (BgSource *source)
{
BgSourcePrivate *priv;
g_return_val_if_fail (BG_IS_SOURCE (source), 1);
priv = bg_source_get_instance_private (source);
return gtk_widget_get_scale_factor (priv->widget);
}
gint
bg_source_get_thumbnail_height (BgSource *source)
{
BgSourcePrivate *priv;
g_return_val_if_fail (BG_IS_SOURCE (source), THUMBNAIL_HEIGHT);
priv = bg_source_get_instance_private (source);
return priv->thumbnail_height;
}
gint
bg_source_get_thumbnail_width (BgSource *source)
{
BgSourcePrivate *priv;
g_return_val_if_fail (BG_IS_SOURCE (source), THUMBNAIL_WIDTH);
priv = bg_source_get_instance_private (source);
return priv->thumbnail_width;
}
GnomeDesktopThumbnailFactory*
bg_source_get_thumbnail_factory (BgSource *source)
{
BgSourcePrivate *priv;
g_return_val_if_fail (BG_IS_SOURCE (source), NULL);
priv = bg_source_get_instance_private (source);
return priv->thumbnail_factory;
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#pragma once
#include <gtk/gtk.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
G_BEGIN_DECLS
#define BG_TYPE_SOURCE (bg_source_get_type ())
G_DECLARE_DERIVABLE_TYPE (BgSource, bg_source, BG, SOURCE, GObject)
struct _BgSourceClass
{
GObjectClass parent_class;
};
GListStore* bg_source_get_liststore (BgSource *source);
gint bg_source_get_scale_factor (BgSource *source);
gint bg_source_get_thumbnail_height (BgSource *source);
gint bg_source_get_thumbnail_width (BgSource *source);
GnomeDesktopThumbnailFactory* bg_source_get_thumbnail_factory (BgSource *source);
G_END_DECLS

View File

@@ -1,138 +0,0 @@
/* bg-wallpapers-source.c */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include "bg-wallpapers-source.h"
#include "cc-background-item.h"
#include "cc-background-xml.h"
#include <cairo-gobject.h>
#include <gio/gio.h>
struct _BgWallpapersSource
{
BgSource parent_instance;
CcBackgroundXml *xml;
};
G_DEFINE_TYPE (BgWallpapersSource, bg_wallpapers_source, BG_TYPE_SOURCE)
static void
load_wallpapers (gchar *key,
CcBackgroundItem *item,
BgWallpapersSource *source)
{
GListStore *store = bg_source_get_liststore (BG_SOURCE (source));
gboolean deleted;
g_object_get (G_OBJECT (item), "is-deleted", &deleted, NULL);
if (deleted)
return;
g_list_store_append (store, item);
}
static void
list_load_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
if (!cc_background_xml_load_list_finish (CC_BACKGROUND_XML (source_object), res, &error))
g_warning ("Failed to load background list: %s", error->message);
}
static void
item_added (BgWallpapersSource *self,
CcBackgroundItem *item)
{
load_wallpapers (NULL, item, self);
}
static void
load_default_bg (BgWallpapersSource *self)
{
const char * const *system_data_dirs;
guint i;
/* FIXME We could do this nicer if we had the XML source in GSettings */
system_data_dirs = g_get_system_data_dirs ();
for (i = 0; system_data_dirs[i]; i++) {
g_autofree gchar *filename = NULL;
filename = g_build_filename (system_data_dirs[i],
"gnome-background-properties",
"adwaita.xml",
NULL);
if (cc_background_xml_load_xml (self->xml, filename))
break;
}
}
static void
bg_wallpapers_source_constructed (GObject *object)
{
BgWallpapersSource *self = BG_WALLPAPERS_SOURCE (object);
G_OBJECT_CLASS (bg_wallpapers_source_parent_class)->constructed (object);
g_signal_connect_object (G_OBJECT (self->xml), "added",
G_CALLBACK (item_added), self, G_CONNECT_SWAPPED);
/* Try adding the default background first */
load_default_bg (self);
cc_background_xml_load_list_async (self->xml, NULL, list_load_cb, self);
}
static void
bg_wallpapers_source_dispose (GObject *object)
{
BgWallpapersSource *self = BG_WALLPAPERS_SOURCE (object);
g_clear_object (&self->xml);
G_OBJECT_CLASS (bg_wallpapers_source_parent_class)->dispose (object);
}
static void
bg_wallpapers_source_init (BgWallpapersSource *self)
{
self->xml = cc_background_xml_new ();
}
static void
bg_wallpapers_source_class_init (BgWallpapersSourceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = bg_wallpapers_source_constructed;
object_class->dispose = bg_wallpapers_source_dispose;
}
BgWallpapersSource *
bg_wallpapers_source_new (GtkWidget *widget)
{
return g_object_new (BG_TYPE_WALLPAPERS_SOURCE, "widget", widget, NULL);
}

View File

@@ -1,34 +0,0 @@
/* bg-wallpapers-source.h */
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#pragma once
#include <gtk/gtk.h>
#include "bg-source.h"
G_BEGIN_DECLS
#define BG_TYPE_WALLPAPERS_SOURCE (bg_wallpapers_source_get_type ())
G_DECLARE_FINAL_TYPE (BgWallpapersSource, bg_wallpapers_source, BG, WALLPAPERS_SOURCE, BgSource)
BgWallpapersSource *bg_wallpapers_source_new (GtkWidget *widget);
G_END_DECLS

View File

@@ -1,385 +0,0 @@
/* cc-background-chooser.c
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "cc-background-chooser"
#include <glib/gi18n.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "bg-colors-source.h"
#include "bg-pictures-source.h"
#include "bg-recent-source.h"
#include "bg-wallpapers-source.h"
#include "cc-background-chooser.h"
struct _CcBackgroundChooser
{
GtkBox parent;
GtkFlowBox *flowbox;
GtkWidget *recent_box;
GtkFlowBox *recent_flowbox;
gboolean recent_selected;
BgWallpapersSource *wallpapers_source;
BgRecentSource *recent_source;
};
G_DEFINE_TYPE (CcBackgroundChooser, cc_background_chooser, GTK_TYPE_BOX)
enum
{
BACKGROUND_CHOSEN,
N_SIGNALS,
};
static guint signals [N_SIGNALS];
static void
emit_background_chosen (CcBackgroundChooser *self)
{
g_autoptr(GList) list = NULL;
CcBackgroundItem *item;
GtkFlowBox *flowbox;
flowbox = self->recent_selected ? self->recent_flowbox : self->flowbox;
list = gtk_flow_box_get_selected_children (flowbox);
g_assert (g_list_length (list) == 1);
item = g_object_get_data (list->data, "item");
g_signal_emit (self, signals[BACKGROUND_CHOSEN], 0, item);
}
static void
on_delete_background_clicked_cb (GtkButton *button,
BgRecentSource *source)
{
GtkWidget *parent;
CcBackgroundItem *item;
parent = gtk_widget_get_parent (gtk_widget_get_parent (GTK_WIDGET (button)));
g_assert (GTK_IS_FLOW_BOX_CHILD (parent));
item = g_object_get_data (G_OBJECT (parent), "item");
bg_recent_source_remove_item (source, item);
}
static GtkWidget*
create_widget_func (gpointer model_item,
gpointer user_data)
{
g_autoptr(GdkPixbuf) pixbuf = NULL;
CcBackgroundItem *item;
GtkWidget *overlay;
GtkWidget *child;
GtkWidget *image;
GtkWidget *icon;
GtkWidget *button = NULL;
BgSource *source;
source = BG_SOURCE (user_data);
item = CC_BACKGROUND_ITEM (model_item);
pixbuf = cc_background_item_get_thumbnail (item,
bg_source_get_thumbnail_factory (source),
bg_source_get_thumbnail_width (source),
bg_source_get_thumbnail_height (source),
bg_source_get_scale_factor (source));
image = gtk_image_new_from_gicon (G_ICON (pixbuf), GTK_ICON_SIZE_DIALOG);
gtk_widget_show (image);
icon = gtk_image_new_from_icon_name("slideshow-emblem", GTK_ICON_SIZE_BUTTON);
gtk_image_set_pixel_size (GTK_IMAGE (icon), 16);
gtk_widget_set_margin_start (icon, 8);
gtk_widget_set_margin_end (icon, 8);
gtk_widget_set_margin_top (icon, 8);
gtk_widget_set_margin_bottom (icon, 8);
gtk_widget_set_halign (icon, GTK_ALIGN_END);
gtk_widget_set_valign (icon, GTK_ALIGN_END);
gtk_widget_set_visible (icon, cc_background_item_changes_with_time (item));
gtk_style_context_add_class (gtk_widget_get_style_context (icon), "slideshow-emblem");
if (BG_IS_RECENT_SOURCE (source))
{
button = gtk_button_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_widget_set_halign (button, GTK_ALIGN_END);
gtk_widget_set_valign (button, GTK_ALIGN_START);
gtk_widget_set_margin_start (icon, 6);
gtk_widget_set_margin_end (icon, 6);
gtk_widget_set_margin_top (icon, 6);
gtk_widget_set_margin_bottom (icon, 6);
gtk_widget_show (button);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "osd");
gtk_style_context_add_class (gtk_widget_get_style_context (button), "remove-button");
g_signal_connect (button,
"clicked",
G_CALLBACK (on_delete_background_clicked_cb),
source);
}
overlay = gtk_overlay_new ();
gtk_container_add (GTK_CONTAINER (overlay), image);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), icon);
if (button)
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), button);
gtk_widget_show (overlay);
child = gtk_flow_box_child_new();
gtk_widget_set_halign (child, GTK_ALIGN_CENTER);
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (child), overlay);
gtk_widget_show (child);
g_object_set_data_full (G_OBJECT (child), "item", g_object_ref (item), g_object_unref);
return child;
}
static void
update_recent_visibility (CcBackgroundChooser *self)
{
GListStore *store;
gboolean has_items;
store = bg_source_get_liststore (BG_SOURCE (self->recent_source));
has_items = g_list_model_get_n_items (G_LIST_MODEL (store)) != 0;
gtk_widget_set_visible (self->recent_box, has_items);
}
static void
setup_flowbox (CcBackgroundChooser *self)
{
GListStore *store;
store = bg_source_get_liststore (BG_SOURCE (self->wallpapers_source));
gtk_flow_box_bind_model (self->flowbox,
G_LIST_MODEL (store),
create_widget_func,
self->wallpapers_source,
NULL);
store = bg_source_get_liststore (BG_SOURCE (self->recent_source));
gtk_flow_box_bind_model (self->recent_flowbox,
G_LIST_MODEL (store),
create_widget_func,
self->recent_source,
NULL);
update_recent_visibility (self);
g_signal_connect_object (store,
"items-changed",
G_CALLBACK (update_recent_visibility),
self,
G_CONNECT_SWAPPED);
}
static void
on_item_activated_cb (GtkFlowBox *flowbox,
GtkFlowBoxChild *child,
CcBackgroundChooser *self)
{
self->recent_selected = flowbox == self->recent_flowbox;
if (self->recent_selected)
gtk_flow_box_unselect_all (self->flowbox);
else
gtk_flow_box_unselect_all (self->recent_flowbox);
emit_background_chosen (self);
}
static void
on_file_chooser_response_cb (GtkDialog *filechooser,
gint response,
CcBackgroundChooser *self)
{
if (response == GTK_RESPONSE_ACCEPT)
{
g_autoptr(GSList) filenames = NULL;
GSList *l;
filenames = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (filechooser));
for (l = filenames; l != NULL; l = l->next)
{
g_autofree gchar *filename = l->data;
bg_recent_source_add_file (self->recent_source, filename);
}
}
gtk_widget_destroy (GTK_WIDGET (filechooser));
}
static void
on_file_chooser_selection_changed_cb (GtkFileChooser *chooser,
GnomeDesktopThumbnailFactory *thumbnail_factory)
{
g_autofree gchar *uri = NULL;
uri = gtk_file_chooser_get_uri (chooser);
if (uri)
{
g_autoptr(GFileInfo) file_info = NULL;
g_autoptr(GdkPixbuf) pixbuf = NULL;
g_autofree gchar *mime_type = NULL;
g_autoptr(GFile) file = NULL;
GtkWidget *preview;
preview = gtk_file_chooser_get_preview_widget (chooser);
file = g_file_new_for_uri (uri);
file_info = g_file_query_info (file,
"standard::*",
G_FILE_QUERY_INFO_NONE,
NULL,
NULL);
if (file_info && g_file_info_get_file_type (file_info) != G_FILE_TYPE_DIRECTORY)
mime_type = g_strdup (g_file_info_get_content_type (file_info));
if (mime_type)
{
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (thumbnail_factory,
uri,
mime_type);
}
gtk_dialog_set_response_sensitive (GTK_DIALOG (chooser),
GTK_RESPONSE_ACCEPT,
pixbuf != NULL);
if (pixbuf)
gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
else
gtk_image_set_from_icon_name (GTK_IMAGE (preview), "dialog-question", GTK_ICON_SIZE_DIALOG);
}
gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
}
/* GObject overrides */
static void
cc_background_chooser_finalize (GObject *object)
{
CcBackgroundChooser *self = (CcBackgroundChooser *)object;
g_clear_object (&self->recent_source);
g_clear_object (&self->wallpapers_source);
G_OBJECT_CLASS (cc_background_chooser_parent_class)->finalize (object);
}
static void
cc_background_chooser_class_init (CcBackgroundChooserClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = cc_background_chooser_finalize;
signals[BACKGROUND_CHOSEN] = g_signal_new ("background-chosen",
CC_TYPE_BACKGROUND_CHOOSER,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
1,
CC_TYPE_BACKGROUND_ITEM);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/background/cc-background-chooser.ui");
gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, flowbox);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, recent_box);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundChooser, recent_flowbox);
gtk_widget_class_bind_template_callback (widget_class, on_item_activated_cb);
}
static void
cc_background_chooser_init (CcBackgroundChooser *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
self->recent_source = bg_recent_source_new (GTK_WIDGET (self));
self->wallpapers_source = bg_wallpapers_source_new (GTK_WIDGET (self));
setup_flowbox (self);
}
void
cc_background_chooser_select_file (CcBackgroundChooser *self)
{
g_autoptr(GnomeDesktopThumbnailFactory) factory = NULL;
GtkFileFilter *filter;
GtkWidget *filechooser;
GtkWindow *toplevel;
GtkWidget *preview;
g_return_if_fail (CC_IS_BACKGROUND_CHOOSER (self));
toplevel = (GtkWindow*) gtk_widget_get_toplevel (GTK_WIDGET (self));
filechooser = gtk_file_chooser_dialog_new (_("Select a picture"),
toplevel,
GTK_FILE_CHOOSER_ACTION_OPEN,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_modal (GTK_WINDOW (filechooser), TRUE);
preview = gtk_image_new ();
gtk_widget_set_size_request (preview, 154, -1);
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (filechooser), preview);
gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (filechooser), FALSE);
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (filechooser), TRUE);
gtk_widget_show (preview);
factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
g_signal_connect_after (filechooser,
"selection-changed",
G_CALLBACK (on_file_chooser_selection_changed_cb),
factory);
g_object_set_data_full (G_OBJECT (filechooser),
"factory",
g_object_ref (factory),
g_object_unref);
filter = gtk_file_filter_new ();
gtk_file_filter_add_pixbuf_formats (filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (filechooser), filter);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filechooser),
g_get_user_special_dir (G_USER_DIRECTORY_PICTURES));
g_signal_connect_object (filechooser,
"response",
G_CALLBACK (on_file_chooser_response_cb),
self,
0);
gtk_window_present (GTK_WINDOW (filechooser));
}

View File

@@ -1,32 +0,0 @@
/* cc-background-chooser.h
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_CHOOSER (cc_background_chooser_get_type())
G_DECLARE_FINAL_TYPE (CcBackgroundChooser, cc_background_chooser, CC, BACKGROUND_CHOOSER, GtkBox)
void cc_background_chooser_select_file (CcBackgroundChooser *self);
G_END_DECLS

View File

@@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcBackgroundChooser" parent="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
<property name="shadow-type">none</property>
<property name="hscrollbar-policy">never</property>
<property name="vscrollbar-policy">automatic</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="expand">True</property>
<style>
<class name="view" />
</style>
<!-- Recent -->
<child>
<object class="GtkBox" id="recent_box">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<property name="halign">center</property>
<child>
<object class="GtkFlowBox" id="recent_flowbox">
<property name="visible">True</property>
<property name="margin">12</property>
<property name="column-spacing">12</property>
<property name="row-spacing">12</property>
<property name="homogeneous">True</property>
<property name="halign">center</property>
<property name="min-children-per-line">1</property>
<property name="max-children-per-line">8</property>
<property name="activate-on-single-click">True</property>
<property name="selection-mode">single</property>
<signal name="child-activated" handler="on_item_activated_cb" object="CcBackgroundChooser" swapped="no" />
</object>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFlowBox" id="flowbox">
<property name="visible">True</property>
<property name="margin">12</property>
<property name="column-spacing">12</property>
<property name="row-spacing">12</property>
<property name="homogeneous">True</property>
<property name="halign">center</property>
<property name="min-children-per-line">1</property>
<property name="max-children-per-line">8</property>
<property name="activate-on-single-click">True</property>
<property name="selection-mode">single</property>
<signal name="child-activated" handler="on_item_activated_cb" object="CcBackgroundChooser" swapped="no" />
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,315 +0,0 @@
/*
* Copyright (C) 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <gio/gio.h>
#include <grilo.h>
#define GOA_API_IS_SUBJECT_TO_CHANGE
#include <goa/goa.h>
#include "bg-pictures-source.h"
#include "cc-background-grilo-miner.h"
struct _CcBackgroundGriloMiner
{
GObject parent_instance;
GCancellable *cancellable;
GList *accounts;
};
G_DEFINE_TYPE (CcBackgroundGriloMiner, cc_background_grilo_miner, G_TYPE_OBJECT)
enum
{
MEDIA_FOUND,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
#define REMOTE_ITEM_COUNT 50
static gchar *
get_grilo_id (GoaObject *goa_object)
{
GoaAccount *account;
account = goa_object_peek_account (goa_object);
return g_strdup_printf ("grl-flickr-%s", goa_account_get_id (account));
}
static void
is_online_data_cached (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
CcBackgroundGriloMiner *self;
GError *error = NULL;
GFileInfo *info = NULL;
GFile *cache_file = G_FILE (object);
GrlMedia *media;
const gchar *uri;
info = g_file_query_info_finish (cache_file, res, &error);
if (info == NULL)
{
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
goto out;
}
self = CC_BACKGROUND_GRILO_MINER (user_data);
media = g_object_get_data (G_OBJECT (cache_file), "grl-media");
uri = grl_media_get_url (media);
if (info != NULL)
{
g_debug ("Ignored URL '%s' as it is already in the cache", uri);
goto out;
}
g_signal_emit (self, signals[MEDIA_FOUND], 0, media);
out:
g_clear_object (&info);
g_clear_error (&error);
}
static void
searched_online_source (GrlSource *source,
guint operation_id,
GrlMedia *media,
guint remaining,
gpointer user_data,
const GError *error)
{
CcBackgroundGriloMiner *self = CC_BACKGROUND_GRILO_MINER (user_data);
g_autoptr(GFile) cache_file = NULL;
const gchar *uri;
g_autofree gchar *cache_path = NULL;
if (error != NULL)
{
const gchar *source_id;
source_id = grl_source_get_id (source);
g_warning ("Error searching %s: %s", source_id, error->message);
grl_operation_cancel (operation_id);
remaining = 0;
goto out;
}
uri = grl_media_get_url (media);
cache_path = bg_pictures_source_get_unique_path (uri);
cache_file = g_file_new_for_path (cache_path);
g_object_set_data_full (G_OBJECT (cache_file), "grl-media", media, g_object_unref);
g_file_query_info_async (cache_file,
G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NONE,
G_PRIORITY_DEFAULT,
self->cancellable,
is_online_data_cached,
self);
out:
if (remaining == 0)
g_object_unref (self);
}
static void
query_online_source (CcBackgroundGriloMiner *self, GrlSource *source)
{
const GList *keys;
GrlCaps *caps;
GrlOperationOptions *options;
keys = grl_source_supported_keys (source);
caps = grl_source_get_caps (source, GRL_OP_BROWSE);
options = grl_operation_options_new (caps);
grl_operation_options_set_count (options, REMOTE_ITEM_COUNT);
grl_operation_options_set_resolution_flags (options, GRL_RESOLVE_FAST_ONLY);
grl_operation_options_set_type_filter (options, GRL_TYPE_FILTER_IMAGE);
grl_source_search (source, NULL, keys, options, searched_online_source, g_object_ref (self));
g_object_unref (options);
}
static void
add_online_source_cb (CcBackgroundGriloMiner *self,
GrlSource *source)
{
GList *l;
gboolean found = FALSE;
const gchar *source_id;
source_id = grl_source_get_id (source);
for (l = self->accounts; l != NULL && !found; l = l->next)
{
GoaObject *goa_object = GOA_OBJECT (l->data);
g_autofree gchar *account_id = NULL;
account_id = get_grilo_id (goa_object);
if (g_strcmp0 (source_id, account_id) == 0)
{
query_online_source (self, source);
found = TRUE;
}
}
}
static void
client_async_ready (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
CcBackgroundGriloMiner *self;
g_autoptr(GError) error = NULL;
GList *accounts = NULL;
GList *photo_accounts = NULL;
GList *l;
GoaClient *client = NULL;
GrlRegistry *registry;
client = goa_client_new_finish (res, &error);
if (client == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to create GoaClient: %s", error->message);
goto out;
}
self = CC_BACKGROUND_GRILO_MINER (user_data);
accounts = goa_client_get_accounts (client);
for (l = accounts; l != NULL; l = l->next)
{
GoaObject *goa_object = GOA_OBJECT (l->data);
GoaAccount *account;
GoaPhotos *photos;
const gchar *provider_type;
account = goa_object_peek_account (goa_object);
provider_type = goa_account_get_provider_type (account);
photos = goa_object_peek_photos (goa_object);
if (photos != NULL && g_strcmp0 (provider_type, "flickr") == 0)
photo_accounts = g_list_prepend (photo_accounts, g_object_ref (goa_object));
}
if (photo_accounts == NULL)
goto out;
registry = grl_registry_get_default ();
for (l = photo_accounts; l != NULL; l = l->next)
{
GoaObject *goa_object = GOA_OBJECT (l->data);
GrlSource *source;
g_autofree gchar *account_id = NULL;
account_id = get_grilo_id (goa_object);
source = grl_registry_lookup_source (registry, account_id);
if (source != NULL)
query_online_source (self, source);
}
self->accounts = photo_accounts;
photo_accounts = NULL;
g_signal_connect_object (registry, "source-added", G_CALLBACK (add_online_source_cb), self, G_CONNECT_SWAPPED);
out:
g_list_free_full (photo_accounts, g_object_unref);
g_list_free_full (accounts, g_object_unref);
g_clear_object (&client);
}
static void
setup_online_accounts (CcBackgroundGriloMiner *self)
{
goa_client_new (self->cancellable, client_async_ready, self);
}
static void
cc_background_grilo_miner_dispose (GObject *object)
{
CcBackgroundGriloMiner *self = CC_BACKGROUND_GRILO_MINER (object);
if (self->cancellable)
{
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
}
if (self->accounts)
{
g_list_free_full (self->accounts, g_object_unref);
self->accounts = NULL;
}
G_OBJECT_CLASS (cc_background_grilo_miner_parent_class)->dispose (object);
}
static void
cc_background_grilo_miner_init (CcBackgroundGriloMiner *self)
{
self->cancellable = g_cancellable_new ();
}
static void
cc_background_grilo_miner_class_init (CcBackgroundGriloMinerClass *klass)
{
g_autoptr(GError) error = NULL;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GrlRegistry *registry;
object_class->dispose = cc_background_grilo_miner_dispose;
signals[MEDIA_FOUND] = g_signal_new ("media-found",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, /* class_offset */
NULL, /* accumulator */
NULL, /* accu_data */
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
GRL_TYPE_MEDIA);
grl_init (NULL, NULL);
registry = grl_registry_get_default ();
error = NULL;
if (!grl_registry_load_all_plugins (registry, FALSE, &error) ||
!grl_registry_activate_plugin_by_id (registry, "grl-flickr", &error))
g_warning ("%s", error->message);
}
CcBackgroundGriloMiner *
cc_background_grilo_miner_new (void)
{
return g_object_new (CC_TYPE_BACKGROUND_GRILO_MINER, NULL);
}
void
cc_background_grilo_miner_start (CcBackgroundGriloMiner *self)
{
setup_online_accounts (self);
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright (C) 2014 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <glib-object.h>
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_GRILO_MINER (cc_background_grilo_miner_get_type ())
G_DECLARE_FINAL_TYPE (CcBackgroundGriloMiner, cc_background_grilo_miner, CC, BACKGROUND_GRILO_MINER, GObject);
CcBackgroundGriloMiner *cc_background_grilo_miner_new (void);
void cc_background_grilo_miner_start (CcBackgroundGriloMiner *self);
G_END_DECLS

View File

@@ -1,977 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <libgnome-desktop/gnome-bg.h>
#include <gdesktop-enums.h>
#include "cc-background-item.h"
#include "gdesktop-enums-types.h"
struct _CcBackgroundItem
{
GObject parent_instance;
/* properties */
char *name;
char *uri;
char *size;
GDesktopBackgroundStyle placement;
GDesktopBackgroundShading shading;
char *primary_color;
char *secondary_color;
char *source_url; /* Used by the Flickr source */
char *source_xml; /* Used by the Wallpapers source */
gboolean is_deleted;
gboolean needs_download;
CcBackgroundItemFlags flags;
guint64 modified;
/* internal */
GnomeBG *bg;
char *mime_type;
int width;
int height;
struct {
int width;
int height;
int frame;
int scale_factor;
GdkPixbuf *thumbnail;
} cached_thumbnail;
};
enum {
PROP_0,
PROP_NAME,
PROP_URI,
PROP_PLACEMENT,
PROP_SHADING,
PROP_PRIMARY_COLOR,
PROP_SECONDARY_COLOR,
PROP_IS_DELETED,
PROP_SOURCE_URL,
PROP_SOURCE_XML,
PROP_FLAGS,
PROP_SIZE,
PROP_NEEDS_DOWNLOAD,
PROP_MODIFIED
};
static void cc_background_item_finalize (GObject *object);
G_DEFINE_TYPE (CcBackgroundItem, cc_background_item, G_TYPE_OBJECT)
static void
set_bg_properties (CcBackgroundItem *item)
{
GdkRGBA pcolor = { 0, 0, 0, 0 };
GdkRGBA scolor = { 0, 0, 0, 0 };
if (item->uri) {
g_autoptr(GFile) file = NULL;
g_autofree gchar *filename = NULL;
file = g_file_new_for_commandline_arg (item->uri);
filename = g_file_get_path (file);
gnome_bg_set_filename (item->bg, filename);
}
if (item->primary_color != NULL) {
gdk_rgba_parse (&pcolor, item->primary_color);
}
if (item->secondary_color != NULL) {
gdk_rgba_parse (&scolor, item->secondary_color);
}
gnome_bg_set_rgba (item->bg, item->shading, &pcolor, &scolor);
gnome_bg_set_placement (item->bg, item->placement);
}
gboolean
cc_background_item_changes_with_time (CcBackgroundItem *item)
{
gboolean changes;
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), FALSE);
changes = FALSE;
if (item->bg != NULL) {
changes = gnome_bg_changes_with_time (item->bg);
}
return changes;
}
static void
update_size (CcBackgroundItem *item)
{
g_clear_pointer (&item->size, g_free);
if (item->uri == NULL) {
item->size = g_strdup ("");
} else {
if (gnome_bg_has_multiple_sizes (item->bg) || gnome_bg_changes_with_time (item->bg)) {
item->size = g_strdup (_("multiple sizes"));
} else {
/* translators: 100 × 100px
* Note that this is not an "x", but U+00D7 MULTIPLICATION SIGN */
item->size = g_strdup_printf (_("%d × %d"),
item->width,
item->height);
}
}
}
static GdkPixbuf *
render_at_size (GnomeBG *bg,
gint width,
gint height)
{
GdkPixbuf *pixbuf;
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
#ifdef GNOME_DESKTOP_BG_API_BREAK
gnome_bg_draw (bg, pixbuf);
#else
gnome_bg_draw (bg, pixbuf, gdk_screen_get_default (), FALSE);
#endif
return pixbuf;
}
GdkPixbuf *
cc_background_item_get_frame_thumbnail (CcBackgroundItem *item,
GnomeDesktopThumbnailFactory *thumbs,
int width,
int height,
int scale_factor,
int frame,
gboolean force_size)
{
g_autoptr(GdkPixbuf) pixbuf = NULL;
g_autoptr(GdkPixbuf) retval = NULL;
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
/* Use the cached thumbnail if the sizes match */
if (item->cached_thumbnail.thumbnail &&
item->cached_thumbnail.width == width &&
item->cached_thumbnail.height == height &&
item->cached_thumbnail.scale_factor == scale_factor &&
item->cached_thumbnail.frame == frame)
return g_object_ref (item->cached_thumbnail.thumbnail);
set_bg_properties (item);
if (force_size) {
/* FIXME: this doesn't play nice with slideshow stepping at all,
* because it will always render the current slideshow frame, which
* might not be what we want.
* We're lacking an API to draw a high-res GnomeBG manually choosing
* the slideshow frame though, so we can't do much better than this
* for now.
*/
pixbuf = render_at_size (item->bg, width, height);
} else {
if (frame >= 0) {
pixbuf = gnome_bg_create_frame_thumbnail (item->bg,
thumbs,
gdk_screen_get_default (),
width,
height,
frame);
} else {
pixbuf = gnome_bg_create_thumbnail (item->bg,
thumbs,
gdk_screen_get_default (),
width,
height);
}
}
retval = g_steal_pointer (&pixbuf);
gnome_bg_get_image_size (item->bg,
thumbs,
width,
height,
&item->width,
&item->height);
update_size (item);
/* Cache the new thumbnail */
g_set_object (&item->cached_thumbnail.thumbnail, retval);
item->cached_thumbnail.width = width;
item->cached_thumbnail.height = height;
item->cached_thumbnail.scale_factor = scale_factor;
item->cached_thumbnail.frame = frame;
return g_steal_pointer (&retval);
}
GdkPixbuf *
cc_background_item_get_thumbnail (CcBackgroundItem *item,
GnomeDesktopThumbnailFactory *thumbs,
int width,
int height,
int scale_factor)
{
return cc_background_item_get_frame_thumbnail (item, thumbs, width, height, scale_factor, -1, FALSE);
}
static void
update_info (CcBackgroundItem *item,
GFileInfo *_info)
{
g_autoptr(GFileInfo) info = NULL;
if (_info == NULL) {
g_autoptr(GFile) file = NULL;
file = g_file_new_for_uri (item->uri);
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SIZE ","
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME ","
G_FILE_ATTRIBUTE_TIME_MODIFIED,
G_FILE_QUERY_INFO_NONE,
NULL,
NULL);
} else {
info = g_object_ref (_info);
}
g_clear_pointer (&item->mime_type, g_free);
if (info == NULL
|| g_file_info_get_content_type (info) == NULL) {
if (item->uri == NULL) {
item->mime_type = g_strdup ("image/x-no-data");
g_free (item->name);
item->name = g_strdup (_("No Desktop Background"));
}
} else {
if (item->name == NULL)
item->name = g_strdup (g_file_info_get_display_name (info));
item->mime_type = g_strdup (g_file_info_get_content_type (info));
if (item->modified == 0)
item->modified = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
}
}
gboolean
cc_background_item_load (CcBackgroundItem *item,
GFileInfo *info)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), FALSE);
if (item->uri == NULL)
return TRUE;
update_info (item, info);
if (item->mime_type != NULL
&& (g_str_has_prefix (item->mime_type, "image/")
|| strcmp (item->mime_type, "application/xml") == 0)) {
set_bg_properties (item);
} else {
return FALSE;
}
/* FIXME we should handle XML files as well */
if (item->mime_type != NULL &&
g_str_has_prefix (item->mime_type, "image/")) {
g_autofree gchar *filename = NULL;
filename = g_filename_from_uri (item->uri, NULL, NULL);
gdk_pixbuf_get_file_info (filename,
&item->width,
&item->height);
update_size (item);
}
return TRUE;
}
static void
_set_name (CcBackgroundItem *item,
const char *value)
{
g_free (item->name);
item->name = g_strdup (value);
}
const char *
cc_background_item_get_name (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->name;
}
static void
_set_uri (CcBackgroundItem *item,
const char *value)
{
g_free (item->uri);
if (value && *value == '\0') {
item->uri = NULL;
} else {
if (value && strstr (value, "://") == NULL)
g_warning ("URI '%s' is invalid", value);
item->uri = g_strdup (value);
}
}
const char *
cc_background_item_get_uri (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->uri;
}
static void
_set_placement (CcBackgroundItem *item,
GDesktopBackgroundStyle value)
{
item->placement = value;
}
static void
_set_shading (CcBackgroundItem *item,
GDesktopBackgroundShading value)
{
item->shading = value;
}
static void
_set_primary_color (CcBackgroundItem *item,
const char *value)
{
g_free (item->primary_color);
item->primary_color = g_strdup (value);
}
const char *
cc_background_item_get_pcolor (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->primary_color;
}
static void
_set_secondary_color (CcBackgroundItem *item,
const char *value)
{
g_free (item->secondary_color);
item->secondary_color = g_strdup (value);
}
const char *
cc_background_item_get_scolor (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->secondary_color;
}
GDesktopBackgroundStyle
cc_background_item_get_placement (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), G_DESKTOP_BACKGROUND_STYLE_SCALED);
return item->placement;
}
GDesktopBackgroundShading
cc_background_item_get_shading (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), G_DESKTOP_BACKGROUND_SHADING_SOLID);
return item->shading;
}
static void
_set_is_deleted (CcBackgroundItem *item,
gboolean value)
{
item->is_deleted = value;
}
static void
_set_source_url (CcBackgroundItem *item,
const char *value)
{
g_free (item->source_url);
item->source_url = g_strdup (value);
}
const char *
cc_background_item_get_source_url (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->source_url;
}
static void
_set_source_xml (CcBackgroundItem *item,
const char *value)
{
g_free (item->source_xml);
item->source_xml = g_strdup (value);
}
const char *
cc_background_item_get_source_xml (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->source_xml;
}
static void
_set_flags (CcBackgroundItem *item,
CcBackgroundItemFlags value)
{
item->flags = value;
}
CcBackgroundItemFlags
cc_background_item_get_flags (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), 0);
return item->flags;
}
const char *
cc_background_item_get_size (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), NULL);
return item->size;
}
static void
_set_needs_download (CcBackgroundItem *item,
gboolean value)
{
item->needs_download = value;
}
gboolean
cc_background_item_get_needs_download (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), 0);
return item->needs_download;
}
static void
_set_modified (CcBackgroundItem *item,
guint64 value)
{
item->modified = value;
}
guint64
cc_background_item_get_modified (CcBackgroundItem *item)
{
g_return_val_if_fail (CC_IS_BACKGROUND_ITEM (item), 0);
return item->modified;
}
static void
cc_background_item_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
CcBackgroundItem *self;
self = CC_BACKGROUND_ITEM (object);
switch (prop_id) {
case PROP_NAME:
_set_name (self, g_value_get_string (value));
break;
case PROP_URI:
_set_uri (self, g_value_get_string (value));
break;
case PROP_PLACEMENT:
_set_placement (self, g_value_get_enum (value));
break;
case PROP_SHADING:
_set_shading (self, g_value_get_enum (value));
break;
case PROP_PRIMARY_COLOR:
_set_primary_color (self, g_value_get_string (value));
break;
case PROP_SECONDARY_COLOR:
_set_secondary_color (self, g_value_get_string (value));
break;
case PROP_IS_DELETED:
_set_is_deleted (self, g_value_get_boolean (value));
break;
case PROP_SOURCE_URL:
_set_source_url (self, g_value_get_string (value));
break;
case PROP_SOURCE_XML:
_set_source_xml (self, g_value_get_string (value));
break;
case PROP_FLAGS:
_set_flags (self, g_value_get_flags (value));
break;
case PROP_NEEDS_DOWNLOAD:
_set_needs_download (self, g_value_get_boolean (value));
break;
case PROP_MODIFIED:
_set_modified (self, g_value_get_uint64 (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
cc_background_item_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CcBackgroundItem *self;
self = CC_BACKGROUND_ITEM (object);
switch (prop_id) {
case PROP_NAME:
g_value_set_string (value, self->name);
break;
case PROP_URI:
g_value_set_string (value, self->uri);
break;
case PROP_PLACEMENT:
g_value_set_enum (value, self->placement);
break;
case PROP_SHADING:
g_value_set_enum (value, self->shading);
break;
case PROP_PRIMARY_COLOR:
g_value_set_string (value, self->primary_color);
break;
case PROP_SECONDARY_COLOR:
g_value_set_string (value, self->secondary_color);
break;
case PROP_IS_DELETED:
g_value_set_boolean (value, self->is_deleted);
break;
case PROP_SOURCE_URL:
g_value_set_string (value, self->source_url);
break;
case PROP_SOURCE_XML:
g_value_set_string (value, self->source_xml);
break;
case PROP_FLAGS:
g_value_set_flags (value, self->flags);
break;
case PROP_SIZE:
g_value_set_string (value, self->size);
break;
case PROP_NEEDS_DOWNLOAD:
g_value_set_boolean (value, self->needs_download);
break;
case PROP_MODIFIED:
g_value_set_uint64 (value, self->modified);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static GObject *
cc_background_item_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
CcBackgroundItem *background_item;
background_item = CC_BACKGROUND_ITEM (G_OBJECT_CLASS (cc_background_item_parent_class)->constructor (type,
n_construct_properties,
construct_properties));
return G_OBJECT (background_item);
}
static void
cc_background_item_class_init (CcBackgroundItemClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = cc_background_item_get_property;
object_class->set_property = cc_background_item_set_property;
object_class->constructor = cc_background_item_constructor;
object_class->finalize = cc_background_item_finalize;
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
"name",
"name",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_URI,
g_param_spec_string ("uri",
"uri",
"uri",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_PLACEMENT,
g_param_spec_enum ("placement",
"placement",
"placement",
G_DESKTOP_TYPE_DESKTOP_BACKGROUND_STYLE,
G_DESKTOP_BACKGROUND_STYLE_SCALED,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SHADING,
g_param_spec_enum ("shading",
"shading",
"shading",
G_DESKTOP_TYPE_DESKTOP_BACKGROUND_SHADING,
G_DESKTOP_BACKGROUND_SHADING_SOLID,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_PRIMARY_COLOR,
g_param_spec_string ("primary-color",
"primary-color",
"primary-color",
"#000000000000",
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SECONDARY_COLOR,
g_param_spec_string ("secondary-color",
"secondary-color",
"secondary-color",
"#000000000000",
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_IS_DELETED,
g_param_spec_boolean ("is-deleted",
NULL,
NULL,
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SOURCE_URL,
g_param_spec_string ("source-url",
"source-url",
"source-url",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SOURCE_XML,
g_param_spec_string ("source-xml",
"source-xml",
"source-xml",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_FLAGS,
g_param_spec_flags ("flags",
"flags",
"flags",
G_DESKTOP_TYPE_BACKGROUND_ITEM_FLAGS,
0,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SIZE,
g_param_spec_string ("size",
"size",
"size",
NULL,
G_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_NEEDS_DOWNLOAD,
g_param_spec_boolean ("needs-download",
NULL,
NULL,
TRUE,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_MODIFIED,
g_param_spec_uint64 ("modified",
"modified",
NULL,
0,
G_MAXUINT64,
0,
G_PARAM_READWRITE));
}
static void
cc_background_item_init (CcBackgroundItem *item)
{
item->bg = gnome_bg_new ();
item->shading = G_DESKTOP_BACKGROUND_SHADING_SOLID;
item->placement = G_DESKTOP_BACKGROUND_STYLE_SCALED;
item->primary_color = g_strdup ("#000000000000");
item->secondary_color = g_strdup ("#000000000000");
item->needs_download = TRUE;
item->flags = 0;
item->modified = 0;
}
static void
cc_background_item_finalize (GObject *object)
{
CcBackgroundItem *item;
g_return_if_fail (object != NULL);
g_return_if_fail (CC_IS_BACKGROUND_ITEM (object));
item = CC_BACKGROUND_ITEM (object);
g_return_if_fail (item != NULL);
g_clear_object (&item->cached_thumbnail.thumbnail);
g_free (item->name);
g_free (item->uri);
g_free (item->primary_color);
g_free (item->secondary_color);
g_free (item->mime_type);
g_free (item->size);
g_free (item->source_url);
g_free (item->source_xml);
if (item->bg != NULL)
g_object_unref (item->bg);
G_OBJECT_CLASS (cc_background_item_parent_class)->finalize (object);
}
CcBackgroundItem *
cc_background_item_new (const char *uri)
{
GObject *object;
object = g_object_new (CC_TYPE_BACKGROUND_ITEM,
"uri", uri,
NULL);
return CC_BACKGROUND_ITEM (object);
}
CcBackgroundItem *
cc_background_item_copy (CcBackgroundItem *item)
{
CcBackgroundItem *ret;
ret = cc_background_item_new (item->uri);
ret->name = g_strdup (item->name);
ret->size = g_strdup (item->size);
ret->placement = item->placement;
ret->shading = item->shading;
ret->primary_color = g_strdup (item->primary_color);
ret->secondary_color = g_strdup (item->secondary_color);
ret->source_url = g_strdup (item->source_url);
ret->source_xml = g_strdup (item->source_xml);
ret->is_deleted = item->is_deleted;
ret->needs_download = item->needs_download;
ret->flags = item->flags;
return ret;
}
static const char *
flags_to_str (CcBackgroundItemFlags flag)
{
GFlagsClass *fclass;
GFlagsValue *value;
fclass = G_FLAGS_CLASS (g_type_class_peek (G_DESKTOP_TYPE_BACKGROUND_ITEM_FLAGS));
value = g_flags_get_first_value (fclass, flag);
g_assert (value);
return value->value_nick;
}
static const char *
enum_to_str (GType type,
int v)
{
GEnumClass *eclass;
GEnumValue *value;
eclass = G_ENUM_CLASS (g_type_class_peek (type));
value = g_enum_get_value (eclass, v);
g_assert (value);
return value->value_nick;
}
void
cc_background_item_dump (CcBackgroundItem *item)
{
g_autoptr(GString) flags = NULL;
int i;
g_return_if_fail (CC_IS_BACKGROUND_ITEM (item));
g_debug ("name:\t\t\t%s", item->name);
g_debug ("URI:\t\t\t%s", item->uri ? item->uri : "NULL");
if (item->size)
g_debug ("size:\t\t\t'%s'", item->size);
flags = g_string_new (NULL);
for (i = 0; i < 5; i++) {
if (item->flags & (1 << i)) {
g_string_append (flags, flags_to_str (1 << i));
g_string_append_c (flags, ' ');
}
}
if (flags->len == 0)
g_string_append (flags, "-none-");
g_debug ("flags:\t\t\t%s", flags->str);
if (item->primary_color)
g_debug ("pcolor:\t\t\t%s", item->primary_color);
if (item->secondary_color)
g_debug ("scolor:\t\t\t%s", item->secondary_color);
g_debug ("placement:\t\t%s", enum_to_str (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_STYLE, item->placement));
g_debug ("shading:\t\t%s", enum_to_str (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_SHADING, item->shading));
if (item->source_url)
g_debug ("source URL:\t\t%s", item->source_url);
if (item->source_xml)
g_debug ("source XML:\t\t%s", item->source_xml);
g_debug ("deleted:\t\t%s", item->is_deleted ? "yes" : "no");
if (item->mime_type)
g_debug ("mime-type:\t\t%s", item->mime_type);
g_debug ("dimensions:\t\t%d x %d", item->width, item->height);
g_debug ("modified: %"G_GUINT64_FORMAT, item->modified);
g_debug (" ");
}
static gboolean
files_equal (const char *a,
const char *b)
{
g_autoptr(GFile) file1 = NULL;
g_autoptr(GFile) file2 = NULL;
gboolean retval;
if (a == NULL &&
b == NULL)
return TRUE;
if (a == NULL ||
b == NULL)
return FALSE;
file1 = g_file_new_for_commandline_arg (a);
file2 = g_file_new_for_commandline_arg (b);
if (g_file_equal (file1, file2) == FALSE)
retval = FALSE;
else
retval = TRUE;
return retval;
}
static gboolean
colors_equal (const char *a,
const char *b)
{
GdkRGBA color1, color2;
gdk_rgba_parse (&color1, a);
gdk_rgba_parse (&color2, b);
return gdk_rgba_equal (&color1, &color2);
}
gboolean
cc_background_item_compare (CcBackgroundItem *saved,
CcBackgroundItem *configured)
{
CcBackgroundItemFlags flags;
flags = saved->flags;
if (flags == 0)
return FALSE;
if (flags & CC_BACKGROUND_ITEM_HAS_URI) {
if (files_equal (saved->uri, configured->uri) == FALSE)
return FALSE;
}
if (flags & CC_BACKGROUND_ITEM_HAS_SHADING) {
if (saved->shading != configured->shading)
return FALSE;
}
if (flags & CC_BACKGROUND_ITEM_HAS_PLACEMENT) {
if (saved->placement != configured->placement)
return FALSE;
}
if (flags & CC_BACKGROUND_ITEM_HAS_PCOLOR) {
if (colors_equal (saved->primary_color,
configured->primary_color) == FALSE) {
return FALSE;
}
}
if (flags & CC_BACKGROUND_ITEM_HAS_SCOLOR) {
if (colors_equal (saved->secondary_color,
configured->secondary_color) == FALSE) {
return FALSE;
}
}
return TRUE;
}

View File

@@ -1,83 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2010-2011 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include <gdesktop-enums.h>
#include <libgnome-desktop/gnome-bg.h>
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_ITEM (cc_background_item_get_type ())
G_DECLARE_FINAL_TYPE (CcBackgroundItem, cc_background_item, CC, BACKGROUND_ITEM, GObject)
typedef enum {
CC_BACKGROUND_ITEM_HAS_SHADING = 1 << 0,
CC_BACKGROUND_ITEM_HAS_PLACEMENT = 1 << 1,
CC_BACKGROUND_ITEM_HAS_PCOLOR = 1 << 2,
CC_BACKGROUND_ITEM_HAS_SCOLOR = 1 << 3,
CC_BACKGROUND_ITEM_HAS_URI = 1 << 4
} CcBackgroundItemFlags;
#define CC_BACKGROUND_ITEM_HAS_ALL (CC_BACKGROUND_ITEM_HAS_SHADING & \
CC_BACKGROUND_ITEM_HAS_PLACEMENT & \
CC_BACKGROUND_ITEM_HAS_PCOLOR & \
CC_BACKGROUND_ITEM_HAS_SCOLOR & \
CC_BACKGROUND_ITEM_HAS_FNAME)
CcBackgroundItem * cc_background_item_new (const char *uri);
CcBackgroundItem * cc_background_item_copy (CcBackgroundItem *item);
gboolean cc_background_item_load (CcBackgroundItem *item,
GFileInfo *info);
gboolean cc_background_item_changes_with_time (CcBackgroundItem *item);
GdkPixbuf * cc_background_item_get_thumbnail (CcBackgroundItem *item,
GnomeDesktopThumbnailFactory *thumbs,
int width,
int height,
int scale_factor);
GdkPixbuf * cc_background_item_get_frame_thumbnail (CcBackgroundItem *item,
GnomeDesktopThumbnailFactory *thumbs,
int width,
int height,
int scale_factor,
int frame,
gboolean force_size);
GDesktopBackgroundStyle cc_background_item_get_placement (CcBackgroundItem *item);
GDesktopBackgroundShading cc_background_item_get_shading (CcBackgroundItem *item);
const char * cc_background_item_get_uri (CcBackgroundItem *item);
const char * cc_background_item_get_source_url (CcBackgroundItem *item);
const char * cc_background_item_get_source_xml (CcBackgroundItem *item);
CcBackgroundItemFlags cc_background_item_get_flags (CcBackgroundItem *item);
const char * cc_background_item_get_pcolor (CcBackgroundItem *item);
const char * cc_background_item_get_scolor (CcBackgroundItem *item);
const char * cc_background_item_get_name (CcBackgroundItem *item);
const char * cc_background_item_get_size (CcBackgroundItem *item);
gboolean cc_background_item_get_needs_download (CcBackgroundItem *item);
guint64 cc_background_item_get_modified (CcBackgroundItem *item);
gboolean cc_background_item_compare (CcBackgroundItem *saved,
CcBackgroundItem *configured);
void cc_background_item_dump (CcBackgroundItem *item);
G_END_DECLS

View File

@@ -1,314 +0,0 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <gdesktop-enums.h>
#include "cc-background-panel.h"
#include "cc-background-chooser.h"
#include "cc-background-item.h"
#include "cc-background-preview.h"
#include "cc-background-resources.h"
#include "cc-background-xml.h"
#include "bg-pictures-source.h"
#define WP_PATH_ID "org.gnome.desktop.background"
#define WP_LOCK_PATH_ID "org.gnome.desktop.screensaver"
#define WP_URI_KEY "picture-uri"
#define WP_OPTIONS_KEY "picture-options"
#define WP_SHADING_KEY "color-shading-type"
#define WP_PCOLOR_KEY "primary-color"
#define WP_SCOLOR_KEY "secondary-color"
struct _CcBackgroundPanel
{
CcPanel parent_instance;
GDBusConnection *connection;
GSettings *settings;
GSettings *lock_settings;
GnomeDesktopThumbnailFactory *thumb_factory;
CcBackgroundItem *current_background;
CcBackgroundChooser *background_chooser;
GtkButton *add_picture_button;
CcBackgroundPreview *desktop_preview;
};
CC_PANEL_REGISTER (CcBackgroundPanel, cc_background_panel)
static void
update_preview (CcBackgroundPanel *panel)
{
CcBackgroundItem *current_background;
current_background = panel->current_background;
cc_background_preview_set_item (panel->desktop_preview, current_background);
}
static gchar *
get_save_path (void)
{
return g_build_filename (g_get_user_config_dir (),
"gnome-control-center",
"backgrounds",
"last-edited.xml",
NULL);
}
static void
reload_current_bg (CcBackgroundPanel *panel)
{
g_autoptr(CcBackgroundItem) saved = NULL;
CcBackgroundItem *configured;
GSettings *settings = NULL;
g_autofree gchar *uri = NULL;
g_autofree gchar *pcolor = NULL;
g_autofree gchar *scolor = NULL;
/* Load the saved configuration */
uri = get_save_path ();
saved = cc_background_xml_get_item (uri);
/* initalise the current background information from settings */
settings = panel->settings;
uri = g_settings_get_string (settings, WP_URI_KEY);
if (uri && *uri == '\0')
g_clear_pointer (&uri, g_free);
configured = cc_background_item_new (uri);
pcolor = g_settings_get_string (settings, WP_PCOLOR_KEY);
scolor = g_settings_get_string (settings, WP_SCOLOR_KEY);
g_object_set (G_OBJECT (configured),
"name", _("Current background"),
"placement", g_settings_get_enum (settings, WP_OPTIONS_KEY),
"shading", g_settings_get_enum (settings, WP_SHADING_KEY),
"primary-color", pcolor,
"secondary-color", scolor,
NULL);
if (saved != NULL && cc_background_item_compare (saved, configured))
{
CcBackgroundItemFlags flags;
flags = cc_background_item_get_flags (saved);
/* Special case for colours */
if (cc_background_item_get_placement (saved) == G_DESKTOP_BACKGROUND_STYLE_NONE)
flags &=~ (CC_BACKGROUND_ITEM_HAS_PCOLOR | CC_BACKGROUND_ITEM_HAS_SCOLOR);
g_object_set (G_OBJECT (configured),
"name", cc_background_item_get_name (saved),
"flags", flags,
"source-url", cc_background_item_get_source_url (saved),
"source-xml", cc_background_item_get_source_xml (saved),
NULL);
}
g_clear_object (&panel->current_background);
panel->current_background = configured;
cc_background_item_load (configured, NULL);
}
static gboolean
create_save_dir (void)
{
g_autofree char *path = NULL;
path = g_build_filename (g_get_user_config_dir (),
"gnome-control-center",
"backgrounds",
NULL);
if (g_mkdir_with_parents (path, USER_DIR_MODE) < 0)
{
g_warning ("Failed to create directory '%s'", path);
return FALSE;
}
return TRUE;
}
static void
set_background (CcBackgroundPanel *panel,
GSettings *settings,
CcBackgroundItem *item)
{
GDesktopBackgroundStyle style;
CcBackgroundItemFlags flags;
g_autofree gchar *filename = NULL;
const char *uri;
if (item == NULL)
return;
uri = cc_background_item_get_uri (item);
flags = cc_background_item_get_flags (item);
g_settings_set_string (settings, WP_URI_KEY, uri);
/* Also set the placement if we have a URI and the previous value was none */
if (flags & CC_BACKGROUND_ITEM_HAS_PLACEMENT)
{
g_settings_set_enum (settings, WP_OPTIONS_KEY, cc_background_item_get_placement (item));
}
else if (uri != NULL)
{
style = g_settings_get_enum (settings, WP_OPTIONS_KEY);
if (style == G_DESKTOP_BACKGROUND_STYLE_NONE)
g_settings_set_enum (settings, WP_OPTIONS_KEY, cc_background_item_get_placement (item));
}
if (flags & CC_BACKGROUND_ITEM_HAS_SHADING)
g_settings_set_enum (settings, WP_SHADING_KEY, cc_background_item_get_shading (item));
g_settings_set_string (settings, WP_PCOLOR_KEY, cc_background_item_get_pcolor (item));
g_settings_set_string (settings, WP_SCOLOR_KEY, cc_background_item_get_scolor (item));
/* Apply all changes */
g_settings_apply (settings);
/* Save the source XML if there is one */
filename = get_save_path ();
if (create_save_dir ())
cc_background_xml_save (panel->current_background, filename);
}
static void
on_chooser_background_chosen_cb (CcBackgroundPanel *self,
CcBackgroundItem *item)
{
set_background (self, self->settings, item);
set_background (self, self->lock_settings, item);
}
static void
on_add_picture_button_clicked_cb (CcBackgroundPanel *self)
{
cc_background_chooser_select_file (self->background_chooser);
}
static const char *
cc_background_panel_get_help_uri (CcPanel *panel)
{
return "help:gnome-help/look-background";
}
static void
cc_background_panel_constructed (GObject *object)
{
CcBackgroundPanel *self;
CcShell *shell;
self = CC_BACKGROUND_PANEL (object);
shell = cc_panel_get_shell (CC_PANEL (self));
cc_shell_embed_widget_in_header (shell, GTK_WIDGET (self->add_picture_button), GTK_POS_RIGHT);
G_OBJECT_CLASS (cc_background_panel_parent_class)->constructed (object);
}
static void
cc_background_panel_dispose (GObject *object)
{
CcBackgroundPanel *panel = CC_BACKGROUND_PANEL (object);
g_clear_object (&panel->settings);
g_clear_object (&panel->lock_settings);
g_clear_object (&panel->thumb_factory);
G_OBJECT_CLASS (cc_background_panel_parent_class)->dispose (object);
}
static void
cc_background_panel_finalize (GObject *object)
{
CcBackgroundPanel *panel = CC_BACKGROUND_PANEL (object);
g_clear_object (&panel->current_background);
G_OBJECT_CLASS (cc_background_panel_parent_class)->finalize (object);
}
static void
cc_background_panel_class_init (CcBackgroundPanelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_ensure (CC_TYPE_BACKGROUND_CHOOSER);
g_type_ensure (CC_TYPE_BACKGROUND_PREVIEW);
panel_class->get_help_uri = cc_background_panel_get_help_uri;
object_class->constructed = cc_background_panel_constructed;
object_class->dispose = cc_background_panel_dispose;
object_class->finalize = cc_background_panel_finalize;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/background/cc-background-panel.ui");
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPanel, add_picture_button);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPanel, background_chooser);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPanel, desktop_preview);
gtk_widget_class_bind_template_callback (widget_class, on_chooser_background_chosen_cb);
gtk_widget_class_bind_template_callback (widget_class, on_add_picture_button_clicked_cb);
}
static void
on_settings_changed (CcBackgroundPanel *panel)
{
reload_current_bg (panel);
update_preview (panel);
}
static void
cc_background_panel_init (CcBackgroundPanel *panel)
{
g_resources_register (cc_background_get_resource ());
gtk_widget_init_template (GTK_WIDGET (panel));
panel->connection = g_application_get_dbus_connection (g_application_get_default ());
panel->thumb_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
panel->settings = g_settings_new (WP_PATH_ID);
g_settings_delay (panel->settings);
panel->lock_settings = g_settings_new (WP_LOCK_PATH_ID);
g_settings_delay (panel->lock_settings);
/* Load the background */
reload_current_bg (panel);
update_preview (panel);
/* Background settings */
g_signal_connect_object (panel->settings, "changed", G_CALLBACK (on_settings_changed), panel, G_CONNECT_SWAPPED);
}

View File

@@ -1,30 +0,0 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#pragma once
#include <shell/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_PANEL (cc_background_panel_get_type ())
G_DECLARE_FINAL_TYPE (CcBackgroundPanel, cc_background_panel, CC, BACKGROUND_PANEL, CcPanel)
G_END_DECLS

View File

@@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcBackgroundPanel" parent="CcPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyClamp">
<property name="visible">1</property>
<property name="maximum_size">300</property>
<property name="tightening_threshold">200</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">24</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">18</property>
<property name="margin-bottom">18</property>
<property name="hexpand">True</property>
<child>
<object class="CcBackgroundPreview" id="desktop_preview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="CcBackgroundChooser" id="background_chooser">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
<signal name="background-chosen" handler="on_chooser_background_chosen_cb" object="CcBackgroundPanel" swapped="yes" />
</object>
</child>
</object>
</child>
</template>
<!-- Header button -->
<object class="GtkButton" id="add_picture_button">
<property name="visible">True</property>
<property name="label" translatable="yes">Add Picture…</property>
<signal name="clicked" handler="on_add_picture_button_clicked_cb" object="CcBackgroundPanel" swapped="yes" />
</object>
</interface>

View File

@@ -1,382 +0,0 @@
/* cc-background-preview.c
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "cc-background-preview.h"
struct _CcBackgroundPreview
{
GtkBox parent;
GtkImage *animated_background_icon;
GtkLabel *desktop_clock_label;
GtkFrame *desktop_frame;
GtkDrawingArea *drawing_area;
GtkFrame *lock_frame;
GtkLabel *lock_screen_label;
GtkStack *stack;
GnomeDesktopThumbnailFactory *thumbnail_factory;
CcBackgroundItem *item;
GSettings *desktop_settings;
guint lock_screen_time_timeout_id;
gboolean is_lock_screen;
GDateTime *previous_time;
gboolean is_24h_format;
};
G_DEFINE_TYPE (CcBackgroundPreview, cc_background_preview, GTK_TYPE_BOX)
enum
{
PROP_0,
PROP_IS_LOCK_SCREEN,
PROP_ITEM,
N_PROPS
};
static GParamSpec *properties [N_PROPS];
/* Auxiliary methods */
static void
update_lock_screen_label (CcBackgroundPreview *self,
gboolean force)
{
g_autoptr(GDateTime) now = NULL;
g_autofree gchar *label = NULL;
now = g_date_time_new_now_local ();
/* Don't update the label if the hour:minute pair did not change */
if (!force && self->previous_time &&
g_date_time_get_hour (now) == g_date_time_get_hour (self->previous_time) &&
g_date_time_get_minute (now) == g_date_time_get_minute (self->previous_time))
{
return;
}
if (self->is_24h_format)
label = g_date_time_format (now, "%R");
else
label = g_date_time_format (now, "%I:%M %p");
gtk_label_set_label (self->lock_screen_label, label);
gtk_label_set_label (self->desktop_clock_label, label);
g_clear_pointer (&self->previous_time, g_date_time_unref);
self->previous_time = g_steal_pointer (&now);
}
static void
update_clock_format (CcBackgroundPreview *self)
{
g_autofree gchar *clock_format = NULL;
gboolean is_24h_format;
clock_format = g_settings_get_string (self->desktop_settings, "clock-format");
is_24h_format = g_strcmp0 (clock_format, "24h") == 0;
if (is_24h_format != self->is_24h_format)
{
self->is_24h_format = is_24h_format;
update_lock_screen_label (self, TRUE);
}
}
static void
load_custom_css (CcBackgroundPreview *self)
{
g_autoptr(GtkCssProvider) provider = NULL;
/* use custom CSS */
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/org/gnome/control-center/background/preview.css");
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
static gboolean
update_clock_cb (gpointer data)
{
CcBackgroundPreview *self = data;
update_lock_screen_label (self, FALSE);
return G_SOURCE_CONTINUE;
}
static void
start_monitor_time (CcBackgroundPreview *self)
{
if (self->lock_screen_time_timeout_id > 0)
return;
self->lock_screen_time_timeout_id = g_timeout_add_seconds (1,
update_clock_cb,
self);
}
static void
stop_monitor_time (CcBackgroundPreview *self)
{
if (self->lock_screen_time_timeout_id > 0)
{
g_source_remove (self->lock_screen_time_timeout_id);
self->lock_screen_time_timeout_id = 0;
}
}
/* Callbacks */
static gboolean
on_preview_draw_cb (CcBackgroundPreview *self,
cairo_t *cr)
{
g_autoptr(GdkPixbuf) pixbuf = NULL;
GtkAllocation allocation;
gint scale_factor;
if (!self->item)
return FALSE;
scale_factor = gtk_widget_get_scale_factor (GTK_WIDGET (self->drawing_area));
gtk_widget_get_allocation (GTK_WIDGET (self->drawing_area), &allocation);
pixbuf = cc_background_item_get_frame_thumbnail (self->item,
self->thumbnail_factory,
allocation.width,
allocation.height,
scale_factor,
0,
TRUE);
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
cairo_paint (cr);
return TRUE;
}
/* GObject overrides */
static void
cc_background_preview_finalize (GObject *object)
{
CcBackgroundPreview *self = (CcBackgroundPreview *)object;
g_clear_object (&self->desktop_settings);
g_clear_object (&self->item);
g_clear_object (&self->thumbnail_factory);
g_clear_pointer (&self->previous_time, g_date_time_unref);
stop_monitor_time (self);
G_OBJECT_CLASS (cc_background_preview_parent_class)->finalize (object);
}
static void
cc_background_preview_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
CcBackgroundPreview *self = CC_BACKGROUND_PREVIEW (object);
switch (prop_id)
{
case PROP_IS_LOCK_SCREEN:
g_value_set_boolean (value, self->is_lock_screen);
break;
case PROP_ITEM:
g_value_set_object (value, self->item);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
cc_background_preview_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
CcBackgroundPreview *self = CC_BACKGROUND_PREVIEW (object);
switch (prop_id)
{
case PROP_IS_LOCK_SCREEN:
self->is_lock_screen = g_value_get_boolean (value);
gtk_stack_set_visible_child (self->stack,
self->is_lock_screen ? GTK_WIDGET (self->lock_frame) : GTK_WIDGET (self->desktop_frame));
break;
case PROP_ITEM:
cc_background_preview_set_item (self, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static GtkSizeRequestMode
cc_background_preview_get_request_mode (GtkWidget *widget)
{
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
}
static gfloat
get_primary_monitor_aspect_ratio (void)
{
GdkDisplay *display;
GdkMonitor *primary_monitor;
gfloat aspect_ratio;
display = gdk_display_get_default ();
primary_monitor = gdk_display_get_primary_monitor (display);
aspect_ratio = 16.0 / 9.0;
if (primary_monitor)
{
GdkRectangle monitor_layout;
gdk_monitor_get_geometry (primary_monitor, &monitor_layout);
aspect_ratio = monitor_layout.width / (gfloat) monitor_layout.height;
}
return aspect_ratio;
}
static void
cc_background_preview_get_preferred_height_for_width (GtkWidget *widget,
gint width,
gint *minimum,
gint *natural)
{
gfloat aspect_ratio = get_primary_monitor_aspect_ratio ();
*minimum = *natural = MAX (2, width / aspect_ratio);
}
static void
cc_background_preview_get_preferred_width_for_height (GtkWidget *widget,
gint height,
gint *minimum,
gint *natural)
{
gfloat aspect_ratio = get_primary_monitor_aspect_ratio ();
*minimum = *natural = MAX (2, height * aspect_ratio);
}
static void
cc_background_preview_class_init (CcBackgroundPreviewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = cc_background_preview_finalize;
object_class->get_property = cc_background_preview_get_property;
object_class->set_property = cc_background_preview_set_property;
widget_class->get_request_mode = cc_background_preview_get_request_mode;
widget_class->get_preferred_height_for_width = cc_background_preview_get_preferred_height_for_width;
widget_class->get_preferred_width_for_height = cc_background_preview_get_preferred_width_for_height;
properties[PROP_IS_LOCK_SCREEN] = g_param_spec_boolean ("is-lock-screen",
"Lock screen",
"Whether the preview is of the lock screen",
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
properties[PROP_ITEM] = g_param_spec_object ("item",
"Item",
"Background item",
CC_TYPE_BACKGROUND_ITEM,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/background/cc-background-preview.ui");
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, animated_background_icon);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, desktop_clock_label);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, desktop_frame);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, drawing_area);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, lock_frame);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, lock_screen_label);
gtk_widget_class_bind_template_child (widget_class, CcBackgroundPreview, stack);
gtk_widget_class_bind_template_callback (widget_class, on_preview_draw_cb);
}
static void
cc_background_preview_init (CcBackgroundPreview *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
self->thumbnail_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE);
self->desktop_settings = g_settings_new ("org.gnome.desktop.interface");
g_signal_connect_object (self->desktop_settings,
"changed::clock-format",
G_CALLBACK (update_clock_format),
self,
G_CONNECT_SWAPPED);
update_clock_format (self);
load_custom_css (self);
start_monitor_time (self);
}
CcBackgroundItem*
cc_background_preview_get_item (CcBackgroundPreview *self)
{
g_return_val_if_fail (CC_IS_BACKGROUND_PREVIEW (self), NULL);
return self->item;
}
void
cc_background_preview_set_item (CcBackgroundPreview *self,
CcBackgroundItem *item)
{
g_return_if_fail (CC_IS_BACKGROUND_PREVIEW (self));
g_return_if_fail (CC_IS_BACKGROUND_ITEM (item));
if (!g_set_object (&self->item, item))
return;
gtk_widget_set_visible (GTK_WIDGET (self->animated_background_icon),
cc_background_item_changes_with_time (item));
gtk_widget_queue_draw (GTK_WIDGET (self->drawing_area));
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ITEM]);
}

View File

@@ -1,36 +0,0 @@
/* cc-background-preview.h
*
* Copyright 2019 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
#include "cc-background-item.h"
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_PREVIEW (cc_background_preview_get_type())
G_DECLARE_FINAL_TYPE (CcBackgroundPreview, cc_background_preview, CC, BACKGROUND_PREVIEW, GtkBox)
CcBackgroundItem* cc_background_preview_get_item (CcBackgroundPreview *self);
void cc_background_preview_set_item (CcBackgroundPreview *self,
CcBackgroundItem *item);
G_END_DECLS

View File

@@ -1,152 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcBackgroundPreview" parent="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">False</property>
<style>
<class name="frame" />
</style>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<!-- Wallpaper -->
<child>
<object class="GtkDrawingArea" id="drawing_area">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="expand">True</property>
<signal name="draw" handler="on_preview_draw_cb" object="CcBackgroundPreview" swapped="yes" />
</object>
</child>
<!-- Desktop / Lock Screen widgets -->
<child type="overlay">
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="expand">True</property>
<child>
<object class="GtkFrame" id="desktop_frame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="shadow-type">none</property>
<property name="valign">start</property>
<style>
<class name="desktop-preview" />
</style>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Activities</property>
</object>
</child>
<child type="center">
<object class="GtkLabel" id="desktop_clock_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">4</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">network-wireless-symbolic</property>
<property name="pixel-size">6</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">audio-volume-high-symbolic</property>
<property name="pixel-size">6</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">battery-low-symbolic</property>
<property name="pixel-size">6</property>
</object>
</child>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkFrame" id="lock_frame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="shadow-type">none</property>
<child>
<object class="GtkLabel" id="lock_screen_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="expand">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
</object>
</child>
<style>
<class name="lock-screen-preview" />
</style>
</object>
</child>
</object>
</child>
<!-- Wallpaper -->
<child type="overlay">
<object class="GtkImage" id="animated_background_icon">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="valign">end</property>
<property name="margin-end">8</property>
<property name="margin-bottom">8</property>
<property name="pixel-size">16</property>
<property name="icon-name">slideshow-emblem</property>
<style>
<class name="slideshow-icon" />
</style>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@@ -1,648 +0,0 @@
/*
* Authors: Rodney Dawes <dobey@ximian.com>
* Bastien Nocera <hadess@hadess.net>
*
* Copyright 2003-2006 Novell, Inc. (www.novell.com)
* Copyright 2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <gio/gio.h>
#include <string.h>
#include <libxml/parser.h>
#include <gdesktop-enums.h>
#include "gdesktop-enums-types.h"
#include "cc-background-item.h"
#include "cc-background-xml.h"
/* The number of items we signal as "added" before
* returning to the main loop */
#define NUM_ITEMS_PER_BATCH 1
struct _CcBackgroundXml
{
GObject parent_instance;
GHashTable *wp_hash;
GAsyncQueue *item_added_queue;
guint item_added_id;
GSList *monitors; /* GSList of GFileMonitor */
};
enum {
ADDED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (CcBackgroundXml, cc_background_xml, G_TYPE_OBJECT)
static gboolean
cc_background_xml_get_bool (const xmlNode *parent,
const gchar *prop_name)
{
xmlChar *prop;
gboolean ret_val = FALSE;
g_return_val_if_fail (parent != NULL, FALSE);
g_return_val_if_fail (prop_name != NULL, FALSE);
prop = xmlGetProp ((xmlNode *) parent, (xmlChar*)prop_name);
if (prop != NULL) {
if (!g_ascii_strcasecmp ((gchar *)prop, "true") || !g_ascii_strcasecmp ((gchar *)prop, "1")) {
ret_val = TRUE;
} else {
ret_val = FALSE;
}
xmlFree (prop);
}
return ret_val;
}
static struct {
int value;
const char *string;
} lookups[] = {
{ G_DESKTOP_BACKGROUND_SHADING_HORIZONTAL, "horizontal-gradient" },
{ G_DESKTOP_BACKGROUND_SHADING_VERTICAL, "vertical-gradient" },
};
static int
enum_string_to_value (GType type,
const char *string)
{
GEnumClass *eclass;
GEnumValue *value;
eclass = G_ENUM_CLASS (g_type_class_peek (type));
value = g_enum_get_value_by_nick (eclass, string);
/* Here's a bit of hand-made parsing, bad bad */
if (value == NULL) {
guint i;
for (i = 0; i < G_N_ELEMENTS (lookups); i++) {
if (g_str_equal (lookups[i].string, string))
return lookups[i].value;
}
g_warning ("Unhandled value '%s' for enum '%s'",
string, G_FLAGS_CLASS_TYPE_NAME (eclass));
return 0;
}
return value->value;
}
static gboolean
idle_emit (CcBackgroundXml *xml)
{
gint i;
g_async_queue_lock (xml->item_added_queue);
for (i = 0; i < NUM_ITEMS_PER_BATCH; i++) {
g_autoptr(GObject) item = NULL;
item = g_async_queue_try_pop_unlocked (xml->item_added_queue);
if (item == NULL)
break;
g_signal_emit (G_OBJECT (xml), signals[ADDED], 0, item);
}
g_async_queue_unlock (xml->item_added_queue);
if (g_async_queue_length (xml->item_added_queue) > 0) {
return TRUE;
} else {
xml->item_added_id = 0;
return FALSE;
}
}
static void
emit_added_in_idle (CcBackgroundXml *xml,
GObject *object)
{
g_async_queue_lock (xml->item_added_queue);
g_async_queue_push_unlocked (xml->item_added_queue, object);
if (xml->item_added_id == 0)
xml->item_added_id = g_idle_add ((GSourceFunc) idle_emit, xml);
g_async_queue_unlock (xml->item_added_queue);
}
#define NONE "(none)"
#define UNSET_FLAG(flag) G_STMT_START{ (flags&=~(flag)); }G_STMT_END
#define SET_FLAG(flag) G_STMT_START{ (flags|=flag); }G_STMT_END
static gboolean
cc_background_xml_load_xml_internal (CcBackgroundXml *xml,
const gchar *filename,
gboolean in_thread)
{
xmlDoc * wplist;
xmlNode * root, * list, * wpa;
xmlChar * nodelang;
const gchar * const * syslangs;
gint i;
gboolean retval;
wplist = xmlParseFile (filename);
retval = FALSE;
if (!wplist)
return retval;
syslangs = g_get_language_names ();
root = xmlDocGetRootElement (wplist);
for (list = root->children; list != NULL; list = list->next) {
if (!strcmp ((gchar *)list->name, "wallpaper")) {
g_autoptr(CcBackgroundItem) item = NULL;
CcBackgroundItemFlags flags;
g_autofree gchar *uri = NULL;
g_autofree gchar *cname = NULL;
g_autofree gchar *id = NULL;
flags = 0;
item = cc_background_item_new (NULL);
g_object_set (G_OBJECT (item),
"is-deleted", cc_background_xml_get_bool (list, "deleted"),
"source-xml", filename,
NULL);
for (wpa = list->children; wpa != NULL; wpa = wpa->next) {
if (wpa->type == XML_COMMENT_NODE) {
continue;
} else if (!strcmp ((gchar *)wpa->name, "filename")) {
if (wpa->last != NULL && wpa->last->content != NULL) {
gchar *content = g_strstrip ((gchar *)wpa->last->content);
g_autofree gchar *bg_uri = NULL;
/* FIXME same rubbish as in other parts of the code */
if (strcmp (content, NONE) == 0) {
bg_uri = NULL;
} else {
g_autoptr(GFile) file = NULL;
g_autofree gchar *dirname = NULL;
dirname = g_path_get_dirname (filename);
file = g_file_new_for_commandline_arg_and_cwd (content, dirname);
bg_uri = g_file_get_uri (file);
}
SET_FLAG(CC_BACKGROUND_ITEM_HAS_URI);
g_object_set (G_OBJECT (item), "uri", bg_uri, NULL);
} else {
break;
}
} else if (!strcmp ((gchar *)wpa->name, "name")) {
if (wpa->last != NULL && wpa->last->content != NULL) {
g_autofree gchar *name = NULL;
nodelang = xmlNodeGetLang (wpa->last);
g_object_get (G_OBJECT (item), "name", &name, NULL);
if (name == NULL && nodelang == NULL) {
g_free (cname);
cname = g_strdup (g_strstrip ((gchar *)wpa->last->content));
g_object_set (G_OBJECT (item), "name", cname, NULL);
} else {
for (i = 0; syslangs[i] != NULL; i++) {
if (!strcmp (syslangs[i], (gchar *)nodelang)) {
g_object_set (G_OBJECT (item), "name",
g_strstrip ((gchar *)wpa->last->content), NULL);
break;
}
}
}
xmlFree (nodelang);
} else {
break;
}
} else if (!strcmp ((gchar *)wpa->name, "options")) {
if (wpa->last != NULL) {
g_object_set (G_OBJECT (item), "placement",
enum_string_to_value (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_STYLE,
g_strstrip ((gchar *)wpa->last->content)), NULL);
SET_FLAG(CC_BACKGROUND_ITEM_HAS_PLACEMENT);
}
} else if (!strcmp ((gchar *)wpa->name, "shade_type")) {
if (wpa->last != NULL) {
g_object_set (G_OBJECT (item), "shading",
enum_string_to_value (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_SHADING,
g_strstrip ((gchar *)wpa->last->content)), NULL);
SET_FLAG(CC_BACKGROUND_ITEM_HAS_SHADING);
}
} else if (!strcmp ((gchar *)wpa->name, "pcolor")) {
if (wpa->last != NULL) {
g_object_set (G_OBJECT (item), "primary-color",
g_strstrip ((gchar *)wpa->last->content), NULL);
SET_FLAG(CC_BACKGROUND_ITEM_HAS_PCOLOR);
}
} else if (!strcmp ((gchar *)wpa->name, "scolor")) {
if (wpa->last != NULL) {
g_object_set (G_OBJECT (item), "secondary-color",
g_strstrip ((gchar *)wpa->last->content), NULL);
SET_FLAG(CC_BACKGROUND_ITEM_HAS_SCOLOR);
}
} else if (!strcmp ((gchar *)wpa->name, "source_url")) {
if (wpa->last != NULL) {
g_object_set (G_OBJECT (item),
"source-url", g_strstrip ((gchar *)wpa->last->content),
"needs-download", FALSE,
NULL);
}
} else if (!strcmp ((gchar *)wpa->name, "text")) {
/* Do nothing here, libxml2 is being weird */
} else {
g_debug ("Unknown Tag in %s: %s", filename, wpa->name);
}
}
/* Check whether the target file exists */
{
const char *uri;
uri = cc_background_item_get_uri (item);
if (uri != NULL)
{
g_autoptr(GFile) file = NULL;
file = g_file_new_for_uri (uri);
if (g_file_query_exists (file, NULL) == FALSE)
{
g_clear_pointer (&cname, g_free);
g_clear_object (&item);
continue;
}
}
}
/* FIXME, this is a broken way of doing,
* need to use proper code here */
uri = g_filename_to_uri (filename, NULL, NULL);
id = g_strdup_printf ("%s#%s", uri, cname);
/* Make sure we don't already have this one and that filename exists */
if (g_hash_table_lookup (xml->wp_hash, id) != NULL) {
continue;
}
g_object_set (G_OBJECT (item), "flags", flags, NULL);
g_hash_table_insert (xml->wp_hash,
g_strdup (id),
g_object_ref (item));
if (in_thread)
emit_added_in_idle (xml, g_object_ref (G_OBJECT (item)));
else
g_signal_emit (G_OBJECT (xml), signals[ADDED], 0, item);
retval = TRUE;
}
}
xmlFreeDoc (wplist);
return retval;
}
static void
gnome_wp_file_changed (GFileMonitor *monitor,
GFile *file,
GFile *other_file,
GFileMonitorEvent event_type,
CcBackgroundXml *data)
{
g_autofree gchar *filename = NULL;
switch (event_type) {
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_CREATED:
filename = g_file_get_path (file);
cc_background_xml_load_xml_internal (data, filename, FALSE);
break;
default:
break;
}
}
static void
cc_background_xml_add_monitor (GFile *directory,
CcBackgroundXml *data)
{
GFileMonitor *monitor;
g_autoptr(GError) error = NULL;
monitor = g_file_monitor_directory (directory,
G_FILE_MONITOR_NONE,
NULL,
&error);
if (error != NULL) {
g_autofree gchar *path = NULL;
path = g_file_get_parse_name (directory);
g_warning ("Unable to monitor directory %s: %s",
path, error->message);
return;
}
g_signal_connect (monitor, "changed",
G_CALLBACK (gnome_wp_file_changed),
data);
data->monitors = g_slist_prepend (data->monitors, monitor);
}
static void
cc_background_xml_load_from_dir (const gchar *path,
CcBackgroundXml *data,
gboolean in_thread)
{
g_autoptr(GFile) directory = NULL;
g_autoptr(GFileEnumerator) enumerator = NULL;
g_autoptr(GError) error = NULL;
if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
return;
}
directory = g_file_new_for_path (path);
enumerator = g_file_enumerate_children (directory,
G_FILE_ATTRIBUTE_STANDARD_NAME,
G_FILE_QUERY_INFO_NONE,
NULL,
&error);
if (error != NULL) {
g_warning ("Unable to check directory %s: %s", path, error->message);
return;
}
while (TRUE) {
g_autoptr(GFileInfo) info = NULL;
const gchar *filename;
g_autofree gchar *fullpath = NULL;
info = g_file_enumerator_next_file (enumerator, NULL, NULL);
if (info == NULL) {
g_file_enumerator_close (enumerator, NULL, NULL);
cc_background_xml_add_monitor (directory, data);
return;
}
filename = g_file_info_get_name (info);
fullpath = g_build_filename (path, filename, NULL);
cc_background_xml_load_xml_internal (data, fullpath, in_thread);
}
}
static void
cc_background_xml_load_list (CcBackgroundXml *data,
gboolean in_thread)
{
const char * const *system_data_dirs;
g_autofree gchar *datadir = NULL;
gint i;
datadir = g_build_filename (g_get_user_data_dir (),
"gnome-background-properties",
NULL);
cc_background_xml_load_from_dir (datadir, data, in_thread);
system_data_dirs = g_get_system_data_dirs ();
for (i = 0; system_data_dirs[i]; i++) {
g_autofree gchar *sdatadir = NULL;
sdatadir = g_build_filename (system_data_dirs[i],
"gnome-background-properties",
NULL);
cc_background_xml_load_from_dir (sdatadir, data, in_thread);
}
}
gboolean
cc_background_xml_load_list_finish (CcBackgroundXml *xml,
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, xml), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
static void
load_list_thread (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
CcBackgroundXml *xml = CC_BACKGROUND_XML (source_object);
cc_background_xml_load_list (xml, TRUE);
g_task_return_boolean (task, TRUE);
}
void
cc_background_xml_load_list_async (CcBackgroundXml *xml,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr(GTask) task = NULL;
g_return_if_fail (CC_IS_BACKGROUND_XML (xml));
task = g_task_new (xml, cancellable, callback, user_data);
g_task_run_in_thread (task, load_list_thread);
}
gboolean
cc_background_xml_load_xml (CcBackgroundXml *xml,
const gchar *filename)
{
g_return_val_if_fail (CC_IS_BACKGROUND_XML (xml), FALSE);
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) == FALSE)
return FALSE;
return cc_background_xml_load_xml_internal (xml, filename, FALSE);
}
static void
single_xml_added (CcBackgroundXml *xml,
CcBackgroundItem *item,
CcBackgroundItem **ret)
{
g_assert (*ret == NULL);
*ret = g_object_ref (item);
}
CcBackgroundItem *
cc_background_xml_get_item (const char *filename)
{
g_autoptr(CcBackgroundXml) xml = NULL;
CcBackgroundItem *item = NULL;
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) == FALSE)
return NULL;
xml = cc_background_xml_new ();
g_signal_connect (G_OBJECT (xml), "added",
G_CALLBACK (single_xml_added), &item);
if (cc_background_xml_load_xml (xml, filename) == FALSE)
return NULL;
return item;
}
static const char *
enum_to_str (GType type,
int v)
{
GEnumClass *eclass;
GEnumValue *value;
eclass = G_ENUM_CLASS (g_type_class_peek (type));
value = g_enum_get_value (eclass, v);
g_assert (value);
return value->value_nick;
}
void
cc_background_xml_save (CcBackgroundItem *item,
const char *filename)
{
xmlDoc *wp;
xmlNode *root, *wallpaper;
xmlNode *xml_item G_GNUC_UNUSED;
const char * none = "(none)";
const char *placement_str, *shading_str;
g_autofree gchar *name = NULL;
g_autofree gchar *pcolor = NULL;
g_autofree gchar *scolor = NULL;
g_autofree gchar *uri = NULL;
g_autofree gchar *source_url = NULL;
CcBackgroundItemFlags flags;
GDesktopBackgroundStyle placement;
GDesktopBackgroundShading shading;
xmlKeepBlanksDefault (0);
wp = xmlNewDoc ((xmlChar *)"1.0");
xmlCreateIntSubset (wp, (xmlChar *)"wallpapers", NULL, (xmlChar *)"gnome-wp-list.dtd");
root = xmlNewNode (NULL, (xmlChar *)"wallpapers");
xmlDocSetRootElement (wp, root);
g_object_get (G_OBJECT (item),
"name", &name,
"uri", &uri,
"shading", &shading,
"placement", &placement,
"primary-color", &pcolor,
"secondary-color", &scolor,
"source-url", &source_url,
"flags", &flags,
NULL);
placement_str = enum_to_str (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_STYLE, placement);
shading_str = enum_to_str (G_DESKTOP_TYPE_DESKTOP_BACKGROUND_SHADING, shading);
wallpaper = xmlNewChild (root, NULL, (xmlChar *)"wallpaper", NULL);
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"name", (xmlChar *)name);
if (flags & CC_BACKGROUND_ITEM_HAS_URI &&
uri != NULL)
{
g_autoptr(GFile) file = NULL;
g_autofree gchar *fname = NULL;
file = g_file_new_for_commandline_arg (uri);
fname = g_file_get_path (file);
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"filename", (xmlChar *)fname);
}
else if (flags & CC_BACKGROUND_ITEM_HAS_URI)
{
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"filename", (xmlChar *)none);
}
if (flags & CC_BACKGROUND_ITEM_HAS_PLACEMENT)
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"options", (xmlChar *)placement_str);
if (flags & CC_BACKGROUND_ITEM_HAS_SHADING)
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"shade_type", (xmlChar *)shading_str);
if (flags & CC_BACKGROUND_ITEM_HAS_PCOLOR)
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"pcolor", (xmlChar *)pcolor);
if (flags & CC_BACKGROUND_ITEM_HAS_SCOLOR)
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"scolor", (xmlChar *)scolor);
if (source_url != NULL)
xml_item = xmlNewTextChild (wallpaper, NULL, (xmlChar *)"source_url", (xmlChar *)source_url);
xmlSaveFormatFile (filename, wp, 1);
xmlFreeDoc (wp);
}
static void
cc_background_xml_finalize (GObject *object)
{
CcBackgroundXml *xml;
g_return_if_fail (object != NULL);
g_return_if_fail (CC_IS_BACKGROUND_XML (object));
xml = CC_BACKGROUND_XML (object);
g_slist_free_full (xml->monitors, g_object_unref);
g_clear_pointer (&xml->wp_hash, g_hash_table_destroy);
if (xml->item_added_id != 0) {
g_source_remove (xml->item_added_id);
xml->item_added_id = 0;
}
g_clear_pointer (&xml->item_added_queue, g_async_queue_unref);
G_OBJECT_CLASS (cc_background_xml_parent_class)->finalize (object);
}
static void
cc_background_xml_class_init (CcBackgroundXmlClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = cc_background_xml_finalize;
signals[ADDED] = g_signal_new ("added",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, CC_TYPE_BACKGROUND_ITEM);
}
static void
cc_background_xml_init (CcBackgroundXml *xml)
{
xml->wp_hash = g_hash_table_new_full (g_str_hash,
g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
xml->item_added_queue = g_async_queue_new_full ((GDestroyNotify) g_object_unref);
}
CcBackgroundXml *
cc_background_xml_new (void)
{
return CC_BACKGROUND_XML (g_object_new (CC_TYPE_BACKGROUND_XML, NULL));
}

View File

@@ -1,46 +0,0 @@
/*
* Authors: Rodney Dawes <dobey@ximian.com>
*
* Copyright 2003-2012 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <gtk/gtk.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define CC_TYPE_BACKGROUND_XML (cc_background_xml_get_type ())
G_DECLARE_FINAL_TYPE (CcBackgroundXml, cc_background_xml, CC, BACKGROUND_XML, GObject)
CcBackgroundXml *cc_background_xml_new (void);
void cc_background_xml_save (CcBackgroundItem *item,
const char *filename);
CcBackgroundItem *cc_background_xml_get_item (const char *filename);
gboolean cc_background_xml_load_xml (CcBackgroundXml *data,
const char *filename);
void cc_background_xml_load_list_async (CcBackgroundXml *xml,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean cc_background_xml_load_list_finish (CcBackgroundXml *xml,
GAsyncResult *result,
GError **error);
G_END_DECLS

View File

@@ -1,14 +0,0 @@
[Desktop Entry]
Name=Background
Comment=Change your background image to a wallpaper or photo
Exec=gnome-control-center background
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=preferences-desktop-wallpaper
Terminal=false
Type=Application
NoDisplay=true
StartupNotify=true
Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-PersonalizationSettings;
OnlyShowIn=GNOME;
# Translators: Search terms to find the Background panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=Wallpaper;Screen;Desktop;

View File

@@ -1,115 +0,0 @@
panels_list += cappletname
desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
desktop_in = configure_file(
input: desktop + '.in.in',
output: desktop + '.in',
configuration: desktop_conf
)
i18n.merge_file(
desktop,
type: 'desktop',
input: desktop_in,
output: desktop,
po_dir: po_dir,
install: true,
install_dir: control_center_desktopdir
)
install_data(
'slideshow-symbolic.svg',
install_dir: join_paths(control_center_icondir, 'hicolor', 'scalable', 'categories')
)
install_data(
'slideshow-emblem.svg',
install_dir: join_paths(control_center_icondir, 'hicolor', 'scalable', 'emblems')
)
install_data(
'noise-texture-light.png',
install_dir: join_paths(control_center_pkgdatadir, 'pixmaps')
)
common_sources = []
enums = 'gdesktop-enums-types'
enums_header = files(
gsettings_desktop_dep.get_pkgconfig_variable('prefix') + '/include/gsettings-desktop-schemas/gdesktop-enums.h',
'cc-background-item.h'
)
common_sources += gnome.mkenums(
enums + '.h',
sources: enums_header,
fhead: '#pragma once\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
fprod: '/* enumerations from "@filename@" */\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define G_DESKTOP_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n',
ftail: 'G_END_DECLS\n'
)
common_sources += gnome.mkenums(
enums + '.c',
sources: enums_header,
fhead: '#include <gdesktop-enums.h>\n#include "gdesktop-enums-types.h"\n#include "cc-background-item.h"',
fprod: '\n/* enumerations from "@filename@" */',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
vtail: ' { 0, NULL, NULL }\n };\n etype = g_@type@_register_static ("@EnumName@", values);\n }\n return etype;\n}\n'
)
resource_data = files(
'cc-background-chooser.ui',
'cc-background-panel.ui',
'cc-background-preview.ui',
'preview.css',
)
common_sources += gnome.compile_resources(
'cc-@0@-resources'.format(cappletname),
cappletname + '.gresource.xml',
c_name: 'cc_' + cappletname,
dependencies: resource_data,
export: true
)
sources = common_sources + files(
'bg-colors-source.c',
'bg-pictures-source.c',
'bg-recent-source.c',
'bg-source.c',
'bg-wallpapers-source.c',
'cc-background-chooser.c',
'cc-background-grilo-miner.c',
'cc-background-item.c',
'cc-background-panel.c',
'cc-background-preview.c',
'cc-background-xml.c',
)
deps = common_deps + [
gdk_pixbuf_dep,
gnome_desktop_dep,
goa_dep,
libxml_dep,
dependency('cairo-gobject'),
dependency('grilo-0.3', version: '>= 0.3.0')
]
cflags += [
'-DDATADIR="@0@"'.format(control_center_datadir),
'-DGNOME_DESKTOP_USE_UNSTABLE_API'
]
if gnome_desktop_dep.version().version_compare('>=3.35.4')
cflags += '-DGNOME_DESKTOP_BG_API_BREAK'
endif
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
dependencies: deps,
c_args: cflags,
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -1,40 +0,0 @@
frame.desktop-preview {
min-height: 10px;
padding: 0 4px;
background-color: black;
}
frame.desktop-preview image {
color: white;
}
frame.desktop-preview label {
color: white;
font-weight: bold;
font-size: 6px;
}
frame.lock-screen-preview {
border: solid rgba(0, 0, 0, 0.33);
border-width: 10px 0 0 0;
}
frame.lock-screen-preview label {
color: white;
font-weight: bold;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
font-size: 1.2em;
}
image.slideshow-icon {
color: white;
-gtk-icon-shadow: 0 1px 2px rgba(0, 0, 0, 0.33);
}
button.remove-button {
border-radius: 9999px;
-gtk-outline-radius: 9999px;
padding: 1px 0px; /* circles instead of ellipses */
background-origin: padding-box, border-box;
background-clip: padding-box, border-box;
}

View File

@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg4978"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="slideshow-emblem.svg">
<defs
id="defs4980" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="41.944792"
inkscape:cy="39.155574"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="962"
inkscape:window-height="817"
inkscape:window-x="4"
inkscape:window-y="51"
inkscape:window-maximized="0" />
<metadata
id="metadata4983">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-924.36215)">
<g
style="display:inline"
id="g14317"
transform="matrix(7.1989829,0,0,7.1989829,-772.01578,-783.40043)">
<g
style="stroke:#000000;stroke-opacity:1"
transform="translate(69,-449)"
id="g14258"
inkscape:label="document-open-recent">
<path
sodipodi:type="arc"
style="color:#000000;fill:none;stroke:#000000;stroke-width:2.15384626;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path14260"
sodipodi:cx="48"
sodipodi:cy="696"
sodipodi:rx="7"
sodipodi:ry="7"
d="m 55,696 c 0,3.86599 -3.134007,7 -7,7 -3.865993,0 -7,-3.13401 -7,-7 0,-3.86599 3.134007,-7 7,-7 3.865993,0 7,3.13401 7,7 z"
transform="matrix(0.92857143,0,0,0.92857143,2.9285714,49.21429)" />
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 45.5,693.5 2,2 3,-3"
id="path14262"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
</g>
<g
inkscape:label="document-open-recent"
id="g4692"
transform="translate(69,-450)">
<path
transform="matrix(0.92857143,0,0,0.92857143,2.9285714,49.21429)"
d="m 55,696 c 0,3.86599 -3.134007,7 -7,7 -3.865993,0 -7,-3.13401 -7,-7 0,-3.86599 3.134007,-7 7,-7 3.865993,0 7,3.13401 7,7 z"
sodipodi:ry="7"
sodipodi:rx="7"
sodipodi:cy="696"
sodipodi:cx="48"
id="path3869"
style="color:#000000;fill:none;stroke:#ffffff;stroke-width:2.15384626;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<path
sodipodi:nodetypes="ccc"
inkscape:connector-curvature="0"
id="path4639"
d="m 45.5,693.5 2,2 3,-3"
style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
id="svg5594"
version="1.1"
inkscape:version="0.48.0 r9654"
sodipodi:docname="slideshow-emblem-symbolic.svg">
<defs
id="defs5596" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.4"
inkscape:cx="10.858512"
inkscape:cy="10.780448"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="789"
inkscape:window-height="774"
inkscape:window-x="4"
inkscape:window-y="51"
inkscape:window-maximized="0" />
<metadata
id="metadata5599">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
<g
id="g3763"
transform="matrix(0.86221939,0,0,0.86221939,1.0303599,144.13347)">
<path
inkscape:connector-curvature="0"
id="path14584"
d="m 7.9642862,1038.3322 c -3.3085937,0 -5.9942603,2.6857 -5.9942603,5.9943 0,3.3086 2.6856666,5.9942 5.9942603,5.9942 3.3085938,0 5.9942608,-2.6856 5.9942608,-5.9942 0,-3.3086 -2.685667,-5.9943 -5.9942608,-5.9943 z m 0,0.8457 c 2.8454368,0 5.1485968,2.3031 5.1485968,5.1486 0,2.8454 -2.30316,5.1486 -5.1485968,5.1486 -2.8454368,0 -5.148597,-2.3032 -5.148597,-5.1486 0,-2.8455 2.3031602,-5.1486 5.148597,-5.1486 z"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:1.0767436;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
<path
inkscape:connector-curvature="0"
id="path14586"
d="m 10.5,1041.3125 a 0.42854288,0.42854288 0 0 0 -0.28125,0.125 l -2.25,2.2813 -1.40625,-1.4063 a 0.4310176,0.4310176 0 1 0 -0.625,0.5937 l 1.71875,1.7188 a 0.42854288,0.42854288 0 0 0 0.625,0 l 2.5625,-2.5625 a 0.42854288,0.42854288 0 0 0 -0.34375,-0.75 z"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#999999;fill-opacity:1;stroke:none;stroke-width:0.85700005;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/bluetooth">
<file preprocess="xml-stripblanks">cc-bluetooth-panel.ui</file>
</gresource>
</gresources>

View File

@@ -1,261 +0,0 @@
/*
*
* Copyright (C) 2013 Bastien Nocera <hadess@hadess.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <shell/cc-shell.h>
#include <shell/cc-object-storage.h>
#include <bluetooth-settings-widget.h>
#include "cc-bluetooth-panel.h"
#include "cc-bluetooth-resources.h"
struct _CcBluetoothPanel {
CcPanel parent_instance;
GtkBox *airplane_box;
GtkBox *disabled_box;
GtkSwitch *enable_switch;
GtkBox *header_box;
GtkBox *hw_airplane_box;
GtkBox *no_devices_box;
BluetoothSettingsWidget *settings_widget;
GtkStack *stack;
/* Killswitch */
GDBusProxy *rfkill;
GDBusProxy *properties;
gboolean airplane_mode;
gboolean bt_airplane_mode;
gboolean hardware_airplane_mode;
gboolean has_airplane_mode;
};
CC_PANEL_REGISTER (CcBluetoothPanel, cc_bluetooth_panel)
static const char *
cc_bluetooth_panel_get_help_uri (CcPanel *panel)
{
return "help:gnome-help/bluetooth";
}
static void
cc_bluetooth_panel_finalize (GObject *object)
{
CcBluetoothPanel *self;
self = CC_BLUETOOTH_PANEL (object);
g_clear_object (&self->properties);
g_clear_object (&self->rfkill);
G_OBJECT_CLASS (cc_bluetooth_panel_parent_class)->finalize (object);
}
static void
cc_bluetooth_panel_constructed (GObject *object)
{
CcBluetoothPanel *self = CC_BLUETOOTH_PANEL (object);
G_OBJECT_CLASS (cc_bluetooth_panel_parent_class)->constructed (object);
/* add kill switch widgets */
cc_shell_embed_widget_in_header (cc_panel_get_shell (CC_PANEL (self)),
GTK_WIDGET (self->header_box), GTK_POS_RIGHT);
}
static void
enable_switch_changed_cb (CcBluetoothPanel *self)
{
gboolean state;
state = gtk_switch_get_active (self->enable_switch);
g_debug ("Power switched to %s", state ? "on" : "off");
g_dbus_proxy_call (self->properties,
"Set",
g_variant_new_parsed ("('org.gnome.SettingsDaemon.Rfkill', 'BluetoothAirplaneMode', %v)",
g_variant_new_boolean (!state)),
G_DBUS_CALL_FLAGS_NONE,
-1,
cc_panel_get_cancellable (CC_PANEL (self)),
NULL, NULL);
}
static void
adapter_status_changed_cb (CcBluetoothPanel *self)
{
GtkAlign valign;
gboolean sensitive, powered, change_powered;
GtkWidget *page;
g_debug ("Updating airplane mode: BluetoothHasAirplaneMode %d, BluetoothHardwareAirplaneMode %d, BluetoothAirplaneMode %d, AirplaneMode %d",
self->has_airplane_mode, self->hardware_airplane_mode, self->bt_airplane_mode, self->airplane_mode);
change_powered = TRUE;
valign = GTK_ALIGN_CENTER;
if (self->has_airplane_mode == FALSE) {
g_debug ("No Bluetooth available");
sensitive = FALSE;
powered = FALSE;
page = GTK_WIDGET (self->no_devices_box);
} else if (self->hardware_airplane_mode) {
g_debug ("Bluetooth is Hard blocked");
sensitive = FALSE;
powered = FALSE;
page = GTK_WIDGET (self->hw_airplane_box);
} else if (self->airplane_mode) {
g_debug ("Airplane mode is on, Wi-Fi and Bluetooth are disabled");
sensitive = FALSE;
powered = FALSE;
page = GTK_WIDGET (self->airplane_box);
} else if (self->bt_airplane_mode ||
!bluetooth_settings_widget_get_default_adapter_powered (self->settings_widget)) {
g_debug ("Default adapter is unpowered, but should be available");
sensitive = TRUE;
change_powered = FALSE;
page = GTK_WIDGET (self->disabled_box);
} else {
g_debug ("Bluetooth is available and powered");
sensitive = TRUE;
powered = TRUE;
page = GTK_WIDGET (self->settings_widget);
valign = GTK_ALIGN_FILL;
}
gtk_widget_set_valign (GTK_WIDGET (self->stack), valign);
gtk_widget_set_sensitive (GTK_WIDGET (self->header_box), sensitive);
if (change_powered) {
g_signal_handlers_block_by_func (self->enable_switch, enable_switch_changed_cb, self);
gtk_switch_set_active (self->enable_switch, powered);
g_signal_handlers_unblock_by_func (self->enable_switch, enable_switch_changed_cb, self);
}
gtk_stack_set_visible_child (self->stack, page);
}
static void
airplane_mode_changed (CcBluetoothPanel *self)
{
g_autoptr(GVariant) airplane_mode = NULL;
g_autoptr(GVariant) bluetooth_airplane_mode = NULL;
g_autoptr(GVariant) bluetooth_hardware_airplane_mode = NULL;
g_autoptr(GVariant) bluetooth_has_airplane_mode = NULL;
airplane_mode = g_dbus_proxy_get_cached_property (self->rfkill, "AirplaneMode");
self->airplane_mode = g_variant_get_boolean (airplane_mode);
bluetooth_airplane_mode = g_dbus_proxy_get_cached_property (self->rfkill, "BluetoothAirplaneMode");
self->bt_airplane_mode = g_variant_get_boolean (bluetooth_airplane_mode);
bluetooth_hardware_airplane_mode = g_dbus_proxy_get_cached_property (self->rfkill, "BluetoothHardwareAirplaneMode");
self->hardware_airplane_mode = g_variant_get_boolean (bluetooth_hardware_airplane_mode);
bluetooth_has_airplane_mode = g_dbus_proxy_get_cached_property (self->rfkill, "BluetoothHasAirplaneMode");
self->has_airplane_mode = g_variant_get_boolean (bluetooth_has_airplane_mode);
adapter_status_changed_cb (self);
}
static void
airplane_mode_off_button_clicked_cb (CcBluetoothPanel *self)
{
g_debug ("Airplane Mode Off clicked, disabling airplane mode");
g_dbus_proxy_call (self->rfkill,
"org.freedesktop.DBus.Properties.Set",
g_variant_new_parsed ("('org.gnome.SettingsDaemon.Rfkill',"
"'AirplaneMode', %v)",
g_variant_new_boolean (FALSE)),
G_DBUS_CALL_FLAGS_NONE,
-1,
cc_panel_get_cancellable (CC_PANEL (self)),
NULL, NULL);
}
static void
panel_changed_cb (CcBluetoothPanel *self,
const char *panel)
{
CcShell *shell;
g_autoptr(GError) error = NULL;
shell = cc_panel_get_shell (CC_PANEL (self));
if (cc_shell_set_active_panel_from_id (shell, panel, NULL, &error) == FALSE)
g_warning ("Failed to activate '%s' panel: %s", panel, error->message);
}
static void
cc_bluetooth_panel_class_init (CcBluetoothPanelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
object_class->constructed = cc_bluetooth_panel_constructed;
object_class->finalize = cc_bluetooth_panel_finalize;
panel_class->get_help_uri = cc_bluetooth_panel_get_help_uri;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/bluetooth/cc-bluetooth-panel.ui");
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, airplane_box);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, disabled_box);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, enable_switch);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, header_box);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, no_devices_box);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, hw_airplane_box);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, settings_widget);
gtk_widget_class_bind_template_child (widget_class, CcBluetoothPanel, stack);
gtk_widget_class_bind_template_callback (widget_class, adapter_status_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, airplane_mode_off_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, enable_switch_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, panel_changed_cb);
}
static void
cc_bluetooth_panel_init (CcBluetoothPanel *self)
{
bluetooth_settings_widget_get_type ();
g_resources_register (cc_bluetooth_get_resource ());
gtk_widget_init_template (GTK_WIDGET (self));
/* RFKill */
self->rfkill = cc_object_storage_create_dbus_proxy_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"org.gnome.SettingsDaemon.Rfkill",
"/org/gnome/SettingsDaemon/Rfkill",
"org.gnome.SettingsDaemon.Rfkill",
NULL, NULL);
self->properties = cc_object_storage_create_dbus_proxy_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"org.gnome.SettingsDaemon.Rfkill",
"/org/gnome/SettingsDaemon/Rfkill",
"org.freedesktop.DBus.Properties",
NULL, NULL);
airplane_mode_changed (self);
g_signal_connect_object (self->rfkill, "g-properties-changed",
G_CALLBACK (airplane_mode_changed), self, G_CONNECT_SWAPPED);
}

View File

@@ -1,34 +0,0 @@
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2005-2008 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2006-2010 Bastien Nocera <hadess@hadess.net>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#pragma once
#include <shell/cc-shell.h>
G_BEGIN_DECLS
#define CC_TYPE_BLUETOOTH_PANEL (cc_bluetooth_panel_get_type ())
G_DECLARE_FINAL_TYPE (CcBluetoothPanel, cc_bluetooth_panel, CC, BLUETOOTH_PANEL, CcPanel)
G_END_DECLS

View File

@@ -1,200 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<template class="CcBluetoothPanel" parent="CcPanel">
<property name="visible">True</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<child>
<object class="GtkBox" id="no_devices_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">bluetooth-active-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">No Bluetooth Found</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Plug in a dongle to use Bluetooth.</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="disabled_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">bluetooth-active-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Bluetooth Turned Off</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Turn on to connect devices and receive file transfers.</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="airplane_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">airplane-mode-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Airplane Mode is on</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Bluetooth is disabled when airplane mode is on.</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="label" translatable="yes">Turn Off Airplane Mode</property>
<property name="halign">center</property>
<property name="valign">center</property>
<signal name="clicked" handler="airplane_mode_off_button_clicked_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="hw_airplane_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="margin_top">64</property>
<property name="margin_bottom">64</property>
<property name="margin_start">12</property>
<property name="margin_end">12</property>
<property name="spacing">24</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">airplane-mode-symbolic</property>
<property name="pixel_size">192</property>
<style>
<class name="dim-label"/>
</style>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Hardware Airplane Mode is on</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.2"/>
</attributes>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Turn off the Airplane mode switch to enable Bluetooth.</property>
</object>
</child>
</object>
</child>
<child>
<object class="BluetoothSettingsWidget" id="settings_widget">
<property name="visible">True</property>
<signal name="panel-changed" handler="panel_changed_cb" object="CcBluetoothPanel" swapped="yes"/>
<signal name="adapter-status-changed" handler="adapter_status_changed_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
</child>
</object>
</child>
</template>
<object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSwitch" id="enable_switch">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<signal name="notify::active" handler="enable_switch_changed_cb" object="CcBluetoothPanel" swapped="yes"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">4</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
</interface>

View File

@@ -1,18 +0,0 @@
[Desktop Entry]
Name=Bluetooth
Comment=Turn Bluetooth on and off and connect your devices
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=bluetooth
Exec=gnome-control-center bluetooth
Terminal=false
Type=Application
NoDisplay=true
Categories=GTK;GNOME;Settings;X-GNOME-NetworkSettings;HardwareSettings;X-GNOME-Settings-Panel;X-GNOME-ConnectivitySettings;
OnlyShowIn=GNOME;Unity;
StartupNotify=true
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-bluetooth
X-GNOME-Bugzilla-Component=properties
X-GNOME-Bugzilla-Version=@VERSION@
# Translators: Search terms to find the Bluetooth panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=share;sharing;bluetooth;obex;

View File

@@ -1,40 +0,0 @@
panels_list += cappletname
desktop = 'gnome-@0@-panel.desktop'.format(cappletname)
desktop_in = configure_file(
input: desktop + '.in.in',
output: desktop + '.in',
configuration: desktop_conf
)
i18n.merge_file(
desktop,
type: 'desktop',
input: desktop_in,
output: desktop,
po_dir: po_dir,
install: true,
install_dir: control_center_desktopdir
)
sources = files('cc-bluetooth-panel.c')
resource_data = files('cc-bluetooth-panel.ui')
sources += gnome.compile_resources(
'cc-' + cappletname + '-resources',
cappletname + '.gresource.xml',
c_name: 'cc_' + cappletname,
dependencies: resource_data,
export: true
)
deps = common_deps + [gnome_bluetooth_dep]
panels_libs += static_library(
cappletname,
sources: sources,
include_directories: top_inc,
dependencies: deps,
c_args: cflags
)

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/control-center/camera">
<file preprocess="xml-stripblanks">cc-camera-panel.ui</file>
</gresource>
</gresources>

Some files were not shown because too many files have changed in this diff Show More