Commit graph

210 commits

Author SHA1 Message Date
Robert Ancell
91fbc1b8df sharing: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
Maksym Hazevych
b5cee63632 Use page for description instead of single group
When there is only one AdwPreferencesGroup in a whole
AdwPreferencesPage, use "description" property of the latter.
2023-06-06 13:40:33 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Felipe Borges
073cf028a2 sharing: Add subtitle to each panel row
Fixes #2407
2023-05-15 13:37:17 +02:00
Felipe Borges
36938d53d6 sharing: Add icons next to each row
See #2407
2023-05-15 13:37:17 +02:00
velsinki
efc595cccd sharing: Fix visual bug for active indicators
The switch for the current network was only updated to TRUE after a
network change. However, if a new network was not enabled, the switch
should be set to FALSE. This is now properly handled.

Furthermore, the Off/Enabled/Active indicator was also inconsistent
after network changes due to the is_visible check failing sometimes,
even after changing to an already enabled network. Because the actual
current network state is now better tracked, we can just check the state
of the switch instead.
2023-05-05 09:35:01 +00:00
Automeris naranja
13e4e0c242 general: Set a minimum size for various dialogs
This change prevents some dialogs from being shrunk
to a really small size by setting a minimum size for them.
2023-05-04 09:54:07 +00:00
Gotam Gorabh
8cb77b4d3a sharing:removed global master switch
These changes remove the global master switch from
sharing panel and set main_list_box active.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2415
2023-04-12 13:47:31 +00:00
velsinki
e61b270fb7 sharing: Fix network row visible name bug
In `cc_sharing_networks_new_row`, the `network_name` is not being set to
the new row, but to `self->current_row`. This is incorrect behavior,
as it leaves the new row without any title, and overwrites the title of
the current row incorrectly to the last network entry in the enabled
networks list. This fix correctly sets the name to the new row instead.

This problem is at least discussed in #2318 (point 3) and causes some
confusion in #2299 as well.
2023-04-03 08:46:36 +00:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
velsinki
d766a0c0c6 sharing: Disable AdwActionRow markup for networks
Network names have many allowed characters, among which `&`, `<`, and
`>`. These are problematic for Pango markup. By default, AdwActionRow
has markup enabled for its title. We could escape strings at every
`adw_preferences_row_set_title` call, but this might be easy to forget
in the future. Instead, let's disable markup altogether for these rows.
2023-03-24 00:56:03 +00:00
Alessandro Bono
9d2844e02f sharing: Set active property instead of state
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
2023-03-03 18:16:57 +00:00
Alessandro Bono
4cacdb3544 sharing: Connect to the active property instead of state
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
2023-03-03 18:16:57 +00:00
Alessandro Bono
b892e6ff15 sharing: Bind to the active property instead of state
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
2023-03-03 18:16:57 +00:00
Alessandro Bono
e7458ff1b4 sharing: Set active property instead of state
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
2023-03-03 18:16:57 +00:00
Jonas Ådahl
b612179cdb panels/remote-desktop: Popuplate address label
This means the address will displayed as intended, and clicking the copy
icon will copy it again.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2173136
2023-03-03 13:57:09 +01:00
Felipe Borges
294156c0f9 Drop most uses of deprecated gtk_style_context_add/remove_class
GtkStyleContext will be deprecated in gtk 4.10.
https://docs.gtk.org/gtk4/class.StyleContext.html

This preserves code blocks where additional GtkStyleContext operations
were used, such as gtk_style_context_save/restore.
2023-01-05 18:55:51 +00:00
sunflowerskater
e27d13183e sharing: Rename "Computer Name" AdwEntryRow to "Device Name"
Currently, the "Computer Name" AdwEntryRow has some problems due to its label name:

- It's inconsistent with the AdwEntryRow from info-overview, which uses the label "Device Name"
- "Computer Name" isn't suitable for other kind of devices
2023-01-02 12:18:55 +00:00
Felipe Borges
9871a09143 common, info-overview, sharing: Use AdwEntryRow for Hostname entries
See mockups in https://gitlab.gnome.org/Teams/Design/settings-mockups/-/issues/48
2022-12-13 16:16:08 +00:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

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

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +00:00
Felipe Borges
ec2c3d477d sharing: Use AdwEntryRow for remote-desktop setup
See #1930
2022-07-26 20:11:56 +00:00
Jens Alpers
b9bf21a016 Issue 1846, Check for NULL pointer before gtk_editable_set_text 2022-07-11 02:20:50 +00:00
Lukáš Tyrychtr
af197cb813 Add missing a11y labels 2022-05-31 21:08:44 +00:00
Felipe Borges
44fdf9a492 sharing: Let GtkWindowControls add its own buttons
On the Verify Encryption dialog we were adding a GtkWindowControls
widget with a button child. This is a misunderstanding of the behavior
of GtkWindowControls, which adds its own buttons to the window.

Let's remove our custom close-button and its callback, since the
previous commit disabled this codepath for hiding the dialog.
2022-05-13 13:18:01 +02:00
Felipe Borges
a701ab0b8b sharing: Set Verify Encryption dialog to "hide-on-close"
This way GtkWindow handles the hiding of the dialog instead of the
callback of the close-button.

Fixes #1832
2022-05-13 13:18:01 +02:00
Jeremy Bicha
f94c96577b sharing: Turn off RDP gsettings key when turning off RDP
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1825
2022-05-11 00:28:25 +00:00
Jonas Ådahl
48354fde43 sharing/remote-desktop/fingerprint: Add missing period to string 2022-05-10 20:58:40 +00:00
Jonas Ådahl
6affceebee sharing/remote-desktop: Show toasts when copying 2022-05-10 20:58:40 +00:00
Robert Ancell
7f77d087f4 sharing: Fix misleading widget name 2022-04-26 21:31:27 +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
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
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
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
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
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00