#include <modest-text-utils.h>
#include "modest-protocol-registry.h"
#include "modest-runtime.h"
+#include <modest-account-protocol.h>
#include <stdlib.h>
#include <string.h> /* For memcpy() */
continue;
}
+ if (MODEST_ACCOUNT_PROTOCOL (proto) &&
+ !modest_account_protocol_is_supported (MODEST_ACCOUNT_PROTOCOL (proto))) {
+ continue;
+ }
+
gtk_list_store_append (liststore, &iter);
gtk_list_store_set (liststore, &iter,
MODEL_COL_ID, modest_protocol_get_name (proto),
#include <modest-text-utils.h>
#include "modest-protocol-registry.h"
#include "modest-runtime.h"
+#include <modest-account-protocol.h>
#include <stdlib.h>
#include <string.h> /* For memcpy() */
while (tmp) {
GtkTreeIter iter;
ModestProtocol *proto = MODEST_PROTOCOL (tmp->data);
- const gchar *name = modest_protocol_get_display_name (proto);
/* only add store protocols, no need to duplicate them */
if (modest_protocol_registry_protocol_type_has_tag (registry,
modest_protocol_get_type_id (proto),
MODEST_PROTOCOL_REGISTRY_STORE_PROTOCOLS)) {
- gtk_list_store_append (liststore, &iter);
- gtk_list_store_set (liststore, &iter,
- MODEL_COL_ID, modest_protocol_get_name (proto),
- MODEL_COL_NAME, name,
- MODEL_COL_ID_TYPE, EASYSETUP_PROVIDER_COMBO_BOX_ID_PLUGIN_PROTOCOL,
- -1);
+ gboolean supported;
+
+ supported = modest_account_protocol_is_supported (MODEST_ACCOUNT_PROTOCOL (proto));
+
+ if (supported) {
+ const gchar *name = modest_protocol_get_display_name (proto);
+
+ gtk_list_store_append (liststore, &iter);
+ gtk_list_store_set (liststore, &iter,
+ MODEL_COL_ID, modest_protocol_get_name (proto),
+ MODEL_COL_NAME, name,
+ MODEL_COL_ID_TYPE, EASYSETUP_PROVIDER_COMBO_BOX_ID_PLUGIN_PROTOCOL,
+ -1);
+ }
}
tmp = g_slist_next (tmp);
}
static ModestWizardDialogResponseOverrideFunc
modest_account_protocol_get_wizard_response_override_default (ModestAccountProtocol *self);
+static gboolean modest_account_protocol_is_supported_default (ModestAccountProtocol *self);
+
/* globals */
static GObjectClass *parent_class = NULL;
modest_account_protocol_create_account_default;
account_class->get_wizard_response_override =
modest_account_protocol_get_wizard_response_override_default;
+ account_class->is_supported =
+ modest_account_protocol_is_supported_default;
}
static void
return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_wizard_response_override (self);
}
+static gboolean
+modest_account_protocol_is_supported_default (ModestAccountProtocol *self)
+{
+ return TRUE;
+}
+
+gboolean
+modest_account_protocol_is_supported (ModestAccountProtocol *self)
+{
+ return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->is_supported (self);
+}
ModestWizardDialogResponseOverrideFunc (*get_wizard_response_override) (ModestAccountProtocol *self);
void (*save_settings) (ModestAccountProtocol *self, ModestAccountSettingsDialog *dialog, ModestAccountSettings *settings);
void (*save_wizard_settings) (ModestAccountProtocol *self, GList *wizard_pages, ModestAccountSettings *settings);
+ gboolean (*is_supported) (ModestAccountProtocol *self);
};
/**
*/
ModestWizardDialogResponseOverrideFunc modest_account_protocol_get_wizard_response_override (ModestAccountProtocol *self);
+/**
+ * modest_account_protocol_is_supported:
+ * @self: a #ModestAccountProtocol
+ *
+ * Determines if the account protocol is supported on this device.
+ *
+ * Returns: %TRUE if the protocol is supported, %FALSE otherwise
+ */
+gboolean modest_account_protocol_is_supported (ModestAccountProtocol *self);
G_END_DECLS
priv->wizard_name, current + 1, pages, steps);
*/
- str = g_strdup_printf (_HL("%s: %s"),
+ str = g_strdup_printf ((steps&&*steps)?_HL("%s: %s"):_HL("%s"),
priv->wizard_name, steps);
/* } */