/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <bonobo.h>
#include <gnome.h>

#include "callbacks.h"
#include "interface.h"
#include "support.h"

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  g_object_set_data_full (G_OBJECT (component), name, \
    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  g_object_set_data (G_OBJECT (component), name, widget)

GtkWidget*
create_backup_window (void)
{
  GtkWidget *backup_window;
  GtkWidget *vbox1;
  GtkWidget *notebook1;
  GtkWidget *vbox2;
  GtkWidget *scrolledwindow1;
  GtkWidget *backuplist;
  GtkWidget *hbuttonbox2;
  GtkWidget *restorebutton;
  GtkWidget *alignment1;
  GtkWidget *hbox2;
  GtkWidget *image1;
  GtkWidget *label13;
  GtkWidget *restoreallbutton;
  GtkWidget *alignment3;
  GtkWidget *hbox4;
  GtkWidget *image3;
  GtkWidget *label15;
  GtkWidget *deletebutton;
  GtkWidget *alignment2;
  GtkWidget *hbox3;
  GtkWidget *image2;
  GtkWidget *label14;
  GtkWidget *rebackupbutton;
  GtkWidget *alignment4;
  GtkWidget *hbox5;
  GtkWidget *image4;
  GtkWidget *label16;
  GtkWidget *label12;
  GtkWidget *label2;
  GtkWidget *vbox3;
  GtkWidget *hbox1;
  GtkWidget *label5;
  GtkWidget *dirfileentry;
  GtkWidget *direntry;
  GtkWidget *harddeletebutton;
  GtkWidget *label1;
  GtkWidget *hseparator1;
  GtkWidget *hbuttonbox1;
  GtkWidget *cancelbutton;
  GtkWidget *okbutton;

  backup_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width (GTK_CONTAINER (backup_window), 12);
  gtk_window_set_title (GTK_WINDOW (backup_window), "Backup plugin");

  vbox1 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (backup_window), vbox1);
  gtk_container_set_border_width (GTK_CONTAINER (vbox1), 4);

  notebook1 = gtk_notebook_new ();
  gtk_widget_show (notebook1);
  gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);

  vbox2 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 6);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 0);
  GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN);

  backuplist = gtk_tree_view_new ();
  gtk_widget_show (backuplist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), backuplist);
  gtk_widget_set_size_request (backuplist, 600, 150);

  hbuttonbox2 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox2);
  gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox2, FALSE, TRUE, 0);
  gtk_box_set_spacing (GTK_BOX (hbuttonbox2), 12);

  restorebutton = gtk_button_new ();
  gtk_widget_show (restorebutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), restorebutton);
  GTK_WIDGET_SET_FLAGS (restorebutton, GTK_CAN_DEFAULT);

  alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (restorebutton), alignment1);

  hbox2 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox2);
  gtk_container_add (GTK_CONTAINER (alignment1), hbox2);

  image1 = gtk_image_new_from_stock ("gtk-undo", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0);

  label13 = gtk_label_new_with_mnemonic ("Restore selected");
  gtk_widget_show (label13);
  gtk_box_pack_start (GTK_BOX (hbox2), label13, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT);

  restoreallbutton = gtk_button_new ();
  gtk_widget_show (restoreallbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), restoreallbutton);
  GTK_WIDGET_SET_FLAGS (restoreallbutton, GTK_CAN_DEFAULT);

  alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment3);
  gtk_container_add (GTK_CONTAINER (restoreallbutton), alignment3);

  hbox4 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox4);
  gtk_container_add (GTK_CONTAINER (alignment3), hbox4);

  image3 = gtk_image_new_from_stock ("gtk-undo", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image3);
  gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0);

  label15 = gtk_label_new_with_mnemonic ("Restore all");
  gtk_widget_show (label15);
  gtk_box_pack_start (GTK_BOX (hbox4), label15, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_LEFT);

  deletebutton = gtk_button_new ();
  gtk_widget_show (deletebutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), deletebutton);
  GTK_WIDGET_SET_FLAGS (deletebutton, GTK_CAN_DEFAULT);

  alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment2);
  gtk_container_add (GTK_CONTAINER (deletebutton), alignment2);

  hbox3 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox3);
  gtk_container_add (GTK_CONTAINER (alignment2), hbox3);

  image2 = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image2);
  gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0);

  label14 = gtk_label_new_with_mnemonic ("Delete from backup");
  gtk_widget_show (label14);
  gtk_box_pack_start (GTK_BOX (hbox3), label14, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_LEFT);

  rebackupbutton = gtk_button_new ();
  gtk_widget_show (rebackupbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), rebackupbutton);
  GTK_WIDGET_SET_FLAGS (rebackupbutton, GTK_CAN_DEFAULT);

  alignment4 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment4);
  gtk_container_add (GTK_CONTAINER (rebackupbutton), alignment4);

  hbox5 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox5);
  gtk_container_add (GTK_CONTAINER (alignment4), hbox5);

  image4 = gtk_image_new_from_stock ("gtk-go-up", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image4);
  gtk_box_pack_start (GTK_BOX (hbox5), image4, FALSE, FALSE, 0);

  label16 = gtk_label_new_with_mnemonic ("Rebackup all");
  gtk_widget_show (label16);
  gtk_box_pack_start (GTK_BOX (hbox5), label16, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_LEFT);

  label12 = gtk_label_new ("All actions will be performed on next synchronization.");
  gtk_widget_show (label12);
  gtk_box_pack_start (GTK_BOX (vbox2), label12, FALSE, FALSE, 0);

  label2 = gtk_label_new ("Files");
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label2);

  vbox3 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox3);
  gtk_container_add (GTK_CONTAINER (notebook1), vbox3);
  gtk_container_set_border_width (GTK_CONTAINER (vbox3), 6);

  hbox1 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, TRUE, 0);

  label5 = gtk_label_new ("Backup to directory:");
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox1), label5, FALSE, FALSE, 0);

  dirfileentry = gnome_file_entry_new (NULL, "Select directory to backup to...");
  gtk_widget_show (dirfileentry);
  gtk_box_pack_start (GTK_BOX (hbox1), dirfileentry, TRUE, TRUE, 0);
  gnome_file_entry_set_directory_entry (GNOME_FILE_ENTRY (dirfileentry), TRUE);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (dirfileentry), TRUE);

  direntry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (dirfileentry));
  gtk_widget_show (direntry);

  harddeletebutton = gtk_check_button_new_with_mnemonic ("Remove deleted files from backup");
  gtk_widget_show (harddeletebutton);
  gtk_box_pack_start (GTK_BOX (vbox3), harddeletebutton, FALSE, FALSE, 0);

  label1 = gtk_label_new ("Options");
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label1);

  hseparator1 = gtk_hseparator_new ();
  gtk_widget_show (hseparator1);
  gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, TRUE, 0);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
  gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);

  cancelbutton = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (cancelbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancelbutton);
  GTK_WIDGET_SET_FLAGS (cancelbutton, GTK_CAN_DEFAULT);

  okbutton = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (okbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), okbutton);
  GTK_WIDGET_SET_FLAGS (okbutton, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) backup_window, "delete_event",
                    G_CALLBACK (backup_on_backup_window_delete_event),
                    NULL);
  g_signal_connect ((gpointer) restorebutton, "clicked",
                    G_CALLBACK (backup_restorebutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) restoreallbutton, "clicked",
                    G_CALLBACK (backup_restoreallbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) deletebutton, "clicked",
                    G_CALLBACK (backup_deletebutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) rebackupbutton, "clicked",
                    G_CALLBACK (backup_rebackupbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) cancelbutton, "clicked",
                    G_CALLBACK (backup_cancelbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) okbutton, "clicked",
                    G_CALLBACK (backup_okbutton_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (backup_window, backup_window, "backup_window");
  GLADE_HOOKUP_OBJECT (backup_window, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (backup_window, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (backup_window, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (backup_window, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (backup_window, backuplist, "backuplist");
  GLADE_HOOKUP_OBJECT (backup_window, hbuttonbox2, "hbuttonbox2");
  GLADE_HOOKUP_OBJECT (backup_window, restorebutton, "restorebutton");
  GLADE_HOOKUP_OBJECT (backup_window, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (backup_window, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (backup_window, image1, "image1");
  GLADE_HOOKUP_OBJECT (backup_window, label13, "label13");
  GLADE_HOOKUP_OBJECT (backup_window, restoreallbutton, "restoreallbutton");
  GLADE_HOOKUP_OBJECT (backup_window, alignment3, "alignment3");
  GLADE_HOOKUP_OBJECT (backup_window, hbox4, "hbox4");
  GLADE_HOOKUP_OBJECT (backup_window, image3, "image3");
  GLADE_HOOKUP_OBJECT (backup_window, label15, "label15");
  GLADE_HOOKUP_OBJECT (backup_window, deletebutton, "deletebutton");
  GLADE_HOOKUP_OBJECT (backup_window, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (backup_window, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (backup_window, image2, "image2");
  GLADE_HOOKUP_OBJECT (backup_window, label14, "label14");
  GLADE_HOOKUP_OBJECT (backup_window, rebackupbutton, "rebackupbutton");
  GLADE_HOOKUP_OBJECT (backup_window, alignment4, "alignment4");
  GLADE_HOOKUP_OBJECT (backup_window, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (backup_window, image4, "image4");
  GLADE_HOOKUP_OBJECT (backup_window, label16, "label16");
  GLADE_HOOKUP_OBJECT (backup_window, label12, "label12");
  GLADE_HOOKUP_OBJECT (backup_window, label2, "label2");
  GLADE_HOOKUP_OBJECT (backup_window, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (backup_window, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (backup_window, label5, "label5");
  GLADE_HOOKUP_OBJECT (backup_window, dirfileentry, "dirfileentry");
  GLADE_HOOKUP_OBJECT (backup_window, direntry, "direntry");
  GLADE_HOOKUP_OBJECT (backup_window, harddeletebutton, "harddeletebutton");
  GLADE_HOOKUP_OBJECT (backup_window, label1, "label1");
  GLADE_HOOKUP_OBJECT (backup_window, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (backup_window, hbuttonbox1, "hbuttonbox1");
  GLADE_HOOKUP_OBJECT (backup_window, cancelbutton, "cancelbutton");
  GLADE_HOOKUP_OBJECT (backup_window, okbutton, "okbutton");

  return backup_window;
}

