From 90f97916e28326bcc4481a7cef72705ee359d361 Mon Sep 17 00:00:00 2001 From: infirit Date: Wed, 22 Jul 2015 12:59:26 +0200 Subject: appearance: Allow to save notification theme optionally Closes #42 --- capplets/appearance/data/appearance.ui | 20 +++++++++++++++++++- capplets/appearance/theme-save.c | 11 ++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'capplets/appearance') diff --git a/capplets/appearance/data/appearance.ui b/capplets/appearance/data/appearance.ui index 5f117007..e9736ca9 100644 --- a/capplets/appearance/data/appearance.ui +++ b/capplets/appearance/data/appearance.ui @@ -2455,7 +2455,7 @@ True 6 - 3 + 4 2 12 6 @@ -2541,6 +2541,24 @@ + + + Save _notification theme + True + True + False + True + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + diff --git a/capplets/appearance/theme-save.c b/capplets/appearance/theme-save.c index 64184444..81265b79 100644 --- a/capplets/appearance/theme-save.c +++ b/capplets/appearance/theme-save.c @@ -172,6 +172,7 @@ write_theme_to_disk (MateThemeMetaInfo *theme_info, const gchar *theme_name, const gchar *theme_description, gboolean save_background, + gboolean save_notification, GError **error) { gchar* dir; @@ -237,7 +238,7 @@ write_theme_to_disk (MateThemeMetaInfo *theme_info, g_free (str); } - if (theme_info->notification_theme_name) { + if (theme_info->notification_theme_name && save_notification) { str = g_strdup_printf ("NotificationTheme=%s\n", theme_info->notification_theme_name); g_output_stream_write (output, str, strlen (str), NULL, NULL); g_free (str); @@ -272,6 +273,7 @@ save_theme_to_disk (MateThemeMetaInfo *theme_info, const gchar *theme_name, const gchar *theme_description, gboolean save_background, + gboolean save_notification, GError **error) { if (!check_theme_name (theme_name, error)) @@ -280,7 +282,7 @@ save_theme_to_disk (MateThemeMetaInfo *theme_info, if (!setup_directory_structure (theme_name, error)) return FALSE; - if (!write_theme_to_disk (theme_info, theme_name, theme_description, save_background, error)) + if (!write_theme_to_disk (theme_info, theme_name, theme_description, save_background, save_notification, error)) return FALSE; return TRUE; @@ -302,6 +304,7 @@ save_dialog_response (GtkWidget *save_dialog, gchar *theme_description = NULL; gchar *theme_name = NULL; gboolean save_background; + gboolean save_notification; GError *error = NULL; entry = appearance_capplet_get_widget (data, "save_dialog_entry"); @@ -317,8 +320,10 @@ save_dialog_response (GtkWidget *save_dialog, theme_info = (MateThemeMetaInfo *) g_object_get_data (G_OBJECT (save_dialog), "meta-theme-info"); save_background = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( appearance_capplet_get_widget (data, "save_background_checkbutton"))); + save_notification = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( + appearance_capplet_get_widget (data, "save_notification_checkbutton"))); - if (save_theme_to_disk (theme_info, theme_name, theme_description, save_background, &error)) { + if (save_theme_to_disk (theme_info, theme_name, theme_description, save_background, save_notification, &error)) { /* remove the custom theme */ GtkTreeIter iter; -- cgit v1.2.1