2007-05-14 Murray Cumming <murrayc@murrayc.com>
+ * src/modest-protocol-info.h: Split the ModestProtocol enum
+ into ModestProtocol, ModestSecureConnection, and ModestSecureAuthentication.
+ There was no need to have these unrelated values in one enum.
+
+ * src/: many files: Adapted to changed enum. This makes the code a bit
+ clearer, and the compiler could catch some errors.
+
+2007-05-14 Murray Cumming <murrayc@murrayc.com>
+
* src/modest-tny-account-store.c: (modest_tny_account_store_alert):
Show the detailed internal camel error message when an error happens
during the configuration, so that our testers can give us more clues.
on_apply (ModestAccountAssistant *self, gpointer user_data)
{
ModestAccountAssistantPrivate *priv;
- ModestProtocol proto, security, auth;
+ ModestProtocol proto = MODEST_PROTOCOL_UNKNOWN;
+ ModestSecureConnection security = MODEST_PROTOCOL_SECURITY_NONE;
+ ModestSecureAuthentication auth = MODEST_PROCOTOL_AUTH_NONE;
gchar *store_name, *transport_name;
const gchar *account_name, *username, *servername, *path;
ModestStoreWidget *store;
return NULL;
}
-static ModestProtocol
-get_protocol_from_combo (GtkWidget *combo)
+static gint
+get_value_from_combo (GtkWidget *combo)
{
gchar *chosen;
}
-ModestProtocol
+ModestSecureAuthentication
modest_store_widget_get_auth (ModestStoreWidget *self)
{
ModestStoreWidgetPrivate *priv;
g_return_val_if_fail (self, MODEST_PROTOCOL_UNKNOWN);
priv = MODEST_STORE_WIDGET_GET_PRIVATE(self);
- return get_protocol_from_combo (priv->auth);
+ return get_value_from_combo (priv->auth);
}
-ModestProtocol
+ModestSecureConnection
modest_store_widget_get_security (ModestStoreWidget *self)
{
ModestStoreWidgetPrivate *priv;
g_return_val_if_fail (self, MODEST_PROTOCOL_UNKNOWN);
priv = MODEST_STORE_WIDGET_GET_PRIVATE(self);
- return get_protocol_from_combo (priv->security);
+ return get_value_from_combo (priv->security);
}
const gchar* modest_store_widget_get_servername (ModestStoreWidget *self);
ModestProtocol modest_store_widget_get_proto (ModestStoreWidget *self);
gchar * modest_store_widget_get_path (ModestStoreWidget *self);
-ModestProtocol modest_store_widget_get_auth (ModestStoreWidget *self);
-ModestProtocol modest_store_widget_get_security (ModestStoreWidget *self);
+ModestSecureAuthentication modest_store_widget_get_auth (ModestStoreWidget *self);
+ModestSecureConnection modest_store_widget_get_security (ModestStoreWidget *self);
G_END_DECLS
*/
static void update_incoming_server_title (ModestEasysetupWizardDialog *self)
{
- ModestProtocol protocol = easysetup_servertype_combo_box_get_active_servertype (
+ const ModestProtocol protocol = easysetup_servertype_combo_box_get_active_servertype (
EASYSETUP_SERVERTYPE_COMBO_BOX (self->combo_incoming_servertype));
const gchar* type =
(protocol == MODEST_PROTOCOL_STORE_POP ?
*/
static void update_incoming_server_security_choices (ModestEasysetupWizardDialog *self)
{
- ModestProtocol protocol = easysetup_servertype_combo_box_get_active_servertype (
+ const ModestProtocol protocol = easysetup_servertype_combo_box_get_active_servertype (
EASYSETUP_SERVERTYPE_COMBO_BOX (self->combo_incoming_servertype));
/* Fill the combo with appropriately titled choices for POP or IMAP. */
const gchar* password = gtk_entry_get_text (GTK_ENTRY (self->entry_user_password));
/* Incoming server: */
- /* Note: We need something as default for the ModestProtocol values,
+ /* Note: We need something as default for the ModestProtocol* values,
* or modest_account_mgr_add_server_account will fail. */
gchar* servername_incoming = NULL;
ModestProtocol protocol_incoming = MODEST_PROTOCOL_STORE_POP;
- ModestProtocol protocol_security_incoming = MODEST_PROTOCOL_SECURITY_NONE;
- ModestProtocol protocol_authentication_incoming = MODEST_PROTOCOL_AUTH_NONE;
+ ModestSecureConnection protocol_security_incoming = MODEST_PROTOCOL_SECURITY_NONE;
+ ModestSecureAuthentication protocol_authentication_incoming = MODEST_PROTOCOL_AUTH_NONE;
/* Get details from the specified presets: */
gchar* provider_id = easysetup_provider_combo_box_get_active_provider_id (
/* Outgoing server: */
gchar* servername_outgoing = NULL;
ModestProtocol protocol_outgoing = MODEST_PROTOCOL_STORE_POP;
- ModestProtocol protocol_security_outgoing = MODEST_PROTOCOL_SECURITY_NONE;
- ModestProtocol protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
+ ModestSecureConnection protocol_security_outgoing = MODEST_PROTOCOL_SECURITY_NONE;
+ ModestSecureAuthentication protocol_authentication_outgoing = MODEST_PROTOCOL_AUTH_NONE;
if(provider_id) {
/* Use presets: */
{
ModestAccountSettingsDialog *self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
- ModestProtocol protocol_security =
+ ModestSecureAuthentication protocol_security =
modest_secureauth_combo_box_get_active_secureauth (
MODEST_SECUREAUTH_COMBO_BOX (self->combo_outgoing_auth));
const gboolean secureauth_used = protocol_security != MODEST_PROTOCOL_AUTH_NONE;
* If secure authentication is checked, require one of the secure methods during connection: SSL, TLS, CRAM-MD5 etc.
* TODO: Do we need to discover which of these (SSL, TLS, CRAM-MD5) is supported?
*/
- const ModestProtocol secure_auth = modest_server_account_get_secure_auth(
+ const ModestSecureAuthentication secure_auth = modest_server_account_get_secure_auth(
dialog->account_manager, incoming_account->account_name);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (dialog->checkbox_incoming_auth),
secure_auth != MODEST_PROTOCOL_AUTH_PASSWORD);
update_incoming_server_title (dialog, incoming_account->proto);
update_incoming_server_security_choices (dialog, incoming_account->proto);
- const ModestProtocol security = modest_server_account_get_security (
+ const ModestSecureConnection security = modest_server_account_get_security (
dialog->account_manager, incoming_account->account_name);
modest_serversecurity_combo_box_set_active_serversecurity (
MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security), security);
outgoing_account->password ? outgoing_account->password : "");
/* Get the secure-auth setting: */
- const ModestProtocol secure_auth = modest_server_account_get_secure_auth(
+ const ModestSecureAuthentication secure_auth = modest_server_account_get_secure_auth(
dialog->account_manager, outgoing_account->account_name);
modest_secureauth_combo_box_set_active_secureauth (
MODEST_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth), secure_auth);
MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), outgoing_account->proto);
/* Get the security setting: */
- const ModestProtocol security = modest_server_account_get_security (
+ const ModestSecureConnection security = modest_server_account_get_security (
dialog->account_manager, outgoing_account->account_name);
modest_serversecurity_combo_box_set_active_serversecurity (
MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security), security);
* If secure authentication is checked, require one of the secure methods during connection: SSL, TLS, CRAM-MD5 etc.
* TODO: Do we need to discover which of these (SSL, TLS, CRAM-MD5) is supported?
*/
- const ModestProtocol protocol_authentication_incoming = gtk_toggle_button_get_active
+ const ModestSecureAuthentication protocol_authentication_incoming = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (dialog->checkbox_incoming_auth))
? MODEST_PROTOCOL_AUTH_CRAMMD5
: MODEST_PROTOCOL_AUTH_PASSWORD;
modest_server_account_set_secure_auth (dialog->account_manager, incoming_account_name, protocol_authentication_incoming);
- const ModestProtocol protocol_security_incoming = modest_serversecurity_combo_box_get_active_serversecurity (
+ const ModestSecureConnection protocol_security_incoming = modest_serversecurity_combo_box_get_active_serversecurity (
MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_incoming_security));
modest_server_account_set_security (dialog->account_manager, incoming_account_name, protocol_security_incoming);
modest_server_account_set_password (dialog->account_manager, outgoing_account_name,
password);
- const ModestProtocol protocol_security_outgoing = modest_serversecurity_combo_box_get_active_serversecurity (
+ const ModestSecureConnection protocol_security_outgoing = modest_serversecurity_combo_box_get_active_serversecurity (
MODEST_SERVERSECURITY_COMBO_BOX (dialog->combo_outgoing_security));
modest_server_account_set_security (dialog->account_manager, outgoing_account_name, protocol_security_outgoing);
- const ModestProtocol protocol_authentication_outgoing = modest_secureauth_combo_box_get_active_secureauth (
+ const ModestSecureAuthentication protocol_authentication_outgoing = modest_secureauth_combo_box_get_active_secureauth (
MODEST_SECUREAUTH_COMBO_BOX (dialog->combo_outgoing_auth));
modest_server_account_set_secure_auth (dialog->account_manager, outgoing_account_name, protocol_authentication_outgoing);
gtk_label_set_markup (GTK_LABEL(label),_("<b>Security</b>"));
gtk_box_pack_start (GTK_BOX(box), label, FALSE, FALSE, 0);
- protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_SECURITY);
+ protos = modest_protocol_info_get_protocol_security_pair_list ();
priv->security = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_label_set_text (GTK_LABEL(label),_("Authentication:"));
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 6);
- protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
+ protos = modest_protocol_info_get_protocol_auth_pair_list ();
combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_label_set_text (GTK_LABEL(label),_("Connection type:"));
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
- protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
+ protos = modest_protocol_info_get_protocol_security_pair_list ();
combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
gtk_label_set_text (GTK_LABEL(label),_("Authentication:"));
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 6);
- protos = modest_protocol_info_get_protocol_pair_list (MODEST_PROTOCOL_TYPE_AUTH);
+ protos = modest_protocol_info_get_protocol_auth_pair_list ();
combo = modest_combo_box_new (protos, g_str_equal);
modest_pair_list_free (protos);
}
-static ModestProtocol
+static ModestSecureAuthentication
get_secure_auth_for_conf_string(const gchar* value)
{
- ModestProtocol result = MODEST_PROTOCOL_AUTH_NONE;
+ ModestSecureAuthentication result = MODEST_PROTOCOL_AUTH_NONE;
if (value) {
if (strcmp(value, MODEST_ACCOUNT_AUTH_MECH_VALUE_NONE) == 0)
result = MODEST_PROTOCOL_AUTH_NONE;
return result;
}
-ModestProtocol
+ModestSecureAuthentication
modest_server_account_get_secure_auth (ModestAccountMgr *self,
const gchar* account_name)
{
- ModestProtocol result = MODEST_PROTOCOL_AUTH_NONE;
+ ModestSecureAuthentication result = MODEST_PROTOCOL_AUTH_NONE;
gchar* value = modest_account_mgr_get_string (self, account_name, MODEST_ACCOUNT_AUTH_MECH,
TRUE /* server account */);
if (value) {
void
modest_server_account_set_secure_auth (ModestAccountMgr *self,
- const gchar* account_name, ModestProtocol secure_auth)
+ const gchar* account_name, ModestSecureAuthentication secure_auth)
{
/* Get the conf string for the enum value: */
const gchar* str_value = NULL;
modest_account_mgr_set_string (self, account_name, MODEST_ACCOUNT_AUTH_MECH, str_value, TRUE);
}
-static ModestProtocol
+static ModestSecureConnection
get_security_for_conf_string(const gchar* value)
{
- ModestProtocol result = MODEST_PROTOCOL_SECURITY_NONE;
+ ModestSecureConnection result = MODEST_PROTOCOL_SECURITY_NONE;
if (value) {
if (strcmp(value, MODEST_ACCOUNT_SECURITY_VALUE_NONE) == 0)
result = MODEST_PROTOCOL_SECURITY_NONE;
return result;
}
-ModestProtocol
+ModestSecureConnection
modest_server_account_get_security (ModestAccountMgr *self,
const gchar* account_name)
{
- ModestProtocol result = MODEST_PROTOCOL_SECURITY_NONE;
+ ModestSecureConnection result = MODEST_PROTOCOL_SECURITY_NONE;
gchar* value = modest_account_mgr_get_string (self, account_name, MODEST_ACCOUNT_SECURITY,
TRUE /* server account */);
if (value) {
void
modest_server_account_set_security (ModestAccountMgr *self,
- const gchar* account_name, ModestProtocol security)
+ const gchar* account_name, ModestSecureConnection security)
{
/* Get the conf string for the enum value: */
const gchar* str_value = NULL;
gchar *password;
time_t last_updated;
gint port; /* Or 0, if the default should be used. */
- ModestProtocol secure_auth;
- ModestProtocol security;
+ ModestSecureAuthentication secure_auth;
+ ModestSecureConnection security;
} ModestServerAccountData;
typedef struct {
*
* Returns: The secure authentication enum value.
*/
-ModestProtocol
+ModestSecureAuthentication
modest_server_account_get_secure_auth (ModestAccountMgr *self, const gchar* account_name);
/**
*/
void
modest_server_account_set_secure_auth (ModestAccountMgr *self, const gchar* account_name,
- ModestProtocol secure_auth);
+ ModestSecureAuthentication secure_auth);
/**
* modest_server_account_data_get_security:
*
* Returns: The security enum value.
*/
-ModestProtocol
+ModestSecureConnection
modest_server_account_get_security (ModestAccountMgr *self, const gchar* account_name);
/**
*/
void
modest_server_account_set_security (ModestAccountMgr *self, const gchar* account_name,
- ModestProtocol security);
+ ModestSecureConnection security);
ModestServerAccountData*
modest_account_mgr_get_server_account_data (ModestAccountMgr *self, const gchar* name);
const gchar * name, const gchar *hostname,
const gchar * username, const gchar * password,
ModestProtocol proto,
- ModestProtocol security,
- ModestProtocol auth)
+ ModestSecureConnection security,
+ ModestSecureAuthentication auth)
{
ModestAccountMgrPrivate *priv;
gchar *key;
const gchar *username,
const gchar *password,
ModestProtocol proto,
- ModestProtocol security,
- ModestProtocol auth);
+ ModestSecureConnection security,
+ ModestSecureAuthentication auth);
/**
{ MODEST_PROTOCOL_STORE_POP, "pop", N_("POP3") },
{ MODEST_PROTOCOL_STORE_IMAP, "imap", N_("IMAPv4") },
{ MODEST_PROTOCOL_STORE_MAILDIR, "maildir", N_("Maildir") },
- { MODEST_PROTOCOL_STORE_MBOX, "mbox", N_("MBox") },
+ { MODEST_PROTOCOL_STORE_MBOX, "mbox", N_("MBox") }
+};
+const guint PROTOCOL_SECURITY_MAP_SIZE = sizeof(ProtocolMap)/sizeof(ProtocolInfo);
+static const ProtocolInfo ProtocolSecurityMap[] = {
{ MODEST_PROTOCOL_SECURITY_NONE, "none", N_("None") },
{ MODEST_PROTOCOL_SECURITY_SSL, "ssl", N_("SSL") },
{ MODEST_PROTOCOL_SECURITY_TLS, "tls", N_("TLS") },
- { MODEST_PROTOCOL_SECURITY_TLS_OP, "tls-op", N_("TLS when possible") }, /* op stands for optional */
+ { MODEST_PROTOCOL_SECURITY_TLS_OP, "tls-op", N_("TLS when possible") } /* op stands for optional */
+};
+const guint PROTOCOL_MAP_SIZE = sizeof(ProtocolSecurityMap)/sizeof(ProtocolInfo);
+static const ProtocolInfo ProtocolAuthMap[] = {
{ MODEST_PROTOCOL_AUTH_NONE, "none", N_("None") },
{ MODEST_PROTOCOL_AUTH_PASSWORD, "password", N_("Password") },
{ MODEST_PROTOCOL_AUTH_CRAMMD5, "cram-md5", N_("Cram MD5") }
};
-const guint PROTOCOL_MAP_SIZE = sizeof(ProtocolMap)/sizeof(ProtocolInfo);
+const guint PROTOCOL_AUTH_MAP_SIZE = sizeof(ProtocolAuthMap)/sizeof(ProtocolInfo);
+
+#if 0
GSList*
modest_protocol_info_get_protocol_list (ModestProtocolType type)
{
}
return proto_list;
}
+#endif
-
-
-ModestPairList*
-modest_protocol_info_get_protocol_pair_list (ModestProtocolType type)
+static ModestPairList*
+modest_protocol_info_get_pair_list (const ProtocolInfo* map, guint size)
{
ModestPairList *proto_list = NULL;
int i;
-
- g_return_val_if_fail (type > MODEST_PROTOCOL_TYPE_UNKNOWN && type < MODEST_PROTOCOL_TYPE_NUM,
- NULL);
- for (i = 0; i != PROTOCOL_MAP_SIZE; ++i) {
- ProtocolInfo info = (ProtocolInfo)ProtocolMap[i];
- if (modest_protocol_info_get_protocol_type(info.proto) == type)
- proto_list = g_slist_append (proto_list,
+ for (i = 0; i != size; ++i) {
+ const ProtocolInfo info = map[i];
+ proto_list = g_slist_append (proto_list,
(gpointer)modest_pair_new(
(gpointer)info.name,
(gpointer)info.display_name,
return proto_list;
}
+ModestPairList*
+modest_protocol_info_get_protocol_pair_list ()
+{
+ return modest_protocol_info_get_pair_list (ProtocolMap, PROTOCOL_MAP_SIZE);
+}
+
+ModestPairList*
+modest_protocol_info_get_protocol_security_pair_list ()
+{
+ return modest_protocol_info_get_pair_list (ProtocolSecurityMap, PROTOCOL_SECURITY_MAP_SIZE);
+}
+
+
+ModestPairList*
+modest_protocol_info_get_protocol_auth_pair_list ()
+{
+ return modest_protocol_info_get_pair_list (ProtocolAuthMap, PROTOCOL_AUTH_MAP_SIZE);
+}
+
+
ModestProtocolType
modest_protocol_info_get_protocol_type (ModestProtocol proto)
case MODEST_PROTOCOL_STORE_MBOX:
return MODEST_PROTOCOL_TYPE_STORE;
- case MODEST_PROTOCOL_SECURITY_NONE:
- case MODEST_PROTOCOL_SECURITY_SSL:
- case MODEST_PROTOCOL_SECURITY_TLS:
- case MODEST_PROTOCOL_SECURITY_TLS_OP:
- return MODEST_PROTOCOL_TYPE_SECURITY;
-
- case MODEST_PROTOCOL_AUTH_NONE:
- case MODEST_PROTOCOL_AUTH_PASSWORD:
- return MODEST_PROTOCOL_TYPE_AUTH;
-
default:
return MODEST_PROTOCOL_TYPE_UNKNOWN;
}
typedef enum {
MODEST_PROTOCOL_UNKNOWN,
- MODEST_PROTOCOL_TRANSPORT_SENDMAIL,
+ MODEST_PROTOCOL_TRANSPORT_SENDMAIL,
MODEST_PROTOCOL_TRANSPORT_SMTP,
MODEST_PROTOCOL_STORE_POP,
MODEST_PROTOCOL_STORE_IMAP,
MODEST_PROTOCOL_STORE_MAILDIR,
- MODEST_PROTOCOL_STORE_MBOX,
+ MODEST_PROTOCOL_STORE_MBOX
+} ModestProtocol;
+
+
+typedef enum {
+ MODEST_PROTOCOL_TYPE_UNKNOWN,
+ MODEST_PROTOCOL_TYPE_TRANSPORT,
+ MODEST_PROTOCOL_TYPE_STORE
+} ModestProtocolType;
+typedef enum {
MODEST_PROTOCOL_SECURITY_NONE,
MODEST_PROTOCOL_SECURITY_SSL,
MODEST_PROTOCOL_SECURITY_TLS,
- MODEST_PROTOCOL_SECURITY_TLS_OP,
+ MODEST_PROTOCOL_SECURITY_TLS_OP
+} ModestSecureConnection;
+typedef enum {
MODEST_PROTOCOL_AUTH_NONE,
MODEST_PROTOCOL_AUTH_PASSWORD,
- MODEST_PROTOCOL_AUTH_CRAMMD5,
+ MODEST_PROTOCOL_AUTH_CRAMMD5
+} ModestSecureAuthentication;
- MODEST_PROTOCOL_NUM
-} ModestProtocol;
-
-
-typedef enum {
- MODEST_PROTOCOL_TYPE_UNKNOWN,
- MODEST_PROTOCOL_TYPE_TRANSPORT,
- MODEST_PROTOCOL_TYPE_STORE,
- MODEST_PROTOCOL_TYPE_SECURITY,
- MODEST_PROTOCOL_TYPE_AUTH,
-
- MODEST_PROTOCOL_TYPE_NUM
-} ModestProtocolType;
-
+#if 0
/**
* modest_protocol_info_get_list:
* @type: the type of list you want, it should NOT be MODEST_PROTOCOL_TYPE_UNKNOWN
* for them.
*/
GSList* modest_protocol_info_get_protocol_list (ModestProtocolType type);
+#endif
/**
- * modest_protocol_info_get_list:
- * @type: the type of list you want, it should NOT be MODEST_PROTOCOL_TYPE_UNKNOWN
+ * modest_protocol_info_get_protocol_pair_list:
*
- * return the list of <protocol,display-name>-tupels of the given @type.
- * the elements of the returned list are ModestPairs
- * this is a convenience function for use with ModestComboBox
+ * return the list of <protocol,display-name>-tupels of protocols.
+ * The elements of the returned list are ModestPairs
+ * This is a convenience function for use with ModestComboBox
*
- * Returns: a list of protocols of the given @type; after use, it should be freed
+ * Returns: a list of protocols. After use, it should be freed
+ * with modest_pair_list_free
+ */
+ModestPairList* modest_protocol_info_get_protocol_pair_list ();
+
+/**
+ * modest_protocol_info_get_protocol_security_pair_list:
+ *
+ * return the list of <protocol,display-name>-tupels of protocol secure connection methods.
+ * The elements of the returned list are ModestPairs
+ * This is a convenience function for use with ModestComboBox
+ *
+ * Returns: a list of secure connection methods. After use, it should be freed
+ * with modest_pair_list_free
+ */
+ModestPairList* modest_protocol_info_get_protocol_security_pair_list ();
+
+/**
+ * modest_protocol_info_get_protocol_auth_pair_list:
+ *
+ * return the list of <protocol,display-name>-tupels of protocol secure authentication methods.
+ * The elements of the returned list are ModestPairs
+ * This is a convenience function for use with ModestComboBox
+ *
+ * Returns: a list of secure authentication methods. After use, it should be freed
* with modest_pair_list_free
*/
-ModestPairList* modest_protocol_info_get_protocol_pair_list (ModestProtocolType type);
+ModestPairList* modest_protocol_info_get_protocol_auth_pair_list ();
/**
/**
* Returns the selected secureauth,
- * or MODEST_PROTOCOL_UNKNOWN if no secureauth was selected.
+ * or MODEST_PROTOCOL_AUTH_NONE if no secureauth was selected.
*/
-ModestProtocol
+ModestSecureAuthentication
modest_secureauth_combo_box_get_active_secureauth (ModestSecureauthComboBox *combobox)
{
GtkTreeIter active;
if (found) {
ModestSecureauthComboBoxPrivate *priv = SECUREAUTH_COMBO_BOX_GET_PRIVATE (combobox);
- ModestProtocol secureauth = MODEST_PROTOCOL_UNKNOWN;
+ ModestProtocol secureauth = MODEST_PROTOCOL_AUTH_NONE;
gtk_tree_model_get (priv->model, &active, MODEL_COL_ID, &secureauth, -1);
return secureauth;
}
- return MODEST_PROTOCOL_UNKNOWN; /* Failed. */
+ return MODEST_PROTOCOL_AUTH_NONE; /* Failed. */
}
/* This allows us to pass more than one piece of data to the signal handler,
* or MODEST_PROTOCOL_UNKNOWN if no secureauth was selected.
*/
gboolean
-modest_secureauth_combo_box_set_active_secureauth (ModestSecureauthComboBox *combobox, ModestProtocol secureauth)
+modest_secureauth_combo_box_set_active_secureauth (ModestSecureauthComboBox *combobox, ModestSecureAuthentication secureauth)
{
ModestSecureauthComboBoxPrivate *priv = SECUREAUTH_COMBO_BOX_GET_PRIVATE (combobox);
ModestSecureauthComboBox* modest_secureauth_combo_box_new (void);
-ModestProtocol modest_secureauth_combo_box_get_active_secureauth (ModestSecureauthComboBox *combobox);
+ModestSecureAuthentication modest_secureauth_combo_box_get_active_secureauth (ModestSecureauthComboBox *combobox);
-gboolean modest_secureauth_combo_box_set_active_secureauth (ModestSecureauthComboBox *combobox, ModestProtocol secureauth);
+gboolean modest_secureauth_combo_box_set_active_secureauth (ModestSecureauthComboBox *combobox, ModestSecureAuthentication secureauth);
G_END_DECLS
}
}
-static gint get_port_for_security (ModestProtocol protocol, ModestProtocol security)
+static gint get_port_for_security (ModestProtocol protocol, ModestSecureConnection security)
{
/* See the UI spec, section Email Wizards, Incoming Details [MSG-WIZ001]: */
gint result = 0;
/**
* Returns the selected serversecurity,
- * or MODEST_PROTOCOL_UNKNOWN if no serversecurity was selected.
+ * or MODEST_PROTOCOL_SECURITY_NONE if no serversecurity was selected.
*/
-ModestProtocol
+ModestSecureConnection
modest_serversecurity_combo_box_get_active_serversecurity (ModestServersecurityComboBox *combobox)
{
GtkTreeIter active;
if (found) {
ModestServersecurityComboBoxPrivate *priv = SERVERSECURITY_COMBO_BOX_GET_PRIVATE (combobox);
- ModestProtocol serversecurity = MODEST_PROTOCOL_UNKNOWN;
+ ModestSecureConnection serversecurity = MODEST_PROTOCOL_SECURITY_NONE;
gtk_tree_model_get (priv->model, &active, MODEL_COL_ID, &serversecurity, -1);
return serversecurity;
}
- return MODEST_PROTOCOL_UNKNOWN; /* Failed. */
+ return MODEST_PROTOCOL_SECURITY_NONE; /* Failed. */
}
/**
{
ModestServersecurityComboBoxPrivate *priv = SERVERSECURITY_COMBO_BOX_GET_PRIVATE (combobox);
- const ModestProtocol security = modest_serversecurity_combo_box_get_active_serversecurity
+ const ModestSecureConnection security = modest_serversecurity_combo_box_get_active_serversecurity
(combobox);
return get_port_for_security (priv->protocol, security);
}
* or MODEST_PROTOCOL_UNKNOWN if no serversecurity was selected.
*/
gboolean
-modest_serversecurity_combo_box_set_active_serversecurity (ModestServersecurityComboBox *combobox, ModestProtocol serversecurity)
+modest_serversecurity_combo_box_set_active_serversecurity (ModestServersecurityComboBox *combobox, ModestSecureConnection serversecurity)
{
ModestServersecurityComboBoxPrivate *priv = SERVERSECURITY_COMBO_BOX_GET_PRIVATE (combobox);
void modest_serversecurity_combo_box_fill (ModestServersecurityComboBox *combobox, ModestProtocol protocol);
-ModestProtocol modest_serversecurity_combo_box_get_active_serversecurity (ModestServersecurityComboBox *combobox);
+ModestSecureConnection modest_serversecurity_combo_box_get_active_serversecurity (ModestServersecurityComboBox *combobox);
-gboolean modest_serversecurity_combo_box_set_active_serversecurity (ModestServersecurityComboBox *combobox, ModestProtocol serversecurity);
+gboolean modest_serversecurity_combo_box_set_active_serversecurity (ModestServersecurityComboBox *combobox, ModestSecureConnection serversecurity);
gint modest_serversecurity_combo_box_get_active_serversecurity_port (ModestServersecurityComboBox *combobox);