[evolution-data-server] Bug 781790 - Configure signature and start cursor position per account
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 781790 - Configure signature and start cursor position per account
- Date: Tue, 4 Jul 2017 16:22:25 +0000 (UTC)
commit d61097ce704caa252e2dcb3c2c5eb1502df9f540
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 4 18:21:30 2017 +0200
Bug 781790 - Configure signature and start cursor position per account
src/libedataserver/e-source-enums.h | 16 +++
src/libedataserver/e-source-mail-composition.c | 148 +++++++++++++++++++++++-
src/libedataserver/e-source-mail-composition.h | 10 ++
3 files changed, 173 insertions(+), 1 deletions(-)
---
diff --git a/src/libedataserver/e-source-enums.h b/src/libedataserver/e-source-enums.h
index 2c37f52..ec56c2b 100644
--- a/src/libedataserver/e-source-enums.h
+++ b/src/libedataserver/e-source-enums.h
@@ -273,4 +273,20 @@ typedef enum {
E_SOURCE_MAIL_COMPOSITION_REPLY_STYLE_OUTLOOK
} ESourceMailCompositionReplyStyle;
+/**
+ * EThreeState:
+ * @E_THREE_STATE_OFF: the three-state value is Off
+ * @E_THREE_STATE_ON: the three-state value is On
+ * @E_THREE_STATE_INCONSISTENT: the three-state value is neither On, nor Off
+ *
+ * Describes a three-state value, which can be either Off, On or Inconsistent.
+ *
+ * Since: 3.26
+ **/
+typedef enum {
+ E_THREE_STATE_OFF = 0,
+ E_THREE_STATE_ON,
+ E_THREE_STATE_INCONSISTENT
+} EThreeState;
+
#endif /* E_SOURCE_ENUMS_H */
diff --git a/src/libedataserver/e-source-mail-composition.c b/src/libedataserver/e-source-mail-composition.c
index c8ccebe..80b9640 100644
--- a/src/libedataserver/e-source-mail-composition.c
+++ b/src/libedataserver/e-source-mail-composition.c
@@ -52,6 +52,8 @@ struct _ESourceMailCompositionPrivate {
gchar *templates_folder;
gboolean sign_imip;
ESourceMailCompositionReplyStyle reply_style;
+ EThreeState start_bottom;
+ EThreeState top_signature;
};
enum {
@@ -61,7 +63,9 @@ enum {
PROP_DRAFTS_FOLDER,
PROP_REPLY_STYLE,
PROP_SIGN_IMIP,
- PROP_TEMPLATES_FOLDER
+ PROP_TEMPLATES_FOLDER,
+ PROP_START_BOTTOM,
+ PROP_TOP_SIGNATURE
};
G_DEFINE_TYPE (
@@ -106,11 +110,23 @@ source_mail_composition_set_property (GObject *object,
g_value_get_boolean (value));
return;
+ case PROP_START_BOTTOM:
+ e_source_mail_composition_set_start_bottom (
+ E_SOURCE_MAIL_COMPOSITION (object),
+ g_value_get_enum (value));
+ return;
+
case PROP_TEMPLATES_FOLDER:
e_source_mail_composition_set_templates_folder (
E_SOURCE_MAIL_COMPOSITION (object),
g_value_get_string (value));
return;
+
+ case PROP_TOP_SIGNATURE:
+ e_source_mail_composition_set_top_signature (
+ E_SOURCE_MAIL_COMPOSITION (object),
+ g_value_get_enum (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -158,12 +174,26 @@ source_mail_composition_get_property (GObject *object,
E_SOURCE_MAIL_COMPOSITION (object)));
return;
+ case PROP_START_BOTTOM:
+ g_value_set_enum (
+ value,
+ e_source_mail_composition_get_start_bottom (
+ E_SOURCE_MAIL_COMPOSITION (object)));
+ return;
+
case PROP_TEMPLATES_FOLDER:
g_value_take_string (
value,
e_source_mail_composition_dup_templates_folder (
E_SOURCE_MAIL_COMPOSITION (object)));
return;
+
+ case PROP_TOP_SIGNATURE:
+ g_value_set_enum (
+ value,
+ e_source_mail_composition_get_top_signature (
+ E_SOURCE_MAIL_COMPOSITION (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -271,6 +301,20 @@ e_source_mail_composition_class_init (ESourceMailCompositionClass *class)
g_object_class_install_property (
object_class,
+ PROP_START_BOTTOM,
+ g_param_spec_enum (
+ "start-bottom",
+ "Start Bottom",
+ "Whether start at bottom on reply or forward",
+ E_TYPE_THREE_STATE,
+ E_THREE_STATE_INCONSISTENT,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS |
+ E_SOURCE_PARAM_SETTING));
+
+ g_object_class_install_property (
+ object_class,
PROP_TEMPLATES_FOLDER,
g_param_spec_string (
"templates-folder",
@@ -281,6 +325,20 @@ e_source_mail_composition_class_init (ESourceMailCompositionClass *class)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS |
E_SOURCE_PARAM_SETTING));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TOP_SIGNATURE,
+ g_param_spec_enum (
+ "top-signature",
+ "Top Signature",
+ "Whether place signature at the top on reply or forward",
+ E_TYPE_THREE_STATE,
+ E_THREE_STATE_INCONSISTENT,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS |
+ E_SOURCE_PARAM_SETTING));
}
static void
@@ -727,3 +785,91 @@ e_source_mail_composition_set_reply_style (ESourceMailComposition *extension,
g_object_notify (G_OBJECT (extension), "reply-style");
}
+
+/**
+ * e_source_mail_composition_get_start_bottom:
+ * @extension: an #ESourceMailComposition
+ *
+ * Returns whether start at bottom when replying or forwarding
+ * using the associated account. If no preference is set,
+ * the %E_THREE_STATE_INCONSISTENT is returned.
+ *
+ * Returns: start bottom on reply or forward preference
+ *
+ * Since: 3.26
+ **/
+EThreeState
+e_source_mail_composition_get_start_bottom (ESourceMailComposition *extension)
+{
+ g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), E_THREE_STATE_INCONSISTENT);
+
+ return extension->priv->start_bottom;
+}
+
+/**
+ * e_source_mail_composition_set_start_bottom:
+ * @extension: an #ESourceMailComposition
+ * @start_bottom: an #EThreeState
+ *
+ * Sets whether start bottom when replying or forwarding using the associated account.
+ * To unset the preference, use the %E_THREE_STATE_INCONSISTENT.
+ *
+ * Since: 3.26
+ **/
+void
+e_source_mail_composition_set_start_bottom (ESourceMailComposition *extension,
+ EThreeState start_bottom)
+{
+ g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
+
+ if (extension->priv->start_bottom == start_bottom)
+ return;
+
+ extension->priv->start_bottom = start_bottom;
+
+ g_object_notify (G_OBJECT (extension), "start-bottom");
+}
+
+/**
+ * e_source_mail_composition_get_top_signature:
+ * @extension: an #ESourceMailComposition
+ *
+ * Returns whether place signature at top when replying or forwarding
+ * using the associated account. If no preference is set,
+ * the %E_THREE_STATE_INCONSISTENT is returned.
+ *
+ * Returns: top signature on reply or forward preference
+ *
+ * Since: 3.26
+ **/
+EThreeState
+e_source_mail_composition_get_top_signature (ESourceMailComposition *extension)
+{
+ g_return_val_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension), E_THREE_STATE_INCONSISTENT);
+
+ return extension->priv->top_signature;
+}
+
+/**
+ * e_source_mail_composition_set_top_signature:
+ * @extension: an #ESourceMailComposition
+ * @top_signature: an #EThreeState
+ *
+ * Sets whether place signature at top when replying or forwarding using the associated account.
+ * To unset the preference, use the %E_THREE_STATE_INCONSISTENT.
+ *
+ * Since: 3.26
+ **/
+void
+e_source_mail_composition_set_top_signature (ESourceMailComposition *extension,
+ EThreeState top_signature)
+{
+ g_return_if_fail (E_IS_SOURCE_MAIL_COMPOSITION (extension));
+
+ if (extension->priv->top_signature == top_signature)
+ return;
+
+ extension->priv->top_signature = top_signature;
+
+ g_object_notify (G_OBJECT (extension), "top-signature");
+}
diff --git a/src/libedataserver/e-source-mail-composition.h b/src/libedataserver/e-source-mail-composition.h
index 2afa234..bd682e4 100644
--- a/src/libedataserver/e-source-mail-composition.h
+++ b/src/libedataserver/e-source-mail-composition.h
@@ -121,6 +121,16 @@ ESourceMailCompositionReplyStyle
void e_source_mail_composition_set_reply_style
(ESourceMailComposition *extension,
ESourceMailCompositionReplyStyle reply_style);
+EThreeState e_source_mail_composition_get_start_bottom
+ (ESourceMailComposition *extension);
+void e_source_mail_composition_set_start_bottom
+ (ESourceMailComposition *extension,
+ EThreeState start_bottom);
+EThreeState e_source_mail_composition_get_top_signature
+ (ESourceMailComposition *extension);
+void e_source_mail_composition_set_top_signature
+ (ESourceMailComposition *extension,
+ EThreeState top_signature);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]