/*
 * 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 <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "callbacks.h"
#include "bpm-gui.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_app (void)
{
  GtkWidget *app;
  GtkWidget *vbox5;
  GtkWidget *menubar1;
  GtkWidget *file_menu;
  GtkWidget *file_menu_menu;
  GtkWidget *quit_mitem;
  GtkWidget *action_mitem;
  GtkWidget *view1;
  GtkWidget *view1_menu;
  GtkWidget *console1;
  GtkWidget *image369;
  GtkWidget *separator1;
  GtkWidget *search_mitem;
  GtkWidget *image370;
  GtkWidget *clear_mitem;
  GtkWidget *image371;
  GtkWidget *separator2;
  GtkWidget *view_log;
  GtkWidget *image372;
  GtkWidget *separator3;
  GtkWidget *refresh_mitem;
  GtkWidget *image373;
  GtkWidget *help_menu;
  GtkWidget *help_menu_menu;
  GtkWidget *about_mitem;
  GtkWidget *image374;
  GtkWidget *handlebox1;
  GtkWidget *toolbar;
  gint tmp_toolbar_icon_size;
  GtkWidget *toolitem1;
  GtkWidget *action_tool;
  GtkWidget *action_tool_vbox;
  GtkWidget *action_tool_img;
  GtkWidget *action_tool_lbl;
  GtkWidget *toolitem6;
  GtkWidget *action_ctool;
  GtkWidget *arrow1;
  GtkWidget *tmp_image;
  GtkWidget *console_tool;
  GtkWidget *refresh_tool;
  GtkWidget *spacer_tool;
  GtkWidget *spacer_lbl;
  GtkWidget *toolitem3;
  GtkWidget *search_vbox;
  GtkWidget *search_hbox;
  GtkWidget *search_ent;
  GtkWidget *clear_tool;
  GtkWidget *image33;
  GtkWidget *button9;
  GtkWidget *alignment2;
  GtkWidget *hbox5;
  GtkWidget *image32;
  GtkWidget *label5;
  GtkWidget *status_bar;
  GtkWidget *hpaned1;
  GtkWidget *scrolledwindow1;
  GtkWidget *catlist;
  GtkWidget *label15;
  GtkWidget *vpaned1;
  GtkWidget *scrolledwindow2;
  GtkWidget *portlist;
  GtkWidget *hbox15;
  GtkWidget *label19;
  GtkWidget *portlist_sort_arr;
  GtkWidget *label17;
  GtkWidget *label18;
  GtkWidget *scrolledwindow3;
  GtkWidget *descview;
  GtkAccelGroup *accel_group;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  accel_group = gtk_accel_group_new ();

  app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (app), _("Ports Collection Browser"));
  gtk_window_set_default_size (GTK_WINDOW (app), 898, 627);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (app), TRUE);

  vbox5 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox5);
  gtk_container_add (GTK_CONTAINER (app), vbox5);

  menubar1 = gtk_menu_bar_new ();
  gtk_widget_show (menubar1);
  gtk_box_pack_start (GTK_BOX (vbox5), menubar1, FALSE, FALSE, 0);

  file_menu = gtk_menu_item_new_with_mnemonic (_("_File"));
  gtk_widget_show (file_menu);
  gtk_container_add (GTK_CONTAINER (menubar1), file_menu);

  file_menu_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_menu), file_menu_menu);

  quit_mitem = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
  gtk_widget_show (quit_mitem);
  gtk_container_add (GTK_CONTAINER (file_menu_menu), quit_mitem);

  action_mitem = gtk_menu_item_new_with_mnemonic (_("_Action"));
  gtk_widget_show (action_mitem);
  gtk_container_add (GTK_CONTAINER (menubar1), action_mitem);
  gtk_widget_set_sensitive (action_mitem, FALSE);

  view1 = gtk_menu_item_new_with_mnemonic (_("_View"));
  gtk_widget_show (view1);
  gtk_container_add (GTK_CONTAINER (menubar1), view1);

  view1_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (view1), view1_menu);

  console1 = gtk_image_menu_item_new_with_mnemonic (_("_Console"));
  gtk_widget_show (console1);
  gtk_container_add (GTK_CONTAINER (view1_menu), console1);
  gtk_widget_add_accelerator (console1, "activate", accel_group,
                              GDK_T, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  image369 = create_pixmap (app, "term_16.png");
  gtk_widget_show (image369);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (console1), image369);

  separator1 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator1);
  gtk_container_add (GTK_CONTAINER (view1_menu), separator1);
  gtk_widget_set_sensitive (separator1, FALSE);

  search_mitem = gtk_image_menu_item_new_with_mnemonic (_("_Search..."));
  gtk_widget_show (search_mitem);
  gtk_container_add (GTK_CONTAINER (view1_menu), search_mitem);
  gtk_widget_add_accelerator (search_mitem, "activate", accel_group,
                              GDK_S, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  image370 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image370);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (search_mitem), image370);

  clear_mitem = gtk_image_menu_item_new_with_mnemonic (_("C_lear"));
  gtk_widget_show (clear_mitem);
  gtk_container_add (GTK_CONTAINER (view1_menu), clear_mitem);
  gtk_widget_set_sensitive (clear_mitem, FALSE);
  gtk_widget_add_accelerator (clear_mitem, "activate", accel_group,
                              GDK_L, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  image371 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image371);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (clear_mitem), image371);

  separator2 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator2);
  gtk_container_add (GTK_CONTAINER (view1_menu), separator2);
  gtk_widget_set_sensitive (separator2, FALSE);

  view_log = gtk_image_menu_item_new_with_mnemonic (_("View Lo_g"));
  gtk_widget_show (view_log);
  gtk_container_add (GTK_CONTAINER (view1_menu), view_log);
  gtk_widget_add_accelerator (view_log, "activate", accel_group,
                              GDK_G, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  image372 = gtk_image_new_from_stock ("gtk-index", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image372);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (view_log), image372);

  separator3 = gtk_separator_menu_item_new ();
  gtk_widget_show (separator3);
  gtk_container_add (GTK_CONTAINER (view1_menu), separator3);
  gtk_widget_set_sensitive (separator3, FALSE);

  refresh_mitem = gtk_image_menu_item_new_with_mnemonic (_("_Refresh"));
  gtk_widget_show (refresh_mitem);
  gtk_container_add (GTK_CONTAINER (view1_menu), refresh_mitem);
  gtk_widget_add_accelerator (refresh_mitem, "activate", accel_group,
                              GDK_R, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  image373 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image373);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (refresh_mitem), image373);

  help_menu = gtk_menu_item_new_with_mnemonic (_("_Help"));
  gtk_widget_show (help_menu);
  gtk_container_add (GTK_CONTAINER (menubar1), help_menu);

  help_menu_menu = gtk_menu_new ();
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_menu), help_menu_menu);

  about_mitem = gtk_image_menu_item_new_with_mnemonic (_("_About"));
  gtk_widget_show (about_mitem);
  gtk_container_add (GTK_CONTAINER (help_menu_menu), about_mitem);

  image374 = gtk_image_new_from_stock ("gtk-dialog-info", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image374);
  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (about_mitem), image374);

  handlebox1 = gtk_handle_box_new ();
  gtk_widget_show (handlebox1);
  gtk_box_pack_start (GTK_BOX (vbox5), handlebox1, FALSE, TRUE, 0);

  toolbar = gtk_toolbar_new ();
  gtk_widget_show (toolbar);
  gtk_container_add (GTK_CONTAINER (handlebox1), toolbar);
  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar));

  toolitem1 = (GtkWidget*) gtk_tool_item_new ();
  gtk_widget_show (toolitem1);
  gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (toolitem1), TRUE);
  gtk_container_add (GTK_CONTAINER (toolbar), toolitem1);

  action_tool = gtk_button_new ();
  gtk_widget_show (action_tool);
  gtk_container_add (GTK_CONTAINER (toolitem1), action_tool);
  gtk_widget_set_sensitive (action_tool, FALSE);
  GTK_WIDGET_UNSET_FLAGS (action_tool, GTK_CAN_FOCUS);
  gtk_button_set_relief (GTK_BUTTON (action_tool), GTK_RELIEF_NONE);

  action_tool_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (action_tool_vbox);
  gtk_container_add (GTK_CONTAINER (action_tool), action_tool_vbox);

  action_tool_img = create_pixmap (app, NULL);
  gtk_widget_show (action_tool_img);
  gtk_box_pack_start (GTK_BOX (action_tool_vbox), action_tool_img, TRUE, TRUE, 0);

  action_tool_lbl = gtk_label_new_with_mnemonic ("");
  gtk_widget_show (action_tool_lbl);
  gtk_box_pack_start (GTK_BOX (action_tool_vbox), action_tool_lbl, FALSE, FALSE, 0);

  toolitem6 = (GtkWidget*) gtk_tool_item_new ();
  gtk_widget_show (toolitem6);
  gtk_container_add (GTK_CONTAINER (toolbar), toolitem6);

  action_ctool = gtk_button_new ();
  gtk_widget_show (action_ctool);
  gtk_container_add (GTK_CONTAINER (toolitem6), action_ctool);
  GTK_WIDGET_UNSET_FLAGS (action_ctool, GTK_CAN_FOCUS);
  gtk_button_set_relief (GTK_BUTTON (action_ctool), GTK_RELIEF_NONE);

  arrow1 = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
  gtk_widget_show (arrow1);
  gtk_container_add (GTK_CONTAINER (action_ctool), arrow1);

  tmp_image = create_pixmap (app, "term_24.png");
  gtk_widget_show (tmp_image);
  console_tool = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Console"));
  gtk_widget_show (console_tool);
  gtk_container_add (GTK_CONTAINER (toolbar), console_tool);

  refresh_tool = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-refresh");
  gtk_widget_show (refresh_tool);
  gtk_container_add (GTK_CONTAINER (toolbar), refresh_tool);

  spacer_tool = (GtkWidget*) gtk_tool_item_new ();
  gtk_widget_show (spacer_tool);
  gtk_tool_item_set_expand (GTK_TOOL_ITEM (spacer_tool), TRUE);
  gtk_container_add (GTK_CONTAINER (toolbar), spacer_tool);

  spacer_lbl = gtk_label_new ("");
  gtk_container_add (GTK_CONTAINER (spacer_tool), spacer_lbl);

  toolitem3 = (GtkWidget*) gtk_tool_item_new ();
  gtk_widget_show (toolitem3);
  gtk_container_add (GTK_CONTAINER (toolbar), toolitem3);

  search_vbox = gtk_vbox_new (TRUE, 0);
  gtk_widget_show (search_vbox);
  gtk_container_add (GTK_CONTAINER (toolitem3), search_vbox);
  gtk_widget_set_sensitive (search_vbox, FALSE);

  search_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (search_hbox);
  gtk_box_pack_start (GTK_BOX (search_vbox), search_hbox, TRUE, TRUE, 0);

  search_ent = gtk_entry_new ();
  gtk_widget_show (search_ent);
  gtk_box_pack_start (GTK_BOX (search_hbox), search_ent, TRUE, TRUE, 0);
  gtk_tooltips_set_tip (tooltips, search_ent, _("Enter a search term"), NULL);
  gtk_entry_set_width_chars (GTK_ENTRY (search_ent), 16);

  clear_tool = gtk_button_new ();
  gtk_widget_show (clear_tool);
  gtk_box_pack_start (GTK_BOX (search_hbox), clear_tool, FALSE, FALSE, 0);
  gtk_widget_set_sensitive (clear_tool, FALSE);
  gtk_tooltips_set_tip (tooltips, clear_tool, _("Clear search results"), NULL);
  gtk_button_set_relief (GTK_BUTTON (clear_tool), GTK_RELIEF_NONE);

  image33 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image33);
  gtk_container_add (GTK_CONTAINER (clear_tool), image33);

  button9 = gtk_button_new ();
  gtk_widget_show (button9);
  gtk_box_pack_end (GTK_BOX (search_vbox), button9, FALSE, FALSE, 0);
  GTK_WIDGET_UNSET_FLAGS (button9, GTK_CAN_FOCUS);
  gtk_button_set_relief (GTK_BUTTON (button9), GTK_RELIEF_NONE);

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

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

  image32 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
  gtk_widget_show (image32);
  gtk_box_pack_start (GTK_BOX (hbox5), image32, FALSE, FALSE, 0);

  label5 = gtk_label_new_with_mnemonic (_("_Search"));
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox5), label5, FALSE, FALSE, 0);

  status_bar = gtk_statusbar_new ();
  gtk_widget_show (status_bar);
  gtk_box_pack_start (GTK_BOX (vbox5), status_bar, FALSE, FALSE, 0);
  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE);

  hpaned1 = gtk_hpaned_new ();
  gtk_widget_show (hpaned1);
  gtk_box_pack_start (GTK_BOX (vbox5), hpaned1, TRUE, TRUE, 0);
  gtk_paned_set_position (GTK_PANED (hpaned1), 170);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_paned_pack1 (GTK_PANED (hpaned1), scrolledwindow1, FALSE, TRUE);
  gtk_widget_set_sensitive (scrolledwindow1, FALSE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);

  catlist = gtk_clist_new (1);
  gtk_widget_show (catlist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), catlist);
  gtk_clist_set_column_width (GTK_CLIST (catlist), 0, 80);
  gtk_clist_column_titles_show (GTK_CLIST (catlist));

  label15 = gtk_label_new (_("Category"));
  gtk_widget_show (label15);
  gtk_clist_set_column_widget (GTK_CLIST (catlist), 0, label15);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label15), 2, 0);

  vpaned1 = gtk_vpaned_new ();
  gtk_widget_show (vpaned1);
  gtk_paned_pack2 (GTK_PANED (hpaned1), vpaned1, TRUE, TRUE);
  gtk_paned_set_position (GTK_PANED (vpaned1), 332);

  scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow2);
  gtk_paned_pack1 (GTK_PANED (vpaned1), scrolledwindow2, FALSE, TRUE);
  gtk_widget_set_sensitive (scrolledwindow2, FALSE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);

  portlist = gtk_clist_new (3);
  gtk_widget_show (portlist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow2), portlist);
  gtk_clist_set_column_width (GTK_CLIST (portlist), 0, 128);
  gtk_clist_set_column_width (GTK_CLIST (portlist), 1, 90);
  gtk_clist_set_column_width (GTK_CLIST (portlist), 2, 80);
  gtk_clist_column_titles_show (GTK_CLIST (portlist));

  hbox15 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox15);
  gtk_clist_set_column_widget (GTK_CLIST (portlist), 0, hbox15);

  label19 = gtk_label_new (_("Name"));
  gtk_widget_show (label19);
  gtk_box_pack_start (GTK_BOX (hbox15), label19, TRUE, TRUE, 0);
  gtk_misc_set_alignment (GTK_MISC (label19), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label19), 2, 0);

  portlist_sort_arr = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
  gtk_widget_show (portlist_sort_arr);
  gtk_box_pack_start (GTK_BOX (hbox15), portlist_sort_arr, FALSE, FALSE, 0);

  label17 = gtk_label_new (_("Version"));
  gtk_widget_show (label17);
  gtk_clist_set_column_widget (GTK_CLIST (portlist), 1, label17);
  gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label17), 2, 0);

  label18 = gtk_label_new (_("Description"));
  gtk_widget_show (label18);
  gtk_clist_set_column_widget (GTK_CLIST (portlist), 2, label18);
  gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label18), 2, 0);

  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow3);
  gtk_paned_pack2 (GTK_PANED (vpaned1), scrolledwindow3, TRUE, TRUE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN);

  descview = gtk_text_view_new ();
  gtk_widget_show (descview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow3), descview);
  gtk_widget_set_sensitive (descview, FALSE);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (descview), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (descview), GTK_WRAP_WORD);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (descview), FALSE);
  gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (descview), 2);
  gtk_text_view_set_left_margin (GTK_TEXT_VIEW (descview), 2);
  gtk_text_view_set_right_margin (GTK_TEXT_VIEW (descview), 2);

  g_signal_connect ((gpointer) app, "delete_event",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
  g_signal_connect ((gpointer) quit_mitem, "activate",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
  g_signal_connect ((gpointer) console1, "activate",
                    G_CALLBACK (on_console),
                    NULL);
  g_signal_connect ((gpointer) search_mitem, "activate",
                    G_CALLBACK (on_search_prompt),
                    NULL);
  g_signal_connect ((gpointer) clear_mitem, "activate",
                    G_CALLBACK (on_search_clear),
                    NULL);
  g_signal_connect ((gpointer) view_log, "activate",
                    G_CALLBACK (on_log_view),
                    NULL);
  g_signal_connect ((gpointer) refresh_mitem, "activate",
                    G_CALLBACK (on_refresh),
                    NULL);
  g_signal_connect ((gpointer) about_mitem, "activate",
                    G_CALLBACK (on_about),
                    NULL);
  g_signal_connect ((gpointer) action_tool, "clicked",
                    G_CALLBACK (on_action),
                    NULL);
  g_signal_connect ((gpointer) console_tool, "clicked",
                    G_CALLBACK (on_console),
                    NULL);
  g_signal_connect ((gpointer) refresh_tool, "clicked",
                    G_CALLBACK (on_refresh),
                    NULL);
  g_signal_connect ((gpointer) search_ent, "activate",
                    G_CALLBACK (on_search),
                    NULL);
  g_signal_connect ((gpointer) clear_tool, "clicked",
                    G_CALLBACK (on_search_clear),
                    NULL);
  g_signal_connect ((gpointer) button9, "clicked",
                    G_CALLBACK (on_search),
                    NULL);
  g_signal_connect ((gpointer) catlist, "select_row",
                    G_CALLBACK (on_catlist_select_row),
                    NULL);
  g_signal_connect ((gpointer) portlist, "select_row",
                    G_CALLBACK (on_portlist_select_row),
                    NULL);
  g_signal_connect ((gpointer) portlist, "button_press_event",
                    G_CALLBACK (on_portlist_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) portlist, "key_press_event",
                    G_CALLBACK (on_portlist_key_press_event),
                    NULL);
  g_signal_connect ((gpointer) portlist, "click_column",
                    G_CALLBACK (on_portlist_click_column),
                    NULL);
  g_signal_connect ((gpointer) descview, "motion_notify_event",
                    G_CALLBACK (on_descview_motion_notify_event),
                    NULL);
  g_signal_connect ((gpointer) descview, "button_press_event",
                    G_CALLBACK (on_descview_button_press_event),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (app, app, "app");
  GLADE_HOOKUP_OBJECT (app, vbox5, "vbox5");
  GLADE_HOOKUP_OBJECT (app, menubar1, "menubar1");
  GLADE_HOOKUP_OBJECT (app, file_menu, "file_menu");
  GLADE_HOOKUP_OBJECT (app, file_menu_menu, "file_menu_menu");
  GLADE_HOOKUP_OBJECT (app, quit_mitem, "quit_mitem");
  GLADE_HOOKUP_OBJECT (app, action_mitem, "action_mitem");
  GLADE_HOOKUP_OBJECT (app, view1, "view1");
  GLADE_HOOKUP_OBJECT (app, view1_menu, "view1_menu");
  GLADE_HOOKUP_OBJECT (app, console1, "console1");
  GLADE_HOOKUP_OBJECT (app, image369, "image369");
  GLADE_HOOKUP_OBJECT (app, separator1, "separator1");
  GLADE_HOOKUP_OBJECT (app, search_mitem, "search_mitem");
  GLADE_HOOKUP_OBJECT (app, image370, "image370");
  GLADE_HOOKUP_OBJECT (app, clear_mitem, "clear_mitem");
  GLADE_HOOKUP_OBJECT (app, image371, "image371");
  GLADE_HOOKUP_OBJECT (app, separator2, "separator2");
  GLADE_HOOKUP_OBJECT (app, view_log, "view_log");
  GLADE_HOOKUP_OBJECT (app, image372, "image372");
  GLADE_HOOKUP_OBJECT (app, separator3, "separator3");
  GLADE_HOOKUP_OBJECT (app, refresh_mitem, "refresh_mitem");
  GLADE_HOOKUP_OBJECT (app, image373, "image373");
  GLADE_HOOKUP_OBJECT (app, help_menu, "help_menu");
  GLADE_HOOKUP_OBJECT (app, help_menu_menu, "help_menu_menu");
  GLADE_HOOKUP_OBJECT (app, about_mitem, "about_mitem");
  GLADE_HOOKUP_OBJECT (app, image374, "image374");
  GLADE_HOOKUP_OBJECT (app, handlebox1, "handlebox1");
  GLADE_HOOKUP_OBJECT (app, toolbar, "toolbar");
  GLADE_HOOKUP_OBJECT (app, toolitem1, "toolitem1");
  GLADE_HOOKUP_OBJECT (app, action_tool, "action_tool");
  GLADE_HOOKUP_OBJECT (app, action_tool_vbox, "action_tool_vbox");
  GLADE_HOOKUP_OBJECT (app, action_tool_img, "action_tool_img");
  GLADE_HOOKUP_OBJECT (app, action_tool_lbl, "action_tool_lbl");
  GLADE_HOOKUP_OBJECT (app, toolitem6, "toolitem6");
  GLADE_HOOKUP_OBJECT (app, action_ctool, "action_ctool");
  GLADE_HOOKUP_OBJECT (app, arrow1, "arrow1");
  GLADE_HOOKUP_OBJECT (app, console_tool, "console_tool");
  GLADE_HOOKUP_OBJECT (app, refresh_tool, "refresh_tool");
  GLADE_HOOKUP_OBJECT (app, spacer_tool, "spacer_tool");
  GLADE_HOOKUP_OBJECT (app, spacer_lbl, "spacer_lbl");
  GLADE_HOOKUP_OBJECT (app, toolitem3, "toolitem3");
  GLADE_HOOKUP_OBJECT (app, search_vbox, "search_vbox");
  GLADE_HOOKUP_OBJECT (app, search_hbox, "search_hbox");
  GLADE_HOOKUP_OBJECT (app, search_ent, "search_ent");
  GLADE_HOOKUP_OBJECT (app, clear_tool, "clear_tool");
  GLADE_HOOKUP_OBJECT (app, image33, "image33");
  GLADE_HOOKUP_OBJECT (app, button9, "button9");
  GLADE_HOOKUP_OBJECT (app, alignment2, "alignment2");
  GLADE_HOOKUP_OBJECT (app, hbox5, "hbox5");
  GLADE_HOOKUP_OBJECT (app, image32, "image32");
  GLADE_HOOKUP_OBJECT (app, label5, "label5");
  GLADE_HOOKUP_OBJECT (app, status_bar, "status_bar");
  GLADE_HOOKUP_OBJECT (app, hpaned1, "hpaned1");
  GLADE_HOOKUP_OBJECT (app, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (app, catlist, "catlist");
  GLADE_HOOKUP_OBJECT (app, label15, "label15");
  GLADE_HOOKUP_OBJECT (app, vpaned1, "vpaned1");
  GLADE_HOOKUP_OBJECT (app, scrolledwindow2, "scrolledwindow2");
  GLADE_HOOKUP_OBJECT (app, portlist, "portlist");
  GLADE_HOOKUP_OBJECT (app, hbox15, "hbox15");
  GLADE_HOOKUP_OBJECT (app, label19, "label19");
  GLADE_HOOKUP_OBJECT (app, portlist_sort_arr, "portlist_sort_arr");
  GLADE_HOOKUP_OBJECT (app, label17, "label17");
  GLADE_HOOKUP_OBJECT (app, label18, "label18");
  GLADE_HOOKUP_OBJECT (app, scrolledwindow3, "scrolledwindow3");
  GLADE_HOOKUP_OBJECT (app, descview, "descview");
  GLADE_HOOKUP_OBJECT_NO_REF (app, tooltips, "tooltips");

  gtk_window_add_accel_group (GTK_WINDOW (app), accel_group);

  return app;
}

GtkWidget*
create_refresh_dlg (void)
{
  GtkWidget *refresh_dlg;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox3;
  GtkWidget *_;
  GtkWidget *image43;
  GtkWidget *refresh_title_lbl;
  GtkWidget *progress;
  GtkWidget *status_bar;
  GtkWidget *dialog_action_area1;
  GtkWidget *button8;

  refresh_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (refresh_dlg), _("Refreshing..."));
  gtk_window_set_modal (GTK_WINDOW (refresh_dlg), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (refresh_dlg), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (refresh_dlg)->vbox;
  gtk_widget_show (dialog_vbox1);

  vbox3 = gtk_vbox_new (FALSE, 4);
  gtk_widget_show (vbox3);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox3, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);

  _ = gtk_hbox_new (FALSE, 8);
  gtk_widget_show (_);
  gtk_box_pack_start (GTK_BOX (vbox3), _, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (_), 10);

  image43 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_DIALOG);
  gtk_widget_show (image43);
  gtk_box_pack_start (GTK_BOX (_), image43, FALSE, FALSE, 0);

  refresh_title_lbl = gtk_label_new (_("<big><b>Refreshing...</b></big>"));
  gtk_widget_show (refresh_title_lbl);
  gtk_box_pack_start (GTK_BOX (_), refresh_title_lbl, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (refresh_title_lbl), TRUE);

  progress = gtk_progress_bar_new ();
  gtk_widget_show (progress);
  gtk_box_pack_start (GTK_BOX (vbox3), progress, FALSE, FALSE, 0);
  gtk_widget_set_size_request (progress, 250, 26);
  gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress), _(" "));

  status_bar = gtk_statusbar_new ();
  gtk_widget_show (status_bar);
  gtk_box_pack_start (GTK_BOX (vbox3), status_bar, FALSE, TRUE, 0);
  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE);

  dialog_action_area1 = GTK_DIALOG (refresh_dlg)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_SPREAD);

  button8 = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (button8);
  gtk_dialog_add_action_widget (GTK_DIALOG (refresh_dlg), button8, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (button8, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (refresh_dlg, refresh_dlg, "refresh_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (refresh_dlg, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (refresh_dlg, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (refresh_dlg, _, "_");
  GLADE_HOOKUP_OBJECT (refresh_dlg, image43, "image43");
  GLADE_HOOKUP_OBJECT (refresh_dlg, refresh_title_lbl, "refresh_title_lbl");
  GLADE_HOOKUP_OBJECT (refresh_dlg, progress, "progress");
  GLADE_HOOKUP_OBJECT (refresh_dlg, status_bar, "status_bar");
  GLADE_HOOKUP_OBJECT_NO_REF (refresh_dlg, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (refresh_dlg, button8, "button8");

  return refresh_dlg;
}

GtkWidget*
create_about_dlg (void)
{
  GtkWidget *about_dlg;
  GtkWidget *dialog_vbox2;
  GtkWidget *vbox6;
  GtkWidget *vbox7;
  GtkWidget *image240;
  GtkWidget *version_lbl;
  GtkWidget *desc_lbl;
  GtkWidget *label7;
  GtkWidget *label6;
  GtkWidget *hbuttonbox1;
  GtkWidget *dialog_action_area2;
  GtkWidget *closebutton1;

  about_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (about_dlg), _("BPM: About"));
  gtk_window_set_type_hint (GTK_WINDOW (about_dlg), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox2 = GTK_DIALOG (about_dlg)->vbox;
  gtk_widget_show (dialog_vbox2);

  vbox6 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox6);
  gtk_box_pack_start (GTK_BOX (dialog_vbox2), vbox6, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox6), 8);

  vbox7 = gtk_vbox_new (FALSE, 8);
  gtk_widget_show (vbox7);
  gtk_box_pack_start (GTK_BOX (vbox6), vbox7, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox7), 16);

  image240 = create_pixmap (about_dlg, "pkg_48.png");
  gtk_widget_show (image240);
  gtk_box_pack_start (GTK_BOX (vbox7), image240, TRUE, TRUE, 0);

  version_lbl = gtk_label_new (_("(version)"));
  gtk_widget_show (version_lbl);
  gtk_box_pack_start (GTK_BOX (vbox7), version_lbl, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (version_lbl), TRUE);

  desc_lbl = gtk_label_new (_("<b>A BSD ports collection manager.</b>"));
  gtk_widget_show (desc_lbl);
  gtk_box_pack_start (GTK_BOX (vbox7), desc_lbl, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (desc_lbl), TRUE);

  label7 = gtk_label_new (_("(C) 2003 Seth Kingsley, All Rights Reserved"));
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (vbox6), label7, FALSE, FALSE, 0);

  label6 = gtk_label_new (_("Contains code (C) The FreeBSD Project"));
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (vbox6), label6, FALSE, FALSE, 0);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (vbox6), hbuttonbox1, FALSE, TRUE, 0);

  dialog_action_area2 = GTK_DIALOG (about_dlg)->action_area;
  gtk_widget_show (dialog_action_area2);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), GTK_BUTTONBOX_SPREAD);

  closebutton1 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (closebutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (about_dlg), closebutton1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (closebutton1, GTK_CAN_DEFAULT);

  g_signal_connect_swapped ((gpointer) about_dlg, "response",
                            G_CALLBACK (gtk_widget_hide),
                            GTK_OBJECT (about_dlg));

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (about_dlg, about_dlg, "about_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (about_dlg, dialog_vbox2, "dialog_vbox2");
  GLADE_HOOKUP_OBJECT (about_dlg, vbox6, "vbox6");
  GLADE_HOOKUP_OBJECT (about_dlg, vbox7, "vbox7");
  GLADE_HOOKUP_OBJECT (about_dlg, image240, "image240");
  GLADE_HOOKUP_OBJECT (about_dlg, version_lbl, "version_lbl");
  GLADE_HOOKUP_OBJECT (about_dlg, desc_lbl, "desc_lbl");
  GLADE_HOOKUP_OBJECT (about_dlg, label7, "label7");
  GLADE_HOOKUP_OBJECT (about_dlg, label6, "label6");
  GLADE_HOOKUP_OBJECT (about_dlg, hbuttonbox1, "hbuttonbox1");
  GLADE_HOOKUP_OBJECT_NO_REF (about_dlg, dialog_action_area2, "dialog_action_area2");
  GLADE_HOOKUP_OBJECT (about_dlg, closebutton1, "closebutton1");

  return about_dlg;
}

GtkWidget*
create_search_dlg (void)
{
  GtkWidget *search_dlg;
  GtkWidget *dialog_vbox3;
  GtkWidget *hbox7;
  GtkWidget *label9;
  GtkWidget *search_ent;
  GtkWidget *dialog_action_area3;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;
  GtkWidget *alignment3;
  GtkWidget *hbox6;
  GtkWidget *image302;
  GtkWidget *label8;

  search_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (search_dlg), _("BPM: Search"));
  gtk_window_set_resizable (GTK_WINDOW (search_dlg), FALSE);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (search_dlg), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (search_dlg), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox3 = GTK_DIALOG (search_dlg)->vbox;
  gtk_widget_show (dialog_vbox3);

  hbox7 = gtk_hbox_new (FALSE, 4);
  gtk_widget_show (hbox7);
  gtk_box_pack_start (GTK_BOX (dialog_vbox3), hbox7, FALSE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox7), 8);

  label9 = gtk_label_new (_("Term:"));
  gtk_widget_show (label9);
  gtk_box_pack_start (GTK_BOX (hbox7), label9, FALSE, FALSE, 0);

  search_ent = gtk_entry_new ();
  gtk_widget_show (search_ent);
  gtk_box_pack_start (GTK_BOX (hbox7), search_ent, TRUE, TRUE, 0);
  gtk_entry_set_activates_default (GTK_ENTRY (search_ent), TRUE);

  dialog_action_area3 = GTK_DIALOG (search_dlg)->action_area;
  gtk_widget_show (dialog_action_area3);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END);

  cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (cancelbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (search_dlg), cancelbutton1, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);

  okbutton1 = gtk_button_new ();
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (search_dlg), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

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

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

  image302 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image302);
  gtk_box_pack_start (GTK_BOX (hbox6), image302, FALSE, FALSE, 0);

  label8 = gtk_label_new_with_mnemonic (_("_Search"));
  gtk_widget_show (label8);
  gtk_box_pack_start (GTK_BOX (hbox6), label8, FALSE, FALSE, 0);

  g_signal_connect ((gpointer) search_dlg, "response",
                    G_CALLBACK (on_search_dialog_response),
                    NULL);
  g_signal_connect ((gpointer) search_dlg, "delete_event",
                    G_CALLBACK (gtk_widget_hide_on_delete),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (search_dlg, search_dlg, "search_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (search_dlg, dialog_vbox3, "dialog_vbox3");
  GLADE_HOOKUP_OBJECT (search_dlg, hbox7, "hbox7");
  GLADE_HOOKUP_OBJECT (search_dlg, label9, "label9");
  GLADE_HOOKUP_OBJECT (search_dlg, search_ent, "search_ent");
  GLADE_HOOKUP_OBJECT_NO_REF (search_dlg, dialog_action_area3, "dialog_action_area3");
  GLADE_HOOKUP_OBJECT (search_dlg, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (search_dlg, okbutton1, "okbutton1");
  GLADE_HOOKUP_OBJECT (search_dlg, alignment3, "alignment3");
  GLADE_HOOKUP_OBJECT (search_dlg, hbox6, "hbox6");
  GLADE_HOOKUP_OBJECT (search_dlg, image302, "image302");
  GLADE_HOOKUP_OBJECT (search_dlg, label8, "label8");

  gtk_widget_grab_default (okbutton1);
  return search_dlg;
}

GtkWidget*
create_action_win (void)
{
  GtkWidget *action_win;
  GtkWidget *vbox8;
  GtkWidget *hbox10;
  GtkWidget *action_img;
  GtkWidget *action_lbl;
  GtkWidget *action_prog;
  GtkWidget *action_sbar;
  GtkWidget *fetch_sbar;
  GtkWidget *hseparator1;
  GtkWidget *hbox11;
  GtkWidget *action_btn;
  GtkWidget *alignment6;
  GtkWidget *hbox14;
  GtkWidget *action_btn_img;
  GtkWidget *action_btn_lbl;
  GtkWidget *button14;
  GtkWidget *vseparator1;
  GtkWidget *details_btn;
  GtkWidget *alignment5;
  GtkWidget *hbox13;
  GtkWidget *image338;
  GtkWidget *label14;
  GtkWidget *details_sw;
  GtkWidget *details_text;

  action_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_position (GTK_WINDOW (action_win), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (action_win), TRUE);
  gtk_window_set_resizable (GTK_WINDOW (action_win), FALSE);

  vbox8 = gtk_vbox_new (FALSE, 8);
  gtk_widget_show (vbox8);
  gtk_container_add (GTK_CONTAINER (action_win), vbox8);
  gtk_container_set_border_width (GTK_CONTAINER (vbox8), 7);

  hbox10 = gtk_hbox_new (FALSE, 8);
  gtk_widget_show (hbox10);
  gtk_box_pack_start (GTK_BOX (vbox8), hbox10, FALSE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox10), 7);

  action_img = create_pixmap (action_win, NULL);
  gtk_widget_show (action_img);
  gtk_box_pack_start (GTK_BOX (hbox10), action_img, FALSE, TRUE, 0);

  action_lbl = gtk_label_new ("");
  gtk_widget_show (action_lbl);
  gtk_box_pack_start (GTK_BOX (hbox10), action_lbl, FALSE, FALSE, 0);

  action_prog = gtk_progress_bar_new ();
  gtk_widget_show (action_prog);
  gtk_box_pack_start (GTK_BOX (vbox8), action_prog, FALSE, FALSE, 0);
  gtk_widget_set_size_request (action_prog, 325, 20);
  gtk_widget_set_sensitive (action_prog, FALSE);

  action_sbar = gtk_statusbar_new ();
  gtk_widget_show (action_sbar);
  gtk_box_pack_start (GTK_BOX (vbox8), action_sbar, FALSE, FALSE, 0);
  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (action_sbar), FALSE);

  fetch_sbar = gtk_statusbar_new ();
  gtk_widget_show (fetch_sbar);
  gtk_box_pack_start (GTK_BOX (vbox8), fetch_sbar, FALSE, FALSE, 0);
  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (fetch_sbar), FALSE);

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

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

  action_btn = gtk_button_new ();
  gtk_widget_show (action_btn);
  gtk_box_pack_end (GTK_BOX (hbox11), action_btn, FALSE, FALSE, 0);
  gtk_widget_set_sensitive (action_btn, FALSE);
  GTK_WIDGET_SET_FLAGS (action_btn, GTK_CAN_DEFAULT);

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

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

  action_btn_img = create_pixmap (action_win, NULL);
  gtk_widget_show (action_btn_img);
  gtk_box_pack_start (GTK_BOX (hbox14), action_btn_img, FALSE, FALSE, 0);

  action_btn_lbl = gtk_label_new_with_mnemonic ("");
  gtk_widget_show (action_btn_lbl);
  gtk_box_pack_start (GTK_BOX (hbox14), action_btn_lbl, FALSE, FALSE, 0);

  button14 = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (button14);
  gtk_box_pack_end (GTK_BOX (hbox11), button14, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (button14, GTK_CAN_DEFAULT);

  vseparator1 = gtk_vseparator_new ();
  gtk_widget_show (vseparator1);
  gtk_box_pack_end (GTK_BOX (hbox11), vseparator1, FALSE, FALSE, 0);

  details_btn = gtk_toggle_button_new ();
  gtk_widget_show (details_btn);
  gtk_box_pack_end (GTK_BOX (hbox11), details_btn, FALSE, FALSE, 0);

  alignment5 = gtk_alignment_new (0.5, 0.5, 0, 0);
  gtk_widget_show (alignment5);
  gtk_container_add (GTK_CONTAINER (details_btn), alignment5);

  hbox13 = gtk_hbox_new (FALSE, 2);
  gtk_widget_show (hbox13);
  gtk_container_add (GTK_CONTAINER (alignment5), hbox13);

  image338 = gtk_image_new_from_stock ("gtk-goto-bottom", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image338);
  gtk_box_pack_start (GTK_BOX (hbox13), image338, FALSE, FALSE, 0);

  label14 = gtk_label_new_with_mnemonic (_("_Details"));
  gtk_widget_show (label14);
  gtk_box_pack_start (GTK_BOX (hbox13), label14, FALSE, FALSE, 0);

  details_sw = gtk_scrolled_window_new (NULL, NULL);
  gtk_box_pack_start (GTK_BOX (vbox8), details_sw, TRUE, TRUE, 0);
  gtk_widget_set_size_request (details_sw, 350, 150);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (details_sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (details_sw), GTK_SHADOW_IN);

  details_text = gtk_text_view_new ();
  gtk_widget_show (details_text);
  gtk_container_add (GTK_CONTAINER (details_sw), details_text);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (details_text), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (details_text), GTK_WRAP_CHAR);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (details_text), FALSE);

  g_signal_connect ((gpointer) action_win, "delete_event",
                    G_CALLBACK (on_action_cancel),
                    NULL);
  g_signal_connect ((gpointer) action_sbar, "realize",
                    G_CALLBACK (on_action_sbar_realize),
                    NULL);
  g_signal_connect ((gpointer) action_btn, "clicked",
                    G_CALLBACK (on_action_run),
                    NULL);
  g_signal_connect ((gpointer) button14, "clicked",
                    G_CALLBACK (on_action_cancel),
                    NULL);
  g_signal_connect ((gpointer) details_btn, "toggled",
                    G_CALLBACK (on_action_details_toggled),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (action_win, action_win, "action_win");
  GLADE_HOOKUP_OBJECT (action_win, vbox8, "vbox8");
  GLADE_HOOKUP_OBJECT (action_win, hbox10, "hbox10");
  GLADE_HOOKUP_OBJECT (action_win, action_img, "action_img");
  GLADE_HOOKUP_OBJECT (action_win, action_lbl, "action_lbl");
  GLADE_HOOKUP_OBJECT (action_win, action_prog, "action_prog");
  GLADE_HOOKUP_OBJECT (action_win, action_sbar, "action_sbar");
  GLADE_HOOKUP_OBJECT (action_win, fetch_sbar, "fetch_sbar");
  GLADE_HOOKUP_OBJECT (action_win, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (action_win, hbox11, "hbox11");
  GLADE_HOOKUP_OBJECT (action_win, action_btn, "action_btn");
  GLADE_HOOKUP_OBJECT (action_win, alignment6, "alignment6");
  GLADE_HOOKUP_OBJECT (action_win, hbox14, "hbox14");
  GLADE_HOOKUP_OBJECT (action_win, action_btn_img, "action_btn_img");
  GLADE_HOOKUP_OBJECT (action_win, action_btn_lbl, "action_btn_lbl");
  GLADE_HOOKUP_OBJECT (action_win, button14, "button14");
  GLADE_HOOKUP_OBJECT (action_win, vseparator1, "vseparator1");
  GLADE_HOOKUP_OBJECT (action_win, details_btn, "details_btn");
  GLADE_HOOKUP_OBJECT (action_win, alignment5, "alignment5");
  GLADE_HOOKUP_OBJECT (action_win, hbox13, "hbox13");
  GLADE_HOOKUP_OBJECT (action_win, image338, "image338");
  GLADE_HOOKUP_OBJECT (action_win, label14, "label14");
  GLADE_HOOKUP_OBJECT (action_win, details_sw, "details_sw");
  GLADE_HOOKUP_OBJECT (action_win, details_text, "details_text");

  gtk_widget_grab_focus (action_btn);
  gtk_widget_grab_default (action_btn);
  return action_win;
}

GtkWidget*
create_log_win (void)
{
  GtkWidget *log_win;
  GtkWidget *vbox9;
  GtkWidget *scrolledwindow4;
  GtkWidget *textview;
  GtkWidget *hseparator2;
  GtkWidget *hbuttonbox2;
  GtkWidget *button15;
  GtkWidget *button16;

  log_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (log_win), _("BPM: Log"));
  gtk_window_set_default_size (GTK_WINDOW (log_win), 550, 300);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (log_win), TRUE);

  vbox9 = gtk_vbox_new (FALSE, 6);
  gtk_widget_show (vbox9);
  gtk_container_add (GTK_CONTAINER (log_win), vbox9);
  gtk_container_set_border_width (GTK_CONTAINER (vbox9), 8);

  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow4);
  gtk_box_pack_start (GTK_BOX (vbox9), scrolledwindow4, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);

  textview = gtk_text_view_new ();
  gtk_widget_show (textview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow4), textview);
  gtk_container_set_border_width (GTK_CONTAINER (textview), 1);
  gtk_text_view_set_editable (GTK_TEXT_VIEW (textview), FALSE);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview), GTK_WRAP_WORD);
  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (textview), FALSE);

  hseparator2 = gtk_hseparator_new ();
  gtk_widget_show (hseparator2);
  gtk_box_pack_start (GTK_BOX (vbox9), hseparator2, FALSE, TRUE, 0);

  hbuttonbox2 = gtk_hbutton_box_new ();
  gtk_widget_show (hbuttonbox2);
  gtk_box_pack_start (GTK_BOX (vbox9), hbuttonbox2, FALSE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);
  gtk_box_set_spacing (GTK_BOX (hbuttonbox2), 6);

  button15 = gtk_button_new_from_stock ("gtk-clear");
  gtk_widget_show (button15);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), button15);

  button16 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button16);
  gtk_container_add (GTK_CONTAINER (hbuttonbox2), button16);
  GTK_WIDGET_SET_FLAGS (button16, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) log_win, "delete_event",
                    G_CALLBACK (gtk_widget_hide),
                    NULL);
  g_signal_connect ((gpointer) button15, "clicked",
                    G_CALLBACK (on_log_clear),
                    NULL);
  g_signal_connect ((gpointer) button16, "clicked",
                    G_CALLBACK (xmk_widget_hide_parent_window),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (log_win, log_win, "log_win");
  GLADE_HOOKUP_OBJECT (log_win, vbox9, "vbox9");
  GLADE_HOOKUP_OBJECT (log_win, scrolledwindow4, "scrolledwindow4");
  GLADE_HOOKUP_OBJECT (log_win, textview, "textview");
  GLADE_HOOKUP_OBJECT (log_win, hseparator2, "hseparator2");
  GLADE_HOOKUP_OBJECT (log_win, hbuttonbox2, "hbuttonbox2");
  GLADE_HOOKUP_OBJECT (log_win, button15, "button15");
  GLADE_HOOKUP_OBJECT (log_win, button16, "button16");

  gtk_widget_grab_focus (button16);
  gtk_widget_grab_default (button16);
  return log_win;
}

GtkWidget*
create_package_dlg (void)
{
  GtkWidget *package_dlg;
  GtkWidget *dialog_vbox4;
  GtkWidget *dialog_action_area4;
  GtkWidget *button17;
  GtkWidget *button18;

  package_dlg = gtk_file_chooser_dialog_new (_("BPM: Save Package"), NULL, GTK_FILE_CHOOSER_ACTION_SAVE, NULL);
  gtk_window_set_position (GTK_WINDOW (package_dlg), GTK_WIN_POS_CENTER_ON_PARENT);
  gtk_window_set_modal (GTK_WINDOW (package_dlg), TRUE);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (package_dlg), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (package_dlg), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox4 = GTK_DIALOG (package_dlg)->vbox;
  gtk_widget_show (dialog_vbox4);

  dialog_action_area4 = GTK_DIALOG (package_dlg)->action_area;
  gtk_widget_show (dialog_action_area4);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area4), GTK_BUTTONBOX_END);

  button17 = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_show (button17);
  gtk_dialog_add_action_widget (GTK_DIALOG (package_dlg), button17, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (button17, GTK_CAN_DEFAULT);

  button18 = gtk_button_new_from_stock ("gtk-save");
  gtk_widget_show (button18);
  gtk_dialog_add_action_widget (GTK_DIALOG (package_dlg), button18, GTK_RESPONSE_ACCEPT);
  GTK_WIDGET_SET_FLAGS (button18, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) package_dlg, "response",
                    G_CALLBACK (gtk_widget_hide),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (package_dlg, package_dlg, "package_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (package_dlg, dialog_vbox4, "dialog_vbox4");
  GLADE_HOOKUP_OBJECT_NO_REF (package_dlg, dialog_action_area4, "dialog_action_area4");
  GLADE_HOOKUP_OBJECT (package_dlg, button17, "button17");
  GLADE_HOOKUP_OBJECT (package_dlg, button18, "button18");

  gtk_widget_grab_default (button18);
  return package_dlg;
}

