Logo Search packages:      
Sourcecode: sanduhr version File versions  Download package

interface.c

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

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

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

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

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

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

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

GtkWidget*
create_about1 (void)
{
  const gchar *authors[] = {
    "Jochen Voss <voss@mathematik.uni-kl.de>",
    NULL
  };
  const gchar *documenters[] = { NULL };
  /* TRANSLATORS: Replace this string with your names, one name per line. */
  gchar *translators = _("translator_credits");
  GdkPixbuf *about1_logo_pixbuf;
  GtkWidget *about1;

  if (!strcmp (translators, "translator_credits"))
    translators = NULL;
  about1_logo_pixbuf = create_pixbuf ("sanduhr/about.png");
  about1 = gnome_about_new ("SandUhr", VERSION,
                        _("Copyright 1999, 2000,2003 Jochen Voss"),
                        _("This is just another alarm clock,\nwhich is designed as a sand-glass."),
                        authors,
                        documenters,
                        translators,
                        about1_logo_pixbuf);
  gtk_container_set_border_width (GTK_CONTAINER (about1), 5);
  gtk_window_set_type_hint (GTK_WINDOW (about1), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  return about1;
}

GtkWidget*
create_initdialog (void)
{
  GtkWidget *initdialog;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *frame1;
  GtkWidget *vbox2;
  GtkWidget *b90;
  GSList *b90_group = NULL;
  GtkWidget *b180;
  GtkWidget *b300;
  GtkWidget *b1800;
  GtkWidget *bxxx;
  GtkWidget *custom_entry;
  GtkWidget *label1;
  GtkWidget *frame2;
  GtkWidget *entry2;
  GtkWidget *message;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *helpbutton1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  initdialog = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (initdialog), _("Initial Sanduhr Settings"));
  gtk_window_set_type_hint (GTK_WINDOW (initdialog), GDK_WINDOW_TYPE_HINT_DIALOG);

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

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

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

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);
  gtk_container_add (GTK_CONTAINER (frame1), vbox2);

  b90 = gtk_radio_button_new_with_mnemonic (NULL, _("90 seconds"));
  gtk_widget_show (b90);
  gtk_box_pack_start (GTK_BOX (vbox2), b90, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (b90), b90_group);
  b90_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b90));

  b180 = gtk_radio_button_new_with_mnemonic (NULL, _("3 minutes"));
  gtk_widget_show (b180);
  gtk_box_pack_start (GTK_BOX (vbox2), b180, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (b180), b90_group);
  b90_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b180));

  b300 = gtk_radio_button_new_with_mnemonic (NULL, _("5 minutes"));
  gtk_widget_show (b300);
  gtk_box_pack_start (GTK_BOX (vbox2), b300, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (b300), b90_group);
  b90_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b300));

  b1800 = gtk_radio_button_new_with_mnemonic (NULL, _("30 minutes"));
  gtk_widget_show (b1800);
  gtk_box_pack_start (GTK_BOX (vbox2), b1800, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (b1800), b90_group);
  b90_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (b1800));

  bxxx = gtk_radio_button_new_with_mnemonic (NULL, _("custom (e.g. +1h45m30s or 14:32):"));
  gtk_widget_show (bxxx);
  gtk_box_pack_start (GTK_BOX (vbox2), bxxx, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (bxxx), b90_group);
  b90_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (bxxx));

  custom_entry = gtk_entry_new ();
  gtk_widget_show (custom_entry);
  gtk_box_pack_start (GTK_BOX (vbox2), custom_entry, FALSE, FALSE, 0);
  gtk_tooltips_set_tip (tooltips, custom_entry, _("The alarm period, e.g. \"+1h30m\", \"+45s\", or \"21:30\""), NULL);
  gtk_entry_set_activates_default (GTK_ENTRY (custom_entry), TRUE);

  label1 = gtk_label_new (_("Alarm time"));
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);

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

  entry2 = gnome_entry_new ("message");
  gtk_widget_show (entry2);
  gtk_container_add (GTK_CONTAINER (frame2), entry2);

  message = gnome_entry_gtk_entry (GNOME_ENTRY (entry2));
  gtk_widget_show (message);
  gtk_entry_set_activates_default (GTK_ENTRY (message), TRUE);

  label2 = gtk_label_new (_("Alarm message"));
  gtk_widget_show (label2);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);

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

  helpbutton1 = gtk_button_new_from_stock ("gtk-help");
  gtk_widget_show (helpbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (initdialog), helpbutton1, GTK_RESPONSE_HELP);
  GTK_WIDGET_SET_FLAGS (helpbutton1, GTK_CAN_DEFAULT);

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

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

  g_signal_connect ((gpointer) custom_entry, "changed",
                    G_CALLBACK (on_custom_entry_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (initdialog, initdialog, "initdialog");
  GLADE_HOOKUP_OBJECT_NO_REF (initdialog, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (initdialog, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (initdialog, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (initdialog, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (initdialog, b90, "b90");
  GLADE_HOOKUP_OBJECT (initdialog, b180, "b180");
  GLADE_HOOKUP_OBJECT (initdialog, b300, "b300");
  GLADE_HOOKUP_OBJECT (initdialog, b1800, "b1800");
  GLADE_HOOKUP_OBJECT (initdialog, bxxx, "bxxx");
  GLADE_HOOKUP_OBJECT (initdialog, custom_entry, "custom_entry");
  GLADE_HOOKUP_OBJECT (initdialog, label1, "label1");
  GLADE_HOOKUP_OBJECT (initdialog, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (initdialog, entry2, "entry2");
  GLADE_HOOKUP_OBJECT (initdialog, message, "message");
  GLADE_HOOKUP_OBJECT (initdialog, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (initdialog, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (initdialog, helpbutton1, "helpbutton1");
  GLADE_HOOKUP_OBJECT (initdialog, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (initdialog, okbutton1, "okbutton1");
  GLADE_HOOKUP_OBJECT_NO_REF (initdialog, tooltips, "tooltips");

  return initdialog;
}

GtkWidget*
create_properties (void)
{
  GtkWidget *properties;
  GtkWidget *notebook1;
  GtkWidget *table1;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkWidget *time_entry;
  GtkWidget *entry4;
  GtkWidget *msg_entry;
  GtkWidget *label1;
  GtkWidget *vbox3;
  GtkWidget *bell_alarm;
  GSList *bell_alarm_group = NULL;
  GtkWidget *snd_alarm;
  GtkWidget *snd_file_entry;
  GtkWidget *snd_entry;
  GtkWidget *cmd_alarm;
  GtkWidget *cmd_file_entry;
  GtkWidget *cmd_entry;
  GtkWidget *corba_alarm;
  GtkWidget *corba_entry;
  GtkWidget *label2;
  GtkWidget *table2;
  GtkWidget *label7;
  GtkWidget *sand_color;
  GtkWidget *label3;
  GtkWidget *table3;
  GtkWidget *label8;
  GtkWidget *label9;
  GtkWidget *deco_button;
  GtkWidget *vbox4;
  GtkWidget *layer_desktop;
  GSList *layer_desktop_group = NULL;
  GtkWidget *layer_below;
  GtkWidget *layer_normal;
  GtkWidget *layer_ontop;
  GtkWidget *label4;

  properties = gnome_property_box_new ();
  gtk_window_set_title (GTK_WINDOW (properties), _("SandUhr properties"));

  notebook1 = GNOME_PROPERTY_BOX (properties)->notebook;
  gtk_widget_show (notebook1);

  table1 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (notebook1), table1);
  gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
  gtk_table_set_col_spacings (GTK_TABLE (table1), 4);

  label5 = gtk_label_new (_("Time:"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0);

  label6 = gtk_label_new (_("Message:"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_CENTER);

  time_entry = gtk_entry_new ();
  gtk_widget_show (time_entry);
  gtk_table_attach (GTK_TABLE (table1), time_entry, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  entry4 = gnome_entry_new ("message");
  gtk_widget_show (entry4);
  gtk_table_attach (GTK_TABLE (table1), entry4, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  msg_entry = gnome_entry_gtk_entry (GNOME_ENTRY (entry4));
  gtk_widget_show (msg_entry);

  label1 = gtk_label_new (_("alarm"));
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);

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

  bell_alarm = gtk_radio_button_new_with_mnemonic (NULL, _("Ring terminal bell"));
  gtk_widget_show (bell_alarm);
  gtk_box_pack_start (GTK_BOX (vbox3), bell_alarm, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (bell_alarm), bell_alarm_group);
  bell_alarm_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (bell_alarm));
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bell_alarm), TRUE);

  snd_alarm = gtk_radio_button_new_with_mnemonic (NULL, _("Play sound file:"));
  gtk_widget_show (snd_alarm);
  gtk_box_pack_start (GTK_BOX (vbox3), snd_alarm, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (snd_alarm), bell_alarm_group);
  bell_alarm_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (snd_alarm));

  snd_file_entry = gnome_file_entry_new ("sounds", _("Alarm sound file"));
  gtk_widget_show (snd_file_entry);
  gtk_box_pack_start (GTK_BOX (vbox3), snd_file_entry, FALSE, FALSE, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (snd_file_entry), TRUE);

  snd_entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (snd_file_entry));
  gtk_widget_show (snd_entry);

  cmd_alarm = gtk_radio_button_new_with_mnemonic (NULL, _("External command:"));
  gtk_widget_show (cmd_alarm);
  gtk_box_pack_start (GTK_BOX (vbox3), cmd_alarm, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (cmd_alarm), bell_alarm_group);
  bell_alarm_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cmd_alarm));

  cmd_file_entry = gnome_file_entry_new ("commands", _("External alarm command"));
  gtk_widget_show (cmd_file_entry);
  gtk_box_pack_start (GTK_BOX (vbox3), cmd_file_entry, FALSE, FALSE, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (cmd_file_entry), TRUE);

  cmd_entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (cmd_file_entry));
  gtk_widget_show (cmd_entry);

  corba_alarm = gtk_radio_button_new_with_mnemonic (NULL, _("External SandUhr::AlarmAction CORBA object:"));
  gtk_widget_show (corba_alarm);
  gtk_box_pack_start (GTK_BOX (vbox3), corba_alarm, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (corba_alarm), bell_alarm_group);
  bell_alarm_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (corba_alarm));

  corba_entry = gtk_entry_new ();
  gtk_widget_show (corba_entry);
  gtk_box_pack_start (GTK_BOX (vbox3), corba_entry, FALSE, FALSE, 0);

  label2 = gtk_label_new (_("action"));
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);

  table2 = gtk_table_new (1, 2, FALSE);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (notebook1), table2);
  gtk_table_set_row_spacings (GTK_TABLE (table2), 4);
  gtk_table_set_col_spacings (GTK_TABLE (table2), 8);

  label7 = gtk_label_new (_("Color:"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table2), label7, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  sand_color = gnome_color_picker_new ();
  gtk_widget_show (sand_color);
  gtk_table_attach (GTK_TABLE (table2), sand_color, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gnome_color_picker_set_title (GNOME_COLOR_PICKER (sand_color), _("Pick a sand color"));

  label3 = gtk_label_new (_("sand"));
  gtk_widget_show (label3);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_CENTER);

  table3 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (notebook1), table3);
  gtk_table_set_row_spacings (GTK_TABLE (table3), 4);
  gtk_table_set_col_spacings (GTK_TABLE (table3), 8);

  label8 = gtk_label_new (_("handles:"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table3), label8, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  label9 = gtk_label_new (_("layer:"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0);

  deco_button = gtk_check_button_new_with_mnemonic (_("add window decorations"));
  gtk_widget_show (deco_button);
  gtk_table_attach (GTK_TABLE (table3), deco_button, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  vbox4 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox4);
  gtk_table_attach (GTK_TABLE (table3), vbox4, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  layer_desktop = gtk_radio_button_new_with_mnemonic (NULL, _("desktop"));
  gtk_widget_show (layer_desktop);
  gtk_box_pack_start (GTK_BOX (vbox4), layer_desktop, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (layer_desktop), layer_desktop_group);
  layer_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (layer_desktop));

  layer_below = gtk_radio_button_new_with_mnemonic (NULL, _("below"));
  gtk_widget_show (layer_below);
  gtk_box_pack_start (GTK_BOX (vbox4), layer_below, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (layer_below), layer_desktop_group);
  layer_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (layer_below));

  layer_normal = gtk_radio_button_new_with_mnemonic (NULL, _("normal"));
  gtk_widget_show (layer_normal);
  gtk_box_pack_start (GTK_BOX (vbox4), layer_normal, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (layer_normal), layer_desktop_group);
  layer_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (layer_normal));

  layer_ontop = gtk_radio_button_new_with_mnemonic (NULL, _("on top"));
  gtk_widget_show (layer_ontop);
  gtk_box_pack_start (GTK_BOX (vbox4), layer_ontop, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (layer_ontop), layer_desktop_group);
  layer_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (layer_ontop));

  label4 = gtk_label_new (_("window"));
  gtk_widget_show (label4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_CENTER);

  g_signal_connect ((gpointer) properties, "apply",
                    G_CALLBACK (apply_settings),
                    NULL);
  g_signal_connect ((gpointer) properties, "help",
                    G_CALLBACK (on_properties_help),
                    NULL);
  g_signal_connect ((gpointer) properties, "close",
                    G_CALLBACK (on_properties_close),
                    NULL);
  g_signal_connect ((gpointer) time_entry, "changed",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) msg_entry, "changed",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) bell_alarm, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) snd_alarm, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) snd_entry, "changed",
                    G_CALLBACK (on_snd_entry_changed),
                    NULL);
  g_signal_connect ((gpointer) cmd_alarm, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) cmd_entry, "changed",
                    G_CALLBACK (on_cmd_entry_changed),
                    NULL);
  g_signal_connect ((gpointer) corba_alarm, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) corba_entry, "changed",
                    G_CALLBACK (on_corba_entry_changed),
                    NULL);
  g_signal_connect ((gpointer) sand_color, "color_set",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) deco_button, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) layer_desktop, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) layer_below, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) layer_normal, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);
  g_signal_connect ((gpointer) layer_ontop, "toggled",
                    G_CALLBACK (settings_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (properties, properties, "properties");
  GLADE_HOOKUP_OBJECT_NO_REF (properties, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (properties, table1, "table1");
  GLADE_HOOKUP_OBJECT (properties, label5, "label5");
  GLADE_HOOKUP_OBJECT (properties, label6, "label6");
  GLADE_HOOKUP_OBJECT (properties, time_entry, "time_entry");
  GLADE_HOOKUP_OBJECT (properties, entry4, "entry4");
  GLADE_HOOKUP_OBJECT (properties, msg_entry, "msg_entry");
  GLADE_HOOKUP_OBJECT (properties, label1, "label1");
  GLADE_HOOKUP_OBJECT (properties, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (properties, bell_alarm, "bell_alarm");
  GLADE_HOOKUP_OBJECT (properties, snd_alarm, "snd_alarm");
  GLADE_HOOKUP_OBJECT (properties, snd_file_entry, "snd_file_entry");
  GLADE_HOOKUP_OBJECT (properties, snd_entry, "snd_entry");
  GLADE_HOOKUP_OBJECT (properties, cmd_alarm, "cmd_alarm");
  GLADE_HOOKUP_OBJECT (properties, cmd_file_entry, "cmd_file_entry");
  GLADE_HOOKUP_OBJECT (properties, cmd_entry, "cmd_entry");
  GLADE_HOOKUP_OBJECT (properties, corba_alarm, "corba_alarm");
  GLADE_HOOKUP_OBJECT (properties, corba_entry, "corba_entry");
  GLADE_HOOKUP_OBJECT (properties, label2, "label2");
  GLADE_HOOKUP_OBJECT (properties, table2, "table2");
  GLADE_HOOKUP_OBJECT (properties, label7, "label7");
  GLADE_HOOKUP_OBJECT (properties, sand_color, "sand_color");
  GLADE_HOOKUP_OBJECT (properties, label3, "label3");
  GLADE_HOOKUP_OBJECT (properties, table3, "table3");
  GLADE_HOOKUP_OBJECT (properties, label8, "label8");
  GLADE_HOOKUP_OBJECT (properties, label9, "label9");
  GLADE_HOOKUP_OBJECT (properties, deco_button, "deco_button");
  GLADE_HOOKUP_OBJECT (properties, vbox4, "vbox4");
  GLADE_HOOKUP_OBJECT (properties, layer_desktop, "layer_desktop");
  GLADE_HOOKUP_OBJECT (properties, layer_below, "layer_below");
  GLADE_HOOKUP_OBJECT (properties, layer_normal, "layer_normal");
  GLADE_HOOKUP_OBJECT (properties, layer_ontop, "layer_ontop");
  GLADE_HOOKUP_OBJECT (properties, label4, "label4");

  return properties;
}

GtkWidget*
create_preferences (void)
{
  GtkWidget *preferences;
  GtkWidget *notebook3;
  GtkWidget *vbox5;
  GtkWidget *bell_pref;
  GSList *bell_pref_group = NULL;
  GtkWidget *snd_pref;
  GtkWidget *pref_file_entry;
  GtkWidget *pref_file;
  GtkWidget *cmd_pref;
  GtkWidget *pref_cmdstring_entry;
  GtkWidget *pref_cmdstring;
  GtkWidget *label13;
  GtkWidget *vbox6;
  GtkWidget *random_color_pref;
  GSList *random_color_pref_group = NULL;
  GtkWidget *hbox1;
  GtkWidget *fixed_color_pref;
  GtkWidget *color_pref;
  GtkWidget *label16;
  GtkWidget *table4;
  GtkWidget *label18;
  GtkWidget *label19;
  GtkWidget *pref_deco;
  GtkWidget *vbox7;
  GtkWidget *pref_desktop;
  GSList *pref_desktop_group = NULL;
  GtkWidget *pref_below;
  GtkWidget *pref_normal;
  GtkWidget *pref_ontop;
  GtkWidget *label17;

  preferences = gnome_property_box_new ();
  gtk_window_set_title (GTK_WINDOW (preferences), _("SandUhr preferences"));

  notebook3 = GNOME_PROPERTY_BOX (preferences)->notebook;
  gtk_widget_show (notebook3);

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

  bell_pref = gtk_radio_button_new_with_mnemonic (NULL, _("Ring terminal bell"));
  gtk_widget_show (bell_pref);
  gtk_box_pack_start (GTK_BOX (vbox5), bell_pref, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (bell_pref), bell_pref_group);
  bell_pref_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (bell_pref));
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (bell_pref), TRUE);

  snd_pref = gtk_radio_button_new_with_mnemonic (NULL, _("Play sound file:"));
  gtk_widget_show (snd_pref);
  gtk_box_pack_start (GTK_BOX (vbox5), snd_pref, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (snd_pref), bell_pref_group);
  bell_pref_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (snd_pref));

  pref_file_entry = gnome_file_entry_new ("sounds", _("Alarm sound file"));
  gtk_widget_show (pref_file_entry);
  gtk_box_pack_start (GTK_BOX (vbox5), pref_file_entry, FALSE, FALSE, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (pref_file_entry), TRUE);

  pref_file = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (pref_file_entry));
  gtk_widget_show (pref_file);

  cmd_pref = gtk_radio_button_new_with_mnemonic (NULL, _("External command:"));
  gtk_widget_show (cmd_pref);
  gtk_box_pack_start (GTK_BOX (vbox5), cmd_pref, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (cmd_pref), bell_pref_group);
  bell_pref_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (cmd_pref));

  pref_cmdstring_entry = gnome_file_entry_new ("commands", _("External alarm command"));
  gtk_widget_show (pref_cmdstring_entry);
  gtk_box_pack_start (GTK_BOX (vbox5), pref_cmdstring_entry, FALSE, FALSE, 0);
  gnome_file_entry_set_modal (GNOME_FILE_ENTRY (pref_cmdstring_entry), TRUE);

  pref_cmdstring = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (pref_cmdstring_entry));
  gtk_widget_show (pref_cmdstring);

  label13 = gtk_label_new (_("action"));
  gtk_widget_show (label13);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook3), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook3), 0), label13);

  vbox6 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox6);
  gtk_container_add (GTK_CONTAINER (notebook3), vbox6);

  random_color_pref = gtk_radio_button_new_with_mnemonic (NULL, _("random color"));
  gtk_widget_show (random_color_pref);
  gtk_box_pack_start (GTK_BOX (vbox6), random_color_pref, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (random_color_pref), random_color_pref_group);
  random_color_pref_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (random_color_pref));

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox6), hbox1, FALSE, FALSE, 0);

  fixed_color_pref = gtk_radio_button_new_with_mnemonic (NULL, _("fixed color: "));
  gtk_widget_show (fixed_color_pref);
  gtk_box_pack_start (GTK_BOX (hbox1), fixed_color_pref, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (fixed_color_pref), random_color_pref_group);
  random_color_pref_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (fixed_color_pref));

  color_pref = gnome_color_picker_new ();
  gtk_widget_show (color_pref);
  gtk_box_pack_start (GTK_BOX (hbox1), color_pref, FALSE, FALSE, 0);
  gnome_color_picker_set_title (GNOME_COLOR_PICKER (color_pref), _("Pick a sand color"));

  label16 = gtk_label_new (_("sand"));
  gtk_widget_show (label16);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook3), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook3), 1), label16);
  gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_CENTER);

  table4 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table4);
  gtk_container_add (GTK_CONTAINER (notebook3), table4);
  gtk_table_set_row_spacings (GTK_TABLE (table4), 4);
  gtk_table_set_col_spacings (GTK_TABLE (table4), 8);

  label18 = gtk_label_new (_("handles:"));
  gtk_widget_show (label18);
  gtk_table_attach (GTK_TABLE (table4), label18, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label18), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5);

  label19 = gtk_label_new (_("layer:"));
  gtk_widget_show (label19);
  gtk_table_attach (GTK_TABLE (table4), label19, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label19), GTK_JUSTIFY_CENTER);
  gtk_misc_set_alignment (GTK_MISC (label19), 0, 0);

  pref_deco = gtk_check_button_new_with_mnemonic (_("add window decorations"));
  gtk_widget_show (pref_deco);
  gtk_table_attach (GTK_TABLE (table4), pref_deco, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  vbox7 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox7);
  gtk_table_attach (GTK_TABLE (table4), vbox7, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  pref_desktop = gtk_radio_button_new_with_mnemonic (NULL, _("desktop"));
  gtk_widget_show (pref_desktop);
  gtk_box_pack_start (GTK_BOX (vbox7), pref_desktop, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (pref_desktop), pref_desktop_group);
  pref_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (pref_desktop));

  pref_below = gtk_radio_button_new_with_mnemonic (NULL, _("below"));
  gtk_widget_show (pref_below);
  gtk_box_pack_start (GTK_BOX (vbox7), pref_below, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (pref_below), pref_desktop_group);
  pref_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (pref_below));

  pref_normal = gtk_radio_button_new_with_mnemonic (NULL, _("normal"));
  gtk_widget_show (pref_normal);
  gtk_box_pack_start (GTK_BOX (vbox7), pref_normal, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (pref_normal), pref_desktop_group);
  pref_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (pref_normal));

  pref_ontop = gtk_radio_button_new_with_mnemonic (NULL, _("on top"));
  gtk_widget_show (pref_ontop);
  gtk_box_pack_start (GTK_BOX (vbox7), pref_ontop, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (pref_ontop), pref_desktop_group);
  pref_desktop_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (pref_ontop));

  label17 = gtk_label_new (_("window"));
  gtk_widget_show (label17);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook3), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook3), 2), label17);
  gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_CENTER);

  g_signal_connect ((gpointer) preferences, "help",
                    G_CALLBACK (on_preferences_help),
                    NULL);
  g_signal_connect ((gpointer) bell_pref, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) snd_pref, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_file, "changed",
                    G_CALLBACK (on_pref_file_changed),
                    NULL);
  g_signal_connect ((gpointer) cmd_pref, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_cmdstring, "changed",
                    G_CALLBACK (on_pref_cmd_changed),
                    NULL);
  g_signal_connect ((gpointer) random_color_pref, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) fixed_color_pref, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) color_pref, "color_set",
                    G_CALLBACK (on_color_pref_color_set),
                    NULL);
  g_signal_connect ((gpointer) pref_deco, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_desktop, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_below, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_normal, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);
  g_signal_connect ((gpointer) pref_ontop, "toggled",
                    G_CALLBACK (pref_changed),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (preferences, preferences, "preferences");
  GLADE_HOOKUP_OBJECT_NO_REF (preferences, notebook3, "notebook3");
  GLADE_HOOKUP_OBJECT (preferences, vbox5, "vbox5");
  GLADE_HOOKUP_OBJECT (preferences, bell_pref, "bell_pref");
  GLADE_HOOKUP_OBJECT (preferences, snd_pref, "snd_pref");
  GLADE_HOOKUP_OBJECT (preferences, pref_file_entry, "pref_file_entry");
  GLADE_HOOKUP_OBJECT (preferences, pref_file, "pref_file");
  GLADE_HOOKUP_OBJECT (preferences, cmd_pref, "cmd_pref");
  GLADE_HOOKUP_OBJECT (preferences, pref_cmdstring_entry, "pref_cmdstring_entry");
  GLADE_HOOKUP_OBJECT (preferences, pref_cmdstring, "pref_cmdstring");
  GLADE_HOOKUP_OBJECT (preferences, label13, "label13");
  GLADE_HOOKUP_OBJECT (preferences, vbox6, "vbox6");
  GLADE_HOOKUP_OBJECT (preferences, random_color_pref, "random_color_pref");
  GLADE_HOOKUP_OBJECT (preferences, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (preferences, fixed_color_pref, "fixed_color_pref");
  GLADE_HOOKUP_OBJECT (preferences, color_pref, "color_pref");
  GLADE_HOOKUP_OBJECT (preferences, label16, "label16");
  GLADE_HOOKUP_OBJECT (preferences, table4, "table4");
  GLADE_HOOKUP_OBJECT (preferences, label18, "label18");
  GLADE_HOOKUP_OBJECT (preferences, label19, "label19");
  GLADE_HOOKUP_OBJECT (preferences, pref_deco, "pref_deco");
  GLADE_HOOKUP_OBJECT (preferences, vbox7, "vbox7");
  GLADE_HOOKUP_OBJECT (preferences, pref_desktop, "pref_desktop");
  GLADE_HOOKUP_OBJECT (preferences, pref_below, "pref_below");
  GLADE_HOOKUP_OBJECT (preferences, pref_normal, "pref_normal");
  GLADE_HOOKUP_OBJECT (preferences, pref_ontop, "pref_ontop");
  GLADE_HOOKUP_OBJECT (preferences, label17, "label17");

  return preferences;
}


Generated by  Doxygen 1.6.0   Back to index