/* InfoPanel.c generated by valac 0.56.19, the Vala compiler
 * generated from InfoPanel.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*-
 * Copyright (c) 2013-2020 elementary, Inc. (http://launchpad.net/maya)
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Corentin Noël <corentin@elementaryos.org>
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <granite.h>
#include <libical-glib/libical-glib.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <libedataserver/libedataserver.h>
#include <libecal/libecal.h>
#include "elementary-calendar.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL (maya_view_event_edition_info_panel_get_type ())
#define MAYA_VIEW_EVENT_EDITION_INFO_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanel))
#define MAYA_VIEW_EVENT_EDITION_INFO_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanelClass))
#define MAYA_VIEW_EVENT_EDITION_IS_INFO_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL))
#define MAYA_VIEW_EVENT_EDITION_IS_INFO_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL))
#define MAYA_VIEW_EVENT_EDITION_INFO_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanelClass))

typedef struct _MayaViewEventEditionInfoPanel MayaViewEventEditionInfoPanel;
typedef struct _MayaViewEventEditionInfoPanelClass MayaViewEventEditionInfoPanelClass;
typedef struct _MayaViewEventEditionInfoPanelPrivate MayaViewEventEditionInfoPanelPrivate;

#define MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER (maya_view_widgets_calendar_chooser_get_type ())
#define MAYA_VIEW_WIDGETS_CALENDAR_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER, MayaViewWidgetsCalendarChooser))
#define MAYA_VIEW_WIDGETS_CALENDAR_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER, MayaViewWidgetsCalendarChooserClass))
#define MAYA_VIEW_WIDGETS_IS_CALENDAR_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER))
#define MAYA_VIEW_WIDGETS_IS_CALENDAR_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER))
#define MAYA_VIEW_WIDGETS_CALENDAR_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAYA_VIEW_WIDGETS_TYPE_CALENDAR_CHOOSER, MayaViewWidgetsCalendarChooserClass))

typedef struct _MayaViewWidgetsCalendarChooser MayaViewWidgetsCalendarChooser;
typedef struct _MayaViewWidgetsCalendarChooserClass MayaViewWidgetsCalendarChooserClass;

#define MAYA_VIEW_TYPE_EVENT_DIALOG (maya_view_event_dialog_get_type ())
#define MAYA_VIEW_EVENT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAYA_VIEW_TYPE_EVENT_DIALOG, MayaViewEventDialog))
#define MAYA_VIEW_EVENT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAYA_VIEW_TYPE_EVENT_DIALOG, MayaViewEventDialogClass))
#define MAYA_VIEW_IS_EVENT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAYA_VIEW_TYPE_EVENT_DIALOG))
#define MAYA_VIEW_IS_EVENT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAYA_VIEW_TYPE_EVENT_DIALOG))
#define MAYA_VIEW_EVENT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAYA_VIEW_TYPE_EVENT_DIALOG, MayaViewEventDialogClass))

typedef struct _MayaViewEventDialog MayaViewEventDialog;
typedef struct _MayaViewEventDialogClass MayaViewEventDialogClass;
enum  {
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_0_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_NUM_PROPERTIES
};
static GParamSpec* maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_CALENDAR_ROW (calendar_row_get_type ())
#define CALENDAR_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALENDAR_ROW, CalendarRow))
#define CALENDAR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CALENDAR_ROW, CalendarRowClass))
#define IS_CALENDAR_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALENDAR_ROW))
#define IS_CALENDAR_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CALENDAR_ROW))
#define CALENDAR_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CALENDAR_ROW, CalendarRowClass))

typedef struct _CalendarRow CalendarRow;
typedef struct _CalendarRowClass CalendarRowClass;
typedef struct _Block14Data Block14Data;
typedef struct _MayaViewEventDialogPrivate MayaViewEventDialogPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _MayaViewWidgetsCalendarChooserPrivate MayaViewWidgetsCalendarChooserPrivate;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
enum  {
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_PARSE_EVENT_SIGNAL,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_VALID_EVENT_SIGNAL,
	MAYA_VIEW_EVENT_EDITION_INFO_PANEL_NUM_SIGNALS
};
static guint maya_view_event_edition_info_panel_signals[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_NUM_SIGNALS] = {0};

struct _MayaViewEventEditionInfoPanel {
	GtkGrid parent_instance;
	MayaViewEventEditionInfoPanelPrivate * priv;
	gboolean nl_parsing_enabled;
};

struct _MayaViewEventEditionInfoPanelClass {
	GtkGridClass parent_class;
};

struct _MayaViewEventEditionInfoPanelPrivate {
	GtkEntry* title_entry;
	GraniteHyperTextView* comment_textview;
	GraniteWidgetsDatePicker* from_date_picker;
	GraniteWidgetsDatePicker* to_date_picker;
	GtkSwitch* allday_switch;
	GraniteWidgetsTimePicker* from_time_picker;
	GraniteWidgetsTimePicker* to_time_picker;
	GtkLabel* timezone_label;
	MayaViewWidgetsCalendarChooser* calchooser;
	MayaViewEventDialog* parent_dialog;
	ICalTimezone* _timezone;
};

struct _Block14Data {
	int _ref_count_;
	MayaViewEventEditionInfoPanel* self;
	GtkPopover* popover;
	CalendarRow* current_calendar_grid;
	GtkMenuButton* calendar_button;
};

struct _MayaViewEventDialog {
	GraniteDialog parent_instance;
	MayaViewEventDialogPrivate * priv;
	gboolean can_edit;
};

struct _MayaViewEventDialogClass {
	GraniteDialogClass parent_class;
};

struct _MayaViewWidgetsCalendarChooser {
	GtkBox parent_instance;
	MayaViewWidgetsCalendarChooserPrivate * priv;
	GList* sources;
};

struct _MayaViewWidgetsCalendarChooserClass {
	GtkBoxClass parent_class;
};

static gint MayaViewEventEditionInfoPanel_private_offset;
static gpointer maya_view_event_edition_info_panel_parent_class = NULL;

VALA_EXTERN GType maya_view_event_edition_info_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MayaViewEventEditionInfoPanel, g_object_unref)
VALA_EXTERN GType maya_view_widgets_calendar_chooser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MayaViewWidgetsCalendarChooser, g_object_unref)
VALA_EXTERN GType maya_view_event_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MayaViewEventDialog, g_object_unref)
VALA_EXTERN MayaViewEventEditionInfoPanel* maya_view_event_edition_info_panel_new (MayaViewEventDialog* parent_dialog);
VALA_EXTERN MayaViewEventEditionInfoPanel* maya_view_event_edition_info_panel_construct (GType object_type,
                                                                             MayaViewEventDialog* parent_dialog);
VALA_EXTERN GType calendar_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CalendarRow, g_object_unref)
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static GraniteWidgetsDatePicker* maya_view_event_edition_info_panel_make_date_picker (MayaViewEventEditionInfoPanel* self);
static void __lambda26_ (MayaViewEventEditionInfoPanel* self);
static void maya_view_event_edition_info_panel_on_date_modified (MayaViewEventEditionInfoPanel* self,
                                                          gint index);
static void ___lambda26__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static GraniteWidgetsTimePicker* maya_view_event_edition_info_panel_make_time_picker (MayaViewEventEditionInfoPanel* self);
static void __lambda27_ (MayaViewEventEditionInfoPanel* self);
static void maya_view_event_edition_info_panel_on_time_modified (MayaViewEventEditionInfoPanel* self,
                                                          gint index);
static void ___lambda27__granite_widgets_time_picker_time_changed (GraniteWidgetsTimePicker* _sender,
                                                            gpointer self);
static void __lambda28_ (MayaViewEventEditionInfoPanel* self);
static void ___lambda28__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda29_ (MayaViewEventEditionInfoPanel* self);
static void ___lambda29__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda30_ (MayaViewEventEditionInfoPanel* self);
static void ___lambda30__granite_widgets_time_picker_time_changed (GraniteWidgetsTimePicker* _sender,
                                                            gpointer self);
static void maya_view_event_edition_info_panel_on_title_entry_modified (MayaViewEventEditionInfoPanel* self);
static void _maya_view_event_edition_info_panel_on_title_entry_modified_gtk_editable_changed (GtkEditable* _sender,
                                                                                       gpointer self);
static void __lambda31_ (MayaViewEventEditionInfoPanel* self);
static void ___lambda31__gtk_entry_activate (GtkEntry* _sender,
                                      gpointer self);
static void __lambda32_ (MayaViewEventEditionInfoPanel* self);
static void ___lambda32__gtk_editable_changed (GtkEditable* _sender,
                                        gpointer self);
static void __lambda33_ (MayaViewEventEditionInfoPanel* self);
static gboolean __lambda34_ (MayaViewEventEditionInfoPanel* self);
static gboolean ___lambda34__gsource_func (gpointer self);
static void ___lambda33__gtk_widget_realize (GtkWidget* _sender,
                                      gpointer self);
VALA_EXTERN MayaViewWidgetsCalendarChooser* maya_view_widgets_calendar_chooser_new (void);
VALA_EXTERN MayaViewWidgetsCalendarChooser* maya_view_widgets_calendar_chooser_construct (GType object_type);
VALA_EXTERN ESource* maya_view_widgets_calendar_chooser_get_current_source (MayaViewWidgetsCalendarChooser* self);
VALA_EXTERN CalendarRow* calendar_row_new (ESource* source);
VALA_EXTERN CalendarRow* calendar_row_construct (GType object_type,
                                     ESource* source);
VALA_EXTERN ESource* maya_view_event_dialog_get_source (MayaViewEventDialog* self);
VALA_EXTERN void maya_view_event_dialog_set_source (MayaViewEventDialog* self,
                                        ESource* value);
static void maya_view_event_edition_info_panel_load (MayaViewEventEditionInfoPanel* self);
static void __lambda35_ (Block14Data* _data14_,
                  GObject* s,
                  GParamSpec* p);
VALA_EXTERN const gchar* calendar_row_get_label (CalendarRow* self);
VALA_EXTERN const gchar* calendar_row_get_location (CalendarRow* self);
static void ___lambda35__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda36_ (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_widgets_calendar_chooser_clear_search_entry (MayaViewWidgetsCalendarChooser* self);
static void ___lambda36__gtk_widget_unmap (GtkWidget* _sender,
                                    gpointer self);
VALA_EXTERN void maya_view_event_edition_info_panel_save (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN ECalComponent* maya_view_event_dialog_get_ecal (MayaViewEventDialog* self);
VALA_EXTERN ICalTimezone* maya_view_event_edition_info_panel_get_timezone (MayaViewEventEditionInfoPanel* self);
static void maya_view_event_edition_info_panel_set_timezone (MayaViewEventEditionInfoPanel* self,
                                                      ICalTimezone* value);
VALA_EXTERN void maya_view_event_dialog_set_date_time (MayaViewEventDialog* self,
                                           GDateTime* value);
VALA_EXTERN ESource* maya_view_event_dialog_get_original_source (MayaViewEventDialog* self);
VALA_EXTERN void maya_view_widgets_calendar_chooser_set_current_source (MayaViewWidgetsCalendarChooser* self,
                                                            ESource* value);
VALA_EXTERN void maya_view_event_dialog_set_ecal (MayaViewEventDialog* self,
                                      ECalComponent* value);
VALA_EXTERN GDateTime* maya_view_event_dialog_get_date_time (MayaViewEventDialog* self);
static void maya_view_event_edition_info_panel_update_create_sensitivity (MayaViewEventEditionInfoPanel* self);
static gboolean maya_view_event_edition_info_panel_is_valid_event (MayaViewEventEditionInfoPanel* self);
static gboolean maya_view_event_edition_info_panel_is_valid_dates (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN const gchar* maya_view_event_edition_info_panel_get_title (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_title (MayaViewEventEditionInfoPanel* self,
                                                   const gchar* value);
VALA_EXTERN GDateTime* maya_view_event_edition_info_panel_get_from_date (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_from_date (MayaViewEventEditionInfoPanel* self,
                                                       GDateTime* value);
VALA_EXTERN GDateTime* maya_view_event_edition_info_panel_get_to_date (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_to_date (MayaViewEventEditionInfoPanel* self,
                                                     GDateTime* value);
VALA_EXTERN GDateTime* maya_view_event_edition_info_panel_get_from_time (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_from_time (MayaViewEventEditionInfoPanel* self,
                                                       GDateTime* value);
VALA_EXTERN GDateTime* maya_view_event_edition_info_panel_get_to_time (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_to_time (MayaViewEventEditionInfoPanel* self,
                                                     GDateTime* value);
VALA_EXTERN gboolean maya_view_event_edition_info_panel_get_all_day (MayaViewEventEditionInfoPanel* self);
VALA_EXTERN void maya_view_event_edition_info_panel_set_all_day (MayaViewEventEditionInfoPanel* self,
                                                     gboolean value);
static void maya_view_event_edition_info_panel_finalize (GObject * obj);
static GType maya_view_event_edition_info_panel_get_type_once (void);
static void _vala_maya_view_event_edition_info_panel_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_maya_view_event_edition_info_panel_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
maya_view_event_edition_info_panel_get_instance_private (MayaViewEventEditionInfoPanel* self)
{
	return G_STRUCT_MEMBER_P (self, MayaViewEventEditionInfoPanel_private_offset);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		MayaViewEventEditionInfoPanel* self;
		self = _data14_->self;
		_g_object_unref0 (_data14_->calendar_button);
		_g_object_unref0 (_data14_->current_calendar_grid);
		_g_object_unref0 (_data14_->popover);
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
__lambda26_ (MayaViewEventEditionInfoPanel* self)
{
	maya_view_event_edition_info_panel_on_date_modified (self, 0);
}

static void
___lambda26__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda26_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda27_ (MayaViewEventEditionInfoPanel* self)
{
	maya_view_event_edition_info_panel_on_time_modified (self, 0);
}

static void
___lambda27__granite_widgets_time_picker_time_changed (GraniteWidgetsTimePicker* _sender,
                                                       gpointer self)
{
	__lambda27_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda28_ (MayaViewEventEditionInfoPanel* self)
{
	GraniteWidgetsTimePicker* _tmp0_;
	GtkSwitch* _tmp1_;
	GraniteWidgetsTimePicker* _tmp2_;
	GtkSwitch* _tmp3_;
	maya_view_event_edition_info_panel_on_date_modified (self, 1);
	_tmp0_ = self->priv->from_time_picker;
	_tmp1_ = self->priv->allday_switch;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, !gtk_switch_get_active (_tmp1_));
	_tmp2_ = self->priv->to_time_picker;
	_tmp3_ = self->priv->allday_switch;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, !gtk_switch_get_active (_tmp3_));
}

static void
___lambda28__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda28_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda29_ (MayaViewEventEditionInfoPanel* self)
{
	maya_view_event_edition_info_panel_on_date_modified (self, 1);
}

static void
___lambda29__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda29_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda30_ (MayaViewEventEditionInfoPanel* self)
{
	maya_view_event_edition_info_panel_on_time_modified (self, 1);
}

static void
___lambda30__granite_widgets_time_picker_time_changed (GraniteWidgetsTimePicker* _sender,
                                                       gpointer self)
{
	__lambda30_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
_maya_view_event_edition_info_panel_on_title_entry_modified_gtk_editable_changed (GtkEditable* _sender,
                                                                                  gpointer self)
{
	maya_view_event_edition_info_panel_on_title_entry_modified ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda31_ (MayaViewEventEditionInfoPanel* self)
{
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	GtkEntry* _tmp2_;
	GtkEntry* _tmp3_;
	_tmp0_ = self->priv->title_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	g_signal_emit (self, maya_view_event_edition_info_panel_signals[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_PARSE_EVENT_SIGNAL], 0, _tmp1_);
	_tmp2_ = self->priv->title_entry;
	g_object_set (_tmp2_, "secondary-icon-name", NULL, NULL);
	_tmp3_ = self->priv->title_entry;
	g_object_set (_tmp3_, "secondary-icon-tooltip-text", NULL, NULL);
}

static void
___lambda31__gtk_entry_activate (GtkEntry* _sender,
                                 gpointer self)
{
	__lambda31_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda32_ (MayaViewEventEditionInfoPanel* self)
{
	gboolean _tmp0_ = FALSE;
	GtkEntry* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	_tmp1_ = self->priv->title_entry;
	_tmp2_ = gtk_entry_get_text (_tmp1_);
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		_tmp0_ = self->nl_parsing_enabled;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkEntry* _tmp5_;
		GtkEntry* _tmp6_;
		_tmp5_ = self->priv->title_entry;
		g_object_set (_tmp5_, "secondary-icon-name", "go-jump-symbolic", NULL);
		_tmp6_ = self->priv->title_entry;
		g_object_set (_tmp6_, "secondary-icon-tooltip-text", _ ("Press enter to parse event"), NULL);
	} else {
		GtkEntry* _tmp7_;
		GtkEntry* _tmp8_;
		_tmp7_ = self->priv->title_entry;
		g_object_set (_tmp7_, "secondary-icon-name", NULL, NULL);
		_tmp8_ = self->priv->title_entry;
		g_object_set (_tmp8_, "secondary-icon-tooltip-text", NULL, NULL);
	}
}

static void
___lambda32__gtk_editable_changed (GtkEditable* _sender,
                                   gpointer self)
{
	__lambda32_ ((MayaViewEventEditionInfoPanel*) self);
}

static gboolean
__lambda34_ (MayaViewEventEditionInfoPanel* self)
{
	GtkEntry* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->title_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	result = FALSE;
	return result;
}

static gboolean
___lambda34__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda34_ ((MayaViewEventEditionInfoPanel*) self);
	return result;
}

static void
__lambda33_ (MayaViewEventEditionInfoPanel* self)
{
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda34__gsource_func, g_object_ref (self), g_object_unref);
}

static void
___lambda33__gtk_widget_realize (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda33_ ((MayaViewEventEditionInfoPanel*) self);
}

static void
__lambda35_ (Block14Data* _data14_,
             GObject* s,
             GParamSpec* p)
{
	MayaViewEventEditionInfoPanel* self;
	GtkMenuButton* _tmp0_;
	CalendarRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	CalendarRow* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GtkPopover* _tmp9_;
	self = _data14_->self;
	g_return_if_fail (s != NULL);
	g_return_if_fail (p != NULL);
	_tmp0_ = _data14_->calendar_button;
	_tmp1_ = _data14_->current_calendar_grid;
	_tmp2_ = calendar_row_get_label (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data14_->current_calendar_grid;
	_tmp5_ = calendar_row_get_location (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup_printf ("%s—%s", _tmp3_, _tmp6_);
	_tmp8_ = _tmp7_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp0_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = _data14_->popover;
	gtk_popover_popdown (_tmp9_);
}

static void
___lambda35__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda35_ (self, _sender, pspec);
}

static void
__lambda36_ (MayaViewEventEditionInfoPanel* self)
{
	MayaViewWidgetsCalendarChooser* _tmp0_;
	_tmp0_ = self->priv->calchooser;
	maya_view_widgets_calendar_chooser_clear_search_entry (_tmp0_);
}

static void
___lambda36__gtk_widget_unmap (GtkWidget* _sender,
                               gpointer self)
{
	__lambda36_ ((MayaViewEventEditionInfoPanel*) self);
}

MayaViewEventEditionInfoPanel*
maya_view_event_edition_info_panel_construct (GType object_type,
                                              MayaViewEventDialog* parent_dialog)
{
	MayaViewEventEditionInfoPanel * self = NULL;
	Block14Data* _data14_;
	MayaViewEventDialog* _tmp0_;
	GraniteHeaderLabel* from_label = NULL;
	GraniteHeaderLabel* _tmp1_;
	GraniteWidgetsDatePicker* _tmp2_;
	GraniteWidgetsDatePicker* _tmp3_;
	GraniteWidgetsTimePicker* _tmp4_;
	GraniteWidgetsTimePicker* _tmp5_;
	GtkSwitch* _tmp6_ = NULL;
	GtkLabel* allday_label = NULL;
	GtkSwitch* _tmp7_;
	GtkWidget* _tmp8_;
	GtkLabel* _tmp9_ = NULL;
	GtkSwitch* _tmp10_;
	GraniteHeaderLabel* to_label = NULL;
	GraniteHeaderLabel* _tmp11_;
	GraniteWidgetsDatePicker* _tmp12_;
	GraniteWidgetsDatePicker* _tmp13_;
	GraniteWidgetsTimePicker* _tmp14_;
	GraniteWidgetsTimePicker* _tmp15_;
	GraniteHeaderLabel* timezone_header = NULL;
	GraniteHeaderLabel* _tmp16_;
	GtkLabel* _tmp17_ = NULL;
	gchar* _tmp18_;
	GtkEntry* _tmp19_ = NULL;
	GraniteHeaderLabel* title_label = NULL;
	GtkEntry* _tmp20_;
	GtkWidget* _tmp21_;
	GraniteHeaderLabel* _tmp22_ = NULL;
	GtkEntry* _tmp23_;
	GtkEntry* _tmp24_;
	GtkEntry* _tmp25_;
	MayaViewWidgetsCalendarChooser* _tmp26_ = NULL;
	MayaViewWidgetsCalendarChooser* _tmp27_;
	GtkWidget* _tmp28_;
	GtkPopover* _tmp29_ = NULL;
	MayaViewWidgetsCalendarChooser* _tmp30_;
	ESource* _tmp31_;
	ESource* _tmp32_;
	CalendarRow* _tmp33_ = NULL;
	GtkBox* button_box = NULL;
	GtkBox* _tmp34_;
	GtkBox* _tmp35_;
	CalendarRow* _tmp36_;
	GtkBox* _tmp37_;
	GtkImage* _tmp38_;
	GtkImage* _tmp39_;
	GtkBox* _tmp40_;
	GtkWidget* _tmp41_;
	GtkPopover* _tmp42_;
	GtkPopover* _tmp43_;
	GtkMenuButton* _tmp44_ = NULL;
	GraniteHeaderLabel* calendar_label = NULL;
	GtkMenuButton* _tmp45_;
	GtkWidget* _tmp46_;
	GraniteHeaderLabel* _tmp47_ = NULL;
	ESource* _tmp48_;
	ESource* _tmp49_;
	GraniteHyperTextView* _tmp53_;
	GraniteHyperTextView* _tmp54_;
	GraniteHyperTextView* _tmp55_;
	GraniteHyperTextView* _tmp56_;
	GraniteHyperTextView* _tmp57_;
	GraniteHyperTextView* _tmp58_;
	GraniteHyperTextView* _tmp59_;
	GraniteHeaderLabel* comment_label = NULL;
	GraniteHyperTextView* _tmp60_;
	GtkWidget* _tmp61_;
	GraniteHeaderLabel* _tmp62_ = NULL;
	GtkScrolledWindow* scrolled = NULL;
	GraniteHyperTextView* _tmp63_;
	GtkWidget* _tmp64_;
	GtkScrolledWindow* _tmp65_ = NULL;
	GtkFrame* frame = NULL;
	GtkScrolledWindow* _tmp66_;
	GtkWidget* _tmp67_;
	GtkFrame* _tmp68_ = NULL;
	GraniteHeaderLabel* _tmp69_;
	GtkEntry* _tmp70_;
	gboolean _tmp71_ = FALSE;
	MayaViewWidgetsCalendarChooser* _tmp72_;
	GList* _tmp73_;
	GraniteHeaderLabel* _tmp76_;
	GraniteWidgetsDatePicker* _tmp77_;
	GraniteWidgetsTimePicker* _tmp78_;
	GtkLabel* _tmp79_;
	GtkSwitch* _tmp80_;
	GraniteHeaderLabel* _tmp81_;
	GraniteWidgetsDatePicker* _tmp82_;
	GraniteWidgetsTimePicker* _tmp83_;
	GraniteHeaderLabel* _tmp84_;
	GtkLabel* _tmp85_;
	GraniteHeaderLabel* _tmp86_;
	GtkFrame* _tmp87_;
	MayaViewWidgetsCalendarChooser* _tmp88_;
	CalendarRow* _tmp89_;
	MayaViewWidgetsCalendarChooser* _tmp90_;
	GtkPopover* _tmp91_;
	g_return_val_if_fail (parent_dialog != NULL, NULL);
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	self = (MayaViewEventEditionInfoPanel*) g_object_new (object_type, NULL);
	_data14_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (parent_dialog);
	_g_object_unref0 (self->priv->parent_dialog);
	self->priv->parent_dialog = _tmp0_;
	gtk_widget_set_margin_start ((GtkWidget*) self, 12);
	gtk_widget_set_margin_end ((GtkWidget*) self, 12);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 12);
	gtk_widget_set_sensitive ((GtkWidget*) self, parent_dialog->can_edit);
	_tmp1_ = granite_header_label_new (_ ("From:"));
	g_object_ref_sink (_tmp1_);
	from_label = _tmp1_;
	_tmp2_ = maya_view_event_edition_info_panel_make_date_picker (self);
	_g_object_unref0 (self->priv->from_date_picker);
	self->priv->from_date_picker = _tmp2_;
	_tmp3_ = self->priv->from_date_picker;
	g_signal_connect_object ((GObject*) _tmp3_, "notify::date", (GCallback) ___lambda26__g_object_notify, self, 0);
	_tmp4_ = maya_view_event_edition_info_panel_make_time_picker (self);
	_g_object_unref0 (self->priv->from_time_picker);
	self->priv->from_time_picker = _tmp4_;
	_tmp5_ = self->priv->from_time_picker;
	g_signal_connect_object (_tmp5_, "time-changed", (GCallback) ___lambda27__granite_widgets_time_picker_time_changed, self, 0);
	_tmp6_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->allday_switch);
	self->priv->allday_switch = _tmp6_;
	_tmp7_ = self->priv->allday_switch;
	_tmp8_ = _g_object_ref0 ((GtkWidget*) _tmp7_);
	_tmp9_ = (GtkLabel*) gtk_label_new (_ ("All day:"));
	gtk_label_set_mnemonic_widget (_tmp9_, _tmp8_);
	_g_object_unref0 (_tmp8_);
	gtk_label_set_xalign (_tmp9_, (gfloat) 1);
	g_object_ref_sink (_tmp9_);
	allday_label = _tmp9_;
	_tmp10_ = self->priv->allday_switch;
	g_signal_connect_object ((GObject*) _tmp10_, "notify::active", (GCallback) ___lambda28__g_object_notify, self, 0);
	_tmp11_ = granite_header_label_new (_ ("To:"));
	g_object_ref_sink (_tmp11_);
	to_label = _tmp11_;
	_tmp12_ = maya_view_event_edition_info_panel_make_date_picker (self);
	_g_object_unref0 (self->priv->to_date_picker);
	self->priv->to_date_picker = _tmp12_;
	_tmp13_ = self->priv->to_date_picker;
	g_signal_connect_object ((GObject*) _tmp13_, "notify::date", (GCallback) ___lambda29__g_object_notify, self, 0);
	_tmp14_ = maya_view_event_edition_info_panel_make_time_picker (self);
	_g_object_unref0 (self->priv->to_time_picker);
	self->priv->to_time_picker = _tmp14_;
	_tmp15_ = self->priv->to_time_picker;
	g_signal_connect_object (_tmp15_, "time-changed", (GCallback) ___lambda30__granite_widgets_time_picker_time_changed, self, 0);
	_tmp16_ = granite_header_label_new (_ ("Time zone:"));
	g_object_ref_sink (_tmp16_);
	timezone_header = _tmp16_;
	_tmp17_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp17_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->timezone_label);
	self->priv->timezone_label = _tmp17_;
	_tmp18_ = g_strdup (_ ("Name of Event"));
	_tmp19_ = (GtkEntry*) gtk_entry_new ();
	gtk_entry_set_placeholder_text (_tmp19_, _tmp18_);
	_g_free0 (_tmp18_);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->title_entry);
	self->priv->title_entry = _tmp19_;
	_tmp20_ = self->priv->title_entry;
	_tmp21_ = _g_object_ref0 ((GtkWidget*) _tmp20_);
	_tmp22_ = granite_header_label_new (_ ("Title:"));
	gtk_label_set_mnemonic_widget ((GtkLabel*) _tmp22_, _tmp21_);
	_g_object_unref0 (_tmp21_);
	g_object_ref_sink (_tmp22_);
	title_label = _tmp22_;
	_tmp23_ = self->priv->title_entry;
	g_signal_connect_object ((GtkEditable*) _tmp23_, "changed", (GCallback) _maya_view_event_edition_info_panel_on_title_entry_modified_gtk_editable_changed, self, 0);
	_tmp24_ = self->priv->title_entry;
	g_signal_connect_object (_tmp24_, "activate", (GCallback) ___lambda31__gtk_entry_activate, self, 0);
	_tmp25_ = self->priv->title_entry;
	g_signal_connect_object ((GtkEditable*) _tmp25_, "changed", (GCallback) ___lambda32__gtk_editable_changed, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "realize", (GCallback) ___lambda33__gtk_widget_realize, self, 0);
	_tmp26_ = maya_view_widgets_calendar_chooser_new ();
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp26_, 6);
	g_object_ref_sink (_tmp26_);
	_g_object_unref0 (self->priv->calchooser);
	self->priv->calchooser = _tmp26_;
	_tmp27_ = self->priv->calchooser;
	_tmp28_ = _g_object_ref0 ((GtkWidget*) _tmp27_);
	_tmp29_ = (GtkPopover*) gtk_popover_new (NULL);
	g_object_set ((GtkContainer*) _tmp29_, "child", _tmp28_, NULL);
	_g_object_unref0 (_tmp28_);
	g_object_set ((GtkWidget*) _tmp29_, "width-request", 310, NULL);
	g_object_ref_sink (_tmp29_);
	_data14_->popover = _tmp29_;
	_tmp30_ = self->priv->calchooser;
	_tmp31_ = maya_view_widgets_calendar_chooser_get_current_source (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = calendar_row_new (_tmp32_);
	gtk_widget_set_halign ((GtkWidget*) _tmp33_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp33_, TRUE);
	g_object_ref_sink (_tmp33_);
	_data14_->current_calendar_grid = _tmp33_;
	_tmp34_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp34_);
	button_box = _tmp34_;
	_tmp35_ = button_box;
	_tmp36_ = _data14_->current_calendar_grid;
	gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp36_);
	_tmp37_ = button_box;
	_tmp38_ = (GtkImage*) gtk_image_new_from_icon_name ("pan-down-symbolic", (GtkIconSize) GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp38_);
	_tmp39_ = _tmp38_;
	gtk_container_add ((GtkContainer*) _tmp37_, (GtkWidget*) _tmp39_);
	_g_object_unref0 (_tmp39_);
	_tmp40_ = button_box;
	_tmp41_ = _g_object_ref0 ((GtkWidget*) _tmp40_);
	_tmp42_ = _data14_->popover;
	_tmp43_ = _g_object_ref0 (_tmp42_);
	_tmp44_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_set ((GtkContainer*) _tmp44_, "child", _tmp41_, NULL);
	_g_object_unref0 (_tmp41_);
	gtk_menu_button_set_popover (_tmp44_, _tmp43_);
	_g_object_unref0 (_tmp43_);
	g_object_ref_sink (_tmp44_);
	_data14_->calendar_button = _tmp44_;
	_tmp45_ = _data14_->calendar_button;
	_tmp46_ = _g_object_ref0 ((GtkWidget*) _tmp45_);
	_tmp47_ = granite_header_label_new (_ ("Calendar:"));
	gtk_label_set_mnemonic_widget ((GtkLabel*) _tmp47_, _tmp46_);
	_g_object_unref0 (_tmp46_);
	g_object_ref_sink (_tmp47_);
	calendar_label = _tmp47_;
	_tmp48_ = maya_view_event_dialog_get_source (parent_dialog);
	_tmp49_ = _tmp48_;
	if (_tmp49_ == NULL) {
		MayaViewWidgetsCalendarChooser* _tmp50_;
		ESource* _tmp51_;
		ESource* _tmp52_;
		_tmp50_ = self->priv->calchooser;
		_tmp51_ = maya_view_widgets_calendar_chooser_get_current_source (_tmp50_);
		_tmp52_ = _tmp51_;
		maya_view_event_dialog_set_source (parent_dialog, _tmp52_);
	}
	_tmp53_ = granite_hyper_text_view_new ();
	g_object_ref_sink (_tmp53_);
	_g_object_unref0 (self->priv->comment_textview);
	self->priv->comment_textview = _tmp53_;
	_tmp54_ = self->priv->comment_textview;
	gtk_text_view_set_wrap_mode ((GtkTextView*) _tmp54_, GTK_WRAP_WORD_CHAR);
	_tmp55_ = self->priv->comment_textview;
	gtk_text_view_set_accepts_tab ((GtkTextView*) _tmp55_, FALSE);
	_tmp56_ = self->priv->comment_textview;
	gtk_text_view_set_border_window_size ((GtkTextView*) _tmp56_, GTK_TEXT_WINDOW_LEFT, 2);
	_tmp57_ = self->priv->comment_textview;
	gtk_text_view_set_border_window_size ((GtkTextView*) _tmp57_, GTK_TEXT_WINDOW_RIGHT, 2);
	_tmp58_ = self->priv->comment_textview;
	gtk_text_view_set_border_window_size ((GtkTextView*) _tmp58_, GTK_TEXT_WINDOW_TOP, 2);
	_tmp59_ = self->priv->comment_textview;
	gtk_text_view_set_border_window_size ((GtkTextView*) _tmp59_, GTK_TEXT_WINDOW_BOTTOM, 2);
	_tmp60_ = self->priv->comment_textview;
	_tmp61_ = _g_object_ref0 ((GtkWidget*) _tmp60_);
	_tmp62_ = granite_header_label_new (_ ("Comments:"));
	gtk_label_set_mnemonic_widget ((GtkLabel*) _tmp62_, _tmp61_);
	_g_object_unref0 (_tmp61_);
	g_object_ref_sink (_tmp62_);
	comment_label = _tmp62_;
	_tmp63_ = self->priv->comment_textview;
	_tmp64_ = _g_object_ref0 ((GtkWidget*) _tmp63_);
	_tmp65_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_set ((GtkContainer*) _tmp65_, "child", _tmp64_, NULL);
	_g_object_unref0 (_tmp64_);
	g_object_set ((GtkWidget*) _tmp65_, "height-request", 100, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp65_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp65_, TRUE);
	g_object_set (_tmp65_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_ref_sink (_tmp65_);
	scrolled = _tmp65_;
	_tmp66_ = scrolled;
	_tmp67_ = _g_object_ref0 ((GtkWidget*) _tmp66_);
	_tmp68_ = (GtkFrame*) gtk_frame_new (NULL);
	g_object_set ((GtkContainer*) _tmp68_, "child", _tmp67_, NULL);
	_g_object_unref0 (_tmp67_);
	g_object_ref_sink (_tmp68_);
	frame = _tmp68_;
	_tmp69_ = title_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp69_, 0, 0, 1, 1);
	_tmp70_ = self->priv->title_entry;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp70_, 0, 1, 1, 1);
	_tmp72_ = self->priv->calchooser;
	_tmp73_ = _tmp72_->sources;
	if (g_list_length (_tmp73_) > ((guint) 1)) {
		_tmp71_ = parent_dialog->can_edit;
	} else {
		_tmp71_ = FALSE;
	}
	if (_tmp71_) {
		GraniteHeaderLabel* _tmp74_;
		GtkMenuButton* _tmp75_;
		_tmp74_ = calendar_label;
		gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp74_, 1, 0, 4, 1);
		_tmp75_ = _data14_->calendar_button;
		gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp75_, 1, 1, 4, 1);
	}
	_tmp76_ = from_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp76_, 0, 2, 4, 1);
	_tmp77_ = self->priv->from_date_picker;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp77_, 0, 3, 1, 1);
	_tmp78_ = self->priv->from_time_picker;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp78_, 1, 3, 1, 1);
	_tmp79_ = allday_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp79_, 2, 3, 1, 1);
	_tmp80_ = self->priv->allday_switch;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp80_, 3, 3, 1, 1);
	_tmp81_ = to_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp81_, 0, 4, 2, 1);
	_tmp82_ = self->priv->to_date_picker;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp82_, 0, 5, 1, 1);
	_tmp83_ = self->priv->to_time_picker;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp83_, 1, 5, 1, 1);
	_tmp84_ = timezone_header;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp84_, 0, 6, 1, 1);
	_tmp85_ = self->priv->timezone_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp85_, 0, 7, 1, 1);
	_tmp86_ = comment_label;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp86_, 0, 8, 4, 1);
	_tmp87_ = frame;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp87_, 0, 9, 5, 1);
	maya_view_event_edition_info_panel_load (self);
	_tmp88_ = self->priv->calchooser;
	_tmp89_ = _data14_->current_calendar_grid;
	g_object_bind_property_with_closures ((GObject*) _tmp88_, "current-source", (GObject*) _tmp89_, "source", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp90_ = self->priv->calchooser;
	g_signal_connect_data ((GObject*) _tmp90_, "notify::current-source", (GCallback) ___lambda35__g_object_notify, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
	_tmp91_ = _data14_->popover;
	g_signal_connect_object ((GtkWidget*) _tmp91_, "unmap", (GCallback) ___lambda36__gtk_widget_unmap, self, 0);
	_g_object_unref0 (frame);
	_g_object_unref0 (scrolled);
	_g_object_unref0 (comment_label);
	_g_object_unref0 (calendar_label);
	_g_object_unref0 (button_box);
	_g_object_unref0 (title_label);
	_g_object_unref0 (timezone_header);
	_g_object_unref0 (to_label);
	_g_object_unref0 (allday_label);
	_g_object_unref0 (from_label);
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return self;
}

MayaViewEventEditionInfoPanel*
maya_view_event_edition_info_panel_new (MayaViewEventDialog* parent_dialog)
{
	return maya_view_event_edition_info_panel_construct (MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, parent_dialog);
}

/**
     * Save the values in the dialog into the component.
     */
void
maya_view_event_edition_info_panel_save (MayaViewEventEditionInfoPanel* self)
{
	ICalComponent* comp = NULL;
	MayaViewEventDialog* _tmp0_;
	ECalComponent* _tmp1_;
	ECalComponent* _tmp2_;
	ICalComponent* _tmp3_;
	ICalComponent* _tmp4_;
	GtkEntry* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GtkSwitch* _tmp8_;
	gint count = 0;
	ICalComponent* _tmp50_;
	ICalProperty* property = NULL;
	ICalProperty* _tmp57_;
	GraniteHyperTextView* _tmp58_;
	GtkTextBuffer* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	gchar* _tmp62_;
	ICalComponent* _tmp63_;
	MayaViewEventDialog* _tmp64_;
	MayaViewWidgetsCalendarChooser* _tmp65_;
	ESource* _tmp66_;
	ESource* _tmp67_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent_dialog;
	_tmp1_ = maya_view_event_dialog_get_ecal (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = e_cal_component_get_icalcomponent (_tmp2_);
	comp = _tmp3_;
	_tmp4_ = comp;
	_tmp5_ = self->priv->title_entry;
	_tmp6_ = gtk_entry_get_text (_tmp5_);
	_tmp7_ = _tmp6_;
	i_cal_component_set_summary (_tmp4_, _tmp7_);
	_tmp8_ = self->priv->allday_switch;
	if (gtk_switch_get_active (_tmp8_) == TRUE) {
		ICalTime* dt_start = NULL;
		GraniteWidgetsDatePicker* _tmp9_;
		GDateTime* _tmp10_;
		GDateTime* _tmp11_;
		CalendarTimeManager* _tmp12_;
		ICalTimezone* _tmp13_;
		ICalTimezone* _tmp14_;
		ICalTime* _tmp15_;
		ICalTime* dt_end = NULL;
		GraniteWidgetsDatePicker* _tmp16_;
		GDateTime* _tmp17_;
		GDateTime* _tmp18_;
		GDateTime* _tmp19_;
		GDateTime* _tmp20_;
		CalendarTimeManager* _tmp21_;
		ICalTimezone* _tmp22_;
		ICalTimezone* _tmp23_;
		ICalTime* _tmp24_;
		ICalTime* _tmp25_;
		ICalComponent* _tmp26_;
		ICalTime* _tmp27_;
		ICalComponent* _tmp28_;
		ICalTime* _tmp29_;
		_tmp9_ = self->priv->from_date_picker;
		_tmp10_ = granite_widgets_date_picker_get_date (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = calendar_time_manager_get_default ();
		_tmp13_ = calendar_time_manager_get_system_timezone (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = calendar_util_datetimes_to_icaltime (_tmp11_, NULL, _tmp14_);
		dt_start = _tmp15_;
		_tmp16_ = self->priv->to_date_picker;
		_tmp17_ = granite_widgets_date_picker_get_date (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_date_time_add_days (_tmp18_, 1);
		_tmp20_ = _tmp19_;
		_tmp21_ = calendar_time_manager_get_default ();
		_tmp22_ = calendar_time_manager_get_system_timezone (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = calendar_util_datetimes_to_icaltime (_tmp20_, NULL, _tmp23_);
		_tmp25_ = _tmp24_;
		_g_date_time_unref0 (_tmp20_);
		dt_end = _tmp25_;
		_tmp26_ = comp;
		_tmp27_ = dt_start;
		i_cal_component_set_dtstart (_tmp26_, _tmp27_);
		_tmp28_ = comp;
		_tmp29_ = dt_end;
		i_cal_component_set_dtend (_tmp28_, _tmp29_);
		_g_object_unref0 (dt_end);
		_g_object_unref0 (dt_start);
	} else {
		ICalTime* dt_start = NULL;
		GraniteWidgetsDatePicker* _tmp30_;
		GDateTime* _tmp31_;
		GDateTime* _tmp32_;
		GraniteWidgetsTimePicker* _tmp33_;
		GDateTime* _tmp34_;
		GDateTime* _tmp35_;
		ICalTimezone* _tmp36_;
		ICalTime* _tmp37_;
		ICalTime* dt_end = NULL;
		GraniteWidgetsDatePicker* _tmp38_;
		GDateTime* _tmp39_;
		GDateTime* _tmp40_;
		GraniteWidgetsTimePicker* _tmp41_;
		GDateTime* _tmp42_;
		GDateTime* _tmp43_;
		ICalTimezone* _tmp44_;
		ICalTime* _tmp45_;
		ICalComponent* _tmp46_;
		ICalTime* _tmp47_;
		ICalComponent* _tmp48_;
		ICalTime* _tmp49_;
		_tmp30_ = self->priv->from_date_picker;
		_tmp31_ = granite_widgets_date_picker_get_date (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = self->priv->from_time_picker;
		_tmp34_ = granite_widgets_time_picker_get_time (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = self->priv->_timezone;
		_tmp37_ = calendar_util_datetimes_to_icaltime (_tmp32_, _tmp35_, _tmp36_);
		dt_start = _tmp37_;
		_tmp38_ = self->priv->to_date_picker;
		_tmp39_ = granite_widgets_date_picker_get_date (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp41_ = self->priv->to_time_picker;
		_tmp42_ = granite_widgets_time_picker_get_time (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = self->priv->_timezone;
		_tmp45_ = calendar_util_datetimes_to_icaltime (_tmp40_, _tmp43_, _tmp44_);
		dt_end = _tmp45_;
		_tmp46_ = comp;
		_tmp47_ = dt_start;
		i_cal_component_set_dtstart (_tmp46_, _tmp47_);
		_tmp48_ = comp;
		_tmp49_ = dt_end;
		i_cal_component_set_dtend (_tmp48_, _tmp49_);
		_g_object_unref0 (dt_end);
		_g_object_unref0 (dt_start);
	}
	_tmp50_ = comp;
	count = i_cal_component_count_properties (_tmp50_, I_CAL_DESCRIPTION_PROPERTY);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp51_ = FALSE;
			_tmp51_ = TRUE;
			while (TRUE) {
				ICalProperty* remove_prop = NULL;
				ICalComponent* _tmp53_;
				ICalProperty* _tmp54_;
				ICalComponent* _tmp55_;
				ICalProperty* _tmp56_;
				if (!_tmp51_) {
					gint _tmp52_;
					_tmp52_ = i;
					i = _tmp52_ + 1;
				}
				_tmp51_ = FALSE;
				if (!(i < count)) {
					break;
				}
				_tmp53_ = comp;
				_tmp54_ = i_cal_component_get_first_property (_tmp53_, I_CAL_COMMENT_PROPERTY);
				_g_object_unref0 (remove_prop);
				remove_prop = _tmp54_;
				_tmp55_ = comp;
				_tmp56_ = remove_prop;
				i_cal_component_remove_property (_tmp55_, _tmp56_);
				_g_object_unref0 (remove_prop);
			}
		}
	}
	_tmp57_ = i_cal_property_new (I_CAL_DESCRIPTION_PROPERTY);
	property = _tmp57_;
	_tmp58_ = self->priv->comment_textview;
	_tmp59_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp58_);
	g_object_get (_tmp59_, "text", &_tmp60_, NULL);
	_tmp61_ = _tmp60_;
	_tmp62_ = _tmp61_;
	i_cal_property_set_comment (property, _tmp62_);
	_g_free0 (_tmp62_);
	_tmp63_ = comp;
	i_cal_component_add_property (_tmp63_, property);
	_tmp64_ = self->priv->parent_dialog;
	_tmp65_ = self->priv->calchooser;
	_tmp66_ = maya_view_widgets_calendar_chooser_get_current_source (_tmp65_);
	_tmp67_ = _tmp66_;
	maya_view_event_dialog_set_source (_tmp64_, _tmp67_);
	_g_object_unref0 (property);
}

/**
     * Populate the dialog's widgets with the component's values.
     */
static void
maya_view_event_edition_info_panel_load (MayaViewEventEditionInfoPanel* self)
{
	MayaViewEventDialog* _tmp0_;
	ECalComponent* _tmp1_;
	ECalComponent* _tmp2_;
	GtkLabel* _tmp94_;
	ICalTimezone* _tmp95_;
	const gchar* _tmp96_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent_dialog;
	_tmp1_ = maya_view_event_dialog_get_ecal (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ICalComponent* comp = NULL;
		MayaViewEventDialog* _tmp3_;
		ECalComponent* _tmp4_;
		ECalComponent* _tmp5_;
		ICalComponent* _tmp6_;
		gchar* summary = NULL;
		ICalComponent* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		const gchar* _tmp10_;
		GDateTime* from_date = NULL;
		GDateTime* to_date = NULL;
		ICalComponent* _tmp13_;
		GDateTime* _tmp14_ = NULL;
		GDateTime* _tmp15_ = NULL;
		ICalComponent* _tmp16_;
		ICalTime* _tmp17_;
		ICalTime* _tmp18_;
		ICalTimezone* _tmp19_;
		GDateTime* _tmp20_;
		GDateTime* _tmp21_;
		GraniteWidgetsDatePicker* _tmp26_;
		GDateTime* _tmp27_;
		GraniteWidgetsTimePicker* _tmp28_;
		GDateTime* _tmp29_;
		MayaViewEventDialog* _tmp30_;
		GDateTime* _tmp31_;
		gboolean allday = FALSE;
		GDateTime* _tmp32_;
		GDateTime* _tmp33_;
		GraniteWidgetsDatePicker* _tmp34_;
		GDateTime* _tmp35_;
		GraniteWidgetsTimePicker* _tmp36_;
		GDateTime* _tmp37_;
		ICalProperty* property = NULL;
		ICalComponent* _tmp41_;
		ICalProperty* _tmp42_;
		ICalProperty* _tmp43_;
		MayaViewWidgetsCalendarChooser* _tmp50_;
		MayaViewEventDialog* _tmp51_;
		ESource* _tmp52_;
		ESource* _tmp53_;
		_tmp3_ = self->priv->parent_dialog;
		_tmp4_ = maya_view_event_dialog_get_ecal (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = e_cal_component_get_icalcomponent (_tmp5_);
		comp = _tmp6_;
		_tmp7_ = comp;
		_tmp8_ = i_cal_component_get_summary (_tmp7_);
		_tmp9_ = g_strdup (_tmp8_);
		summary = _tmp9_;
		_tmp10_ = summary;
		if (_tmp10_ != NULL) {
			GtkEntry* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = self->priv->title_entry;
			_tmp12_ = summary;
			gtk_entry_set_text (_tmp11_, _tmp12_);
		}
		_tmp13_ = comp;
		calendar_util_icalcomponent_get_datetimes_for_display (_tmp13_, &_tmp14_, &_tmp15_);
		_g_date_time_unref0 (from_date);
		from_date = _tmp14_;
		_g_date_time_unref0 (to_date);
		to_date = _tmp15_;
		_tmp16_ = comp;
		_tmp17_ = i_cal_component_get_dtstart (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = i_cal_time_get_timezone (_tmp18_);
		maya_view_event_edition_info_panel_set_timezone (self, _tmp19_);
		_g_object_unref0 (_tmp18_);
		_tmp20_ = to_date;
		_tmp21_ = from_date;
		if (g_date_time_get_utc_offset (_tmp20_) != g_date_time_get_utc_offset (_tmp21_)) {
			GDateTime* _tmp22_;
			GDateTime* _tmp23_;
			GTimeZone* _tmp24_;
			GDateTime* _tmp25_;
			_tmp22_ = to_date;
			_tmp23_ = from_date;
			_tmp24_ = g_date_time_get_timezone (_tmp23_);
			_tmp25_ = g_date_time_to_timezone (_tmp22_, _tmp24_);
			_g_date_time_unref0 (to_date);
			to_date = _tmp25_;
		}
		_tmp26_ = self->priv->from_date_picker;
		_tmp27_ = from_date;
		granite_widgets_date_picker_set_date (_tmp26_, _tmp27_);
		_tmp28_ = self->priv->from_time_picker;
		_tmp29_ = from_date;
		granite_widgets_time_picker_set_time (_tmp28_, _tmp29_);
		_tmp30_ = self->priv->parent_dialog;
		_tmp31_ = from_date;
		maya_view_event_dialog_set_date_time (_tmp30_, _tmp31_);
		_tmp32_ = from_date;
		_tmp33_ = to_date;
		allday = calendar_util_datetime_is_all_day (_tmp32_, _tmp33_);
		_tmp34_ = self->priv->to_date_picker;
		_tmp35_ = to_date;
		granite_widgets_date_picker_set_date (_tmp34_, _tmp35_);
		_tmp36_ = self->priv->to_time_picker;
		_tmp37_ = to_date;
		granite_widgets_time_picker_set_time (_tmp36_, _tmp37_);
		if (allday) {
			GtkSwitch* _tmp38_;
			GraniteWidgetsTimePicker* _tmp39_;
			GraniteWidgetsTimePicker* _tmp40_;
			_tmp38_ = self->priv->allday_switch;
			gtk_switch_set_active (_tmp38_, TRUE);
			_tmp39_ = self->priv->from_time_picker;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp39_, FALSE);
			_tmp40_ = self->priv->to_time_picker;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp40_, FALSE);
		}
		_tmp41_ = comp;
		_tmp42_ = i_cal_component_get_first_property (_tmp41_, I_CAL_DESCRIPTION_PROPERTY);
		_g_object_unref0 (property);
		property = _tmp42_;
		_tmp43_ = property;
		if (_tmp43_ != NULL) {
			GtkTextBuffer* buffer = NULL;
			GtkTextBuffer* _tmp44_;
			GtkTextBuffer* _tmp45_;
			ICalProperty* _tmp46_;
			const gchar* _tmp47_;
			GraniteHyperTextView* _tmp48_;
			GtkTextBuffer* _tmp49_;
			_tmp44_ = gtk_text_buffer_new (NULL);
			buffer = _tmp44_;
			_tmp45_ = buffer;
			_tmp46_ = property;
			_tmp47_ = i_cal_property_get_comment (_tmp46_);
			g_object_set (_tmp45_, "text", _tmp47_, NULL);
			_tmp48_ = self->priv->comment_textview;
			_tmp49_ = buffer;
			gtk_text_view_set_buffer ((GtkTextView*) _tmp48_, _tmp49_);
			_g_object_unref0 (buffer);
		}
		_tmp50_ = self->priv->calchooser;
		_tmp51_ = self->priv->parent_dialog;
		_tmp52_ = maya_view_event_dialog_get_original_source (_tmp51_);
		_tmp53_ = _tmp52_;
		maya_view_widgets_calendar_chooser_set_current_source (_tmp50_, _tmp53_);
		_g_object_unref0 (property);
		_g_date_time_unref0 (to_date);
		_g_date_time_unref0 (from_date);
		_g_free0 (summary);
	} else {
		MayaViewEventDialog* _tmp54_;
		ECalComponent* _tmp55_;
		ECalComponent* _tmp56_;
		MayaViewEventDialog* _tmp57_;
		ECalComponent* _tmp58_;
		ECalComponent* _tmp59_;
		GDateTime* time = NULL;
		GDateTime* _tmp60_;
		gint minutes = 0;
		GDateTime* _tmp61_;
		gboolean now_before_2300 = FALSE;
		GDateTime* _tmp62_;
		GraniteWidgetsDatePicker* _tmp63_;
		MayaViewEventDialog* _tmp64_;
		GDateTime* _tmp65_;
		GDateTime* _tmp66_;
		GraniteWidgetsTimePicker* _tmp71_;
		GDateTime* _tmp72_;
		GraniteWidgetsTimePicker* _tmp73_;
		GDateTime* _tmp74_;
		GDateTime* _tmp75_;
		GDateTime* _tmp76_;
		CalendarTimeManager* _tmp87_;
		ICalTimezone* _tmp88_;
		ICalTimezone* _tmp89_;
		MayaViewWidgetsCalendarChooser* _tmp90_;
		MayaViewEventDialog* _tmp91_;
		ESource* _tmp92_;
		ESource* _tmp93_;
		_tmp54_ = self->priv->parent_dialog;
		_tmp55_ = e_cal_component_new ();
		_tmp56_ = _tmp55_;
		maya_view_event_dialog_set_ecal (_tmp54_, _tmp56_);
		_g_object_unref0 (_tmp56_);
		_tmp57_ = self->priv->parent_dialog;
		_tmp58_ = maya_view_event_dialog_get_ecal (_tmp57_);
		_tmp59_ = _tmp58_;
		e_cal_component_set_new_vtype (_tmp59_, E_CAL_COMPONENT_EVENT);
		_tmp60_ = g_date_time_new_now_local ();
		time = _tmp60_;
		_tmp61_ = time;
		minutes = g_date_time_get_minute (_tmp61_);
		_tmp62_ = time;
		now_before_2300 = g_date_time_get_hour (_tmp62_) < 23;
		_tmp63_ = self->priv->from_date_picker;
		_tmp64_ = self->priv->parent_dialog;
		_tmp65_ = maya_view_event_dialog_get_date_time (_tmp64_);
		_tmp66_ = _tmp65_;
		granite_widgets_date_picker_set_date (_tmp63_, _tmp66_);
		if (now_before_2300) {
			GDateTime* _tmp67_;
			GDateTime* _tmp68_;
			_tmp67_ = time;
			_tmp68_ = g_date_time_add_minutes (_tmp67_, 60 - minutes);
			_g_date_time_unref0 (time);
			time = _tmp68_;
		} else {
			GDateTime* _tmp69_;
			GDateTime* _tmp70_;
			_tmp69_ = time;
			_tmp70_ = g_date_time_add_minutes (_tmp69_, -minutes);
			_g_date_time_unref0 (time);
			time = _tmp70_;
		}
		_tmp71_ = self->priv->from_time_picker;
		_tmp72_ = time;
		granite_widgets_time_picker_set_time (_tmp71_, _tmp72_);
		_tmp73_ = self->priv->to_time_picker;
		_tmp74_ = time;
		_tmp75_ = g_date_time_add_hours (_tmp74_, 1);
		_tmp76_ = _tmp75_;
		granite_widgets_time_picker_set_time (_tmp73_, _tmp76_);
		_g_date_time_unref0 (_tmp76_);
		if (now_before_2300) {
			GraniteWidgetsDatePicker* _tmp77_;
			MayaViewEventDialog* _tmp78_;
			GDateTime* _tmp79_;
			GDateTime* _tmp80_;
			_tmp77_ = self->priv->to_date_picker;
			_tmp78_ = self->priv->parent_dialog;
			_tmp79_ = maya_view_event_dialog_get_date_time (_tmp78_);
			_tmp80_ = _tmp79_;
			granite_widgets_date_picker_set_date (_tmp77_, _tmp80_);
		} else {
			GraniteWidgetsDatePicker* _tmp81_;
			MayaViewEventDialog* _tmp82_;
			GDateTime* _tmp83_;
			GDateTime* _tmp84_;
			GDateTime* _tmp85_;
			GDateTime* _tmp86_;
			_tmp81_ = self->priv->to_date_picker;
			_tmp82_ = self->priv->parent_dialog;
			_tmp83_ = maya_view_event_dialog_get_date_time (_tmp82_);
			_tmp84_ = _tmp83_;
			_tmp85_ = g_date_time_add_days (_tmp84_, 1);
			_tmp86_ = _tmp85_;
			granite_widgets_date_picker_set_date (_tmp81_, _tmp86_);
			_g_date_time_unref0 (_tmp86_);
		}
		_tmp87_ = calendar_time_manager_get_default ();
		_tmp88_ = calendar_time_manager_get_system_timezone (_tmp87_);
		_tmp89_ = _tmp88_;
		maya_view_event_edition_info_panel_set_timezone (self, _tmp89_);
		_tmp90_ = self->priv->calchooser;
		_tmp91_ = self->priv->parent_dialog;
		_tmp92_ = maya_view_event_dialog_get_source (_tmp91_);
		_tmp93_ = _tmp92_;
		maya_view_widgets_calendar_chooser_set_current_source (_tmp90_, _tmp93_);
		_g_date_time_unref0 (time);
	}
	_tmp94_ = self->priv->timezone_label;
	_tmp95_ = self->priv->_timezone;
	_tmp96_ = i_cal_timezone_get_display_name (_tmp95_);
	gtk_label_set_label (_tmp94_, _tmp96_);
}

static GraniteWidgetsDatePicker*
maya_view_event_edition_info_panel_make_date_picker (MayaViewEventEditionInfoPanel* self)
{
	gchar* format = NULL;
	gchar* _tmp0_;
	GraniteWidgetsDatePicker* date_picker = NULL;
	GraniteWidgetsDatePicker* _tmp1_;
	GraniteWidgetsDatePicker* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = granite_date_time_get_default_date_format (FALSE, TRUE, TRUE);
	format = _tmp0_;
	_tmp1_ = granite_widgets_date_picker_new_with_format (format);
	g_object_ref_sink (_tmp1_);
	date_picker = _tmp1_;
	g_object_set ((GtkWidget*) date_picker, "width-request", 200, NULL);
	result = date_picker;
	_g_free0 (format);
	return result;
}

static GraniteWidgetsTimePicker*
maya_view_event_edition_info_panel_make_time_picker (MayaViewEventEditionInfoPanel* self)
{
	GraniteWidgetsTimePicker* time_picker = NULL;
	GraniteWidgetsTimePicker* _tmp0_;
	GraniteWidgetsTimePicker* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = granite_widgets_time_picker_new ();
	g_object_ref_sink (_tmp0_);
	time_picker = _tmp0_;
	g_object_set ((GtkWidget*) time_picker, "width-request", 120, NULL);
	result = time_picker;
	return result;
}

static void
maya_view_event_edition_info_panel_on_title_entry_modified (MayaViewEventEditionInfoPanel* self)
{
	g_return_if_fail (self != NULL);
	maya_view_event_edition_info_panel_update_create_sensitivity (self);
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static void
maya_view_event_edition_info_panel_on_date_modified (MayaViewEventEditionInfoPanel* self,
                                                     gint index)
{
	MayaViewEventDialog* _tmp0_;
	GraniteWidgetsDatePicker* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* start_date = NULL;
	GraniteWidgetsDatePicker* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	GDateTime* end_date = NULL;
	GraniteWidgetsDatePicker* _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	GDateTime* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->parent_dialog;
	_tmp1_ = self->priv->from_date_picker;
	_tmp2_ = granite_widgets_date_picker_get_date (_tmp1_);
	_tmp3_ = _tmp2_;
	maya_view_event_dialog_set_date_time (_tmp0_, _tmp3_);
	_tmp4_ = self->priv->from_date_picker;
	_tmp5_ = granite_widgets_date_picker_get_date (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_date_time_ref0 (_tmp6_);
	start_date = _tmp7_;
	_tmp8_ = self->priv->to_date_picker;
	_tmp9_ = granite_widgets_date_picker_get_date (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_date_time_ref0 (_tmp10_);
	end_date = _tmp11_;
	switch (index) {
		case 0:
		{
			GDateTime* _tmp12_;
			GDateTime* _tmp13_;
			_tmp12_ = start_date;
			_tmp13_ = end_date;
			if (g_date_time_get_year (_tmp12_) == g_date_time_get_year (_tmp13_)) {
				GDateTime* _tmp14_;
				GDateTime* _tmp15_;
				_tmp14_ = start_date;
				_tmp15_ = end_date;
				if (g_date_time_get_day_of_year (_tmp14_) >= g_date_time_get_day_of_year (_tmp15_)) {
					GraniteWidgetsDatePicker* _tmp16_;
					GraniteWidgetsDatePicker* _tmp17_;
					GDateTime* _tmp18_;
					GDateTime* _tmp19_;
					_tmp16_ = self->priv->to_date_picker;
					_tmp17_ = self->priv->from_date_picker;
					_tmp18_ = granite_widgets_date_picker_get_date (_tmp17_);
					_tmp19_ = _tmp18_;
					granite_widgets_date_picker_set_date (_tmp16_, _tmp19_);
				}
			}
			break;
		}
		case 1:
		{
			GDateTime* _tmp20_;
			GDateTime* _tmp21_;
			_tmp20_ = start_date;
			_tmp21_ = end_date;
			if (g_date_time_get_year (_tmp20_) == g_date_time_get_year (_tmp21_)) {
				GDateTime* _tmp22_;
				GDateTime* _tmp23_;
				_tmp22_ = end_date;
				_tmp23_ = start_date;
				if (g_date_time_get_day_of_year (_tmp22_) < g_date_time_get_day_of_year (_tmp23_)) {
					GraniteWidgetsDatePicker* _tmp24_;
					GraniteWidgetsDatePicker* _tmp25_;
					GDateTime* _tmp26_;
					GDateTime* _tmp27_;
					_tmp24_ = self->priv->from_date_picker;
					_tmp25_ = self->priv->to_date_picker;
					_tmp26_ = granite_widgets_date_picker_get_date (_tmp25_);
					_tmp27_ = _tmp26_;
					granite_widgets_date_picker_set_date (_tmp24_, _tmp27_);
				}
			}
			break;
		}
		default:
		break;
	}
	maya_view_event_edition_info_panel_update_create_sensitivity (self);
	_g_date_time_unref0 (end_date);
	_g_date_time_unref0 (start_date);
}

static void
maya_view_event_edition_info_panel_on_time_modified (MayaViewEventEditionInfoPanel* self,
                                                     gint index)
{
	GDateTime* start_date = NULL;
	GraniteWidgetsDatePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* end_date = NULL;
	GraniteWidgetsDatePicker* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	GDateTime* start_time = NULL;
	GraniteWidgetsTimePicker* _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	GDateTime* _tmp11_;
	GDateTime* end_time = NULL;
	GraniteWidgetsTimePicker* _tmp12_;
	GDateTime* _tmp13_;
	GDateTime* _tmp14_;
	GDateTime* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->from_date_picker;
	_tmp1_ = granite_widgets_date_picker_get_date (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_date_time_ref0 (_tmp2_);
	start_date = _tmp3_;
	_tmp4_ = self->priv->to_date_picker;
	_tmp5_ = granite_widgets_date_picker_get_date (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_date_time_ref0 (_tmp6_);
	end_date = _tmp7_;
	_tmp8_ = self->priv->from_time_picker;
	_tmp9_ = granite_widgets_time_picker_get_time (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_date_time_ref0 (_tmp10_);
	start_time = _tmp11_;
	_tmp12_ = self->priv->to_time_picker;
	_tmp13_ = granite_widgets_time_picker_get_time (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_date_time_ref0 (_tmp14_);
	end_time = _tmp15_;
	switch (index) {
		case 0:
		{
			GDateTime* _tmp16_;
			GDateTime* _tmp17_;
			_tmp16_ = start_date;
			_tmp17_ = end_date;
			if (g_date_time_get_year (_tmp16_) == g_date_time_get_year (_tmp17_)) {
				GDateTime* _tmp18_;
				GDateTime* _tmp19_;
				_tmp18_ = start_date;
				_tmp19_ = end_date;
				if (g_date_time_get_day_of_year (_tmp18_) == g_date_time_get_day_of_year (_tmp19_)) {
					GDateTime* _tmp20_;
					GDateTime* _tmp21_;
					gboolean _tmp28_ = FALSE;
					GDateTime* _tmp29_;
					GDateTime* _tmp30_;
					GDateTime* _tmp39_;
					_tmp20_ = start_time;
					_tmp21_ = end_time;
					if (g_date_time_get_hour (_tmp20_) > g_date_time_get_hour (_tmp21_)) {
						GraniteWidgetsTimePicker* _tmp22_;
						GraniteWidgetsTimePicker* _tmp23_;
						GDateTime* _tmp24_;
						GDateTime* _tmp25_;
						GDateTime* _tmp26_;
						GDateTime* _tmp27_;
						_tmp22_ = self->priv->to_time_picker;
						_tmp23_ = self->priv->from_time_picker;
						_tmp24_ = granite_widgets_time_picker_get_time (_tmp23_);
						_tmp25_ = _tmp24_;
						_tmp26_ = g_date_time_add_hours (_tmp25_, 1);
						_tmp27_ = _tmp26_;
						granite_widgets_time_picker_set_time (_tmp22_, _tmp27_);
						_g_date_time_unref0 (_tmp27_);
					}
					_tmp29_ = start_time;
					_tmp30_ = end_time;
					if (g_date_time_get_hour (_tmp29_) == g_date_time_get_hour (_tmp30_)) {
						GDateTime* _tmp31_;
						GDateTime* _tmp32_;
						_tmp31_ = start_time;
						_tmp32_ = end_time;
						_tmp28_ = g_date_time_get_minute (_tmp31_) >= g_date_time_get_minute (_tmp32_);
					} else {
						_tmp28_ = FALSE;
					}
					if (_tmp28_) {
						GraniteWidgetsTimePicker* _tmp33_;
						GraniteWidgetsTimePicker* _tmp34_;
						GDateTime* _tmp35_;
						GDateTime* _tmp36_;
						GDateTime* _tmp37_;
						GDateTime* _tmp38_;
						_tmp33_ = self->priv->to_time_picker;
						_tmp34_ = self->priv->from_time_picker;
						_tmp35_ = granite_widgets_time_picker_get_time (_tmp34_);
						_tmp36_ = _tmp35_;
						_tmp37_ = g_date_time_add_hours (_tmp36_, 1);
						_tmp38_ = _tmp37_;
						granite_widgets_time_picker_set_time (_tmp33_, _tmp38_);
						_g_date_time_unref0 (_tmp38_);
					}
					_tmp39_ = start_time;
					if (g_date_time_get_hour (_tmp39_) >= 23) {
						GraniteWidgetsDatePicker* _tmp40_;
						GraniteWidgetsDatePicker* _tmp41_;
						GDateTime* _tmp42_;
						GDateTime* _tmp43_;
						GDateTime* _tmp44_;
						GDateTime* _tmp45_;
						_tmp40_ = self->priv->to_date_picker;
						_tmp41_ = self->priv->from_date_picker;
						_tmp42_ = granite_widgets_date_picker_get_date (_tmp41_);
						_tmp43_ = _tmp42_;
						_tmp44_ = g_date_time_add_days (_tmp43_, 1);
						_tmp45_ = _tmp44_;
						granite_widgets_date_picker_set_date (_tmp40_, _tmp45_);
						_g_date_time_unref0 (_tmp45_);
					}
				}
			}
			break;
		}
		case 1:
		{
			break;
		}
		default:
		break;
	}
	maya_view_event_edition_info_panel_update_create_sensitivity (self);
	_g_date_time_unref0 (end_time);
	_g_date_time_unref0 (start_time);
	_g_date_time_unref0 (end_date);
	_g_date_time_unref0 (start_date);
}

static void
maya_view_event_edition_info_panel_update_create_sensitivity (MayaViewEventEditionInfoPanel* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, maya_view_event_edition_info_panel_signals[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_VALID_EVENT_SIGNAL], 0, maya_view_event_edition_info_panel_is_valid_event (self));
}

static gboolean
maya_view_event_edition_info_panel_is_valid_event (MayaViewEventEditionInfoPanel* self)
{
	gboolean _tmp0_ = FALSE;
	GtkEntry* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->title_entry;
	_tmp2_ = gtk_entry_get_text (_tmp1_);
	_tmp3_ = _tmp2_;
	if (g_strcmp0 (_tmp3_, "") != 0) {
		_tmp0_ = maya_view_event_edition_info_panel_is_valid_dates (self);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
maya_view_event_edition_info_panel_is_valid_dates (MayaViewEventEditionInfoPanel* self)
{
	GDateTime* start_date = NULL;
	GraniteWidgetsDatePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* end_date = NULL;
	GraniteWidgetsDatePicker* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	GDateTime* start_time = NULL;
	GraniteWidgetsTimePicker* _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	GDateTime* _tmp11_;
	GDateTime* end_time = NULL;
	GraniteWidgetsTimePicker* _tmp12_;
	GDateTime* _tmp13_;
	GDateTime* _tmp14_;
	GDateTime* _tmp15_;
	GDateTime* _tmp16_;
	GDateTime* _tmp17_;
	GDateTime* _tmp29_;
	GDateTime* _tmp30_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->from_date_picker;
	_tmp1_ = granite_widgets_date_picker_get_date (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_date_time_ref0 (_tmp2_);
	start_date = _tmp3_;
	_tmp4_ = self->priv->to_date_picker;
	_tmp5_ = granite_widgets_date_picker_get_date (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_date_time_ref0 (_tmp6_);
	end_date = _tmp7_;
	_tmp8_ = self->priv->from_time_picker;
	_tmp9_ = granite_widgets_time_picker_get_time (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_date_time_ref0 (_tmp10_);
	start_time = _tmp11_;
	_tmp12_ = self->priv->to_time_picker;
	_tmp13_ = granite_widgets_time_picker_get_time (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _g_date_time_ref0 (_tmp14_);
	end_time = _tmp15_;
	_tmp16_ = start_date;
	_tmp17_ = end_date;
	if (g_date_time_get_year (_tmp16_) == g_date_time_get_year (_tmp17_)) {
		GDateTime* _tmp18_;
		GDateTime* _tmp19_;
		GDateTime* _tmp27_;
		GDateTime* _tmp28_;
		_tmp18_ = start_date;
		_tmp19_ = end_date;
		if (g_date_time_get_day_of_year (_tmp18_) == g_date_time_get_day_of_year (_tmp19_)) {
			GtkSwitch* _tmp20_;
			GDateTime* _tmp21_;
			GDateTime* _tmp22_;
			GDateTime* _tmp25_;
			GDateTime* _tmp26_;
			_tmp20_ = self->priv->allday_switch;
			if (gtk_switch_get_active (_tmp20_)) {
				result = TRUE;
				_g_date_time_unref0 (end_time);
				_g_date_time_unref0 (start_time);
				_g_date_time_unref0 (end_date);
				_g_date_time_unref0 (start_date);
				return result;
			}
			_tmp21_ = start_time;
			_tmp22_ = end_time;
			if (g_date_time_get_hour (_tmp21_) == g_date_time_get_hour (_tmp22_)) {
				GDateTime* _tmp23_;
				GDateTime* _tmp24_;
				_tmp23_ = start_time;
				_tmp24_ = end_time;
				result = g_date_time_get_minute (_tmp23_) <= g_date_time_get_minute (_tmp24_);
				_g_date_time_unref0 (end_time);
				_g_date_time_unref0 (start_time);
				_g_date_time_unref0 (end_date);
				_g_date_time_unref0 (start_date);
				return result;
			}
			_tmp25_ = start_time;
			_tmp26_ = end_time;
			result = g_date_time_get_hour (_tmp25_) < g_date_time_get_hour (_tmp26_);
			_g_date_time_unref0 (end_time);
			_g_date_time_unref0 (start_time);
			_g_date_time_unref0 (end_date);
			_g_date_time_unref0 (start_date);
			return result;
		}
		_tmp27_ = start_date;
		_tmp28_ = end_date;
		result = g_date_time_get_day_of_year (_tmp27_) < g_date_time_get_day_of_year (_tmp28_);
		_g_date_time_unref0 (end_time);
		_g_date_time_unref0 (start_time);
		_g_date_time_unref0 (end_date);
		_g_date_time_unref0 (start_date);
		return result;
	}
	_tmp29_ = start_date;
	_tmp30_ = end_date;
	result = g_date_time_get_year (_tmp29_) < g_date_time_get_year (_tmp30_);
	_g_date_time_unref0 (end_time);
	_g_date_time_unref0 (start_time);
	_g_date_time_unref0 (end_date);
	_g_date_time_unref0 (start_date);
	return result;
}

const gchar*
maya_view_event_edition_info_panel_get_title (MayaViewEventEditionInfoPanel* self)
{
	const gchar* result;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->title_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	result = _tmp1_;
	return result;
}

void
maya_view_event_edition_info_panel_set_title (MayaViewEventEditionInfoPanel* self,
                                              const gchar* value)
{
	GtkEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_entry;
	gtk_entry_set_text (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY]);
}

GDateTime*
maya_view_event_edition_info_panel_get_from_date (MayaViewEventEditionInfoPanel* self)
{
	GDateTime* result;
	GraniteWidgetsDatePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->from_date_picker;
	_tmp1_ = granite_widgets_date_picker_get_date (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
maya_view_event_edition_info_panel_set_from_date (MayaViewEventEditionInfoPanel* self,
                                                  GDateTime* value)
{
	GraniteWidgetsDatePicker* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->from_date_picker;
	granite_widgets_date_picker_set_date (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY]);
}

GDateTime*
maya_view_event_edition_info_panel_get_to_date (MayaViewEventEditionInfoPanel* self)
{
	GDateTime* result;
	GraniteWidgetsDatePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->to_date_picker;
	_tmp1_ = granite_widgets_date_picker_get_date (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
maya_view_event_edition_info_panel_set_to_date (MayaViewEventEditionInfoPanel* self,
                                                GDateTime* value)
{
	GraniteWidgetsDatePicker* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->to_date_picker;
	granite_widgets_date_picker_set_date (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY]);
}

GDateTime*
maya_view_event_edition_info_panel_get_from_time (MayaViewEventEditionInfoPanel* self)
{
	GDateTime* result;
	GraniteWidgetsTimePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->from_time_picker;
	_tmp1_ = granite_widgets_time_picker_get_time (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
maya_view_event_edition_info_panel_set_from_time (MayaViewEventEditionInfoPanel* self,
                                                  GDateTime* value)
{
	GraniteWidgetsTimePicker* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->from_time_picker;
	granite_widgets_time_picker_set_time (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY]);
}

GDateTime*
maya_view_event_edition_info_panel_get_to_time (MayaViewEventEditionInfoPanel* self)
{
	GDateTime* result;
	GraniteWidgetsTimePicker* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->to_time_picker;
	_tmp1_ = granite_widgets_time_picker_get_time (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
maya_view_event_edition_info_panel_set_to_time (MayaViewEventEditionInfoPanel* self,
                                                GDateTime* value)
{
	GraniteWidgetsTimePicker* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->to_time_picker;
	granite_widgets_time_picker_set_time (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY]);
}

gboolean
maya_view_event_edition_info_panel_get_all_day (MayaViewEventEditionInfoPanel* self)
{
	gboolean result;
	GtkSwitch* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->allday_switch;
	result = gtk_switch_get_active (_tmp0_);
	return result;
}

void
maya_view_event_edition_info_panel_set_all_day (MayaViewEventEditionInfoPanel* self,
                                                gboolean value)
{
	GtkSwitch* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->allday_switch;
	gtk_switch_set_active (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY]);
}

ICalTimezone*
maya_view_event_edition_info_panel_get_timezone (MayaViewEventEditionInfoPanel* self)
{
	ICalTimezone* result;
	ICalTimezone* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_timezone;
	result = _tmp0_;
	return result;
}

static void
maya_view_event_edition_info_panel_set_timezone (MayaViewEventEditionInfoPanel* self,
                                                 ICalTimezone* value)
{
	ICalTimezone* old_value;
	g_return_if_fail (self != NULL);
	old_value = maya_view_event_edition_info_panel_get_timezone (self);
	if (old_value != value) {
		ICalTimezone* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_timezone);
		self->priv->_timezone = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY]);
	}
}

static void
maya_view_event_edition_info_panel_class_init (MayaViewEventEditionInfoPanelClass * klass,
                                               gpointer klass_data)
{
	maya_view_event_edition_info_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MayaViewEventEditionInfoPanel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_maya_view_event_edition_info_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_maya_view_event_edition_info_panel_set_property;
	G_OBJECT_CLASS (klass)->finalize = maya_view_event_edition_info_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY] = g_param_spec_boxed ("from-date", "from-date", "from-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY] = g_param_spec_boxed ("to-date", "to-date", "to-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY] = g_param_spec_boxed ("from-time", "from-time", "from-time", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY] = g_param_spec_boxed ("to-time", "to-time", "to-time", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY] = g_param_spec_boolean ("all-day", "all-day", "all-day", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY, maya_view_event_edition_info_panel_properties[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY] = g_param_spec_object ("timezone", "timezone", "timezone", i_cal_timezone_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	maya_view_event_edition_info_panel_signals[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_PARSE_EVENT_SIGNAL] = g_signal_new ("parse-event", MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	maya_view_event_edition_info_panel_signals[MAYA_VIEW_EVENT_EDITION_INFO_PANEL_VALID_EVENT_SIGNAL] = g_signal_new ("valid-event", MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}

static void
maya_view_event_edition_info_panel_instance_init (MayaViewEventEditionInfoPanel * self,
                                                  gpointer klass)
{
	self->priv = maya_view_event_edition_info_panel_get_instance_private (self);
	self->nl_parsing_enabled = FALSE;
}

static void
maya_view_event_edition_info_panel_finalize (GObject * obj)
{
	MayaViewEventEditionInfoPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanel);
	_g_object_unref0 (self->priv->title_entry);
	_g_object_unref0 (self->priv->comment_textview);
	_g_object_unref0 (self->priv->from_date_picker);
	_g_object_unref0 (self->priv->to_date_picker);
	_g_object_unref0 (self->priv->allday_switch);
	_g_object_unref0 (self->priv->from_time_picker);
	_g_object_unref0 (self->priv->to_time_picker);
	_g_object_unref0 (self->priv->timezone_label);
	_g_object_unref0 (self->priv->calchooser);
	_g_object_unref0 (self->priv->parent_dialog);
	_g_object_unref0 (self->priv->_timezone);
	G_OBJECT_CLASS (maya_view_event_edition_info_panel_parent_class)->finalize (obj);
}

static GType
maya_view_event_edition_info_panel_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MayaViewEventEditionInfoPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) maya_view_event_edition_info_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MayaViewEventEditionInfoPanel), 0, (GInstanceInitFunc) maya_view_event_edition_info_panel_instance_init, NULL };
	GType maya_view_event_edition_info_panel_type_id;
	maya_view_event_edition_info_panel_type_id = g_type_register_static (gtk_grid_get_type (), "MayaViewEventEditionInfoPanel", &g_define_type_info, 0);
	MayaViewEventEditionInfoPanel_private_offset = g_type_add_instance_private (maya_view_event_edition_info_panel_type_id, sizeof (MayaViewEventEditionInfoPanelPrivate));
	return maya_view_event_edition_info_panel_type_id;
}

GType
maya_view_event_edition_info_panel_get_type (void)
{
	static volatile gsize maya_view_event_edition_info_panel_type_id__once = 0;
	if (g_once_init_enter (&maya_view_event_edition_info_panel_type_id__once)) {
		GType maya_view_event_edition_info_panel_type_id;
		maya_view_event_edition_info_panel_type_id = maya_view_event_edition_info_panel_get_type_once ();
		g_once_init_leave (&maya_view_event_edition_info_panel_type_id__once, maya_view_event_edition_info_panel_type_id);
	}
	return maya_view_event_edition_info_panel_type_id__once;
}

static void
_vala_maya_view_event_edition_info_panel_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	MayaViewEventEditionInfoPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanel);
	switch (property_id) {
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY:
		g_value_set_string (value, maya_view_event_edition_info_panel_get_title (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY:
		g_value_set_boxed (value, maya_view_event_edition_info_panel_get_from_date (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY:
		g_value_set_boxed (value, maya_view_event_edition_info_panel_get_to_date (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY:
		g_value_set_boxed (value, maya_view_event_edition_info_panel_get_from_time (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY:
		g_value_set_boxed (value, maya_view_event_edition_info_panel_get_to_time (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY:
		g_value_set_boolean (value, maya_view_event_edition_info_panel_get_all_day (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY:
		g_value_set_object (value, maya_view_event_edition_info_panel_get_timezone (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_maya_view_event_edition_info_panel_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	MayaViewEventEditionInfoPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MAYA_VIEW_EVENT_EDITION_TYPE_INFO_PANEL, MayaViewEventEditionInfoPanel);
	switch (property_id) {
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TITLE_PROPERTY:
		maya_view_event_edition_info_panel_set_title (self, g_value_get_string (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_DATE_PROPERTY:
		maya_view_event_edition_info_panel_set_from_date (self, g_value_get_boxed (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_DATE_PROPERTY:
		maya_view_event_edition_info_panel_set_to_date (self, g_value_get_boxed (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_FROM_TIME_PROPERTY:
		maya_view_event_edition_info_panel_set_from_time (self, g_value_get_boxed (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TO_TIME_PROPERTY:
		maya_view_event_edition_info_panel_set_to_time (self, g_value_get_boxed (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_ALL_DAY_PROPERTY:
		maya_view_event_edition_info_panel_set_all_day (self, g_value_get_boolean (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_INFO_PANEL_TIMEZONE_PROPERTY:
		maya_view_event_edition_info_panel_set_timezone (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

