Added "Incoming notifications" and "Automatically add to contacts" options to the global settings dialog
}
+ /* Incoming notifications */
+ ppriv->notifications = hildon_check_button_new (MODEST_EDITABLE_SIZE);
+ gtk_button_set_label (GTK_BUTTON (ppriv->notifications), _("mcen_fi_options_incoming_notifications"));
+ gtk_button_set_alignment (GTK_BUTTON (ppriv->notifications), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), ppriv->notifications, FALSE, FALSE, 0);
+
+ /* Automatic add to contacts */
+ ppriv->add_to_contacts = hildon_check_button_new (MODEST_EDITABLE_SIZE);
+ gtk_button_set_label (GTK_BUTTON (ppriv->add_to_contacts), _("mcen_fi_options_automatic_add"));
+ gtk_button_set_alignment (GTK_BUTTON (ppriv->add_to_contacts), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), ppriv->add_to_contacts, FALSE, FALSE, 0);
+
/* Separator label */
separator = gtk_label_new (_("mcen_ti_updating"));
gtk_label_set_justify ((GtkLabel *) separator, GTK_JUSTIFY_CENTER);
ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
conf = modest_runtime_get_conf ();
+ /* Incoming notifications */
+ checked = modest_conf_get_bool (conf, MODEST_CONF_NOTIFICATIONS, &error);
+ if (error) {
+ g_clear_error (&error);
+ error = NULL;
+ checked = FALSE;
+ }
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (ppriv->notifications), checked);
+ ppriv->initial_state.notifications = checked;
+
+ /* Add to contacts */
+ checked = modest_conf_get_bool (conf, MODEST_CONF_AUTO_ADD_TO_CONTACTS, &error);
+ if (error) {
+ g_clear_error (&error);
+ error = NULL;
+ checked = FALSE;
+ }
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (ppriv->add_to_contacts), checked);
+ ppriv->initial_state.add_to_contacts = checked;
+
/* Autoupdate */
checked = modest_conf_get_bool (conf, MODEST_CONF_AUTO_UPDATE, &error);
if (error) {
#define MODEST_CONF_PREFER_FORMATTED_TEXT (modest_defs_namespace ("/prefer_formatted_text")) /* bool */
#define MODEST_CONF_REPLY_TYPE (modest_defs_namespace ("/reply_type")) /* int */
#define MODEST_CONF_FORWARD_TYPE (modest_defs_namespace ("/forward_type")) /* int */
+#define MODEST_CONF_NOTIFICATIONS (modest_defs_namespace ("/notifications")) /* bool */
+#define MODEST_CONF_AUTO_ADD_TO_CONTACTS (modest_defs_namespace ("/auto_add_to_contacs")) /* bool */
/* hidden global settings */
#define MODEST_CONF_FETCH_HTML_EXTERNAL_IMAGES (modest_defs_namespace ("/fetch_external_images")) /* bool */
if (!modest_conf_key_exists (conf, MODEST_CONF_AUTO_UPDATE, NULL))
modest_conf_set_bool (conf, MODEST_CONF_AUTO_UPDATE, TRUE, NULL);
+ if (!modest_conf_key_exists (conf, MODEST_CONF_NOTIFICATIONS, NULL))
+ modest_conf_set_bool (conf, MODEST_CONF_NOTIFICATIONS, TRUE, NULL);
+
+ if (!modest_conf_key_exists (conf, MODEST_CONF_AUTO_ADD_TO_CONTACTS, NULL))
+ modest_conf_set_bool (conf, MODEST_CONF_AUTO_ADD_TO_CONTACTS, TRUE, NULL);
+
if (!modest_conf_key_exists (conf, MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, NULL))
modest_conf_set_int (conf, MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, MODEST_CONNECTED_VIA_WLAN_OR_WIMAX, NULL);
gint connect_via;
gint update_interval;
gint size_limit;
- gchar *default_account;
+ gchar *default_account;
gboolean play_sound;
gboolean prefer_formatted_text;
+ gboolean notifications;
+ gboolean add_to_contacts;
} ModestGlobalSettingsState;
typedef struct _ModestGlobalSettingsDialogPrivate ModestGlobalSettingsDialogPrivate;
ModestPairList *msg_format_list;
GtkWidget *msg_format;
+ GtkWidget *notifications;
+ GtkWidget *add_to_contacts;
+
ModestGlobalSettingsState initial_state;
};
gint *id;
/* Get values from UI */
+ state->notifications = modest_togglable_get_active (HILDON_CHECK_BUTTON (priv->notifications));
+ state->add_to_contacts = modest_togglabale_get_active (HILDON_CHECK_BUTTON (priv->add_to_contacts));
state->auto_update = modest_togglable_get_active (priv->auto_update);
id = modest_selector_get_active_id (priv->connect_via);
state->default_account = modest_selector_get_active_id (priv->default_account_selector);
get_current_settings (priv, ¤t_state);
/* Save configuration */
+ modest_conf_set_bool (conf, MODEST_CONF_NOTIFICATIONS, current_state.notifications, &error);
+ RETURN_FALSE_ON_ERROR(error);
+ modest_conf_set_bool (conf, MODEST_CONF_AUTO_ADD_TO_CONTACTS, current_state.add_to_contacts, &error);
+ RETURN_FALSE_ON_ERROR(error);
modest_conf_set_bool (conf, MODEST_CONF_AUTO_UPDATE, current_state.auto_update, &error);
RETURN_FALSE_ON_ERROR(error);
modest_conf_set_int (conf, MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, current_state.connect_via, NULL);
if (priv->initial_state.auto_update != current_state.auto_update ||
priv->initial_state.connect_via != current_state.connect_via ||
priv->initial_state.update_interval != current_state.update_interval) {
-
+
TnyAccountStore *account_store;
TnyDevice *device;
ModestGlobalSettingsState current_state)
{
if (initial_state.auto_update != current_state.auto_update ||
+ initial_state.notifications != current_state.notifications ||
+ initial_state.add_to_contacts != current_state.add_to_contacts ||
initial_state.connect_via != current_state.connect_via ||
initial_state.update_interval != current_state.update_interval ||
initial_state.size_limit != current_state.size_limit ||