Commit graph

231 commits

Author SHA1 Message Date
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
Georges Basile Stavracas Neto
4300a4a290 panels: Use new CcPanel helpers for title widgets
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Christopher Davis
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
Christopher Davis
981a8cea7b panels: Use .boxed-list instead of .content
The `.content` style class is deprecated in favor
of the `.boxed-list` style class, which is named
after the design pattern it's used for.
2021-12-16 12:52:44 -08:00
Georges Basile Stavracas Neto
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
Jens Georg
598505e719 sharing: Also disable Tracker3
Fixes #1160
2020-10-29 20:31:17 +00:00
Adrien Plazas
f06379e30c Replace HdyColumn by HdyClamp
In libhandy 1, HdyClamp replaces HdyColumn. This stops setting values
when they match HdyClamp's defaults.
2020-07-20 08:04:28 +02:00
Pascal Nowack
f20e54698f sharing: Remove vino preferences
They are unused now.
2020-07-07 21:23:17 +02:00
Pascal Nowack
2a25607e74 sharing: Replace vino with gnome-remote-desktop for X11 sessions
vino does not work in Wayland sessions and gnome-settings-daemon
removed vino support in [1] which will effectively not start
'vino-server' any more.
The replacement for vino is gnome-remote-desktop since it works in both
Wayland and X11 sessions.
The gnome-remote-desktop sharing panel however is currently only shown
for Wayland sessions, which makes it harder to use it for X11 sessions
since the user has to login into the Wayland sessions just to be able
to enable gnome-remote-desktop.

Therefore, also remove vino from g-c-c and replace it with
gnome-remote-desktop for X11 sessions, too.

[1] https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/135

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/212
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/937
2020-07-07 21:23:17 +02:00
Mohammed Sadiq
a623a3a2e3 sharing: Use the new list row patterns 2020-05-12 22:33:15 +00:00
António Fernandes
cde8f69ad6 sharing: Set label for checkbox properly
The Screen Sharing dialog used to have a switch, which was changed to a
checkbox in 8b68961431

However, unlike switches, checkboxes are expected to have clicable labels

Let's set the label properly, instead of doing it the switch way.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/565
2020-03-30 15:37:03 +00:00
Robert Ancell
3e4c1d3822 sharing: Move GTK code that was innappropriately in a helper function 2020-03-30 16:18:49 +13:00
Robert Ancell
10e73b733b sharing: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:49 +13:00
Robert Ancell
dcedf93e72 sharing: Add missing widget cast
Was missed in a5de11c3d6.
2020-02-25 09:46:13 +13:00
Carlos Garnacho
a5de11c3d6 sharing: Remember the password on remote desktop sharing
If we are going through mutter's RemoteDesktop interface, we don't
seemingly remember the password set. Add support for reading it
from secrets and change the entry password on dialog construction,
to bring it on par with our vino handling.
2020-02-14 13:32:44 +00:00
Robert Ancell
93b14a4339 panel: Move shared GCancellable code into panel class
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
2020-02-03 09:36:24 +13:00
Robert Ancell
01fea23df1 sharing: Remove markup from translatable strings 2020-01-06 16:57:43 +00:00
Robert Ancell
51e0b38774 sharing: Replace ifdefs with #pragma once 2019-11-27 21:56:10 +00:00
Robert Ancell
3173ccefb7 sharing: Fix memory leak 2019-11-27 21:25:34 +00:00
Felipe Borges
1b81221092 sharing: Set new shared folder visible as soon as it gets added
When adding a Shared Folder row to the listbox, we were not settings
it to visible. Causing it to be hidden until the next time the panel
gets populated.

Fixes #580
2019-09-12 11:04:57 +02:00
Robert Ancell
90c7311664 sharing: Make .ui filename match the .c filename 2019-09-09 21:58:00 +00:00
Mohammed Sadiq
faf305772c sharing: Allow dialogs to have smaller width
Reduce margins on either side, and allow the texts to be
wrapped early, so that it works well on smaller screens
2019-07-23 06:54:50 +05:30
Robert Ancell
a57a85a1db sharing: Fix warning when disabling sharing
The warning is:
(gnome-control-center:29760): Gtk-CRITICAL **: 11:45:48.076: gtk_widget_is_visible: assertion 'GTK_IS_WIDGET (widget)' failed

This is due to the code trying to disable switches that only exist if support
for that feature is available.
2019-07-15 14:38:52 +12:00
Stefano Facchini
b47ada9b76 sharing: Fix master switch
Since the switches for media, personal file, and screen sharing are in the header bar of the
respective dialogs, they are not visible when we click on the master switch. This caused the
check in OFF_IF_VISIBLE to always fail.

Fix it by checking if the corresponding button in the main list box is visible, instead.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/240
2019-07-15 00:05:23 +00:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Adrien Plazas
39ed06188a sharing: Ellipsize the labels
This helps ensuring the panel fits in narrow windows.
2019-03-29 18:20:56 +00:00
Adrien Plazas
b73213ebaf sharing: Adapt the indentation
This adapts the indentation of the children of HdyColumn, which were
deliberately left intact in the previous commit to make it more
readable.
2019-03-29 18:20:56 +00:00
Adrien Plazas
5be6fc4d1f sharing: Use a HdyColumn and a GtkScrolledWindow
Put the widget's content into a HdyColumn, itself into a
GtkScrolledWindow. This allows the panel to reach narrower sizes.

This deliberately doesn't adapt the indentation of the contained widget
to help this commit to be more readable and easier to review, it will be
adapted in the next commit.
2019-03-29 18:20:56 +00:00