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

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
    This file is part of Déjà Dup.
    © 2008,2009 Michael Terry <mike@mterry.name>

    Déjà Dup 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.

    Déjà Dup 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 Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <widgets.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixdata.h>


#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;
typedef struct _MainWindowPrivate MainWindowPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_ASSISTANT (assistant_get_type ())
#define ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ASSISTANT, Assistant))
#define ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ASSISTANT, AssistantClass))
#define IS_ASSISTANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ASSISTANT))
#define IS_ASSISTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ASSISTANT))
#define ASSISTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ASSISTANT, AssistantClass))

typedef struct _Assistant Assistant;
typedef struct _AssistantClass AssistantClass;

#define TYPE_ASSISTANT_OPERATION (assistant_operation_get_type ())
#define ASSISTANT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ASSISTANT_OPERATION, AssistantOperation))
#define ASSISTANT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ASSISTANT_OPERATION, AssistantOperationClass))
#define IS_ASSISTANT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ASSISTANT_OPERATION))
#define IS_ASSISTANT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ASSISTANT_OPERATION))
#define ASSISTANT_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ASSISTANT_OPERATION, AssistantOperationClass))

typedef struct _AssistantOperation AssistantOperation;
typedef struct _AssistantOperationClass AssistantOperationClass;

#define TYPE_ASSISTANT_BACKUP (assistant_backup_get_type ())
#define ASSISTANT_BACKUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ASSISTANT_BACKUP, AssistantBackup))
#define ASSISTANT_BACKUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ASSISTANT_BACKUP, AssistantBackupClass))
#define IS_ASSISTANT_BACKUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ASSISTANT_BACKUP))
#define IS_ASSISTANT_BACKUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ASSISTANT_BACKUP))
#define ASSISTANT_BACKUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ASSISTANT_BACKUP, AssistantBackupClass))

typedef struct _AssistantBackup AssistantBackup;
typedef struct _AssistantBackupClass AssistantBackupClass;

#define TYPE_ASSISTANT_RESTORE (assistant_restore_get_type ())
#define ASSISTANT_RESTORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ASSISTANT_RESTORE, AssistantRestore))
#define ASSISTANT_RESTORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ASSISTANT_RESTORE, AssistantRestoreClass))
#define IS_ASSISTANT_RESTORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ASSISTANT_RESTORE))
#define IS_ASSISTANT_RESTORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ASSISTANT_RESTORE))
#define ASSISTANT_RESTORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ASSISTANT_RESTORE, AssistantRestoreClass))

typedef struct _AssistantRestore AssistantRestore;
typedef struct _AssistantRestoreClass AssistantRestoreClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _MainWindow {
	GtkWindow parent_instance;
	MainWindowPrivate * priv;
};

struct _MainWindowClass {
	GtkWindowClass parent_class;
};

struct _MainWindowPrivate {
	GtkAction* backup_action;
	GtkAction* restore_action;
};


static gpointer main_window_parent_class = NULL;

GType main_window_get_type (void);
#define MAIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAIN_WINDOW, MainWindowPrivate))
enum  {
	MAIN_WINDOW_DUMMY_PROPERTY
};
static void main_window_ask_backup (MainWindow* self);
static void main_window_on_backup (MainWindow* self, GtkAction* action);
GType assistant_get_type (void);
GType assistant_operation_get_type (void);
static void main_window_show_assistant (MainWindow* self, AssistantOperation* win);
AssistantBackup* assistant_backup_new (gboolean automatic);
AssistantBackup* assistant_backup_construct (GType object_type, gboolean automatic);
GType assistant_backup_get_type (void);
static void main_window_ask_restore (MainWindow* self);
static void main_window_on_restore (MainWindow* self, GtkAction* action);
AssistantRestore* assistant_restore_new (void);
AssistantRestore* assistant_restore_construct (GType object_type);
GType assistant_restore_get_type (void);
static void _lambda22_ (AssistantOperation* w, gboolean succeeded, MainWindow* self);
static void __lambda22__assistant_operation_closing (AssistantOperation* _sender, gboolean success, gpointer self);
static void main_window_on_about (MainWindow* self, GtkAction* action);
static void main_window_on_contents (MainWindow* self, GtkAction* action);
static void main_window_on_get_help (MainWindow* self, GtkAction* action);
static void main_window_on_translate (MainWindow* self, GtkAction* action);
static void main_window_on_report (MainWindow* self, GtkAction* action);
static void main_window_on_preferences (MainWindow* self, GtkAction* action);
static void _main_window_on_backup_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_restore_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _gtk_main_quit_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_preferences_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_contents_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_get_help_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_translate_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_report_gtk_action_activate (GtkAction* _sender, gpointer self);
static void _main_window_on_about_gtk_action_activate (GtkAction* _sender, gpointer self);
static GtkWidget* main_window_setup_menu (MainWindow* self);
MainWindow* main_window_new (void);
MainWindow* main_window_construct (GType object_type);
static void _lambda23_ (GtkButton* b, MainWindow* self);
static void __lambda23__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void _lambda24_ (GtkButton* b, MainWindow* self);
static void __lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self);
static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void main_window_finalize (GObject* obj);



static void main_window_on_backup (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	main_window_ask_backup (self);
}


static void main_window_ask_backup (MainWindow* self) {
	AssistantBackup* _tmp0_;
	g_return_if_fail (self != NULL);
	main_window_show_assistant (self, (AssistantOperation*) (_tmp0_ = g_object_ref_sink (assistant_backup_new (FALSE))));
	_g_object_unref0 (_tmp0_);
}


static void main_window_on_restore (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	main_window_ask_restore (self);
}


static void main_window_ask_restore (MainWindow* self) {
	AssistantRestore* _tmp0_;
	g_return_if_fail (self != NULL);
	main_window_show_assistant (self, (AssistantOperation*) (_tmp0_ = g_object_ref_sink (assistant_restore_new ())));
	_g_object_unref0 (_tmp0_);
}


static void _lambda22_ (AssistantOperation* w, gboolean succeeded, MainWindow* self) {
	g_return_if_fail (w != NULL);
	if (succeeded) {
		gtk_object_destroy ((GtkObject*) self);
	} else {
		gint x2 = 0;
		gint y2 = 0;
		gtk_window_get_position ((GtkWindow*) w, &x2, &y2);
		gtk_window_move ((GtkWindow*) self, x2, y2);
		gtk_widget_show ((GtkWidget*) self);
	}
}


static void __lambda22__assistant_operation_closing (AssistantOperation* _sender, gboolean success, gpointer self) {
	_lambda22_ (_sender, success, self);
}


static void main_window_show_assistant (MainWindow* self, AssistantOperation* win) {
	gint x = 0;
	gint y = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (win != NULL);
	gtk_window_get_position ((GtkWindow*) self, &x, &y);
	gtk_window_move ((GtkWindow*) win, x, y);
	gtk_widget_show ((GtkWidget*) win);
	gtk_widget_hide ((GtkWidget*) self);
	gtk_window_present ((GtkWindow*) win);
	g_signal_connect_object (win, "closing", (GCallback) __lambda22__assistant_operation_closing, self, 0);
}


static void main_window_on_about (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	deja_dup_show_about ((GObject*) self, (GtkWindow*) self);
}


static void main_window_on_contents (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	deja_dup_show_uri ((GtkWindow*) self, "ghelp:deja-dup");
}


static void main_window_on_get_help (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	deja_dup_show_uri ((GtkWindow*) self, "https://answers.launchpad.net/deja-dup");
}


static void main_window_on_translate (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	deja_dup_show_uri ((GtkWindow*) self, "https://translations.launchpad.net/deja-dup");
}


static void main_window_on_report (MainWindow* self, GtkAction* action) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	deja_dup_show_uri ((GtkWindow*) self, "https://bugs.launchpad.net/deja-dup/+filebug");
}


static void main_window_on_preferences (MainWindow* self, GtkAction* action) {
	GError * _inner_error_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_inner_error_ = NULL;
	{
		g_spawn_command_line_async ("deja-dup-preferences", &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch6_g_error;
		}
	}
	goto __finally6;
	__catch6_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
			GtkMessageDialog* dlg;
			dlg = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _ ("Could not open preferences")));
			gtk_message_dialog_format_secondary_text (dlg, "%s", e->message, NULL);
			gtk_dialog_run ((GtkDialog*) dlg);
			gtk_object_destroy ((GtkObject*) dlg);
			_g_error_free0 (e);
			_g_object_unref0 (dlg);
		}
	}
	__finally6:
	if (_inner_error_ != NULL) {
		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);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void _main_window_on_backup_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_backup (self, _sender);
}


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


static void _main_window_on_restore_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_restore (self, _sender);
}


static void _gtk_main_quit_gtk_action_activate (GtkAction* _sender, gpointer self) {
	gtk_main_quit ();
}


static void _main_window_on_preferences_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_preferences (self, _sender);
}


static void _main_window_on_contents_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_contents (self, _sender);
}


static void _main_window_on_get_help_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_get_help (self, _sender);
}


static void _main_window_on_translate_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_translate (self, _sender);
}


static void _main_window_on_report_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_report (self, _sender);
}


static void _main_window_on_about_gtk_action_activate (GtkAction* _sender, gpointer self) {
	main_window_on_about (self, _sender);
}


static GtkWidget* main_window_setup_menu (MainWindow* self) {
	GtkWidget* result = NULL;
	GError * _inner_error_;
	GtkActionGroup* action_group;
	GtkAction* action;
	GtkAction* _tmp0_;
	GtkAction* _tmp1_;
	GtkAction* _tmp2_;
	GtkAction* _tmp3_;
	GtkAction* _tmp4_;
	GtkAction* _tmp5_;
	GtkAction* _tmp6_;
	GtkAction* _tmp7_;
	GtkAction* _tmp8_;
	GtkAction* _tmp9_;
	GtkAction* _tmp10_;
	GtkAction* _tmp11_;
	GtkAction* _tmp12_;
	char* ui;
	GtkUIManager* manager;
	g_return_val_if_fail (self != NULL, NULL);
	_inner_error_ = NULL;
	action_group = gtk_action_group_new ("actions");
	action = gtk_action_new ("FileMenuAction", C_ ("backup is noun", "_Backup"), NULL, NULL);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp0_ = gtk_action_new ("BackupAction", C_ ("backup is verb", "_Backup"), NULL, NULL), _g_object_unref0 (action), _tmp0_);
	g_object_set ((GObject*) action, "icon-name", "deja-dup-backup", NULL);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_backup_gtk_action_activate, self, 0);
	gtk_action_group_add_action_with_accel (action_group, action, "<control>B");
	self->priv->backup_action = (_tmp1_ = _g_object_ref0 (action), _g_object_unref0 (self->priv->backup_action), _tmp1_);
	action = (_tmp2_ = gtk_action_new ("RestoreAction", _ ("_Restore"), NULL, NULL), _g_object_unref0 (action), _tmp2_);
	g_object_set ((GObject*) action, "icon-name", "deja-dup-restore", NULL);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_restore_gtk_action_activate, self, 0);
	gtk_action_group_add_action_with_accel (action_group, action, "<control>R");
	self->priv->restore_action = (_tmp3_ = _g_object_ref0 (action), _g_object_unref0 (self->priv->restore_action), _tmp3_);
	action = (_tmp4_ = gtk_action_new ("QuitAction", NULL, NULL, GTK_STOCK_QUIT), _g_object_unref0 (action), _tmp4_);
	g_signal_connect (action, "activate", (GCallback) _gtk_main_quit_gtk_action_activate, NULL);
	gtk_action_group_add_action_with_accel (action_group, action, "<control>Q");
	action = (_tmp5_ = gtk_action_new ("EditMenuAction", _ ("_Edit"), NULL, NULL), _g_object_unref0 (action), _tmp5_);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp6_ = gtk_action_new ("PreferencesAction", NULL, NULL, GTK_STOCK_PREFERENCES), _g_object_unref0 (action), _tmp6_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_preferences_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp7_ = gtk_action_new ("HelpMenuAction", _ ("_Help"), NULL, NULL), _g_object_unref0 (action), _tmp7_);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp8_ = gtk_action_new ("ContentsAction", _ ("_Contents"), NULL, GTK_STOCK_HELP), _g_object_unref0 (action), _tmp8_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_contents_gtk_action_activate, self, 0);
	gtk_action_group_add_action_with_accel (action_group, action, "F1");
	action = (_tmp9_ = gtk_action_new ("GetHelpAction", _ ("Get Help _Online…"), NULL, NULL), _g_object_unref0 (action), _tmp9_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_get_help_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp10_ = gtk_action_new ("TranslateAction", _ ("_Translate This Application…"), NULL, NULL), _g_object_unref0 (action), _tmp10_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_translate_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp11_ = gtk_action_new ("ReportAction", _ ("_Report a Problem…"), NULL, NULL), _g_object_unref0 (action), _tmp11_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_report_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	action = (_tmp12_ = gtk_action_new ("AboutAction", NULL, NULL, GTK_STOCK_ABOUT), _g_object_unref0 (action), _tmp12_);
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_about_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	ui = g_strdup ("\n" \
"<ui>\n" \
"  <menubar>\n" \
"    <menu name=\"FileMenu\" action=\"FileMenuAction\">\n" \
"      <menuitem name=\"Backup\" action=\"BackupAction\" />\n" \
"      <menuitem name=\"Restore\" action=\"RestoreAction\" />\n" \
"      <separator />\n" \
"      <menuitem name=\"Quit\" action=\"QuitAction\" />\n" \
"    </menu>\n" \
"    <menu name=\"EditMenu\" action=\"EditMenuAction\">\n" \
"      <menuitem name=\"Preferences\" action=\"PreferencesAction\"/>\n" \
"    </menu>\n" \
"    <menu name=\"HelpMenu\" action=\"HelpMenuAction\">\n" \
"      <menuitem name=\"Contents\" action=\"ContentsAction\"/>\n" \
"      <separator/>\n" \
"      <menuitem name=\"GetHelp\" action=\"GetHelpAction\"/>\n" \
"      <menuitem name=\"Translate\" action=\"TranslateAction\"/>\n" \
"      <menuitem name=\"Report\" action=\"ReportAction\"/>\n" \
"      <separator/>\n" \
"      <menuitem name=\"About\" action=\"AboutAction\"/>\n" \
"    </menu>\n" \
"  </menubar>\n" \
"</ui>");
	manager = gtk_ui_manager_new ();
	{
		gtk_ui_manager_add_ui_from_string (manager, ui, (gssize) strlen (ui), &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch7_g_error;
		}
	}
	goto __finally7;
	__catch7_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
			g_error ("MainWindow.vala:262: Internal error: bad ui string.\n");
			_g_error_free0 (e);
		}
	}
	__finally7:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (action_group);
		_g_object_unref0 (action);
		_g_free0 (ui);
		_g_object_unref0 (manager);
		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);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	gtk_ui_manager_insert_action_group (manager, action_group, 0);
	gtk_window_add_accel_group ((GtkWindow*) self, gtk_ui_manager_get_accel_group (manager));
	result = _g_object_ref0 (gtk_ui_manager_get_widget (manager, "/ui/menubar"));
	_g_object_unref0 (action_group);
	_g_object_unref0 (action);
	_g_free0 (ui);
	_g_object_unref0 (manager);
	return result;
}


MainWindow* main_window_construct (GType object_type) {
	MainWindow * self;
	self = g_object_newv (object_type, 0, NULL);
	return self;
}


MainWindow* main_window_new (void) {
	return main_window_construct (TYPE_MAIN_WINDOW);
}


static void _lambda23_ (GtkButton* b, MainWindow* self) {
	g_return_if_fail (b != NULL);
	main_window_ask_restore (self);
}


static void __lambda23__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_lambda23_ (_sender, self);
}


static void _lambda24_ (GtkButton* b, MainWindow* self) {
	g_return_if_fail (b != NULL);
	main_window_ask_backup (self);
}


static void __lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_lambda24_ (_sender, self);
}


static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	MainWindow * self;
	GError * _inner_error_;
	parent_class = G_OBJECT_CLASS (main_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = MAIN_WINDOW (obj);
	_inner_error_ = NULL;
	{
		GtkVBox* vb;
		GtkAlignment* restore_align;
		GtkButton* restore_button;
		GtkImage* restore_icon;
		GtkLabel* restore_label;
		GtkVBox* restore_vbox;
		GtkAlignment* backup_align;
		GtkButton* backup_button;
		GtkImage* backup_icon;
		GtkLabel* backup_label;
		GtkVBox* backup_vbox;
		GtkHBox* hbox;
		GtkWidget* _tmp0_;
		vb = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
		gtk_window_set_title ((GtkWindow*) self, _ ("Déjà Dup"));
		gtk_window_set_resizable ((GtkWindow*) self, FALSE);
		restore_align = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f));
		restore_button = g_object_ref_sink ((GtkButton*) gtk_button_new ());
		g_object_set ((GObject*) restore_button, "child", restore_align, NULL);
		restore_icon = g_object_ref_sink ((GtkImage*) gtk_image_new ());
		{
			GtkIconTheme* theme;
			GdkPixbuf* restore_pix;
			theme = _g_object_ref0 (gtk_icon_theme_get_for_screen (gtk_window_get_screen ((GtkWindow*) self)));
			restore_pix = _g_object_ref0 (gtk_icon_theme_load_icon (theme, "deja-dup-restore", 128, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_));
			if (_inner_error_ != NULL) {
				_g_object_unref0 (theme);
				goto __catch8_g_error;
			}
			g_object_set ((GObject*) restore_icon, "pixbuf", restore_pix, NULL);
			_g_object_unref0 (theme);
			_g_object_unref0 (restore_pix);
		}
		goto __finally8;
		__catch8_g_error:
		{
			GError * e;
			e = _inner_error_;
			_inner_error_ = NULL;
			{
				g_warning ("MainWindow.vala:44: %s\n", e->message);
				_g_error_free0 (e);
			}
		}
		__finally8:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (vb);
			_g_object_unref0 (restore_align);
			_g_object_unref0 (restore_button);
			_g_object_unref0 (restore_icon);
			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);
			g_clear_error (&_inner_error_);
		}
		restore_label = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("_Restore")));
		g_object_set ((GObject*) restore_label, "use-underline", TRUE, "mnemonic-widget", restore_button, NULL);
		restore_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
		g_object_set ((GObject*) restore_vbox, "border-width", 12, "child", restore_icon, "child", restore_label, NULL);
		gtk_container_add ((GtkContainer*) restore_align, (GtkWidget*) restore_vbox);
		backup_align = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f));
		backup_button = g_object_ref_sink ((GtkButton*) gtk_button_new ());
		g_object_set ((GObject*) backup_button, "child", backup_align, NULL);
		backup_icon = g_object_ref_sink ((GtkImage*) gtk_image_new ());
		{
			GtkIconTheme* theme;
			GdkPixbuf* backup_pix;
			theme = _g_object_ref0 (gtk_icon_theme_get_for_screen (gtk_window_get_screen ((GtkWindow*) self)));
			backup_pix = _g_object_ref0 (gtk_icon_theme_load_icon (theme, "deja-dup-backup", 128, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_));
			if (_inner_error_ != NULL) {
				_g_object_unref0 (theme);
				goto __catch9_g_error;
			}
			g_object_set ((GObject*) backup_icon, "pixbuf", backup_pix, NULL);
			_g_object_unref0 (theme);
			_g_object_unref0 (backup_pix);
		}
		goto __finally9;
		__catch9_g_error:
		{
			GError * e;
			e = _inner_error_;
			_inner_error_ = NULL;
			{
				g_warning ("MainWindow.vala:71: %s\n", e->message);
				_g_error_free0 (e);
			}
		}
		__finally9:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (vb);
			_g_object_unref0 (restore_align);
			_g_object_unref0 (restore_button);
			_g_object_unref0 (restore_icon);
			_g_object_unref0 (restore_label);
			_g_object_unref0 (restore_vbox);
			_g_object_unref0 (backup_align);
			_g_object_unref0 (backup_button);
			_g_object_unref0 (backup_icon);
			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);
			g_clear_error (&_inner_error_);
		}
		backup_label = g_object_ref_sink ((GtkLabel*) gtk_label_new (C_ ("backup is verb", "_Backup")));
		g_object_set ((GObject*) backup_label, "use-underline", TRUE, "mnemonic-widget", backup_button, NULL);
		backup_vbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
		g_object_set ((GObject*) backup_vbox, "border-width", 12, "child", backup_icon, "child", backup_label, NULL);
		gtk_container_add ((GtkContainer*) backup_align, (GtkWidget*) backup_vbox);
		hbox = g_object_ref_sink ((GtkHBox*) gtk_hbox_new (TRUE, 12));
		g_object_set ((GObject*) hbox, "border-width", 12, "child", restore_button, "child", backup_button, NULL);
		g_signal_connect_object (restore_button, "clicked", (GCallback) __lambda23__gtk_button_clicked, self, 0);
		g_signal_connect_object (backup_button, "clicked", (GCallback) __lambda24__gtk_button_clicked, self, 0);
		gtk_box_pack_start ((GtkBox*) vb, _tmp0_ = main_window_setup_menu (self), FALSE, FALSE, (guint) 0);
		_g_object_unref0 (_tmp0_);
		gtk_box_pack_start ((GtkBox*) vb, (GtkWidget*) hbox, TRUE, TRUE, (guint) 0);
		gtk_widget_grab_focus ((GtkWidget*) backup_button);
		gtk_container_add ((GtkContainer*) self, (GtkWidget*) vb);
		_g_object_unref0 (vb);
		_g_object_unref0 (restore_align);
		_g_object_unref0 (restore_button);
		_g_object_unref0 (restore_icon);
		_g_object_unref0 (restore_label);
		_g_object_unref0 (restore_vbox);
		_g_object_unref0 (backup_align);
		_g_object_unref0 (backup_button);
		_g_object_unref0 (backup_icon);
		_g_object_unref0 (backup_label);
		_g_object_unref0 (backup_vbox);
		_g_object_unref0 (hbox);
	}
	return obj;
}


static void main_window_class_init (MainWindowClass * klass) {
	main_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (MainWindowPrivate));
	G_OBJECT_CLASS (klass)->constructor = main_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = main_window_finalize;
}


static void main_window_instance_init (MainWindow * self) {
	self->priv = MAIN_WINDOW_GET_PRIVATE (self);
}


static void main_window_finalize (GObject* obj) {
	MainWindow * self;
	self = MAIN_WINDOW (obj);
	_g_object_unref0 (self->priv->backup_action);
	_g_object_unref0 (self->priv->restore_action);
	G_OBJECT_CLASS (main_window_parent_class)->finalize (obj);
}


GType main_window_get_type (void) {
	static volatile gsize main_window_type_id__volatile = 0;
	if (g_once_init_enter (&main_window_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (MainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainWindow), 0, (GInstanceInitFunc) main_window_instance_init, NULL };
		GType main_window_type_id;
		main_window_type_id = g_type_register_static (GTK_TYPE_WINDOW, "MainWindow", &g_define_type_info, 0);
		g_once_init_leave (&main_window_type_id__volatile, main_window_type_id);
	}
	return main_window_type_id__volatile;
}




