/*
 * 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)

static GnomeUIInfo convertwidget1_uiinfo[] =
{
  GNOMEUIINFO_END
};

static GnomeUIInfo convertwidget2_uiinfo[] =
{
  GNOMEUIINFO_END
};

static GnomeUIInfo convertwidget3_uiinfo[] =
{
  {
    GNOME_APP_UI_ITEM, "Event",
    NULL,
    (gpointer) NULL, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

static GnomeUIInfo convertwidget5_uiinfo[] =
{
  {
    GNOME_APP_UI_ITEM, "Always synchronize",
    NULL,
    (gpointer) NULL, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_ITEM, "Synchronize only if",
    NULL,
    (gpointer) NULL, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_ITEM, "Do not synchronize if",
    NULL,
    (gpointer) NULL, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_ITEM, "Never synchronize",
    NULL,
    (gpointer) on_item1_activate, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

static GnomeUIInfo convertwidget9_uiinfo[] =
{
  {
    GNOME_APP_UI_ITEM, "categories",
    NULL,
    (gpointer) NULL, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

GtkWidget*
create_syncpairwin (void)
{
  GtkWidget *syncpairwin;
  GtkWidget *vbox3;
  GtkWidget *notebook1;
  GtkWidget *vbox11;
  GtkWidget *label32;
  GtkWidget *hbox7;
  GtkWidget *label33;
  GtkWidget *table6;
  GtkWidget *vbox12;
  GtkWidget *hbox8;
  GtkWidget *localoption;
  GtkWidget *convertwidget1;
  GtkWidget *localedit;
  GtkWidget *localinfolabel;
  GtkWidget *label7;
  GtkWidget *vbox13;
  GtkWidget *hbox9;
  GtkWidget *remoteoption;
  GtkWidget *convertwidget2;
  GtkWidget *remoteedit;
  GtkWidget *remoteinfolabel;
  GtkWidget *label23;
  GtkWidget *label8;
  GtkWidget *displaynameentry;
  GtkWidget *label34;
  GtkWidget *hbox10;
  GtkWidget *label35;
  GtkWidget *table3;
  GtkWidget *calendarcheck;
  GtkWidget *addressbookcheck;
  GtkWidget *todocheck;
  GtkWidget *nocommontypelabel;
  GtkWidget *label12;
  GtkWidget *vbox14;
  GtkWidget *label36;
  GtkWidget *hbox11;
  GtkWidget *label37;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label3;
  GtkWidget *dwellscale;
  GtkWidget *dwelllabel;
  GtkWidget *label5;
  GtkWidget *reconnintervalscale;
  GtkWidget *reconnintervallabel;
  GtkWidget *syncintervalscale;
  GtkWidget *syncintervallabel;
  GtkWidget *label53;
  GtkWidget *hbox22;
  GtkWidget *label54;
  GtkWidget *vbox20;
  GtkWidget *duplicatemanualradio;
  GSList *duplicatemanualradio_group = NULL;
  GtkWidget *duplicatefirstradio;
  GtkWidget *duplicatesecondradio;
  GtkWidget *duplicatebothradio;
  GtkWidget *label13;
  GtkWidget *vbox7;
  GtkWidget *label24;
  GtkWidget *hbox6;
  GtkWidget *label25;
  GtkWidget *table5;
  GtkWidget *label30;
  GtkWidget *filtertypemenu;
  GtkWidget *convertwidget3;
  GtkWidget *vbox10;
  GtkWidget *hbox3;
  GtkWidget *filterrulemenu;
  GtkWidget *convertwidget5;
  GtkWidget *filterfieldmenu;
  GtkWidget *convertwidget9;
  GtkWidget *label19;
  GtkWidget *filterdataentry;
  GtkWidget *label31;
  GtkWidget *vbox8;
  GtkWidget *dirlocalremoteradio;
  GSList *dirlocalremoteradio_group = NULL;
  GtkWidget *dirremotelocalradio;
  GtkWidget *label44;
  GtkWidget *label16;
  GtkWidget *vbox15;
  GtkWidget *label38;
  GtkWidget *hbox12;
  GtkWidget *label39;
  GtkWidget *table7;
  GtkWidget *syncsoundcheck;
  GtkWidget *label40;
  GtkWidget *syncsoundfileentry;
  GtkWidget *syncsoundentry;
  GtkWidget *label41;
  GtkWidget *hbox13;
  GtkWidget *label42;
  GtkWidget *table8;
  GtkWidget *label43;
  GtkWidget *welcomesoundcheck;
  GtkWidget *welcomesoundfileentry;
  GtkWidget *welcomesoundentry;
  GtkWidget *label14;
  GtkWidget *hbuttonbox1;
  GtkWidget *syncpaircancel;
  GtkWidget *syncpairok;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  syncpairwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width (GTK_CONTAINER (syncpairwin), 12);
  gtk_window_set_title (GTK_WINDOW (syncpairwin), "Synchronization Pair");

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

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

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

  label32 = gtk_label_new_with_mnemonic ("<span weight='bold'>Synchronization plugins:</span>");
  gtk_widget_show (label32);
  gtk_box_pack_start (GTK_BOX (vbox11), label32, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label32), TRUE);
  gtk_label_set_justify (GTK_LABEL (label32), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label32), 0, 0.5);

  hbox7 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox7);
  gtk_box_pack_start (GTK_BOX (vbox11), hbox7, FALSE, TRUE, 0);

  label33 = gtk_label_new ("    ");
  gtk_widget_show (label33);
  gtk_box_pack_start (GTK_BOX (hbox7), label33, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label33), GTK_JUSTIFY_LEFT);

  table6 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table6);
  gtk_box_pack_start (GTK_BOX (hbox7), table6, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table6), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table6), 12);

  vbox12 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox12);
  gtk_table_attach (GTK_TABLE (table6), vbox12, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  hbox8 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox8);
  gtk_box_pack_start (GTK_BOX (vbox12), hbox8, FALSE, TRUE, 0);

  localoption = gtk_option_menu_new ();
  gtk_widget_show (localoption);
  gtk_box_pack_start (GTK_BOX (hbox8), localoption, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, localoption, "Select database client to be used in one end of the synchronization.", NULL);

  convertwidget1 = gtk_menu_new ();
  gnome_app_fill_menu (GTK_MENU_SHELL (convertwidget1), convertwidget1_uiinfo,
                       NULL, FALSE, 0);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (localoption), convertwidget1);

  localedit = gtk_button_new_with_mnemonic ("Options...");
  gtk_widget_show (localedit);
  gtk_box_pack_start (GTK_BOX (hbox8), localedit, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, localedit, "Edit options for the local database client.", NULL);

  localinfolabel = gtk_label_new ("Lots of information on the local\nchosen  plugin");
  gtk_widget_show (localinfolabel);
  gtk_box_pack_start (GTK_BOX (vbox12), localinfolabel, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (localinfolabel), GTK_JUSTIFY_LEFT);
  gtk_label_set_line_wrap (GTK_LABEL (localinfolabel), TRUE);
  gtk_misc_set_alignment (GTK_MISC (localinfolabel), 0, 0.5);

  label7 = gtk_label_new_with_mnemonic ("_First plugin:");
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table6), label7, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0);

  vbox13 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox13);
  gtk_table_attach (GTK_TABLE (table6), vbox13, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  hbox9 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox9);
  gtk_box_pack_start (GTK_BOX (vbox13), hbox9, FALSE, TRUE, 0);

  remoteoption = gtk_option_menu_new ();
  gtk_widget_show (remoteoption);
  gtk_box_pack_start (GTK_BOX (hbox9), remoteoption, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, remoteoption, "Select the database client to be used in the other end of the synchronization.", NULL);

  convertwidget2 = gtk_menu_new ();
  gnome_app_fill_menu (GTK_MENU_SHELL (convertwidget2), convertwidget2_uiinfo,
                       NULL, FALSE, 0);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (remoteoption), convertwidget2);

  remoteedit = gtk_button_new_with_mnemonic ("Options...");
  gtk_widget_show (remoteedit);
  gtk_box_pack_start (GTK_BOX (hbox9), remoteedit, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, remoteedit, "Edit options for the remote database client.", NULL);

  remoteinfolabel = gtk_label_new ("Remote plugin information");
  gtk_widget_show (remoteinfolabel);
  gtk_box_pack_start (GTK_BOX (vbox13), remoteinfolabel, FALSE, FALSE, 0);
  gtk_label_set_line_wrap (GTK_LABEL (remoteinfolabel), TRUE);
  gtk_misc_set_alignment (GTK_MISC (remoteinfolabel), 0, 0.5);

  label23 = gtk_label_new_with_mnemonic ("Display _Name:");
  gtk_widget_show (label23);
  gtk_table_attach (GTK_TABLE (table6), label23, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label23), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label23), 0, 0.5);

  label8 = gtk_label_new_with_mnemonic ("_Second plugin:");
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table6), label8, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0);

  displaynameentry = gtk_entry_new ();
  gtk_widget_show (displaynameentry);
  gtk_table_attach (GTK_TABLE (table6), displaynameentry, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, displaynameentry, "Optionally, give this synchronization pair a name which will be displayed in the list.", NULL);

  label34 = gtk_label_new_with_mnemonic ("<span weight='bold'>Data types to synchronize:</span>");
  gtk_widget_show (label34);
  gtk_box_pack_start (GTK_BOX (vbox11), label34, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label34), TRUE);
  gtk_label_set_justify (GTK_LABEL (label34), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label34), 0, 0.5);

  hbox10 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox10);
  gtk_box_pack_start (GTK_BOX (vbox11), hbox10, FALSE, TRUE, 0);

  label35 = gtk_label_new ("    ");
  gtk_widget_show (label35);
  gtk_box_pack_start (GTK_BOX (hbox10), label35, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label35), GTK_JUSTIFY_LEFT);

  table3 = gtk_table_new (4, 1, FALSE);
  gtk_widget_show (table3);
  gtk_box_pack_start (GTK_BOX (hbox10), table3, TRUE, TRUE, 0);

  calendarcheck = gtk_check_button_new_with_mnemonic ("Ca_lendar (Events)");
  gtk_table_attach (GTK_TABLE (table3), calendarcheck, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  addressbookcheck = gtk_check_button_new_with_mnemonic ("A_ddressbook (Contacts)");
  gtk_table_attach (GTK_TABLE (table3), addressbookcheck, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  todocheck = gtk_check_button_new_with_mnemonic ("_Tasks (ToDo)");
  gtk_table_attach (GTK_TABLE (table3), todocheck, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  nocommontypelabel = gtk_label_new ("Plugins have nothing in common");
  gtk_table_attach (GTK_TABLE (table3), nocommontypelabel, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (nocommontypelabel), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (nocommontypelabel), 0, 4);

  label12 = gtk_label_new ("Plugins");
  gtk_widget_show (label12);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label12);

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

  label36 = gtk_label_new_with_mnemonic ("<span weight='bold'>Synchronize intervals:</span>");
  gtk_widget_show (label36);
  gtk_box_pack_start (GTK_BOX (vbox14), label36, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label36), TRUE);
  gtk_label_set_justify (GTK_LABEL (label36), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label36), 0, 0.5);

  hbox11 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox11);
  gtk_box_pack_start (GTK_BOX (vbox14), hbox11, FALSE, TRUE, 0);

  label37 = gtk_label_new ("    ");
  gtk_widget_show (label37);
  gtk_box_pack_start (GTK_BOX (hbox11), label37, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label37), GTK_JUSTIFY_LEFT);

  table1 = gtk_table_new (3, 3, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (hbox11), table1, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table1), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table1), 12);

  label1 = gtk_label_new_with_mnemonic ("_Automatically synchronize every:");
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  label3 = gtk_label_new_with_mnemonic ("_Dwell time after change detected:");
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);

  dwellscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 0, 0, 0)));
  gtk_widget_show (dwellscale);
  gtk_table_attach (GTK_TABLE (table1), dwellscale, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_scale_set_draw_value (GTK_SCALE (dwellscale), FALSE);
  gtk_scale_set_value_pos (GTK_SCALE (dwellscale), GTK_POS_RIGHT);

  dwelllabel = gtk_label_new ("20 sec");
  gtk_widget_show (dwelllabel);
  gtk_table_attach (GTK_TABLE (table1), dwelllabel, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (dwelllabel), 0, 0.5);

  label5 = gtk_label_new_with_mnemonic ("_Retry interval after connect failed:");
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  reconnintervalscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 0, 0, 0)));
  gtk_widget_show (reconnintervalscale);
  gtk_table_attach (GTK_TABLE (table1), reconnintervalscale, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_scale_set_draw_value (GTK_SCALE (reconnintervalscale), FALSE);
  gtk_scale_set_value_pos (GTK_SCALE (reconnintervalscale), GTK_POS_RIGHT);

  reconnintervallabel = gtk_label_new ("10 sec");
  gtk_widget_show (reconnintervallabel);
  gtk_table_attach (GTK_TABLE (table1), reconnintervallabel, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (reconnintervallabel), 0, 0.5);

  syncintervalscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 0, 0, 0, 0)));
  gtk_widget_show (syncintervalscale);
  gtk_table_attach (GTK_TABLE (table1), syncintervalscale, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (syncintervalscale, 150, 20);
  gtk_scale_set_draw_value (GTK_SCALE (syncintervalscale), FALSE);
  gtk_scale_set_value_pos (GTK_SCALE (syncintervalscale), GTK_POS_LEFT);

  syncintervallabel = gtk_label_new ("30 mins");
  gtk_widget_show (syncintervallabel);
  gtk_table_attach (GTK_TABLE (table1), syncintervallabel, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_set_size_request (syncintervallabel, 80, 15);
  gtk_misc_set_alignment (GTK_MISC (syncintervallabel), 0, 0.5);

  label53 = gtk_label_new_with_mnemonic ("<span weight='bold'>Conflicts and near duplicates:</span>");
  gtk_widget_show (label53);
  gtk_box_pack_start (GTK_BOX (vbox14), label53, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label53), TRUE);
  gtk_label_set_justify (GTK_LABEL (label53), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label53), 0, 0.5);

  hbox22 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox22);
  gtk_box_pack_start (GTK_BOX (vbox14), hbox22, TRUE, TRUE, 0);

  label54 = gtk_label_new ("    ");
  gtk_widget_show (label54);
  gtk_box_pack_start (GTK_BOX (hbox22), label54, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label54), GTK_JUSTIFY_LEFT);

  vbox20 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox20);
  gtk_box_pack_start (GTK_BOX (hbox22), vbox20, TRUE, TRUE, 0);

  duplicatemanualradio = gtk_radio_button_new_with_mnemonic (NULL, "Resolve it _manually");
  gtk_widget_show (duplicatemanualradio);
  gtk_box_pack_start (GTK_BOX (vbox20), duplicatemanualradio, FALSE, FALSE, 0);
  gtk_button_set_relief (GTK_BUTTON (duplicatemanualradio), GTK_RELIEF_NONE);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (duplicatemanualradio), duplicatemanualradio_group);
  duplicatemanualradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (duplicatemanualradio));
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplicatemanualradio), TRUE);

  duplicatefirstradio = gtk_radio_button_new_with_mnemonic (NULL, "Always use the entry from the _first plugin");
  gtk_widget_show (duplicatefirstradio);
  gtk_box_pack_start (GTK_BOX (vbox20), duplicatefirstradio, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (duplicatefirstradio), duplicatemanualradio_group);
  duplicatemanualradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (duplicatefirstradio));

  duplicatesecondradio = gtk_radio_button_new_with_mnemonic (NULL, "Always use the entry from the _second plugin");
  gtk_widget_show (duplicatesecondradio);
  gtk_box_pack_start (GTK_BOX (vbox20), duplicatesecondradio, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (duplicatesecondradio), duplicatemanualradio_group);
  duplicatemanualradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (duplicatesecondradio));

  duplicatebothradio = gtk_radio_button_new_with_mnemonic (NULL, "Always put both entries on _both sides");
  gtk_widget_show (duplicatebothradio);
  gtk_box_pack_start (GTK_BOX (vbox20), duplicatebothradio, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (duplicatebothradio), duplicatemanualradio_group);
  duplicatemanualradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (duplicatebothradio));

  label13 = gtk_label_new ("Synchronize options");
  gtk_widget_show (label13);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label13);

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

  label24 = gtk_label_new_with_mnemonic ("<span weight='bold'>Filter rules:</span>");
  gtk_widget_show (label24);
  gtk_box_pack_start (GTK_BOX (vbox7), label24, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label24), TRUE);
  gtk_label_set_justify (GTK_LABEL (label24), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5);

  hbox6 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox6);
  gtk_box_pack_start (GTK_BOX (vbox7), hbox6, FALSE, TRUE, 0);

  label25 = gtk_label_new ("    ");
  gtk_widget_show (label25);
  gtk_box_pack_start (GTK_BOX (hbox6), label25, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_LEFT);

  table5 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table5);
  gtk_box_pack_start (GTK_BOX (hbox6), table5, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table5), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table5), 12);

  label30 = gtk_label_new_with_mnemonic ("For _data of type:");
  gtk_widget_show (label30);
  gtk_table_attach (GTK_TABLE (table5), label30, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label30), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5);

  filtertypemenu = gtk_option_menu_new ();
  gtk_widget_show (filtertypemenu);
  gtk_table_attach (GTK_TABLE (table5), filtertypemenu, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  convertwidget3 = gtk_menu_new ();
  gnome_app_fill_menu (GTK_MENU_SHELL (convertwidget3), convertwidget3_uiinfo,
                       NULL, FALSE, 0);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (filtertypemenu), convertwidget3);

  vbox10 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox10);
  gtk_table_attach (GTK_TABLE (table5), vbox10, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  hbox3 = gtk_hbox_new (FALSE, 6);
  gtk_widget_show (hbox3);
  gtk_box_pack_start (GTK_BOX (vbox10), hbox3, TRUE, TRUE, 0);

  filterrulemenu = gtk_option_menu_new ();
  gtk_widget_show (filterrulemenu);
  gtk_box_pack_start (GTK_BOX (hbox3), filterrulemenu, FALSE, FALSE, 0);

  convertwidget5 = gtk_menu_new ();
  gnome_app_fill_menu (GTK_MENU_SHELL (convertwidget5), convertwidget5_uiinfo,
                       NULL, FALSE, 0);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (filterrulemenu), convertwidget5);

  filterfieldmenu = gtk_option_menu_new ();
  gtk_widget_show (filterfieldmenu);
  gtk_box_pack_start (GTK_BOX (hbox3), filterfieldmenu, FALSE, FALSE, 0);

  convertwidget9 = gtk_menu_new ();
  gnome_app_fill_menu (GTK_MENU_SHELL (convertwidget9), convertwidget9_uiinfo,
                       NULL, FALSE, 0);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (filterfieldmenu), convertwidget9);

  label19 = gtk_label_new ("contains");
  gtk_widget_show (label19);
  gtk_box_pack_start (GTK_BOX (hbox3), label19, FALSE, FALSE, 0);

  filterdataentry = gtk_entry_new ();
  gtk_widget_show (filterdataentry);
  gtk_box_pack_start (GTK_BOX (vbox10), filterdataentry, FALSE, FALSE, 0);

  label31 = gtk_label_new_with_mnemonic ("use filter rule:");
  gtk_widget_show (label31);
  gtk_table_attach (GTK_TABLE (table5), label31, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label31), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label31), 0, 0);

  vbox8 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox8);
  gtk_table_attach (GTK_TABLE (table5), vbox8, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  dirlocalremoteradio = gtk_radio_button_new_with_mnemonic (NULL, "From first to second plugin");
  gtk_widget_show (dirlocalremoteradio);
  gtk_box_pack_start (GTK_BOX (vbox8), dirlocalremoteradio, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (dirlocalremoteradio), dirlocalremoteradio_group);
  dirlocalremoteradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (dirlocalremoteradio));

  dirremotelocalradio = gtk_radio_button_new_with_mnemonic (NULL, "From second to first plugin");
  gtk_widget_show (dirremotelocalradio);
  gtk_box_pack_start (GTK_BOX (vbox8), dirremotelocalradio, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (dirremotelocalradio), dirlocalremoteradio_group);
  dirlocalremoteradio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (dirremotelocalradio));

  label44 = gtk_label_new ("and in direction:");
  gtk_widget_show (label44);
  gtk_table_attach (GTK_TABLE (table5), label44, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label44), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label44), 0, 0);

  label16 = gtk_label_new ("Filters");
  gtk_widget_show (label16);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label16);

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

  label38 = gtk_label_new_with_mnemonic ("<span weight='bold'>After synchronization of data:</span>");
  gtk_widget_show (label38);
  gtk_box_pack_start (GTK_BOX (vbox15), label38, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label38), TRUE);
  gtk_label_set_justify (GTK_LABEL (label38), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label38), 0, 0.5);

  hbox12 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox12);
  gtk_box_pack_start (GTK_BOX (vbox15), hbox12, FALSE, TRUE, 0);

  label39 = gtk_label_new ("    ");
  gtk_widget_show (label39);
  gtk_box_pack_start (GTK_BOX (hbox12), label39, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label39), GTK_JUSTIFY_LEFT);

  table7 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table7);
  gtk_box_pack_start (GTK_BOX (hbox12), table7, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table7), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table7), 12);

  syncsoundcheck = gtk_check_button_new_with_mnemonic ("_Play sound");
  gtk_widget_show (syncsoundcheck);
  gtk_table_attach (GTK_TABLE (table7), syncsoundcheck, 0, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, syncsoundcheck, "Play a sound when some data has been synchronized.", NULL);

  label40 = gtk_label_new_with_mnemonic ("_Sound file:");
  gtk_widget_show (label40);
  gtk_table_attach (GTK_TABLE (table7), label40, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label40), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label40), 0, 0.5);

  syncsoundfileentry = gnome_file_entry_new (NULL, "Select a sound file");
  gtk_widget_show (syncsoundfileentry);
  gtk_table_attach (GTK_TABLE (table7), syncsoundfileentry, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (syncsoundfileentry), TRUE);

  syncsoundentry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (syncsoundfileentry));
  gtk_widget_show (syncsoundentry);

  label41 = gtk_label_new_with_mnemonic ("<span weight='bold'>When connection succeeds after failures:</span>");
  gtk_widget_show (label41);
  gtk_box_pack_start (GTK_BOX (vbox15), label41, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label41), TRUE);
  gtk_label_set_justify (GTK_LABEL (label41), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label41), 0, 0.5);

  hbox13 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox13);
  gtk_box_pack_start (GTK_BOX (vbox15), hbox13, FALSE, TRUE, 0);

  label42 = gtk_label_new ("    ");
  gtk_widget_show (label42);
  gtk_box_pack_start (GTK_BOX (hbox13), label42, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label42), GTK_JUSTIFY_LEFT);

  table8 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table8);
  gtk_box_pack_start (GTK_BOX (hbox13), table8, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table8), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table8), 12);

  label43 = gtk_label_new_with_mnemonic ("Sound _file:");
  gtk_widget_show (label43);
  gtk_table_attach (GTK_TABLE (table8), label43, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label43), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label43), 0, 0.5);

  welcomesoundcheck = gtk_check_button_new_with_mnemonic ("P_lay sound");
  gtk_widget_show (welcomesoundcheck);
  gtk_table_attach (GTK_TABLE (table8), welcomesoundcheck, 0, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, welcomesoundcheck, "Play a sound when e.g. a mobile device comes in proximity of MultiSync again after it has been gone for a while. Sound could be \"Welcome, master!\", for example.", NULL);

  welcomesoundfileentry = gnome_file_entry_new (NULL, NULL);
  gtk_widget_show (welcomesoundfileentry);
  gtk_table_attach (GTK_TABLE (table8), welcomesoundfileentry, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (welcomesoundfileentry), TRUE);

  welcomesoundentry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (welcomesoundfileentry));
  gtk_widget_show (welcomesoundentry);

  label14 = gtk_label_new ("Sounds");
  gtk_widget_show (label14);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label14);

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

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

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

  g_signal_connect ((gpointer) syncpairwin, "delete_event",
                    G_CALLBACK (on_syncpairwin_delete_event),
                    NULL);
  g_signal_connect ((gpointer) localedit, "clicked",
                    G_CALLBACK (on_localedit_clicked),
                    NULL);
  g_signal_connect ((gpointer) remoteedit, "clicked",
                    G_CALLBACK (on_remoteedit_clicked),
                    NULL);
  g_signal_connect ((gpointer) calendarcheck, "toggled",
                    G_CALLBACK (on_calendarcheck_toggled),
                    NULL);
  g_signal_connect ((gpointer) addressbookcheck, "toggled",
                    G_CALLBACK (on_addressbookcheck_toggled),
                    NULL);
  g_signal_connect ((gpointer) todocheck, "toggled",
                    G_CALLBACK (on_todocheck_toggled),
                    NULL);
  g_signal_connect ((gpointer) filterdataentry, "changed",
                    G_CALLBACK (on_filterdataentry_changed),
                    NULL);
  g_signal_connect ((gpointer) dirlocalremoteradio, "toggled",
                    G_CALLBACK (on_dirlocalremoteradio_toggled),
                    NULL);
  g_signal_connect ((gpointer) dirremotelocalradio, "toggled",
                    G_CALLBACK (on_dirremotelocalradio_toggled),
                    NULL);
  g_signal_connect ((gpointer) syncpaircancel, "clicked",
                    G_CALLBACK (on_syncpaircancel_clicked),
                    NULL);
  g_signal_connect ((gpointer) syncpairok, "clicked",
                    G_CALLBACK (on_syncpairok_clicked),
                    NULL);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label7), localoption);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label23), displaynameentry);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label8), remoteoption);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label1), syncintervalscale);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label3), dwellscale);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label5), reconnintervalscale);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label30), filtertypemenu);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label40), syncsoundentry);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label43), welcomesoundentry);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (syncpairwin, syncpairwin, "syncpairwin");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (syncpairwin, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox11, "vbox11");
  GLADE_HOOKUP_OBJECT (syncpairwin, label32, "label32");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox7, "hbox7");
  GLADE_HOOKUP_OBJECT (syncpairwin, label33, "label33");
  GLADE_HOOKUP_OBJECT (syncpairwin, table6, "table6");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox12, "vbox12");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox8, "hbox8");
  GLADE_HOOKUP_OBJECT (syncpairwin, localoption, "localoption");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget1, "convertwidget1");
  GLADE_HOOKUP_OBJECT (syncpairwin, localedit, "localedit");
  GLADE_HOOKUP_OBJECT (syncpairwin, localinfolabel, "localinfolabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, label7, "label7");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox13, "vbox13");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox9, "hbox9");
  GLADE_HOOKUP_OBJECT (syncpairwin, remoteoption, "remoteoption");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget2, "convertwidget2");
  GLADE_HOOKUP_OBJECT (syncpairwin, remoteedit, "remoteedit");
  GLADE_HOOKUP_OBJECT (syncpairwin, remoteinfolabel, "remoteinfolabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, label23, "label23");
  GLADE_HOOKUP_OBJECT (syncpairwin, label8, "label8");
  GLADE_HOOKUP_OBJECT (syncpairwin, displaynameentry, "displaynameentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, label34, "label34");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox10, "hbox10");
  GLADE_HOOKUP_OBJECT (syncpairwin, label35, "label35");
  GLADE_HOOKUP_OBJECT (syncpairwin, table3, "table3");
  GLADE_HOOKUP_OBJECT (syncpairwin, calendarcheck, "calendarcheck");
  GLADE_HOOKUP_OBJECT (syncpairwin, addressbookcheck, "addressbookcheck");
  GLADE_HOOKUP_OBJECT (syncpairwin, todocheck, "todocheck");
  GLADE_HOOKUP_OBJECT (syncpairwin, nocommontypelabel, "nocommontypelabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, label12, "label12");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox14, "vbox14");
  GLADE_HOOKUP_OBJECT (syncpairwin, label36, "label36");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (syncpairwin, label37, "label37");
  GLADE_HOOKUP_OBJECT (syncpairwin, table1, "table1");
  GLADE_HOOKUP_OBJECT (syncpairwin, label1, "label1");
  GLADE_HOOKUP_OBJECT (syncpairwin, label3, "label3");
  GLADE_HOOKUP_OBJECT (syncpairwin, dwellscale, "dwellscale");
  GLADE_HOOKUP_OBJECT (syncpairwin, dwelllabel, "dwelllabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, label5, "label5");
  GLADE_HOOKUP_OBJECT (syncpairwin, reconnintervalscale, "reconnintervalscale");
  GLADE_HOOKUP_OBJECT (syncpairwin, reconnintervallabel, "reconnintervallabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncintervalscale, "syncintervalscale");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncintervallabel, "syncintervallabel");
  GLADE_HOOKUP_OBJECT (syncpairwin, label53, "label53");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox22, "hbox22");
  GLADE_HOOKUP_OBJECT (syncpairwin, label54, "label54");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox20, "vbox20");
  GLADE_HOOKUP_OBJECT (syncpairwin, duplicatemanualradio, "duplicatemanualradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, duplicatefirstradio, "duplicatefirstradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, duplicatesecondradio, "duplicatesecondradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, duplicatebothradio, "duplicatebothradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, label13, "label13");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox7, "vbox7");
  GLADE_HOOKUP_OBJECT (syncpairwin, label24, "label24");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (syncpairwin, label25, "label25");
  GLADE_HOOKUP_OBJECT (syncpairwin, table5, "table5");
  GLADE_HOOKUP_OBJECT (syncpairwin, label30, "label30");
  GLADE_HOOKUP_OBJECT (syncpairwin, filtertypemenu, "filtertypemenu");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget3, "convertwidget3");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget3_uiinfo[0].widget, "convertwidget4");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox10, "vbox10");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (syncpairwin, filterrulemenu, "filterrulemenu");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget5, "convertwidget5");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget5_uiinfo[0].widget, "convertwidget6");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget5_uiinfo[1].widget, "convertwidget7");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget5_uiinfo[2].widget, "convertwidget8");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget5_uiinfo[3].widget, "item1");
  GLADE_HOOKUP_OBJECT (syncpairwin, filterfieldmenu, "filterfieldmenu");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget9, "convertwidget9");
  GLADE_HOOKUP_OBJECT (syncpairwin, convertwidget9_uiinfo[0].widget, "convertwidget10");
  GLADE_HOOKUP_OBJECT (syncpairwin, label19, "label19");
  GLADE_HOOKUP_OBJECT (syncpairwin, filterdataentry, "filterdataentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, label31, "label31");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox8, "vbox8");
  GLADE_HOOKUP_OBJECT (syncpairwin, dirlocalremoteradio, "dirlocalremoteradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, dirremotelocalradio, "dirremotelocalradio");
  GLADE_HOOKUP_OBJECT (syncpairwin, label44, "label44");
  GLADE_HOOKUP_OBJECT (syncpairwin, label16, "label16");
  GLADE_HOOKUP_OBJECT (syncpairwin, vbox15, "vbox15");
  GLADE_HOOKUP_OBJECT (syncpairwin, label38, "label38");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox12, "hbox12");
  GLADE_HOOKUP_OBJECT (syncpairwin, label39, "label39");
  GLADE_HOOKUP_OBJECT (syncpairwin, table7, "table7");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncsoundcheck, "syncsoundcheck");
  GLADE_HOOKUP_OBJECT (syncpairwin, label40, "label40");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncsoundfileentry, "syncsoundfileentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncsoundentry, "syncsoundentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, label41, "label41");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (syncpairwin, label42, "label42");
  GLADE_HOOKUP_OBJECT (syncpairwin, table8, "table8");
  GLADE_HOOKUP_OBJECT (syncpairwin, label43, "label43");
  GLADE_HOOKUP_OBJECT (syncpairwin, welcomesoundcheck, "welcomesoundcheck");
  GLADE_HOOKUP_OBJECT (syncpairwin, welcomesoundfileentry, "welcomesoundfileentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, welcomesoundentry, "welcomesoundentry");
  GLADE_HOOKUP_OBJECT (syncpairwin, label14, "label14");
  GLADE_HOOKUP_OBJECT (syncpairwin, hbuttonbox1, "hbuttonbox1");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncpaircancel, "syncpaircancel");
  GLADE_HOOKUP_OBJECT (syncpairwin, syncpairok, "syncpairok");
  GLADE_HOOKUP_OBJECT_NO_REF (syncpairwin, tooltips, "tooltips");

  return syncpairwin;
}

GtkWidget*
create_aboutdialog (void)
{
  const gchar *authors[] = {
    "Bo Lincoln <lincoln@lysator.liu.se>",
    "Tom Foottit <tfoottit@bridgewatersystems.com>",
    "Armin Bauer <armin.bauer@desscon.com>",
    "Contributions by (among others):",
    "Christoph Lukas <christoph.lukas@gmx.net>",
    "Tobias Karlsson <tobbe@island.liu.se>",
    "Bj\303\266rn Torkelsson <torkel@acc.umu.se>",
    "Eike Lang <mail@elang.de>",
    NULL
  };
  const gchar *documenters[] = {
    "David Zakar <david@zakar.com>",
    NULL
  };
  gchar *translators = NULL;
  GdkPixbuf *aboutdialog_logo_pixbuf;
  GtkWidget *aboutdialog;
  GdkPixbuf *aboutdialog_icon_pixbuf;

  aboutdialog_logo_pixbuf = create_pixbuf ("multisync/multisync.png");
  aboutdialog = gnome_about_new ("Multisync", VERSION,
                        "Copyright (c) 2002-2003 Bo Lincoln",
                        "Multisync is a synchronization program for personal information such as calendars, addressbooks etc.",
                        authors,
                        documenters,
                        translators,
                        aboutdialog_logo_pixbuf);
  gtk_container_set_border_width (GTK_CONTAINER (aboutdialog), 5);
  aboutdialog_icon_pixbuf = create_pixbuf ("multisync/multisync_small.png");
  if (aboutdialog_icon_pixbuf)
    {
      gtk_window_set_icon (GTK_WINDOW (aboutdialog), aboutdialog_icon_pixbuf);
      gdk_pixbuf_unref (aboutdialog_icon_pixbuf);
    }

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (aboutdialog, aboutdialog, "aboutdialog");

  return aboutdialog;
}

GtkWidget*
create_logwindow (void)
{
  GtkWidget *logwindow;
  GtkWidget *vbox6;
  GtkWidget *scrolledwindow2;
  GtkWidget *logtreeview;
  GtkWidget *hseparator1;
  GtkWidget *hbuttonbox3;
  GtkWidget *logclearbutton;
  GtkWidget *logokbutton;

  logwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width (GTK_CONTAINER (logwindow), 12);
  gtk_window_set_title (GTK_WINDOW (logwindow), "Synchronization pair log");

  vbox6 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox6);
  gtk_container_add (GTK_CONTAINER (logwindow), vbox6);

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

  logtreeview = gtk_tree_view_new ();
  gtk_widget_show (logtreeview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), logtreeview);
  gtk_widget_set_size_request (logtreeview, 500, 150);

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

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

  logclearbutton = gtk_button_new_with_mnemonic ("Clear log");
  gtk_widget_show (logclearbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox3), logclearbutton);
  GTK_WIDGET_SET_FLAGS (logclearbutton, GTK_CAN_DEFAULT);

  logokbutton = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (logokbutton);
  gtk_container_add (GTK_CONTAINER (hbuttonbox3), logokbutton);
  GTK_WIDGET_SET_FLAGS (logokbutton, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) logwindow, "delete_event",
                    G_CALLBACK (on_logwindow_delete_event),
                    NULL);
  g_signal_connect ((gpointer) logclearbutton, "clicked",
                    G_CALLBACK (on_logclearbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) logokbutton, "clicked",
                    G_CALLBACK (on_logokbutton_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (logwindow, logwindow, "logwindow");
  GLADE_HOOKUP_OBJECT (logwindow, vbox6, "vbox6");
  GLADE_HOOKUP_OBJECT (logwindow, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (logwindow, logtreeview, "logtreeview");
  GLADE_HOOKUP_OBJECT (logwindow, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (logwindow, hbuttonbox3, "hbuttonbox3");
  GLADE_HOOKUP_OBJECT (logwindow, logclearbutton, "logclearbutton");
  GLADE_HOOKUP_OBJECT (logwindow, logokbutton, "logokbutton");

  return logwindow;
}

static GnomeUIInfo menuitem1_menu_uiinfo[] =
{
  GNOMEUIINFO_MENU_NEW_ITEM ("_New sync pair", "Create a new synchronization pair", on_newpairmenu_activate, NULL),
  GNOMEUIINFO_SEPARATOR,
  {
    GNOME_APP_UI_ITEM, "_Hide this window",
    "Hide this window - run MultiSync again to bring it back",
    (gpointer) on_hidewinmenu_activate, NULL, NULL,
    GNOME_APP_PIXMAP_STOCK, "gtk-close",
    GDK_Z, (GdkModifierType) GDK_CONTROL_MASK, NULL
  },
  GNOMEUIINFO_SEPARATOR,
  GNOMEUIINFO_MENU_EXIT_ITEM (on_exit1_activate, NULL),
  GNOMEUIINFO_END
};

static GnomeUIInfo menuitem5_menu_uiinfo[] =
{
  {
    GNOME_APP_UI_ITEM, "_Edit synchronization pair...",
    "Edit the options of the selected synchronization pair",
    (gpointer) on_editpairitem_activate, NULL, NULL,
    GNOME_APP_PIXMAP_STOCK, "gtk-properties",
    GDK_E, (GdkModifierType) GDK_CONTROL_MASK, NULL
  },
  {
    GNOME_APP_UI_ITEM, "_Delete synchronization pair...",
    "Delete the selected synchronization pair",
    (gpointer) on_deletepairitem_activate, NULL, NULL,
    GNOME_APP_PIXMAP_STOCK, "gtk-delete",
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

static GnomeUIInfo item3_menu_uiinfo[] =
{
  {
    GNOME_APP_UI_TOGGLEITEM, "Show notification tray icon",
    "Show an icon in the panel notification area.",
    (gpointer) on_showtrayitem_activate, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_TOGGLEITEM, "Start hidden",
    "Start MultiSync without a GUI. Run another MultiSync to bring GUI up again.",
    (gpointer) on_starthiddenitem_activate, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_TOGGLEITEM, "Show \"Resync\" button",
    "Show an experimental \"Re-synchronize\" button.",
    (gpointer) on_showresyncitem_activate, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

static GnomeUIInfo menuitem8_menu_uiinfo[] =
{
  GNOMEUIINFO_MENU_ABOUT_ITEM (on_aboutmenu_activate, NULL),
  GNOMEUIINFO_END
};

static GnomeUIInfo menubar1_uiinfo[] =
{
  {
    GNOME_APP_UI_SUBTREE, "_File",
    NULL,
    menuitem1_menu_uiinfo, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_SUBTREE, "_Edit",
    NULL,
    menuitem5_menu_uiinfo, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_SUBTREE, "_Options",
    NULL,
    item3_menu_uiinfo, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  {
    GNOME_APP_UI_SUBTREE, "_Help",
    NULL,
    menuitem8_menu_uiinfo, NULL, NULL,
    GNOME_APP_PIXMAP_NONE, NULL,
    0, (GdkModifierType) 0, NULL
  },
  GNOMEUIINFO_END
};

GtkWidget*
create_mainwindow (void)
{
  GtkWidget *mainwindow;
  GtkWidget *dock1;
  GtkWidget *toolbar2;
  GtkWidget *tmp_toolbar_icon;
  GtkWidget *newbutton;
  GtkWidget *editbutton;
  GtkWidget *deletebutton;
  GtkWidget *logbutton;
  GtkWidget *syncnowbutton;
  GtkWidget *resyncnowbutton;
  GtkWidget *vbox9;
  GtkWidget *hbox14;
  GtkWidget *scrolledwindow3;
  GtkWidget *syncpairlist;
  GtkWidget *appbar;

  mainwindow = gnome_app_new ("Multisync", "Multisync");

  dock1 = GNOME_APP (mainwindow)->dock;
  gtk_widget_show (dock1);

  gnome_app_create_menus (GNOME_APP (mainwindow), menubar1_uiinfo);

  toolbar2 = gtk_toolbar_new ();
  gtk_widget_show (toolbar2);
  gnome_app_add_toolbar (GNOME_APP (mainwindow), GTK_TOOLBAR (toolbar2), "toolbar2",
                                BONOBO_DOCK_ITEM_BEH_EXCLUSIVE,
                                BONOBO_DOCK_TOP, 1, 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (toolbar2), 2);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar2), GTK_TOOLBAR_BOTH);

  tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-new", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar2)));
  newbutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "New...",
                                "Create a new synchronization pair.", NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);
  gtk_widget_show (newbutton);

  tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-properties", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar2)));
  editbutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Edit...",
                                "Edit the selected synchronization pair.", NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);
  gtk_widget_show (editbutton);

  tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-delete", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar2)));
  deletebutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Delete...",
                                "Delete the selected synchronization pair.", NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);
  gtk_widget_show (deletebutton);

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar2));

  tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-find", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar2)));
  logbutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Log...",
                                "Show the log for the selected synchronization pair.", NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);
  gtk_widget_show (logbutton);

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar2));

  tmp_toolbar_icon = create_pixmap (mainwindow, "multisync/multisync_small.png");
  syncnowbutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Sync",
                                "Synchronize the selected pair immediately.", NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);
  gtk_widget_show (syncnowbutton);

  tmp_toolbar_icon = create_pixmap (mainwindow, "multisync/multisync_small.png");
  resyncnowbutton = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                "Resync",
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar2)->children)->data))->label), TRUE);

  vbox9 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox9);
  gnome_app_set_contents (GNOME_APP (mainwindow), vbox9);
  gtk_container_set_border_width (GTK_CONTAINER (vbox9), 6);

  hbox14 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox14);
  gtk_box_pack_start (GTK_BOX (vbox9), hbox14, TRUE, TRUE, 0);

  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow3);
  gtk_box_pack_start (GTK_BOX (hbox14), scrolledwindow3, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  syncpairlist = gtk_tree_view_new ();
  gtk_widget_show (syncpairlist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow3), syncpairlist);
  gtk_widget_set_size_request (syncpairlist, 520, 100);

  appbar = gnome_appbar_new (FALSE, TRUE, GNOME_PREFERENCES_NEVER);
  gtk_widget_show (appbar);
  gnome_app_set_statusbar (GNOME_APP (mainwindow), appbar);

  g_signal_connect ((gpointer) mainwindow, "delete_event",
                    G_CALLBACK (on_mainwindow_delete_event),
                    NULL);
  g_signal_connect ((gpointer) mainwindow, "destroy",
                    G_CALLBACK (on_mainwindow_destroy),
                    NULL);
  gnome_app_install_menu_hints (GNOME_APP (mainwindow), menubar1_uiinfo);
  g_signal_connect ((gpointer) newbutton, "clicked",
                    G_CALLBACK (on_newbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) editbutton, "clicked",
                    G_CALLBACK (on_editbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) deletebutton, "clicked",
                    G_CALLBACK (on_deletebutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) logbutton, "clicked",
                    G_CALLBACK (on_logbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) syncnowbutton, "clicked",
                    G_CALLBACK (on_syncnowbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) resyncnowbutton, "clicked",
                    G_CALLBACK (on_resyncnowbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) syncpairlist, "row_activated",
                    G_CALLBACK (on_syncpairlist_row_activated),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (mainwindow, mainwindow, "mainwindow");
  GLADE_HOOKUP_OBJECT (mainwindow, dock1, "dock1");
  GLADE_HOOKUP_OBJECT (mainwindow, menubar1_uiinfo[0].widget, "menuitem1");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem1_menu_uiinfo[0].widget, "pixmapmenuitem1");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem1_menu_uiinfo[1].widget, "menuitem2");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem1_menu_uiinfo[2].widget, "menuitem3");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem1_menu_uiinfo[3].widget, "menuitem4");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem1_menu_uiinfo[4].widget, "pixmapmenuitem2");
  GLADE_HOOKUP_OBJECT (mainwindow, menubar1_uiinfo[1].widget, "menuitem5");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem5_menu_uiinfo[0].widget, "menuitem6");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem5_menu_uiinfo[1].widget, "menuitem7");
  GLADE_HOOKUP_OBJECT (mainwindow, menubar1_uiinfo[2].widget, "item3");
  GLADE_HOOKUP_OBJECT (mainwindow, item3_menu_uiinfo[0].widget, "showtrayitem");
  GLADE_HOOKUP_OBJECT (mainwindow, item3_menu_uiinfo[1].widget, "starthiddenitem");
  GLADE_HOOKUP_OBJECT (mainwindow, item3_menu_uiinfo[2].widget, "showresyncitem");
  GLADE_HOOKUP_OBJECT (mainwindow, menubar1_uiinfo[3].widget, "menuitem8");
  GLADE_HOOKUP_OBJECT (mainwindow, menuitem8_menu_uiinfo[0].widget, "pixmapmenuitem3");
  GLADE_HOOKUP_OBJECT (mainwindow, toolbar2, "toolbar2");
  GLADE_HOOKUP_OBJECT (mainwindow, newbutton, "newbutton");
  GLADE_HOOKUP_OBJECT (mainwindow, editbutton, "editbutton");
  GLADE_HOOKUP_OBJECT (mainwindow, deletebutton, "deletebutton");
  GLADE_HOOKUP_OBJECT (mainwindow, logbutton, "logbutton");
  GLADE_HOOKUP_OBJECT (mainwindow, syncnowbutton, "syncnowbutton");
  GLADE_HOOKUP_OBJECT (mainwindow, resyncnowbutton, "resyncnowbutton");
  GLADE_HOOKUP_OBJECT (mainwindow, vbox9, "vbox9");
  GLADE_HOOKUP_OBJECT (mainwindow, hbox14, "hbox14");
  GLADE_HOOKUP_OBJECT (mainwindow, scrolledwindow3, "scrolledwindow3");
  GLADE_HOOKUP_OBJECT (mainwindow, syncpairlist, "syncpairlist");
  GLADE_HOOKUP_OBJECT (mainwindow, appbar, "appbar");

  return mainwindow;
}

GtkWidget*
create_duplicatewin (void)
{
  GtkWidget *duplicatewin;
  GtkWidget *vbox16;
  GtkWidget *hbox20;
  GtkWidget *image26;
  GtkWidget *vbox19;
  GtkWidget *syncpairlabel;
  GtkWidget *reasonlabel;
  GtkWidget *hbox15;
  GtkWidget *vbox17;
  GtkWidget *firstlabel;
  GtkWidget *frame1;
  GtkWidget *scrolledwindow4;
  GtkWidget *firsttextview;
  GtkWidget *usefirstbutton;
  GtkWidget *alignment1;
  GtkWidget *hbox16;
  GtkWidget *image22;
  GtkWidget *label46;
  GtkWidget *vbox18;
  GtkWidget *secondlabel;
  GtkWidget *frame2;
  GtkWidget *scrolledwindow5;
  GtkWidget *secondtextview;
  GtkWidget *usesecondbutton;
  GtkWidget *alignment2;
  GtkWidget *hbox17;
  GtkWidget *image23;
  GtkWidget *label48;
  GtkWidget *hbuttonbox4;
  GtkWidget *hbox21;
  GtkWidget *remembercheckbutton;
  GtkWidget *alignment5;
  GtkWidget *usebothbutton;
  GtkWidget *alignment6;
  GtkWidget *hbox23;
  GtkWidget *image27;
  GtkWidget *label55;

  duplicatewin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_set_border_width (GTK_CONTAINER (duplicatewin), 12);
  gtk_window_set_title (GTK_WINDOW (duplicatewin), "Possible duplicate");

  vbox16 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox16);
  gtk_container_add (GTK_CONTAINER (duplicatewin), vbox16);

  hbox20 = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (hbox20);
  gtk_box_pack_start (GTK_BOX (vbox16), hbox20, FALSE, FALSE, 0);

  image26 = gtk_image_new_from_stock ("gtk-dialog-question", GTK_ICON_SIZE_DIALOG);
  gtk_widget_show (image26);
  gtk_box_pack_start (GTK_BOX (hbox20), image26, FALSE, TRUE, 0);

  vbox19 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox19);
  gtk_box_pack_start (GTK_BOX (hbox20), vbox19, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox19), 12);

  syncpairlabel = gtk_label_new_with_mnemonic ("<span weight='bold'>Evolution - Work Sync:</span>");
  gtk_widget_show (syncpairlabel);
  gtk_box_pack_start (GTK_BOX (vbox19), syncpairlabel, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (syncpairlabel), TRUE);
  gtk_label_set_justify (GTK_LABEL (syncpairlabel), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (syncpairlabel), 0, 0.5);

  reasonlabel = gtk_label_new ("The following two entries are similar but not exactly equal.\nHow should MultiSync proceed?");
  gtk_widget_show (reasonlabel);
  gtk_box_pack_start (GTK_BOX (vbox19), reasonlabel, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (reasonlabel), GTK_JUSTIFY_LEFT);

  hbox15 = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (hbox15);
  gtk_box_pack_start (GTK_BOX (vbox16), hbox15, TRUE, TRUE, 0);

  vbox17 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox17);
  gtk_box_pack_start (GTK_BOX (hbox15), vbox17, TRUE, TRUE, 0);

  firstlabel = gtk_label_new ("Entry from Ximian Evolutino (first plugin):");
  gtk_widget_show (firstlabel);
  gtk_box_pack_start (GTK_BOX (vbox17), firstlabel, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (firstlabel), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (firstlabel), 0, 0.5);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (vbox17), frame1, TRUE, TRUE, 0);

  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow4);
  gtk_container_add (GTK_CONTAINER (frame1), scrolledwindow4);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  firsttextview = gtk_text_view_new ();
  gtk_widget_show (firsttextview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow4), firsttextview);
  gtk_widget_set_size_request (firsttextview, 105, 100);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (firsttextview), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (firsttextview), GTK_WRAP_WORD);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (firsttextview), FALSE);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (firsttextview)),
	"Name: Arne Flotto", -1);

  usefirstbutton = gtk_button_new ();
  gtk_widget_show (usefirstbutton);
  gtk_box_pack_start (GTK_BOX (vbox17), usefirstbutton, FALSE, FALSE, 0);

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

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

  image22 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image22);
  gtk_box_pack_start (GTK_BOX (hbox16), image22, FALSE, FALSE, 0);

  label46 = gtk_label_new_with_mnemonic ("Use _first entry");
  gtk_widget_show (label46);
  gtk_box_pack_start (GTK_BOX (hbox16), label46, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label46), GTK_JUSTIFY_LEFT);

  vbox18 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox18);
  gtk_box_pack_start (GTK_BOX (hbox15), vbox18, TRUE, TRUE, 0);

  secondlabel = gtk_label_new ("Entry from IrMC Mobile (second plugin):");
  gtk_widget_show (secondlabel);
  gtk_box_pack_start (GTK_BOX (vbox18), secondlabel, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (secondlabel), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (secondlabel), 0, 0.5);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (vbox18), frame2, TRUE, TRUE, 0);

  scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow5);
  gtk_container_add (GTK_CONTAINER (frame2), scrolledwindow5);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  secondtextview = gtk_text_view_new ();
  gtk_widget_show (secondtextview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow5), secondtextview);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (secondtextview), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (secondtextview), GTK_WRAP_WORD);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (secondtextview), FALSE);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (secondtextview)),
	"Name: Arne flotto", -1);

  usesecondbutton = gtk_button_new ();
  gtk_widget_show (usesecondbutton);
  gtk_box_pack_start (GTK_BOX (vbox18), usesecondbutton, FALSE, FALSE, 0);

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

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

  image23 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image23);
  gtk_box_pack_start (GTK_BOX (hbox17), image23, FALSE, FALSE, 0);

  label48 = gtk_label_new_with_mnemonic ("Use _second entry");
  gtk_widget_show (label48);
  gtk_box_pack_start (GTK_BOX (hbox17), label48, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label48), GTK_JUSTIFY_LEFT);

  hbuttonbox4 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox4);
  gtk_box_pack_start (GTK_BOX (vbox16), hbuttonbox4, FALSE, TRUE, 0);
  gtk_box_set_spacing (GTK_BOX (hbuttonbox4), 12);

  hbox21 = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (hbox21);
  gtk_box_pack_start (GTK_BOX (vbox16), hbox21, FALSE, TRUE, 0);

  remembercheckbutton = gtk_check_button_new_with_mnemonic ("_Use this decision for remaining entries");
  gtk_widget_show (remembercheckbutton);
  gtk_box_pack_start (GTK_BOX (hbox21), remembercheckbutton, FALSE, FALSE, 0);

  alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment5);
  gtk_box_pack_start (GTK_BOX (hbox21), alignment5, TRUE, TRUE, 0);

  usebothbutton = gtk_button_new ();
  gtk_widget_show (usebothbutton);
  gtk_box_pack_start (GTK_BOX (hbox21), usebothbutton, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (usebothbutton, GTK_CAN_DEFAULT);

  alignment6 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment6);
  gtk_container_add (GTK_CONTAINER (usebothbutton), alignment6);

  hbox23 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox23);
  gtk_container_add (GTK_CONTAINER (alignment6), hbox23);

  image27 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image27);
  gtk_box_pack_start (GTK_BOX (hbox23), image27, FALSE, FALSE, 0);

  label55 = gtk_label_new_with_mnemonic ("Keep _both as separate entries");
  gtk_widget_show (label55);
  gtk_box_pack_start (GTK_BOX (hbox23), label55, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label55), GTK_JUSTIFY_LEFT);

  g_signal_connect ((gpointer) duplicatewin, "delete_event",
                    G_CALLBACK (on_duplicatewin_delete),
                    NULL);
  g_signal_connect ((gpointer) usefirstbutton, "clicked",
                    G_CALLBACK (on_duplicate_usefirstbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) usesecondbutton, "clicked",
                    G_CALLBACK (on_duplicate_usesecondbutton_clicked),
                    NULL);
  g_signal_connect ((gpointer) usebothbutton, "clicked",
                    G_CALLBACK (on_duplicate_usebothbutton_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (duplicatewin, duplicatewin, "duplicatewin");
  GLADE_HOOKUP_OBJECT (duplicatewin, vbox16, "vbox16");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (duplicatewin, image26, "image26");
  GLADE_HOOKUP_OBJECT (duplicatewin, vbox19, "vbox19");
  GLADE_HOOKUP_OBJECT (duplicatewin, syncpairlabel, "syncpairlabel");
  GLADE_HOOKUP_OBJECT (duplicatewin, reasonlabel, "reasonlabel");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox15, "hbox15");
  GLADE_HOOKUP_OBJECT (duplicatewin, vbox17, "vbox17");
  GLADE_HOOKUP_OBJECT (duplicatewin, firstlabel, "firstlabel");
  GLADE_HOOKUP_OBJECT (duplicatewin, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (duplicatewin, scrolledwindow4, "scrolledwindow4");
  GLADE_HOOKUP_OBJECT (duplicatewin, firsttextview, "firsttextview");
  GLADE_HOOKUP_OBJECT (duplicatewin, usefirstbutton, "usefirstbutton");
  GLADE_HOOKUP_OBJECT (duplicatewin, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox16, "hbox16");
  GLADE_HOOKUP_OBJECT (duplicatewin, image22, "image22");
  GLADE_HOOKUP_OBJECT (duplicatewin, label46, "label46");
  GLADE_HOOKUP_OBJECT (duplicatewin, vbox18, "vbox18");
  GLADE_HOOKUP_OBJECT (duplicatewin, secondlabel, "secondlabel");
  GLADE_HOOKUP_OBJECT (duplicatewin, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (duplicatewin, scrolledwindow5, "scrolledwindow5");
  GLADE_HOOKUP_OBJECT (duplicatewin, secondtextview, "secondtextview");
  GLADE_HOOKUP_OBJECT (duplicatewin, usesecondbutton, "usesecondbutton");
  GLADE_HOOKUP_OBJECT (duplicatewin, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox17, "hbox17");
  GLADE_HOOKUP_OBJECT (duplicatewin, image23, "image23");
  GLADE_HOOKUP_OBJECT (duplicatewin, label48, "label48");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbuttonbox4, "hbuttonbox4");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox21, "hbox21");
  GLADE_HOOKUP_OBJECT (duplicatewin, remembercheckbutton, "remembercheckbutton");
  GLADE_HOOKUP_OBJECT (duplicatewin, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (duplicatewin, usebothbutton, "usebothbutton");
  GLADE_HOOKUP_OBJECT (duplicatewin, alignment6, "alignment6");
  GLADE_HOOKUP_OBJECT (duplicatewin, hbox23, "hbox23");
  GLADE_HOOKUP_OBJECT (duplicatewin, image27, "image27");
  GLADE_HOOKUP_OBJECT (duplicatewin, label55, "label55");

  return duplicatewin;
}

