/* Generated by GOB (v2.0.15)   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 15

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "mn-pi-mailbox-properties.h"

#include "mn-pi-mailbox-properties-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 26 "src/mn-pi-mailbox-properties.gob"

#include <glib/gi18n.h>
#include "mn-mailbox-properties-dialog.h"
#include "mn-mailbox-properties-dialog-private.h"
#include "mn-mailbox-properties-private.h"
#include "mn-authenticated-mailbox-properties-private.h"
#include "mn-auth-combo-box.h"
#include "mn-util.h"
#include "mn-stock.h"

#line 37 "mn-pi-mailbox-properties.c"
/* self casting macros */
#define SELF(x) MN_PI_MAILBOX_PROPERTIES(x)
#define SELF_CONST(x) MN_PI_MAILBOX_PROPERTIES_CONST(x)
#define IS_SELF(x) MN_IS_PI_MAILBOX_PROPERTIES(x)
#define TYPE_SELF MN_TYPE_PI_MAILBOX_PROPERTIES
#define SELF_CLASS(x) MN_PI_MAILBOX_PROPERTIES_CLASS(x)

#define SELF_GET_CLASS(x) MN_PI_MAILBOX_PROPERTIES_GET_CLASS(x)

/* self typedefs */
typedef MNPIMailboxProperties Self;
typedef MNPIMailboxPropertiesClass SelfClass;

/* here are local prototypes */
static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
#line 52 "src/mn-pi-mailbox-properties.gob"
static void mn_pi_mailbox_properties_class_init (MNPIMailboxPropertiesClass * class);
#line 55 "mn-pi-mailbox-properties.c"
#line 59 "src/mn-pi-mailbox-properties.gob"
static void mn_pi_mailbox_properties_init (MNPIMailboxProperties * self);
#line 58 "mn-pi-mailbox-properties.c"
#line 133 "src/mn-pi-mailbox-properties.gob"
static void mn_pi_mailbox_properties_add_connection_type (MNPIMailboxProperties * self, GtkBox * type_vbox, MNPIMailboxConnectionType type, const char * mnemonic);
#line 61 "mn-pi-mailbox-properties.c"
#line 164 "src/mn-pi-mailbox-properties.gob"
static void mn_pi_mailbox_properties_add_authentication (MNPIMailboxProperties * self);
#line 64 "mn-pi-mailbox-properties.c"
#line 190 "src/mn-pi-mailbox-properties.gob"
static void mn_pi_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data);
#line 67 "mn-pi-mailbox-properties.c"
#line 203 "src/mn-pi-mailbox-properties.gob"
static void ___6_mn_pi_mailbox_properties_activate (MNMailboxProperties * properties);
#line 70 "mn-pi-mailbox-properties.c"
#line 214 "src/mn-pi-mailbox-properties.gob"
static void ___7_mn_pi_mailbox_properties_deactivate (MNMailboxProperties * properties);
#line 73 "mn-pi-mailbox-properties.c"
#line 222 "src/mn-pi-mailbox-properties.gob"
static void ___8_mn_pi_mailbox_properties_set_mailbox (MNMailboxProperties * properties, MNMailbox * mailbox);
#line 76 "mn-pi-mailbox-properties.c"
#line 236 "src/mn-pi-mailbox-properties.gob"
static MNMailbox * ___9_mn_pi_mailbox_properties_get_mailbox (MNMailboxProperties * properties);
#line 79 "mn-pi-mailbox-properties.c"

enum {
	PROP_0,
	PROP_COMPLETE
};

/* pointer to the class of our parent */
static MNAuthenticatedMailboxPropertiesClass *parent_class = NULL;

/* Short form macros */
#define self_add_connection_type mn_pi_mailbox_properties_add_connection_type
#define self_add_authentication mn_pi_mailbox_properties_add_authentication
#define self_radio_toggled_h mn_pi_mailbox_properties_radio_toggled_h
#define self_get_contents mn_pi_mailbox_properties_get_contents
#define self_is_complete mn_pi_mailbox_properties_is_complete
GType
mn_pi_mailbox_properties_get_type (void)
{
	static GType type = 0;

	if ___GOB_UNLIKELY(type == 0) {
		static const GTypeInfo info = {
			sizeof (MNPIMailboxPropertiesClass),
			(GBaseInitFunc) NULL,
			(GBaseFinalizeFunc) NULL,
			(GClassInitFunc) mn_pi_mailbox_properties_class_init,
			(GClassFinalizeFunc) NULL,
			NULL /* class_data */,
			sizeof (MNPIMailboxProperties),
			0 /* n_preallocs */,
			(GInstanceInitFunc) mn_pi_mailbox_properties_init,
			NULL
		};

		type = g_type_register_static (MN_TYPE_AUTHENTICATED_MAILBOX_PROPERTIES, "MNPIMailboxProperties", &info, (GTypeFlags)G_TYPE_FLAG_ABSTRACT);
	}

	return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((MNPIMailboxProperties *)g_object_new(mn_pi_mailbox_properties_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static MNPIMailboxProperties * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static MNPIMailboxProperties *
GET_NEW_VARG (const char *first, ...)
{
	MNPIMailboxProperties *ret;
	va_list ap;
	va_start (ap, first);
	ret = (MNPIMailboxProperties *)g_object_new_valist (mn_pi_mailbox_properties_get_type (), first, ap);
	va_end (ap);
	return ret;
}


static void
___dispose (GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::dispose"
	MNPIMailboxProperties *self G_GNUC_UNUSED = MN_PI_MAILBOX_PROPERTIES (obj_self);
	if (G_OBJECT_CLASS (parent_class)->dispose) \
		(* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
#line 40 "src/mn-pi-mailbox-properties.gob"
	if(self->connection_page) { g_object_unref ((gpointer) self->connection_page); self->connection_page = NULL; }
#line 147 "mn-pi-mailbox-properties.c"
#line 41 "src/mn-pi-mailbox-properties.gob"
	if(self->connection_size_group) { g_object_unref ((gpointer) self->connection_size_group); self->connection_size_group = NULL; }
#line 150 "mn-pi-mailbox-properties.c"
}
#undef __GOB_FUNCTION__

#line 52 "src/mn-pi-mailbox-properties.gob"
static void 
mn_pi_mailbox_properties_class_init (MNPIMailboxPropertiesClass * class G_GNUC_UNUSED)
{
#line 158 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::class_init"
	GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;
	MNMailboxPropertiesClass *mn_mailbox_properties_class = (MNMailboxPropertiesClass *)class;

	parent_class = g_type_class_ref (MN_TYPE_AUTHENTICATED_MAILBOX_PROPERTIES);

#line 203 "src/mn-pi-mailbox-properties.gob"
	mn_mailbox_properties_class->activate = ___6_mn_pi_mailbox_properties_activate;
#line 214 "src/mn-pi-mailbox-properties.gob"
	mn_mailbox_properties_class->deactivate = ___7_mn_pi_mailbox_properties_deactivate;
#line 222 "src/mn-pi-mailbox-properties.gob"
	mn_mailbox_properties_class->set_mailbox = ___8_mn_pi_mailbox_properties_set_mailbox;
#line 236 "src/mn-pi-mailbox-properties.gob"
	mn_mailbox_properties_class->get_mailbox = ___9_mn_pi_mailbox_properties_get_mailbox;
#line 173 "mn-pi-mailbox-properties.c"
	g_object_class->dispose = ___dispose;
	g_object_class->get_property = ___object_get_property;
    {
	g_object_class_override_property (g_object_class,
		PROP_COMPLETE,
		"complete");
    }
 {
#line 53 "src/mn-pi-mailbox-properties.gob"

    MNMailboxPropertiesClass *p_class = MN_MAILBOX_PROPERTIES_CLASS(class);

    p_class->stock_id = MN_STOCK_REMOTE;
  
#line 188 "mn-pi-mailbox-properties.c"
 }
}
#undef __GOB_FUNCTION__
#line 59 "src/mn-pi-mailbox-properties.gob"
static void 
mn_pi_mailbox_properties_init (MNPIMailboxProperties * self G_GNUC_UNUSED)
{
#line 196 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::init"
#line 41 "src/mn-pi-mailbox-properties.gob"
	self->connection_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
#line 200 "mn-pi-mailbox-properties.c"
 {
#line 60 "src/mn-pi-mailbox-properties.gob"

    MNMailboxProperties *properties = MN_MAILBOX_PROPERTIES(self);
    MNAuthenticatedMailboxProperties *auth = MN_AUTHENTICATED_MAILBOX_PROPERTIES(self);
    GtkWidget *hbox;
    GtkWidget *label;
    GtkWidget *type_section;
    GtkWidget *type_vbox;
    int i;
    static const struct
    {
      MNPIMailboxConnectionType	type;
      const char		*mnemonic;
    } connection_types[] = {
      { MN_PI_MAILBOX_CONNECTION_TYPE_NORMAL,		N_("_Standard")			},
      { MN_PI_MAILBOX_CONNECTION_TYPE_INBAND_SSL,	N_("In-_band SSL/TLS")		},
      { MN_PI_MAILBOX_CONNECTION_TYPE_SSL,		N_("SSL/TLS on s_eparate port")	}
    };

    hbox = mn_authenticated_mailbox_properties_field_new(auth,
							 _("_Server:"),
							 &label,
							 &self->server_entry);

    gtk_box_pack_start(GTK_BOX(auth->account_vbox), hbox, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(auth->account_vbox), auth->username_vbox, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(auth->account_vbox), auth->password_vbox, FALSE, FALSE, 0);

    properties->entries = mn_g_slist_append_elements(properties->entries,
						     self->server_entry,
						     auth->username_entry,
						     auth->password_entry,
						     NULL);

    self->connection_page = gtk_vbox_new(FALSE, 18);
    gtk_container_set_border_width(GTK_CONTAINER(self->connection_page), 12);
    mn_mailbox_properties_dialog_set_help_section(self->connection_page, "mailbox-properties-connection");
    g_object_ref_sink(self->connection_page);

    /* translators: header capitalization */
    type_section = mn_hig_section_new_with_box(_("Connection Type"), NULL, &type_vbox);
    gtk_box_pack_start(GTK_BOX(self->connection_page), type_section, FALSE, FALSE, 0);
    gtk_widget_show(type_section);

    for (i = 0; i < MN_PI_MAILBOX_N_CONNECTION_TYPES; i++)
      self_add_connection_type(self,
			       GTK_BOX(type_vbox),
			       connection_types[i].type,
			       _(connection_types[i].mnemonic));

#if ! WITH_SSL
    gtk_widget_set_sensitive(self->conn_radio[MN_PI_MAILBOX_CONNECTION_TYPE_INBAND_SSL], FALSE);
    gtk_widget_set_sensitive(self->conn_radio[MN_PI_MAILBOX_CONNECTION_TYPE_SSL], FALSE);
#endif

    /* by default, standard is enabled */
    gtk_widget_set_sensitive(self->port_spin[MN_PI_MAILBOX_CONNECTION_TYPE_INBAND_SSL], FALSE);
    gtk_widget_set_sensitive(self->port_spin[MN_PI_MAILBOX_CONNECTION_TYPE_SSL], FALSE);

    self_add_authentication(self);

    gtk_widget_show_all(self->connection_page);

    g_object_connect(self->server_entry,
		     "swapped-signal::changed", mn_mailbox_properties_notify_complete, self,
		     "swapped-signal::changed", mn_mailbox_properties_notify_default_name, self,
		     NULL);

    g_object_connect(auth->username_entry,
		     "swapped-signal::changed", mn_mailbox_properties_notify_complete, self,
		     "swapped-signal::changed", mn_mailbox_properties_notify_default_name, self,
		     NULL);
  
#line 275 "mn-pi-mailbox-properties.c"
 }
}
#undef __GOB_FUNCTION__

static void
___object_get_property (GObject *object,
	guint property_id,
	GValue *VAL G_GNUC_UNUSED,
	GParamSpec *pspec G_GNUC_UNUSED)
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_property"
{
	MNPIMailboxProperties *self G_GNUC_UNUSED;

	self = MN_PI_MAILBOX_PROPERTIES (object);

	switch (property_id) {
	case PROP_COMPLETE:
		{
#line 48 "src/mn-pi-mailbox-properties.gob"

      g_value_set_boolean(VAL, self_is_complete(self));
    
#line 298 "mn-pi-mailbox-properties.c"
		}
		break;
	default:
/* Apparently in g++ this is needed, glib is b0rk */
#ifndef __PRETTY_FUNCTION__
#  undef G_STRLOC
#  define G_STRLOC	__FILE__ ":" G_STRINGIFY (__LINE__)
#endif
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}
#undef __GOB_FUNCTION__



#line 133 "src/mn-pi-mailbox-properties.gob"
static void 
mn_pi_mailbox_properties_add_connection_type (MNPIMailboxProperties * self, GtkBox * type_vbox, MNPIMailboxConnectionType type, const char * mnemonic)
{
#line 319 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::add_connection_type"
#line 133 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (self != NULL);
#line 133 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
#line 133 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (type_vbox != NULL);
#line 133 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (mnemonic != NULL);
#line 329 "mn-pi-mailbox-properties.c"
{
#line 138 "src/mn-pi-mailbox-properties.gob"
	
    GtkWidget *hbox;
    GtkWidget *port_label;

    self->conn_radio[type] = type == 0
      ? gtk_radio_button_new_with_mnemonic(NULL, mnemonic)
      : gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(self->conn_radio[0]), mnemonic);

    port_label = gtk_label_new(_("Port:"));

    self->port_spin[type] = gtk_spin_button_new_with_range(0, 0xFFFF, 1);
    gtk_entry_set_activates_default(GTK_ENTRY(self->port_spin[type]), TRUE);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(self->port_spin[type]), TRUE);

    hbox = gtk_hbox_new(FALSE, 12);
    gtk_box_pack_start(GTK_BOX(hbox), self->conn_radio[type], FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), port_label, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), self->port_spin[type], FALSE, FALSE, 0);
    gtk_box_pack_start(type_vbox, hbox, FALSE, FALSE, 0);
    gtk_widget_show_all(hbox);

    gtk_size_group_add_widget(self->connection_size_group, self->conn_radio[type]);

    g_signal_connect(self->conn_radio[type], "toggled", G_CALLBACK(self_radio_toggled_h), self);
  }}
#line 357 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__

#line 164 "src/mn-pi-mailbox-properties.gob"
static void 
mn_pi_mailbox_properties_add_authentication (MNPIMailboxProperties * self)
{
#line 364 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::add_authentication"
#line 164 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (self != NULL);
#line 164 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
#line 370 "mn-pi-mailbox-properties.c"
{
#line 166 "src/mn-pi-mailbox-properties.gob"
	
    GtkWidget *section;
    GtkWidget *vbox;
    GtkWidget *hbox;
    GtkWidget *label;

    /* translators: header capitalization */
    section = mn_hig_section_new_with_box(_("Authentication"), NULL, &vbox);
    gtk_box_pack_start(GTK_BOX(self->connection_page), section, FALSE, FALSE, 0);

    hbox = gtk_hbox_new(FALSE, 12);
    label = gtk_label_new_with_mnemonic(_("_Mechanism:"));
    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);

    self->auth_combo = mn_auth_combo_box_new();
    gtk_label_set_mnemonic_widget(GTK_LABEL(label), self->auth_combo);

    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(hbox), self->auth_combo, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

    gtk_size_group_add_widget(self->connection_size_group, label);
  }}
#line 396 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__

#line 190 "src/mn-pi-mailbox-properties.gob"
static void 
mn_pi_mailbox_properties_radio_toggled_h (GtkToggleButton * togglebutton, gpointer user_data)
{
#line 403 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::radio_toggled_h"
#line 190 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (togglebutton != NULL);
#line 190 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (GTK_IS_TOGGLE_BUTTON (togglebutton));
#line 190 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (user_data != NULL);
#line 411 "mn-pi-mailbox-properties.c"
{
#line 193 "src/mn-pi-mailbox-properties.gob"
	
    Self *self = user_data;
    int i;

    for (i = 0; i < MN_PI_MAILBOX_N_CONNECTION_TYPES; i++)
      gtk_widget_set_sensitive(self->port_spin[i], GTK_WIDGET_SENSITIVE(self->conn_radio[i]) && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])));

    g_object_notify(G_OBJECT(self), "complete");
  }}
#line 423 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__

#line 203 "src/mn-pi-mailbox-properties.gob"
static void 
___6_mn_pi_mailbox_properties_activate (MNMailboxProperties * properties G_GNUC_UNUSED)
#line 429 "mn-pi-mailbox-properties.c"
#define PARENT_HANDLER(___properties) \
	{ if(MN_MAILBOX_PROPERTIES_CLASS(parent_class)->activate) \
		(* MN_MAILBOX_PROPERTIES_CLASS(parent_class)->activate)(___properties); }
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::activate"
{
#line 205 "src/mn-pi-mailbox-properties.gob"
	
    Self *self = SELF(properties);

    PARENT_HANDLER(properties);

    gtk_notebook_insert_page(GTK_NOTEBOOK(MN_MAILBOX_PROPERTIES_DIALOG(properties->dialog)->notebook), self->connection_page, NULL, 1);
    gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(MN_MAILBOX_PROPERTIES_DIALOG(properties->dialog)->notebook), self->connection_page, _("Connection"));
  }}
#line 445 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 214 "src/mn-pi-mailbox-properties.gob"
static void 
___7_mn_pi_mailbox_properties_deactivate (MNMailboxProperties * properties G_GNUC_UNUSED)
#line 452 "mn-pi-mailbox-properties.c"
#define PARENT_HANDLER(___properties) \
	{ if(MN_MAILBOX_PROPERTIES_CLASS(parent_class)->deactivate) \
		(* MN_MAILBOX_PROPERTIES_CLASS(parent_class)->deactivate)(___properties); }
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::deactivate"
{
#line 216 "src/mn-pi-mailbox-properties.gob"
	
    PARENT_HANDLER(properties);

    gtk_notebook_remove_page(GTK_NOTEBOOK(MN_MAILBOX_PROPERTIES_DIALOG(properties->dialog)->notebook), 1);
  }}
#line 465 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 222 "src/mn-pi-mailbox-properties.gob"
static void 
___8_mn_pi_mailbox_properties_set_mailbox (MNMailboxProperties * properties G_GNUC_UNUSED, MNMailbox * mailbox)
#line 472 "mn-pi-mailbox-properties.c"
#define PARENT_HANDLER(___properties,___mailbox) \
	{ if(MN_MAILBOX_PROPERTIES_CLASS(parent_class)->set_mailbox) \
		(* MN_MAILBOX_PROPERTIES_CLASS(parent_class)->set_mailbox)(___properties,___mailbox); }
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::set_mailbox"
{
#line 224 "src/mn-pi-mailbox-properties.gob"
	
    Self *self = SELF(properties);
    MNPIMailbox *pi_mailbox = MN_PI_MAILBOX(mailbox);

    PARENT_HANDLER(properties, mailbox);

    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(self->conn_radio[pi_mailbox->connection_type]), TRUE);
    mn_auth_combo_box_set_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo), pi_mailbox->authmech);
    gtk_entry_set_text(GTK_ENTRY(self->server_entry), pi_mailbox->hostname);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(self->port_spin[pi_mailbox->connection_type]), pi_mailbox->runtime_port);
  }}
#line 491 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 236 "src/mn-pi-mailbox-properties.gob"
static MNMailbox * 
___9_mn_pi_mailbox_properties_get_mailbox (MNMailboxProperties * properties G_GNUC_UNUSED)
#line 498 "mn-pi-mailbox-properties.c"
#define PARENT_HANDLER(___properties) \
	((MN_MAILBOX_PROPERTIES_CLASS(parent_class)->get_mailbox)? \
		(* MN_MAILBOX_PROPERTIES_CLASS(parent_class)->get_mailbox)(___properties): \
		((MNMailbox * )0))
{
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_mailbox"
{
#line 238 "src/mn-pi-mailbox-properties.gob"
	
    MNMailbox *mailbox;
    MNPIMailboxConnectionType connection_type;
    char *authmech;
    const char *server;
    int port;

    mailbox = PARENT_HANDLER(properties);

    self_get_contents(SELF(properties),
		      &connection_type,
		      &authmech,
		      &server,
		      &port);

    g_object_set(mailbox,
		 MN_PI_MAILBOX_PROP_CONNECTION_TYPE(connection_type),
		 MN_PI_MAILBOX_PROP_AUTHMECH(authmech),
		 MN_PI_MAILBOX_PROP_HOSTNAME((char *) server),
		 MN_PI_MAILBOX_PROP_PORT(port),
		 NULL);

    g_free(authmech);

    return mailbox;
  }}
#line 533 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
#undef PARENT_HANDLER

#line 265 "src/mn-pi-mailbox-properties.gob"
void 
mn_pi_mailbox_properties_get_contents (MNPIMailboxProperties * self, MNPIMailboxConnectionType * connection_type, char ** authmech, const char ** server, int * port)
{
#line 541 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::get_contents"
#line 265 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (self != NULL);
#line 265 "src/mn-pi-mailbox-properties.gob"
	g_return_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self));
#line 547 "mn-pi-mailbox-properties.c"
{
#line 271 "src/mn-pi-mailbox-properties.gob"
	
    MNPIMailboxConnectionType _connection_type;

    if (connection_type || port)
      {
	int i;

	_connection_type = -1;

	for (i = 0; i < MN_PI_MAILBOX_N_CONNECTION_TYPES; i++)
	  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(self->conn_radio[i])))
	    {
	      _connection_type = i;
	      break;
	    }

	g_assert(_connection_type != -1);
      }

    if (connection_type)
      *connection_type = _connection_type;
    if (authmech)
      *authmech = mn_auth_combo_box_get_active_mechanism(MN_AUTH_COMBO_BOX(self->auth_combo));
    if (server)
      *server = gtk_entry_get_text(GTK_ENTRY(self->server_entry));
    if (port)
      *port = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(self->port_spin[_connection_type]));
  }}
#line 578 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__

#line 300 "src/mn-pi-mailbox-properties.gob"
gboolean 
mn_pi_mailbox_properties_is_complete (MNPIMailboxProperties * self)
{
#line 585 "mn-pi-mailbox-properties.c"
#define __GOB_FUNCTION__ "MN:PI:Mailbox:Properties::is_complete"
#line 300 "src/mn-pi-mailbox-properties.gob"
	g_return_val_if_fail (self != NULL, (gboolean )0);
#line 300 "src/mn-pi-mailbox-properties.gob"
	g_return_val_if_fail (MN_IS_PI_MAILBOX_PROPERTIES (self), (gboolean )0);
#line 591 "mn-pi-mailbox-properties.c"
{
#line 302 "src/mn-pi-mailbox-properties.gob"
	
    const char *server;

    if (! mn_authenticated_mailbox_properties_is_complete(MN_AUTHENTICATED_MAILBOX_PROPERTIES(self)))
      return FALSE;

    server = gtk_entry_get_text(GTK_ENTRY(self->server_entry));
    if (! *server)
      return FALSE;

#if ! WITH_SSL
    if (! gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(MN_PI_MAILBOX_PROPERTIES(self)->conn_radio[MN_PI_MAILBOX_CONNECTION_TYPE_NORMAL])))
      return FALSE;
#endif /* WITH_SSL */

    return TRUE;
  }}
#line 611 "mn-pi-mailbox-properties.c"
#undef __GOB_FUNCTION__
