Commit baf519e1 authored by Milan Crha's avatar Milan Crha

I#338 - Add option to preset "Preserve my reminder"

Closes #338
parent 2a48d73f
<schemalist>
<schema gettext-domain="evolution" id="org.gnome.evolution.plugin.itip" path="/org/gnome/evolution/plugin/itip/">
<key name="delete-processed" type="b">
<key name="delete-processed" type="b">
<default>false</default>
<_summary>Delete processed</_summary>
<_description>Whether to delete processed iTip objects</_description>
</key>
<key name="preserve-reminder" type="b">
<default>true</default>
<_summary>Preserve exiting reminder by default</_summary>
<_description>Whether to preset option to preserve existing reminder by default</_description>
</key>
</schema>
</schemalist>
......@@ -33,8 +33,6 @@
#include "calendar/gui/calendar-config.h"
#include "shell/e-shell-utils.h"
#define ITIP_FORMATTER_CONF_KEY_DELETE "delete-processed"
struct _ECalendarPreferencesPrivate {
GtkBuilder *builder;
ESourceRegistry *registry;
......@@ -593,18 +591,6 @@ eccp_free (EConfig *ec,
g_slist_free (items);
}
static void
itip_formatter_delete_toggled_cb (GtkWidget *widget)
{
GSettings *settings;
gboolean active;
settings = e_util_ref_settings ("org.gnome.evolution.plugin.itip");
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
g_settings_set_boolean (settings, ITIP_FORMATTER_CONF_KEY_DELETE, active);
g_object_unref (settings);
}
static void
calendar_preferences_add_itip_formatter_page (EShell *shell,
GtkWidget *notebook)
......@@ -658,12 +644,19 @@ calendar_preferences_add_itip_formatter_page (EShell *shell,
settings = e_util_ref_settings ("org.gnome.evolution.plugin.itip");
check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, ITIP_FORMATTER_CONF_KEY_DELETE));
g_signal_connect (
check, "toggled",
G_CALLBACK (itip_formatter_delete_toggled_cb), NULL);
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
g_settings_bind (settings, "delete-processed",
check, "active",
G_SETTINGS_BIND_DEFAULT);
check = gtk_check_button_new_with_mnemonic (_("_Preserve exiting reminder by default"));
gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0);
g_settings_bind (settings, "preserve-reminder",
check, "active",
G_SETTINGS_BIND_DEFAULT);
g_object_unref (settings);
/* "Conflict searching" */
......
......@@ -3090,6 +3090,17 @@ itip_view_set_show_keep_alarm_check (ItipView *view,
g_return_if_fail (ITIP_IS_VIEW (view));
show_checkbox (view, CHECKBOX_KEEP_ALARM, show, TRUE);
if (show) {
GSettings *settings;
settings = e_util_ref_settings ("org.gnome.evolution.plugin.itip");
if (g_settings_get_boolean (settings, "preserve-reminder"))
input_set_checked (view, CHECKBOX_KEEP_ALARM, TRUE);
g_object_unref (settings);
}
}
gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment