/*
 * 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 "gtk-su-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_su_dlg (void)
{
  GtkWidget *su_dlg;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *image1;
  GtkWidget *vbox2;
  GtkWidget *label1;
  GtkWidget *user_lbl;
  GtkWidget *entry;
  GtkWidget *hseparator1;
  GtkWidget *cmd_lbl;
  GtkWidget *dir_lbl;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  su_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (su_dlg), _("Set User"));
  gtk_window_set_position (GTK_WINDOW (su_dlg), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (su_dlg), TRUE);
  gtk_window_set_resizable (GTK_WINDOW (su_dlg), FALSE);
  gtk_window_set_type_hint (GTK_WINDOW (su_dlg), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  vbox1 = gtk_vbox_new (FALSE, 2);
  gtk_widget_show (vbox1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 8);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox1), 8);

  image1 = create_pixmap (su_dlg, "lock_48.png");
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox1), image1, FALSE, TRUE, 16);

  vbox2 = gtk_vbox_new (FALSE, 8);
  gtk_widget_show (vbox2);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox2, TRUE, TRUE, 0);

  label1 = gtk_label_new (_("<big><b>Priviledged Execution Required</b></big>"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (vbox2), label1, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);

  user_lbl = gtk_label_new (_("Please enter the password\nfor user <b>%s</b>:"));
  gtk_widget_show (user_lbl);
  gtk_box_pack_start (GTK_BOX (vbox2), user_lbl, TRUE, TRUE, 0);
  gtk_label_set_line_wrap (GTK_LABEL (user_lbl), TRUE);
  gtk_misc_set_alignment (GTK_MISC (user_lbl), 0, 0.5);

  entry = gtk_entry_new ();
  gtk_widget_show (entry);
  gtk_box_pack_start (GTK_BOX (vbox2), entry, FALSE, FALSE, 0);
  gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
  gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
  gtk_entry_set_width_chars (GTK_ENTRY (entry), 16);

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

  cmd_lbl = gtk_label_new (_("<b>Command:</b> %s"));
  gtk_widget_show (cmd_lbl);
  gtk_box_pack_start (GTK_BOX (vbox1), cmd_lbl, TRUE, TRUE, 0);
  gtk_label_set_line_wrap (GTK_LABEL (cmd_lbl), TRUE);
  gtk_misc_set_alignment (GTK_MISC (cmd_lbl), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (cmd_lbl), 2, 0);

  dir_lbl = gtk_label_new (_("<b>Directory:</b> %s"));
  gtk_widget_show (dir_lbl);
  gtk_box_pack_start (GTK_BOX (vbox1), dir_lbl, FALSE, TRUE, 0);
  gtk_label_set_line_wrap (GTK_LABEL (dir_lbl), TRUE);
  gtk_misc_set_alignment (GTK_MISC (dir_lbl), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (dir_lbl), 2, 0);

  dialog_action_area1 = GTK_DIALOG (su_dlg)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

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

  okbutton1 = gtk_button_new_from_stock ("gtk-execute");
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (su_dlg), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) su_dlg, "response",
                    G_CALLBACK (gtk_widget_hide),
                    NULL);
  g_signal_connect ((gpointer) su_dlg, "delete_event",
                    G_CALLBACK (gtk_widget_hide),
                    NULL);
  g_signal_connect ((gpointer) su_dlg, "show",
                    G_CALLBACK (xmk_window_focus),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (su_dlg, su_dlg, "su_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (su_dlg, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (su_dlg, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (su_dlg, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (su_dlg, image1, "image1");
  GLADE_HOOKUP_OBJECT (su_dlg, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (su_dlg, label1, "label1");
  GLADE_HOOKUP_OBJECT (su_dlg, user_lbl, "user_lbl");
  GLADE_HOOKUP_OBJECT (su_dlg, entry, "entry");
  GLADE_HOOKUP_OBJECT (su_dlg, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (su_dlg, cmd_lbl, "cmd_lbl");
  GLADE_HOOKUP_OBJECT (su_dlg, dir_lbl, "dir_lbl");
  GLADE_HOOKUP_OBJECT_NO_REF (su_dlg, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (su_dlg, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (su_dlg, okbutton1, "okbutton1");

  gtk_widget_grab_focus (entry);
  gtk_widget_grab_default (okbutton1);
  return su_dlg;
}

