summaryrefslogtreecommitdiff
path: root/src/mate-screensaver-preferences.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-15 22:36:39 +0100
committerraveit65 <[email protected]>2020-04-09 21:28:48 +0200
commit344cc22f4ce85dfaf7256b2db7e530741bc29156 (patch)
treec21e7bc37f8ff010a531d92aa630ea3232797dae /src/mate-screensaver-preferences.c
parent9f3cc047877e01dc158e365850ea22d896815d0e (diff)
downloadmate-screensaver-344cc22f4ce85dfaf7256b2db7e530741bc29156.tar.bz2
mate-screensaver-344cc22f4ce85dfaf7256b2db7e530741bc29156.tar.xz
Custom background image for lock screen
Diffstat (limited to 'src/mate-screensaver-preferences.c')
-rw-r--r--src/mate-screensaver-preferences.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index 4ead5ed..8efb25a 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -1086,6 +1086,12 @@ enabled_checkbox_toggled (GtkToggleButton *button, gpointer user_data)
}
static void
+picture_filename_changed (GtkFileChooserButton *button, gpointer user_data)
+{
+ g_settings_set_string (screensaver_settings, "picture-filename", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (button)));
+}
+
+static void
ui_disable_lock (gboolean disable)
{
GtkWidget *widget;
@@ -1533,6 +1539,7 @@ init_capplet (void)
GtkWidget *fullscreen_preview_previous;
GtkWidget *fullscreen_preview_next;
GtkWidget *fullscreen_preview_close;
+ GtkWidget *picture_filename;
gdouble activate_delay;
gboolean enabled;
gboolean is_writable;
@@ -1579,6 +1586,7 @@ init_capplet (void)
fullscreen_preview_close = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_close"));
fullscreen_preview_previous = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_previous_button"));
fullscreen_preview_next = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_next_button"));
+ picture_filename = GTK_WIDGET (gtk_builder_get_object (builder, "picture_filename"));
label = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_label"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), activate_delay_hscale);
@@ -1629,6 +1637,13 @@ init_capplet (void)
g_signal_connect (lock_checkbox, "toggled",
G_CALLBACK (lock_checkbox_toggled), NULL);
+ char *path = g_settings_get_string (screensaver_settings, "picture-filename");
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (gtk_builder_get_object (builder, "picture_filename")), path);
+ gtk_file_filter_add_pixbuf_formats (GTK_FILE_FILTER (gtk_builder_get_object (builder, "picture_filefilter")));
+ g_free (path);
+ g_signal_connect (picture_filename, "selection-changed",
+ G_CALLBACK (picture_filename_changed), NULL);
+
enabled = config_get_enabled (&is_writable);
ui_set_enabled (enabled);
if (! is_writable)