summaryrefslogtreecommitdiff
path: root/panels/sharing/cc-sharing-panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'panels/sharing/cc-sharing-panel.c')
-rw-r--r--panels/sharing/cc-sharing-panel.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index 3d4483a23..7238f205d 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -1076,8 +1076,15 @@ cc_sharing_panel_setup_screen_sharing_dialog_vino (CcSharingPanel *self)
}
static void
+on_vnc_password_entry_notify_text (CcSharingPanel *self)
+{
+ cc_grd_store_vnc_password (gtk_entry_get_text (GTK_ENTRY (self->remote_control_password_entry)), cc_panel_get_cancellable (CC_PANEL (self)));
+}
+
+static void
cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPanel *self)
{
+ g_autofree gchar *password = NULL;
g_autoptr(GSettings) vnc_settings = NULL;
GtkWidget *networks, *w;
@@ -1104,7 +1111,9 @@ cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPane
self,
G_CONNECT_SWAPPED);
- cc_grd_update_password_entry (GTK_ENTRY (self->remote_control_password_entry));
+ password = cc_grd_lookup_vnc_password (cc_panel_get_cancellable (CC_PANEL (self)));
+ if (password != NULL)
+ gtk_entry_set_text (GTK_ENTRY (self->remote_control_password_entry), password);
/* accept at most 8 bytes in password entry */
g_signal_connect_object (self->remote_control_password_entry,
@@ -1142,10 +1151,11 @@ cc_sharing_panel_setup_screen_sharing_dialog_gnome_remote_desktop (CcSharingPane
NULL,
NULL);
- g_signal_connect (self->remote_control_password_entry,
- "notify::text",
- G_CALLBACK (cc_grd_on_vnc_password_entry_notify_text),
- self);
+ g_signal_connect_object (self->remote_control_password_entry,
+ "notify::text",
+ G_CALLBACK (on_vnc_password_entry_notify_text),
+ self,
+ G_CONNECT_SWAPPED);
networks = cc_sharing_networks_new (self->sharing_proxy, "gnome-remote-desktop");
gtk_box_pack_end (GTK_BOX (self->remote_control_box), networks, TRUE, TRUE, 0);