/* gkr-item-add.c generated by valac 0.20.1.64-fa28c, the Vala compiler
 * generated from gkr-item-add.vala, do not modify */

/*
 * Seahorse
 *
 * Copyright (C) 2008 Stefan Walter
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include "seahorse-gkr.h"
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <seahorse-internal.h>
#include <stdlib.h>
#include <string.h>
#include <libsecret/secret.h>
#include <ui/gcr-ui.h>
#include <gio/gio.h>

typedef struct _Block2Data Block2Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __vala_SecretSchema_free0(var) ((var == NULL) ? NULL : (var = (_vala_SecretSchema_free (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define __vala_SecretValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_SecretValue_free (var), NULL)))

struct _Block2Data {
	int _ref_count_;
	SeahorseGkrItemAdd * self;
	GtkComboBox* combo;
	GtkEntry* label;
	GtkEntry* entry;
	GtkToggleButton* check;
};


static gpointer seahorse_gkr_item_add_parent_class = NULL;

enum  {
	SEAHORSE_GKR_ITEM_ADD_DUMMY_PROPERTY
};
static GObject * seahorse_gkr_item_add_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void _seahorse_gkr_item_add___lambda8_ (Block2Data* _data2_, GtkEditable* editable);
static void __seahorse_gkr_item_add___lambda8__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void _seahorse_gkr_item_add___lambda9_ (Block2Data* _data2_);
static void __seahorse_gkr_item_add___lambda9__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
static void _seahorse_gkr_item_add___lambda10_ (Block2Data* _data2_, gint resp);
static void _g_free0_ (gpointer var);
static void __lambda11_ (SeahorseGkrItemAdd* self, GObject* obj, GAsyncResult* res);
static void ___lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _vala_SecretSchema_free (SecretSchema* self);
static void _vala_SecretValue_free (SecretValue* self);
static void __seahorse_gkr_item_add___lambda10__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);


SeahorseGkrItemAdd* seahorse_gkr_item_add_construct (GType object_type, GtkWindow* parent) {
	SeahorseGkrItemAdd * self = NULL;
	GtkWindow* _tmp0_ = NULL;
#line 114 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp0_ = parent;
#line 114 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	self = (SeahorseGkrItemAdd*) g_object_new (object_type, "transient-for", _tmp0_, NULL);
#line 115 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_widget_show ((GtkWidget*) self);
#line 116 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_window_present ((GtkWindow*) self);
#line 113 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	return self;
#line 91 "gkr-item-add.c"
}


SeahorseGkrItemAdd* seahorse_gkr_item_add_new (GtkWindow* parent) {
#line 113 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	return seahorse_gkr_item_add_construct (SEAHORSE_GKR_TYPE_ITEM_ADD, parent);
#line 98 "gkr-item-add.c"
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_atomic_int_inc (&_data2_->_ref_count_);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	return _data2_;
#line 107 "gkr-item-add.c"
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
#line 116 "gkr-item-add.c"
		SeahorseGkrItemAdd * self;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		self = _data2_->self;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (_data2_->check);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (_data2_->entry);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (_data2_->label);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (_data2_->combo);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (self);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		g_slice_free (Block2Data, _data2_);
#line 132 "gkr-item-add.c"
	}
}


static gpointer _g_object_ref0 (gpointer self) {
#line 37 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	return self ? g_object_ref (self) : NULL;
#line 140 "gkr-item-add.c"
}


static void _seahorse_gkr_item_add___lambda8_ (Block2Data* _data2_, GtkEditable* editable) {
	SeahorseGkrItemAdd * self;
	gchar* value = NULL;
	GtkEntry* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	self = _data2_->self;
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_return_if_fail (editable != NULL);
#line 59 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp0_ = _data2_->label;
#line 59 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp1_ = gtk_entry_get_text (_tmp0_);
#line 59 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 59 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	value = _tmp2_;
#line 60 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp3_ = value;
#line 60 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, (gint) GTK_RESPONSE_ACCEPT, g_strcmp0 (_tmp3_, "") != 0);
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_free0 (value);
#line 169 "gkr-item-add.c"
}


static void __seahorse_gkr_item_add___lambda8__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_seahorse_gkr_item_add___lambda8_ (self, _sender);
#line 176 "gkr-item-add.c"
}


static void _seahorse_gkr_item_add___lambda9_ (Block2Data* _data2_) {
	SeahorseGkrItemAdd * self;
	GtkEntry* _tmp0_ = NULL;
	GtkToggleButton* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
#line 71 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	self = _data2_->self;
#line 72 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp0_ = _data2_->entry;
#line 72 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp1_ = _data2_->check;
#line 72 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp2_ = gtk_toggle_button_get_active (_tmp1_);
#line 72 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp3_ = _tmp2_;
#line 72 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_entry_set_visibility (_tmp0_, _tmp3_);
#line 198 "gkr-item-add.c"
}


static void __seahorse_gkr_item_add___lambda9__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
#line 71 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_seahorse_gkr_item_add___lambda9_ (self);
#line 205 "gkr-item-add.c"
}


static void _g_free0_ (gpointer var) {
#line 90 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	var = (g_free (var), NULL);
#line 212 "gkr-item-add.c"
}


static void __lambda11_ (SeahorseGkrItemAdd* self, GObject* obj, GAsyncResult* res) {
	GError * _inner_error_ = NULL;
#line 97 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_return_if_fail (res != NULL);
#line 220 "gkr-item-add.c"
	{
		GAsyncResult* _tmp0_ = NULL;
		SecretItem* _tmp1_ = NULL;
		SecretItem* _tmp2_ = NULL;
#line 100 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		seahorse_gkr_dialog_complete_request ((GtkWidget*) self, FALSE);
#line 102 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp0_ = res;
#line 102 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp1_ = secret_item_create_finish (_tmp0_, &_inner_error_);
#line 102 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp2_ = _tmp1_;
#line 102 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_object_unref0 (_tmp2_);
#line 102 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		if (_inner_error_ != NULL) {
#line 237 "gkr-item-add.c"
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		err = _inner_error_;
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_inner_error_ = NULL;
#line 104 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp3_ = _ ("Couldn't add item");
#line 104 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp4_ = err;
#line 104 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_tmp5_ = _tmp4_->message;
#line 104 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		seahorse_util_show_error ((GtkWidget*) self, _tmp3_, _tmp5_);
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_error_free0 (err);
#line 262 "gkr-item-add.c"
	}
	__finally7:
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	if (_inner_error_ != NULL) {
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		g_clear_error (&_inner_error_);
#line 98 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		return;
#line 273 "gkr-item-add.c"
	}
#line 107 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_widget_destroy ((GtkWidget*) self);
#line 277 "gkr-item-add.c"
}


static void ___lambda11__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	__lambda11_ (self, source_object, res);
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_object_unref (self);
#line 286 "gkr-item-add.c"
}


static void _vala_SecretSchema_free (SecretSchema* self) {
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_boxed_free (secret_schema_get_type (), self);
#line 293 "gkr-item-add.c"
}


static void _vala_SecretValue_free (SecretValue* self) {
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_boxed_free (secret_value_get_type (), self);
#line 300 "gkr-item-add.c"
}


static void _seahorse_gkr_item_add___lambda10_ (Block2Data* _data2_, gint resp) {
	SeahorseGkrItemAdd * self;
	gint _tmp0_ = 0;
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp1_ = NULL;
	GtkTreeIter _tmp2_ = {0};
	gboolean _tmp3_ = FALSE;
	SecretCollection* collection = NULL;
	GtkComboBox* _tmp4_ = NULL;
	GtkTreeModel* _tmp5_ = NULL;
	GtkTreeModel* _tmp6_ = NULL;
	GtkTreeIter _tmp7_ = {0};
	SecretValue* secret = NULL;
	GtkEntry* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	SecretValue* _tmp10_ = NULL;
	GCancellable* cancellable = NULL;
	GCancellable* _tmp11_ = NULL;
	GHashTable* attributes = NULL;
	GHashFunc _tmp12_ = NULL;
	GEqualFunc _tmp13_ = NULL;
	GHashTable* _tmp14_ = NULL;
	SecretSchema* schema = NULL;
	SecretSchema* _tmp15_ = NULL;
	SecretCollection* _tmp16_ = NULL;
	SecretSchema* _tmp17_ = NULL;
	GHashTable* _tmp18_ = NULL;
	GtkEntry* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	SecretValue* _tmp21_ = NULL;
	GCancellable* _tmp22_ = NULL;
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	self = _data2_->self;
#line 76 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp0_ = resp;
#line 76 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	if (_tmp0_ != ((gint) GTK_RESPONSE_ACCEPT)) {
#line 77 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		gtk_widget_destroy ((GtkWidget*) self);
#line 78 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		return;
#line 345 "gkr-item-add.c"
	}
#line 82 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp1_ = _data2_->combo;
#line 82 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp3_ = gtk_combo_box_get_active_iter (_tmp1_, &_tmp2_);
#line 82 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	iter = _tmp2_;
#line 82 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	if (!_tmp3_) {
#line 83 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		return;
#line 357 "gkr-item-add.c"
	}
#line 86 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp4_ = _data2_->combo;
#line 86 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp5_ = gtk_combo_box_get_model (_tmp4_);
#line 86 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp6_ = _tmp5_;
#line 86 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp7_ = iter;
#line 86 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_tree_model_get (_tmp6_, &_tmp7_, 1, &collection, -1, -1);
#line 88 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp8_ = _data2_->entry;
#line 88 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp9_ = gtk_entry_get_text (_tmp8_);
#line 88 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp10_ = secret_value_new (_tmp9_, (gssize) (-1), "text/plain");
#line 88 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	secret = _tmp10_;
#line 89 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp11_ = seahorse_gkr_dialog_begin_request ((GtkWidget*) self);
#line 89 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	cancellable = _tmp11_;
#line 90 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp12_ = g_str_hash;
#line 90 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp13_ = g_str_equal;
#line 90 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp14_ = g_hash_table_new_full (_tmp12_, _tmp13_, _g_free0_, _g_free0_);
#line 90 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	attributes = _tmp14_;
#line 93 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp15_ = secret_schema_new ("org.gnome.keyring.Note", SECRET_SCHEMA_NONE, NULL);
#line 93 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	schema = _tmp15_;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp16_ = collection;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp17_ = schema;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp18_ = attributes;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp19_ = _data2_->label;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp20_ = gtk_entry_get_text (_tmp19_);
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp21_ = secret;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp22_ = cancellable;
#line 95 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	secret_item_create (_tmp16_, _tmp17_, _tmp18_, _tmp20_, _tmp21_, SECRET_ITEM_CREATE_NONE, _tmp22_, ___lambda11__gasync_ready_callback, g_object_ref (self));
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	__vala_SecretSchema_free0 (schema);
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_hash_table_unref0 (attributes);
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (cancellable);
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	__vala_SecretValue_free0 (secret);
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (collection);
#line 419 "gkr-item-add.c"
}


static void __seahorse_gkr_item_add___lambda10__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_seahorse_gkr_item_add___lambda10_ (self, response_id);
#line 426 "gkr-item-add.c"
}


static GObject * seahorse_gkr_item_add_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	SeahorseGkrItemAdd * self;
	Block2Data* _data2_;
	const gchar* _tmp0_ = NULL;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp1_ = NULL;
	GtkBuilder* _tmp2_ = NULL;
	GObject* _tmp3_ = NULL;
	GtkComboBox* _tmp4_ = NULL;
	GtkListStore* store = NULL;
	GtkListStore* _tmp5_ = NULL;
	GtkComboBox* _tmp6_ = NULL;
	GtkListStore* _tmp7_ = NULL;
	GtkCellRendererText* cell = NULL;
	GtkCellRendererText* _tmp8_ = NULL;
	GtkComboBox* _tmp9_ = NULL;
	GtkCellRendererText* _tmp10_ = NULL;
	GtkComboBox* _tmp11_ = NULL;
	GtkCellRendererText* _tmp12_ = NULL;
	SeahorseGkrBackend* _tmp13_ = NULL;
	SeahorseGkrBackend* _tmp14_ = NULL;
	GList* _tmp15_ = NULL;
	GList* _tmp16_ = NULL;
	GtkBuilder* _tmp31_ = NULL;
	GObject* _tmp32_ = NULL;
	GtkEntry* _tmp33_ = NULL;
	GtkEntry* _tmp34_ = NULL;
	GtkContainer* area = NULL;
	GtkBuilder* _tmp35_ = NULL;
	GObject* _tmp36_ = NULL;
	GtkContainer* _tmp37_ = NULL;
	GcrSecureEntryBuffer* buffer = NULL;
	GcrSecureEntryBuffer* _tmp38_ = NULL;
	GcrSecureEntryBuffer* _tmp39_ = NULL;
	GtkEntry* _tmp40_ = NULL;
	GtkEntry* _tmp41_ = NULL;
	GtkContainer* _tmp42_ = NULL;
	GtkEntry* _tmp43_ = NULL;
	GtkEntry* _tmp44_ = NULL;
	GtkBuilder* _tmp45_ = NULL;
	GObject* _tmp46_ = NULL;
	GtkToggleButton* _tmp47_ = NULL;
	GtkToggleButton* _tmp48_ = NULL;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	parent_class = G_OBJECT_CLASS (seahorse_gkr_item_add_parent_class);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAHORSE_GKR_TYPE_ITEM_ADD, SeahorseGkrItemAdd);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_ = g_slice_new0 (Block2Data);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->_ref_count_ = 1;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->self = g_object_ref (self);
#line 27 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp0_ = _ ("Add Password");
#line 27 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_window_set_title ((GtkWindow*) self, _tmp0_);
#line 28 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
#line 29 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_object_set ((GtkWindow*) self, "window-position", GTK_WIN_POS_CENTER_ON_PARENT, NULL);
#line 30 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 5);
#line 32 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp1_ = seahorse_util_load_built_contents ((GtkContainer*) self, "gkr-add-item");
#line 32 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	builder = _tmp1_;
#line 33 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_dialog_add_buttons ((GtkDialog*) self, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
#line 37 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp2_ = builder;
#line 37 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp3_ = gtk_builder_get_object (_tmp2_, "item-keyring");
#line 37 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GTK_TYPE_COMBO_BOX, GtkComboBox));
#line 37 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->combo = _tmp4_;
#line 38 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp5_ = gtk_list_store_new (2, G_TYPE_STRING, secret_collection_get_type ());
#line 38 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	store = _tmp5_;
#line 39 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp6_ = _data2_->combo;
#line 39 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp7_ = store;
#line 39 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_combo_box_set_model (_tmp6_, (GtkTreeModel*) _tmp7_);
#line 41 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp8_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
#line 41 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_object_ref_sink (_tmp8_);
#line 41 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	cell = _tmp8_;
#line 42 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp9_ = _data2_->combo;
#line 42 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp10_ = cell;
#line 42 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp9_, (GtkCellRenderer*) _tmp10_, TRUE);
#line 43 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp11_ = _data2_->combo;
#line 43 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp12_ = cell;
#line 43 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp11_, (GtkCellRenderer*) _tmp12_, "text", 0);
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp13_ = seahorse_gkr_backend_instance ();
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp14_ = _tmp13_;
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp15_ = seahorse_gkr_backend_get_keyrings (_tmp14_);
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp16_ = _tmp15_;
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (_tmp14_);
#line 549 "gkr-item-add.c"
	{
		GList* keyring_collection = NULL;
		GList* keyring_it = NULL;
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		keyring_collection = _tmp16_;
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		for (keyring_it = keyring_collection; keyring_it != NULL; keyring_it = keyring_it->next) {
#line 557 "gkr-item-add.c"
			SeahorseGkrKeyring* keyring = NULL;
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
			keyring = (SeahorseGkrKeyring*) keyring_it->data;
#line 561 "gkr-item-add.c"
			{
				GtkTreeIter iter = {0};
				GtkListStore* _tmp17_ = NULL;
				GtkTreeIter _tmp18_ = {0};
				GtkListStore* _tmp19_ = NULL;
				GtkTreeIter _tmp20_ = {0};
				SeahorseGkrKeyring* _tmp21_ = NULL;
				gchar* _tmp22_ = NULL;
				gchar* _tmp23_ = NULL;
				gchar* _tmp24_ = NULL;
				SeahorseGkrKeyring* _tmp25_ = NULL;
				SeahorseGkrKeyring* _tmp26_ = NULL;
				gboolean _tmp27_ = FALSE;
				gboolean _tmp28_ = FALSE;
#line 47 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp17_ = store;
#line 47 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				gtk_list_store_append (_tmp17_, &_tmp18_);
#line 47 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				iter = _tmp18_;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp19_ = store;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp20_ = iter;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp21_ = keyring;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp22_ = seahorse_place_get_label ((SeahorsePlace*) _tmp21_);
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp23_ = _tmp22_;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp24_ = _tmp23_;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp25_ = keyring;
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				gtk_list_store_set (_tmp19_, &_tmp20_, 0, _tmp24_, 1, _tmp25_, -1, -1);
#line 48 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_g_free0 (_tmp24_);
#line 52 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp26_ = keyring;
#line 52 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp27_ = seahorse_gkr_keyring_get_is_default (_tmp26_);
#line 52 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				_tmp28_ = _tmp27_;
#line 52 "/data/projects/seahorse/gkr/gkr-item-add.vala"
				if (_tmp28_) {
#line 608 "gkr-item-add.c"
					GtkComboBox* _tmp29_ = NULL;
					GtkTreeIter _tmp30_ = {0};
#line 53 "/data/projects/seahorse/gkr/gkr-item-add.vala"
					_tmp29_ = _data2_->combo;
#line 53 "/data/projects/seahorse/gkr/gkr-item-add.vala"
					_tmp30_ = iter;
#line 53 "/data/projects/seahorse/gkr/gkr-item-add.vala"
					gtk_combo_box_set_active_iter (_tmp29_, &_tmp30_);
#line 617 "gkr-item-add.c"
				}
			}
		}
#line 45 "/data/projects/seahorse/gkr/gkr-item-add.vala"
		_g_list_free0 (keyring_collection);
#line 623 "gkr-item-add.c"
	}
#line 56 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp31_ = builder;
#line 56 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp32_ = gtk_builder_get_object (_tmp31_, "item-label");
#line 56 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GTK_TYPE_ENTRY, GtkEntry));
#line 56 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->label = _tmp33_;
#line 57 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, (gint) GTK_RESPONSE_ACCEPT, FALSE);
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp34_ = _data2_->label;
#line 58 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_signal_connect_data ((GtkEditable*) _tmp34_, "changed", (GCallback) __seahorse_gkr_item_add___lambda8__gtk_editable_changed, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
#line 63 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp35_ = builder;
#line 63 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp36_ = gtk_builder_get_object (_tmp35_, "password-area");
#line 63 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp37_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GTK_TYPE_CONTAINER, GtkContainer));
#line 63 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	area = _tmp37_;
#line 64 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp38_ = (GcrSecureEntryBuffer*) gcr_secure_entry_buffer_new ();
#line 64 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	buffer = _tmp38_;
#line 65 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp39_ = buffer;
#line 65 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp40_ = (GtkEntry*) gtk_entry_new_with_buffer ((GtkEntryBuffer*) _tmp39_);
#line 65 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_object_ref_sink (_tmp40_);
#line 65 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->entry = _tmp40_;
#line 66 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp41_ = _data2_->entry;
#line 66 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_entry_set_visibility (_tmp41_, FALSE);
#line 67 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp42_ = area;
#line 67 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp43_ = _data2_->entry;
#line 67 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_container_add (_tmp42_, (GtkWidget*) _tmp43_);
#line 68 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp44_ = _data2_->entry;
#line 68 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	gtk_widget_show ((GtkWidget*) _tmp44_);
#line 70 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp45_ = builder;
#line 70 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp46_ = gtk_builder_get_object (_tmp45_, "show-password");
#line 70 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp47_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GTK_TYPE_TOGGLE_BUTTON, GtkToggleButton));
#line 70 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_->check = _tmp47_;
#line 71 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_tmp48_ = _data2_->check;
#line 71 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_signal_connect_data (_tmp48_, "toggled", (GCallback) __seahorse_gkr_item_add___lambda9__gtk_toggle_button_toggled, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
#line 75 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	g_signal_connect_data ((GtkDialog*) self, "response", (GCallback) __seahorse_gkr_item_add___lambda10__gtk_dialog_response, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (buffer);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (area);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (cell);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (store);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_g_object_unref0 (builder);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	block2_data_unref (_data2_);
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	_data2_ = NULL;
#line 26 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	return obj;
#line 703 "gkr-item-add.c"
}


static void seahorse_gkr_item_add_class_init (SeahorseGkrItemAddClass * klass) {
#line 25 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	seahorse_gkr_item_add_parent_class = g_type_class_peek_parent (klass);
#line 25 "/data/projects/seahorse/gkr/gkr-item-add.vala"
	G_OBJECT_CLASS (klass)->constructor = seahorse_gkr_item_add_constructor;
#line 712 "gkr-item-add.c"
}


static void seahorse_gkr_item_add_instance_init (SeahorseGkrItemAdd * self) {
}


GType seahorse_gkr_item_add_get_type (void) {
	static volatile gsize seahorse_gkr_item_add_type_id__volatile = 0;
	if (g_once_init_enter (&seahorse_gkr_item_add_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (SeahorseGkrItemAddClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_gkr_item_add_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseGkrItemAdd), 0, (GInstanceInitFunc) seahorse_gkr_item_add_instance_init, NULL };
		GType seahorse_gkr_item_add_type_id;
		seahorse_gkr_item_add_type_id = g_type_register_static (GTK_TYPE_DIALOG, "SeahorseGkrItemAdd", &g_define_type_info, 0);
		g_once_init_leave (&seahorse_gkr_item_add_type_id__volatile, seahorse_gkr_item_add_type_id);
	}
	return seahorse_gkr_item_add_type_id__volatile;
}



