/* MainWindow.c generated by valac 0.11.6, 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–2010 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 <whacks.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) G_GNUC_CONST;
#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_on_backup (MainWindow* self, GtkAction* action);
static void main_window_ask_backup (MainWindow* self);
GType assistant_get_type (void) G_GNUC_CONST;
GType assistant_operation_get_type (void) G_GNUC_CONST;
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) G_GNUC_CONST;
static void main_window_on_restore (MainWindow* self, GtkAction* action);
static void main_window_ask_restore (MainWindow* self);
AssistantRestore* assistant_restore_new (void);
AssistantRestore* assistant_restore_construct (GType object_type);
GType assistant_restore_get_type (void) G_GNUC_CONST;
static void _lambda32_ (AssistantOperation* w, gboolean succeeded, MainWindow* self);
static void __lambda32__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 GtkWidget* main_window_setup_menu (MainWindow* self);
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);
MainWindow* main_window_new (void);
MainWindow* main_window_construct (GType object_type);
static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _lambda33_ (GtkButton* b, MainWindow* self);
static void __lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void _lambda34_ (GtkButton* b, MainWindow* self);
static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self);
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_ = NULL;
	AssistantBackup* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = assistant_backup_new (FALSE);
	_tmp1_ = g_object_ref_sink (_tmp0_);
	main_window_show_assistant (self, (AssistantOperation*) _tmp1_);
	_g_object_unref0 (_tmp1_);
}


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_ = NULL;
	AssistantRestore* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = assistant_restore_new ();
	_tmp1_ = g_object_ref_sink (_tmp0_);
	main_window_show_assistant (self, (AssistantOperation*) _tmp1_);
	_g_object_unref0 (_tmp1_);
}


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


static void __lambda32__assistant_operation_closing (AssistantOperation* _sender, gboolean success, gpointer self) {
	_lambda32_ (_sender, success, self);
}


static void main_window_show_assistant (MainWindow* self, AssistantOperation* win) {
	gint x = 0;
	gint y = 0;
	gint _tmp0_;
	gint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (win != NULL);
	gtk_window_get_position ((GtkWindow*) self, &_tmp0_, &_tmp1_);
	x = _tmp0_;
	y = _tmp1_;
	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) __lambda32__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_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	g_spawn_command_line_async ("deja-dup-preferences", &_inner_error_);
	if (_inner_error_ != NULL) {
		goto __catch3_g_error;
	}
	goto __finally3;
	__catch3_g_error:
	{
		GError * e;
		const gchar* _tmp0_ = NULL;
		GtkMessageDialog* _tmp1_ = NULL;
		GtkMessageDialog* dlg;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp0_ = _ ("Could not open preferences");
		_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _tmp0_);
		dlg = g_object_ref_sink (_tmp1_);
		gtk_message_dialog_format_secondary_text (dlg, "%s", e->message, NULL);
		gtk_dialog_run ((GtkDialog*) dlg);
		hacks_widget_destroy ((GtkWidget*) dlg);
		_g_object_unref0 (dlg);
		_g_error_free0 (e);
	}
	__finally3:
	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;
	GtkActionGroup* _tmp0_ = NULL;
	GtkActionGroup* action_group;
	const gchar* _tmp1_ = NULL;
	GtkAction* _tmp2_ = NULL;
	GtkAction* action;
	const gchar* _tmp3_ = NULL;
	GtkAction* _tmp4_ = NULL;
	GtkAction* _tmp5_;
	GtkAction* _tmp6_;
	GtkAction* _tmp7_;
	const gchar* _tmp8_ = NULL;
	GtkAction* _tmp9_ = NULL;
	GtkAction* _tmp10_;
	GtkAction* _tmp11_;
	GtkAction* _tmp12_;
	GtkAction* _tmp13_ = NULL;
	GtkAction* _tmp14_;
	const gchar* _tmp15_ = NULL;
	GtkAction* _tmp16_ = NULL;
	GtkAction* _tmp17_;
	GtkAction* _tmp18_ = NULL;
	GtkAction* _tmp19_;
	const gchar* _tmp20_ = NULL;
	GtkAction* _tmp21_ = NULL;
	GtkAction* _tmp22_;
	const gchar* _tmp23_ = NULL;
	GtkAction* _tmp24_ = NULL;
	GtkAction* _tmp25_;
	const gchar* _tmp26_ = NULL;
	GtkAction* _tmp27_ = NULL;
	GtkAction* _tmp28_;
	const gchar* _tmp29_ = NULL;
	GtkAction* _tmp30_ = NULL;
	GtkAction* _tmp31_;
	const gchar* _tmp32_ = NULL;
	GtkAction* _tmp33_ = NULL;
	GtkAction* _tmp34_;
	GtkAction* _tmp35_ = NULL;
	GtkAction* _tmp36_;
	gchar* _tmp37_;
	gchar* ui;
	GtkUIManager* _tmp38_ = NULL;
	GtkUIManager* manager;
	gint _tmp39_;
	GtkAccelGroup* _tmp40_ = NULL;
	GtkWidget* _tmp41_ = NULL;
	GtkWidget* _tmp42_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gtk_action_group_new ("actions");
	action_group = _tmp0_;
	_tmp1_ = C_ ("backup is noun", "_Backup");
	_tmp2_ = gtk_action_new ("FileMenuAction", _tmp1_, NULL, NULL);
	action = _tmp2_;
	gtk_action_group_add_action (action_group, action);
	_tmp3_ = C_ ("back up is verb", "_Back Up…");
	_tmp4_ = gtk_action_new ("BackupAction", _tmp3_, NULL, NULL);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (action);
	action = _tmp5_;
	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");
	_tmp6_ = _g_object_ref0 (action);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (self->priv->backup_action);
	self->priv->backup_action = _tmp7_;
	_tmp8_ = _ ("_Restore…");
	_tmp9_ = gtk_action_new ("RestoreAction", _tmp8_, NULL, NULL);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (action);
	action = _tmp10_;
	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");
	_tmp11_ = _g_object_ref0 (action);
	_tmp12_ = _tmp11_;
	_g_object_unref0 (self->priv->restore_action);
	self->priv->restore_action = _tmp12_;
	_tmp13_ = gtk_action_new ("QuitAction", NULL, NULL, GTK_STOCK_QUIT);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (action);
	action = _tmp14_;
	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");
	_tmp15_ = _ ("_Edit");
	_tmp16_ = gtk_action_new ("EditMenuAction", _tmp15_, NULL, NULL);
	_tmp17_ = _tmp16_;
	_g_object_unref0 (action);
	action = _tmp17_;
	gtk_action_group_add_action (action_group, action);
	_tmp18_ = gtk_action_new ("PreferencesAction", NULL, NULL, GTK_STOCK_PREFERENCES);
	_tmp19_ = _tmp18_;
	_g_object_unref0 (action);
	action = _tmp19_;
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_preferences_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	_tmp20_ = _ ("_Help");
	_tmp21_ = gtk_action_new ("HelpMenuAction", _tmp20_, NULL, NULL);
	_tmp22_ = _tmp21_;
	_g_object_unref0 (action);
	action = _tmp22_;
	gtk_action_group_add_action (action_group, action);
	_tmp23_ = _ ("_Contents");
	_tmp24_ = gtk_action_new ("ContentsAction", _tmp23_, NULL, GTK_STOCK_HELP);
	_tmp25_ = _tmp24_;
	_g_object_unref0 (action);
	action = _tmp25_;
	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");
	_tmp26_ = _ ("Get Help _Online…");
	_tmp27_ = gtk_action_new ("GetHelpAction", _tmp26_, NULL, NULL);
	_tmp28_ = _tmp27_;
	_g_object_unref0 (action);
	action = _tmp28_;
	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);
	_tmp29_ = _ ("_Translate This Application…");
	_tmp30_ = gtk_action_new ("TranslateAction", _tmp29_, NULL, NULL);
	_tmp31_ = _tmp30_;
	_g_object_unref0 (action);
	action = _tmp31_;
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_translate_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	_tmp32_ = _ ("_Report a Problem…");
	_tmp33_ = gtk_action_new ("ReportAction", _tmp32_, NULL, NULL);
	_tmp34_ = _tmp33_;
	_g_object_unref0 (action);
	action = _tmp34_;
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_report_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	_tmp35_ = gtk_action_new ("AboutAction", NULL, NULL, GTK_STOCK_ABOUT);
	_tmp36_ = _tmp35_;
	_g_object_unref0 (action);
	action = _tmp36_;
	g_signal_connect_object (action, "activate", (GCallback) _main_window_on_about_gtk_action_activate, self, 0);
	gtk_action_group_add_action (action_group, action);
	_tmp37_ = 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>");
	ui = _tmp37_;
	_tmp38_ = gtk_ui_manager_new ();
	manager = _tmp38_;
	_tmp39_ = strlen (ui);
	gtk_ui_manager_add_ui_from_string (manager, ui, (gssize) _tmp39_, &_inner_error_);
	if (_inner_error_ != NULL) {
		goto __catch4_g_error;
	}
	goto __finally4;
	__catch4_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);
	}
	__finally4:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (manager);
		_g_free0 (ui);
		_g_object_unref0 (action);
		_g_object_unref0 (action_group);
		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);
	_tmp40_ = gtk_ui_manager_get_accel_group (manager);
	gtk_window_add_accel_group ((GtkWindow*) self, _tmp40_);
	_tmp41_ = gtk_ui_manager_get_widget (manager, "/ui/menubar");
	_tmp42_ = _g_object_ref0 (_tmp41_);
	result = _tmp42_;
	_g_object_unref0 (manager);
	_g_free0 (ui);
	_g_object_unref0 (action);
	_g_object_unref0 (action_group);
	return result;
}


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


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


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


static void __lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_lambda33_ (_sender, self);
}


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


static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_lambda34_ (_sender, self);
}


static GObject * main_window_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	MainWindow * self;
	GtkVBox* _tmp0_ = NULL;
	GtkVBox* vb;
	const gchar* _tmp1_ = NULL;
	GtkAlignment* _tmp2_ = NULL;
	GtkAlignment* restore_align;
	GtkButton* _tmp3_ = NULL;
	GtkButton* restore_button;
	GdkScreen* _tmp4_ = NULL;
	GtkIconTheme* _tmp5_ = NULL;
	GtkIconTheme* _tmp6_;
	GtkIconTheme* theme;
	GtkImage* _tmp7_ = NULL;
	GtkImage* restore_icon;
	GdkPixbuf* _tmp8_ = NULL;
	GdkPixbuf* restore_pix;
	const gchar* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* restore_label;
	GtkVBox* _tmp11_ = NULL;
	GtkVBox* restore_vbox;
	GtkAlignment* _tmp12_ = NULL;
	GtkAlignment* backup_align;
	GtkButton* _tmp13_ = NULL;
	GtkButton* backup_button;
	GtkImage* _tmp14_ = NULL;
	GtkImage* backup_icon;
	GdkPixbuf* _tmp15_ = NULL;
	GdkPixbuf* backup_pix;
	const gchar* _tmp16_ = NULL;
	GtkLabel* _tmp17_ = NULL;
	GtkLabel* backup_label;
	GtkVBox* _tmp18_ = NULL;
	GtkVBox* backup_vbox;
	GtkHBox* _tmp19_ = NULL;
	GtkHBox* hbox;
	GtkWidget* _tmp20_ = NULL;
	GtkWidget* _tmp21_;
	GError * _inner_error_ = NULL;
	parent_class = G_OBJECT_CLASS (main_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = MAIN_WINDOW (obj);
	_tmp0_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	vb = g_object_ref_sink (_tmp0_);
	_tmp1_ = _ ("Déjà Dup");
	gtk_window_set_title ((GtkWindow*) self, _tmp1_);
	gtk_window_set_resizable ((GtkWindow*) self, FALSE);
	_tmp2_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f);
	restore_align = g_object_ref_sink (_tmp2_);
	_tmp3_ = (GtkButton*) gtk_button_new ();
	restore_button = g_object_ref_sink (_tmp3_);
	g_object_set ((GObject*) restore_button, "child", restore_align, NULL);
	_tmp4_ = gtk_window_get_screen ((GtkWindow*) self);
	_tmp5_ = gtk_icon_theme_get_for_screen (_tmp4_);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	theme = _tmp6_;
	_tmp7_ = (GtkImage*) gtk_image_new ();
	restore_icon = g_object_ref_sink (_tmp7_);
	_tmp8_ = gtk_icon_theme_load_icon (theme, "deja-dup-restore", 128, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_);
	restore_pix = _tmp8_;
	if (_inner_error_ != NULL) {
		goto __catch5_g_error;
	}
	g_object_set ((GObject*) restore_icon, "pixbuf", restore_pix, NULL);
	_g_object_unref0 (restore_pix);
	goto __finally5;
	__catch5_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("MainWindow.vala:45: %s\n", e->message);
		_g_error_free0 (e);
	}
	__finally5:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (restore_icon);
		_g_object_unref0 (theme);
		_g_object_unref0 (restore_button);
		_g_object_unref0 (restore_align);
		_g_object_unref0 (vb);
		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_);
	}
	_tmp9_ = _ ("_Restore…");
	_tmp10_ = (GtkLabel*) gtk_label_new (_tmp9_);
	restore_label = g_object_ref_sink (_tmp10_);
	g_object_set ((GObject*) restore_label, "use-underline", TRUE, "mnemonic-widget", restore_button, NULL);
	_tmp11_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	restore_vbox = g_object_ref_sink (_tmp11_);
	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);
	_tmp12_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f);
	backup_align = g_object_ref_sink (_tmp12_);
	_tmp13_ = (GtkButton*) gtk_button_new ();
	backup_button = g_object_ref_sink (_tmp13_);
	g_object_set ((GObject*) backup_button, "child", backup_align, NULL);
	_tmp14_ = (GtkImage*) gtk_image_new ();
	backup_icon = g_object_ref_sink (_tmp14_);
	_tmp15_ = gtk_icon_theme_load_icon (theme, "deja-dup-backup", 128, GTK_ICON_LOOKUP_FORCE_SIZE, &_inner_error_);
	backup_pix = _tmp15_;
	if (_inner_error_ != NULL) {
		goto __catch6_g_error;
	}
	g_object_set ((GObject*) backup_icon, "pixbuf", backup_pix, NULL);
	_g_object_unref0 (backup_pix);
	goto __finally6;
	__catch6_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_warning ("MainWindow.vala:71: %s\n", e->message);
		_g_error_free0 (e);
	}
	__finally6:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (backup_icon);
		_g_object_unref0 (backup_button);
		_g_object_unref0 (backup_align);
		_g_object_unref0 (restore_vbox);
		_g_object_unref0 (restore_label);
		_g_object_unref0 (restore_icon);
		_g_object_unref0 (theme);
		_g_object_unref0 (restore_button);
		_g_object_unref0 (restore_align);
		_g_object_unref0 (vb);
		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_);
	}
	_tmp16_ = C_ ("back up is verb", "_Back Up…");
	_tmp17_ = (GtkLabel*) gtk_label_new (_tmp16_);
	backup_label = g_object_ref_sink (_tmp17_);
	g_object_set ((GObject*) backup_label, "use-underline", TRUE, "mnemonic-widget", backup_button, NULL);
	_tmp18_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	backup_vbox = g_object_ref_sink (_tmp18_);
	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);
	_tmp19_ = (GtkHBox*) gtk_hbox_new (TRUE, 12);
	hbox = g_object_ref_sink (_tmp19_);
	g_object_set ((GObject*) hbox, "border-width", 12, "child", restore_button, "child", backup_button, NULL);
	g_signal_connect_object (restore_button, "clicked", (GCallback) __lambda33__gtk_button_clicked, self, 0);
	g_signal_connect_object (backup_button, "clicked", (GCallback) __lambda34__gtk_button_clicked, self, 0);
	_tmp20_ = main_window_setup_menu (self);
	_tmp21_ = _tmp20_;
	gtk_box_pack_start ((GtkBox*) vb, _tmp21_, FALSE, FALSE, (guint) 0);
	_g_object_unref0 (_tmp21_);
	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 (hbox);
	_g_object_unref0 (backup_vbox);
	_g_object_unref0 (backup_label);
	_g_object_unref0 (backup_icon);
	_g_object_unref0 (backup_button);
	_g_object_unref0 (backup_align);
	_g_object_unref0 (restore_vbox);
	_g_object_unref0 (restore_label);
	_g_object_unref0 (restore_icon);
	_g_object_unref0 (theme);
	_g_object_unref0 (restore_button);
	_g_object_unref0 (restore_align);
	_g_object_unref0 (vb);
	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;
}



