Commit graph

122 commits

Author SHA1 Message Date
Matthijs Velsink
959f8afde8 sharing: Clean leftover "Remote Login" code
Commit c0c357c3 (!2211) moved the "Remote Login" code to the System
panel. There are some leftover bits of code in the sharing panel though.

This cleans that up.

Closes #2895
2024-02-13 13:06:38 +00:00
Automeris naranja
7009df80d0 sharing: Fix the networks section from the File/Media Sharing dialogs
- Remove the "Networks" title from CcSharingNetworks
and only use the titles from the AdwPreferencesGroups

- Remove the margins from CcSharingNetworks,
since AdwPreferencesGroup already has margins

- Remove unused `spacing` properties

- Replace the Media Sharing GtkGrid with a GtkBox,
like in the File Sharing dialog, and separate the
networks and folders section into their own
AdwPreferencesGroups

- Remove an unnecessary GtkListBox. It was added[1]
in order to make the "Require Password" and "Password"
rows to have the boxed-list style. Since the dialogs
from Sharing panel started to use AdwPreferencesPage/Group[2],
this GtkListBox is no longer necessary.

[1] 9a15a48d
[2] 45a5a1e0

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2818
2024-02-12 09:07:30 +00:00
Felipe Borges
c0c357c3bc system: Move "Remote Login" from Sharing panel to System
Fixes #2836
2024-02-12 09:57:11 +01:00
Brandon Nielsen
5da525773f Move cc_remote_login_get_enabled before connection to notify::active
This prevents an issue where the handler can be erroneously called
by opening the sharing panel.
2024-02-05 12:06:42 +01:00
Brandon Nielsen
944f415215 Drop dependency on pkexec
Based on discussion on fedora-devel[0][1] drop the use of pkexec. pkexec
was used only for starting / stopping / enabling / disabling the sshd
service via systemd.

This changes the "org.gnome.controlcenter.remote-login-helper" policy to
request the necessary systemd permissions, and changes to using polkit
to request the permission, then making the dbus calls once the
permission is acquired.

This also cleans up targets of the dialog response functions as
discussed in the MR[3].

[0] - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/ZDZACAMG2E3P4K4P2CVBQ3XBBZ7CYSXA/
[1] - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/WCZW4Y4ONV5ZXU4JUCQUS56F3R6GNGJF/
[2] - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/F5INKYST7JUNU6FYKU5JJJWXCYOCM33I/
[3] - https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1179#note_1793602
2024-02-05 12:06:41 +01:00
Felipe Borges
5ed0b3e1f8 sharing: Remove unused pwquality and pwd.h dependencies
Those were leftovers from when the Remote Desktop settings got moved
into the System panel.
2024-01-31 10:38:07 +01:00
Felipe Borges
dc514d3df1 sharing: Remove unused "gcr/gcr-base.h" include
This was part of the Remote Desktop code that now is part of the
System panel.
2024-01-31 10:38:07 +01:00
Automeris naranja
00d9cd012f sharing: Add tooltips to some icon-only buttons
Also, remove a11y labels from these buttons,
because a11y labels and tooltips are redundant
(Orca reads both).
2024-01-30 13:44:07 +00:00
Automeris naranja
2c04c9dfc9 sharing: Move switches out of the headerbar
In the "Media Sharing" and "File Sharing"
dialogs, move the main switches out of the
headerbar and show them in a row.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1930
2024-01-30 13:33:35 +00:00
Automeris naranja
50c413e6bb general: Use proper icon in remove buttons of some list rows
window-close-symbolic shouldn't be used in this case.
Use edit-delete-symbolic instead.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2842
2024-01-18 12:08:42 +00:00
Automeris naranja
45a5a1e0e7 sharing: Use AdwPreferencesPage/AdwPreferencesGroup in all dialogs 2024-01-04 11:31:04 +00:00
Maximiliano Sandoval R
9a15a48d50 sharing-panel: Modernize File Sharing dialog
Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1999>
2023-11-07 08:25:02 +00:00
Gotam Gorabh
34fcaa0654 system: Add 'Remote Desktop' panel to system panel
See #2241
2023-11-02 12:15:11 +00:00
Alice Mikhaylenko
b91859c4b3 sharing: Port dialogs to AdwWindow and AdwToolbarView
Normalize the fingerprint dialog: use a header bar, have esc-to-close, stop
leaking it
2023-08-25 08:00:43 +00:00
zalnaRs
67a9e9d2b3 Sharing: Replace Remote Login's GtkSwitch to AdwSwitchRow
Remote Login dialog used the old GtkSwitch.

Replaced the switch with AdwSwitchRow and wrapped it with AdwPreferencesGroup.

part of https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2290 and part of https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1930
2023-08-15 08:51:04 +00:00
Robert Ancell
91fbc1b8df sharing: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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