GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *comboboxOrder;
  GtkWidget *label2;
  GtkWidget *comboboxInterpolate;
  GtkWidget *label3;
  GtkWidget *comboboxType;
  GtkWidget *label4;
  GtkWidget *comboboxMnt;
  GtkWidget *label7;
  GtkWidget *checkbuttonChroma;
  GtkWidget *label8;
  GtkWidget *checkbuttonTryweave;
  GtkWidget *label10;
  GtkWidget *checkbuttonDenoise;
  GtkWidget *label9;
  GtkWidget *combobox5;
  GtkWidget *label5;
  GtkWidget *checkbuttonSharp;
  GtkWidget *label16;
  GtkWidget *checkbuttonFull;
  GtkWidget *label6;
  GtkWidget *combobox6;
  GtkWidget *table2;
  GtkWidget *label11;
  GtkWidget *label12;
  GtkObject *spinbuttonmthreshL_adj;
  GtkWidget *spinbuttonmthreshL;
  GtkObject *spinbuttonmthreshC_adj;
  GtkWidget *spinbuttonmthreshC;
  GtkWidget *label13;
  GtkObject *spinbuttoncthresh_adj;
  GtkWidget *spinbuttoncthresh;
  GtkWidget *label14;
  GtkObject *spinbuttonMI_adj;
  GtkWidget *spinbuttonMI;
  GtkWidget *label15;
  GtkObject *spinbuttonAP_adj;
  GtkWidget *spinbuttonAP;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("TDeint param"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (dialog1)->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);

  table1 = gtk_table_new (11, 2, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0);

  label1 = gtk_label_new (_("Field Order :"));
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  comboboxOrder = gtk_combo_box_new_text ();
  gtk_widget_show (comboboxOrder);
  gtk_table_attach (GTK_TABLE (table1), comboboxOrder, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxOrder), _("Bottom Field First"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxOrder), _("Top Field First"));

  label2 = gtk_label_new (_("Interpolate :"));
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  comboboxInterpolate = gtk_combo_box_new_text ();
  gtk_widget_show (comboboxInterpolate);
  gtk_table_attach (GTK_TABLE (table1), comboboxInterpolate, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxInterpolate), _("Top field (keep bottom)"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxInterpolate), _("Bottom field (keep top)"));

  label3 = gtk_label_new (_("Type"));
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);

  comboboxType = gtk_combo_box_new_text ();
  gtk_widget_show (comboboxType);
  gtk_table_attach (GTK_TABLE (table1), comboboxType, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxType), _("Cubic Interpolation"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxType), _("Modified ELA"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxType), _("Kernerl interpolation"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxType), _("Modified ELA-2"));

  label4 = gtk_label_new (_("MntMode"));
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);

  comboboxMnt = gtk_combo_box_new_text ();
  gtk_widget_show (comboboxMnt);
  gtk_table_attach (GTK_TABLE (table1), comboboxMnt, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxMnt), _("4 field check"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxMnt), _("5 field check"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxMnt), _("4 field check (no average)"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (comboboxMnt), _("5 field check (no average)"));

  label7 = gtk_label_new (_("Use Chroma to evalute"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  checkbuttonChroma = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonChroma);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonChroma, 1, 2, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label8 = gtk_label_new (_("Try weave "));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  checkbuttonTryweave = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonTryweave);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonTryweave, 1, 2, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label10 = gtk_label_new (_("Denoise"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table1), label10, 0, 1, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  checkbuttonDenoise = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonDenoise);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonDenoise, 1, 2, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label9 = gtk_label_new (_("Link"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  combobox5 = gtk_combo_box_new_text ();
  gtk_widget_show (combobox5);
  gtk_table_attach (GTK_TABLE (table1), combobox5, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox5), _("No link"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox5), _("Full linking"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox5), _("Y to UV link"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox5), _("UV to Y link"));

  label5 = gtk_label_new (_("Sharp :"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  checkbuttonSharp = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonSharp);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonSharp, 1, 2, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label16 = gtk_label_new (_("AP type"));
  gtk_widget_show (label16);
  gtk_table_attach (GTK_TABLE (table1), label16, 0, 1, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label16), 0, 0.5);

  checkbuttonFull = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonFull);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonFull, 1, 2, 10, 11,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label6 = gtk_label_new (_("Evaluate ALL frames"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 10, 11,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  combobox6 = gtk_combo_box_new_text ();
  gtk_widget_show (combobox6);
  gtk_table_attach (GTK_TABLE (table1), combobox6, 1, 2, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox6), _("0 (read manual)"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox6), _("1 (read manual)"));
  gtk_combo_box_append_text (GTK_COMBO_BOX (combobox6), _("2 (read manual)"));

  table2 = gtk_table_new (5, 2, FALSE);
  gtk_widget_show (table2);
  gtk_box_pack_start (GTK_BOX (vbox1), table2, TRUE, TRUE, 0);

  label11 = gtk_label_new (_("motion Threshold, Luma"));
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table2), label11, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);

  label12 = gtk_label_new (_("motion Threshold, Chroma"));
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table2), label12, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  spinbuttonmthreshL_adj = gtk_adjustment_new (1, 0, 255, 1, 10, 10);
  spinbuttonmthreshL = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonmthreshL_adj), 1, 0);
  gtk_widget_show (spinbuttonmthreshL);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonmthreshL, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonmthreshL), TRUE);

  spinbuttonmthreshC_adj = gtk_adjustment_new (1, 0, 255, 1, 10, 10);
  spinbuttonmthreshC = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonmthreshC_adj), 1, 0);
  gtk_widget_show (spinbuttonmthreshC);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonmthreshC, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonmthreshC), TRUE);

  label13 = gtk_label_new (_("Area Combing Threshold"));
  gtk_widget_show (label13);
  gtk_table_attach (GTK_TABLE (table2), label13, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);

  spinbuttoncthresh_adj = gtk_adjustment_new (1, 0, 255, 1, 10, 10);
  spinbuttoncthresh = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttoncthresh_adj), 1, 0);
  gtk_widget_show (spinbuttoncthresh);
  gtk_table_attach (GTK_TABLE (table2), spinbuttoncthresh, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label14 = gtk_label_new (_("Combed Treshold"));
  gtk_widget_show (label14);
  gtk_table_attach (GTK_TABLE (table2), label14, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label14), 0, 0.5);

  spinbuttonMI_adj = gtk_adjustment_new (1, 0, 255, 1, 10, 10);
  spinbuttonMI = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonMI_adj), 1, 0);
  gtk_widget_show (spinbuttonMI);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonMI, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonMI), TRUE);

  label15 = gtk_label_new (_("Artefact Protection threshold "));
  gtk_widget_show (label15);
  gtk_table_attach (GTK_TABLE (table2), label15, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);

  spinbuttonAP_adj = gtk_adjustment_new (1, 0, 255, 1, 10, 10);
  spinbuttonAP = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonAP_adj), 1, 0);
  gtk_widget_show (spinbuttonAP);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonAP, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonAP), TRUE);

  dialog_action_area1 = GTK_DIALOG (dialog1)->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 (dialog1), 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 (dialog1), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, comboboxOrder, "comboboxOrder");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, comboboxInterpolate, "comboboxInterpolate");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, comboboxType, "comboboxType");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, comboboxMnt, "comboboxMnt");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonChroma, "checkbuttonChroma");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonTryweave, "checkbuttonTryweave");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonDenoise, "checkbuttonDenoise");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, combobox5, "combobox5");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonSharp, "checkbuttonSharp");
  GLADE_HOOKUP_OBJECT (dialog1, label16, "label16");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonFull, "checkbuttonFull");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, combobox6, "combobox6");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonmthreshL, "spinbuttonmthreshL");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonmthreshC, "spinbuttonmthreshC");
  GLADE_HOOKUP_OBJECT (dialog1, label13, "label13");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttoncthresh, "spinbuttoncthresh");
  GLADE_HOOKUP_OBJECT (dialog1, label14, "label14");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMI, "spinbuttonMI");
  GLADE_HOOKUP_OBJECT (dialog1, label15, "label15");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonAP, "spinbuttonAP");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

  return dialog1;
}
Example #2
0
void create_PreferencesDialog(void)
{
  GtkWidget *PreferencesDialog;
  GtkWidget *dialog_vbox9;
  GtkWidget *notebook1;
  GtkWidget *GenericTable;
  GtkWidget *label173;
  GtkObject *LogLevelSpinner_adj;
  GtkWidget *LogLevelSpinner;
  GtkWidget *DebugCheckButton;
  GtkWidget *label174;
  GtkWidget *StreamDirectoryHbox;
  GtkWidget *StreamDirectory;
  GtkWidget *StreamDirectoryButton;
  GtkWidget *alignment24;
  GtkWidget *hbox84;
  GtkWidget *image24;
  GtkWidget *label175;
  GtkWidget *label176;
  GtkWidget *ProfileDirectoryHbox;
  GtkWidget *ProfileDirectory;
  GtkWidget *ProfileDirectoryButton;
  GtkWidget *alignment25;
  GtkWidget *hbox86;
  GtkWidget *image25;
  GtkWidget *label177;
  GtkWidget *label169;
  GtkWidget *NetworkVbox;
  GtkWidget *NetworkTable;
  GtkWidget *label178;
  GtkWidget *label179;
  GtkWidget *MulticastTtlMenu;
  GtkWidget *menu16;
  GtkWidget *ttl_lan;
  GtkWidget *ttl_organization;
  GtkWidget *ttl_regional;
  GtkWidget *ttl_worldwide;
  GtkObject *MtuSpinButton_adj;
  GtkWidget *MtuSpinButton;
  GtkWidget *vbox39;
  GtkWidget *hbox89;
  GtkWidget *AllowRtcpCheck;
  GtkWidget *hbox87;
  GtkWidget *AllowSSMCheck;
  GtkWidget *label170;
  GtkWidget *MP4FileSettingsVbox;
  GtkWidget *FileStatusFrame;
  GtkWidget *FileStatusVbox;
  GtkWidget *hbox90;
  GtkWidget *FileStatus1;
  GSList *FileStatus1_group = NULL;
  GtkWidget *hbox91;
  GtkWidget *FileStatus2;
  GtkWidget *hbox92;
  GtkWidget *FileStatus3;
  GtkWidget *label180;
  GtkWidget *hbox93;
  GtkWidget *RecordHintTrackButton;
  GtkWidget *hbox94;
  GtkWidget *OptimizeMP4FileButton;
  GtkWidget *hbox95;
  GtkWidget *RecordRawDataButton;
  GtkWidget *RawFileName;
  GtkWidget *RawFileNameBrowse;
  GtkWidget *alignment26;
  GtkWidget *hbox96;
  GtkWidget *image26;
  GtkWidget *label181;
  GtkWidget *label171;
  GtkWidget *dialog_action_area8;
  GtkWidget *cancelbutton6;
  GtkWidget *okbutton8;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new();

  PreferencesDialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(PreferencesDialog), _("Preferences"));
  gtk_window_set_modal(GTK_WINDOW(PreferencesDialog), TRUE);
  gtk_window_set_resizable(GTK_WINDOW(PreferencesDialog), FALSE);
  gtk_window_set_transient_for(GTK_WINDOW(PreferencesDialog), 
			       GTK_WINDOW(MainWindow));

  dialog_vbox9 = GTK_DIALOG(PreferencesDialog)->vbox;
  gtk_widget_show(dialog_vbox9);

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

  GenericTable = gtk_table_new(4, 2, FALSE);
  gtk_widget_show(GenericTable);
  gtk_container_add(GTK_CONTAINER(notebook1), GenericTable);
  gtk_table_set_row_spacings(GTK_TABLE(GenericTable), 9);
  gtk_table_set_col_spacings(GTK_TABLE(GenericTable), 36);

  label173 = gtk_label_new(_("Log Level"));
  gtk_widget_show(label173);
  gtk_table_attach(GTK_TABLE(GenericTable), label173, 0, 1, 1, 2,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label173), 0, 0.5);

  LogLevelSpinner_adj = gtk_adjustment_new(MyConfig->GetIntegerValue(CONFIG_APP_LOGLEVEL),
					    0, 7, 1, 10, 10);
  LogLevelSpinner = gtk_spin_button_new(GTK_ADJUSTMENT(LogLevelSpinner_adj), 1, 0);
  gtk_widget_show(LogLevelSpinner);
  gtk_table_attach(GTK_TABLE(GenericTable), LogLevelSpinner, 1, 2, 1, 2,
                   (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);

  DebugCheckButton = gtk_check_button_new_with_mnemonic(_("Debug"));
  gtk_widget_show(DebugCheckButton);
  gtk_table_attach(GTK_TABLE(GenericTable), DebugCheckButton, 0, 2, 0, 1,
                   (GtkAttachOptions)(0),
                   (GtkAttachOptions)(0), 0, 0);

  label174 = gtk_label_new(_("Stream Directory"));
  gtk_widget_show(label174);
  gtk_table_attach(GTK_TABLE(GenericTable), label174, 0, 1, 2, 3,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label174), 0, 0.5);

  StreamDirectoryHbox = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(StreamDirectoryHbox);
  gtk_table_attach(GTK_TABLE(GenericTable), StreamDirectoryHbox, 1, 2, 2, 3,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(GTK_FILL), 0, 0);

  StreamDirectory = gtk_entry_new();
  gtk_widget_show(StreamDirectory);
  gtk_box_pack_start(GTK_BOX(StreamDirectoryHbox), StreamDirectory, TRUE, TRUE, 0);

  StreamDirectoryButton = gtk_button_new();
  gtk_widget_show(StreamDirectoryButton);
  gtk_box_pack_start(GTK_BOX(StreamDirectoryHbox), StreamDirectoryButton, FALSE, FALSE, 0);

  alignment24 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment24);
  gtk_container_add(GTK_CONTAINER(StreamDirectoryButton), alignment24);

  hbox84 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox84);
  gtk_container_add(GTK_CONTAINER(alignment24), hbox84);

  image24 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image24);
  gtk_box_pack_start(GTK_BOX(hbox84), image24, FALSE, FALSE, 0);

  label175 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label175);
  gtk_box_pack_start(GTK_BOX(hbox84), label175, FALSE, FALSE, 0);

  label176 = gtk_label_new(_("Profiles Directory"));
  gtk_widget_show(label176);
  gtk_table_attach(GTK_TABLE(GenericTable), label176, 0, 1, 3, 4,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label176), 0, 0.5);

  ProfileDirectoryHbox = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(ProfileDirectoryHbox);
  gtk_table_attach(GTK_TABLE(GenericTable), ProfileDirectoryHbox, 1, 2, 3, 4,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(GTK_FILL), 0, 0);

  ProfileDirectory = gtk_entry_new();
  gtk_widget_show(ProfileDirectory);
  gtk_box_pack_start(GTK_BOX(ProfileDirectoryHbox), ProfileDirectory, TRUE, TRUE, 0);

  ProfileDirectoryButton = gtk_button_new();
  gtk_widget_show(ProfileDirectoryButton);
  gtk_box_pack_start(GTK_BOX(ProfileDirectoryHbox), ProfileDirectoryButton, FALSE, FALSE, 0);

  alignment25 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment25);
  gtk_container_add(GTK_CONTAINER(ProfileDirectoryButton), alignment25);

  hbox86 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox86);
  gtk_container_add(GTK_CONTAINER(alignment25), hbox86);

  image25 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image25);
  gtk_box_pack_start(GTK_BOX(hbox86), image25, FALSE, FALSE, 0);

  label177 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label177);
  gtk_box_pack_start(GTK_BOX(hbox86), label177, FALSE, FALSE, 0);

  label169 = gtk_label_new(_("Generic"));
  gtk_widget_show(label169);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 0), label169);

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

  NetworkTable = gtk_table_new(2, 2, TRUE);
  gtk_widget_show(NetworkTable);
  gtk_box_pack_start(GTK_BOX(NetworkVbox), NetworkTable, FALSE, TRUE, 6);
  gtk_table_set_row_spacings(GTK_TABLE(NetworkTable), 7);

  label178 = gtk_label_new(_("Multicast TTL"));
  gtk_widget_show(label178);
  gtk_table_attach(GTK_TABLE(NetworkTable), label178, 0, 1, 0, 1,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label178), 0, 0.5);

  label179 = gtk_label_new(_("MTU"));
  gtk_widget_show(label179);
  gtk_table_attach(GTK_TABLE(NetworkTable), label179, 0, 1, 1, 2,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);
  gtk_misc_set_alignment(GTK_MISC(label179), 0, 0.5);

  MulticastTtlMenu = gtk_option_menu_new();
  gtk_widget_show(MulticastTtlMenu);
  gtk_table_attach(GTK_TABLE(NetworkTable), MulticastTtlMenu, 1, 2, 0, 1,
                   (GtkAttachOptions)(GTK_FILL),
                   (GtkAttachOptions)(0), 0, 0);

  menu16 = gtk_menu_new();

  ttl_lan = gtk_menu_item_new_with_mnemonic(_("LAN - 1"));
  gtk_widget_show(ttl_lan);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_lan);

  ttl_organization = gtk_menu_item_new_with_mnemonic(_("Organization - 15"));
  gtk_widget_show(ttl_organization);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_organization);

  ttl_regional = gtk_menu_item_new_with_mnemonic(_("Regional - 63"));
  gtk_widget_show(ttl_regional);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_regional);

  ttl_worldwide = gtk_menu_item_new_with_mnemonic(_("Worldwide -127"));
  gtk_widget_show(ttl_worldwide);
  gtk_container_add(GTK_CONTAINER(menu16), ttl_worldwide);

  gtk_option_menu_set_menu(GTK_OPTION_MENU(MulticastTtlMenu), menu16);

  MtuSpinButton_adj = 
    gtk_adjustment_new(MyConfig->GetIntegerValue(CONFIG_RTP_PAYLOAD_SIZE), 
		       256, 65535, 1, 100, 100);
  MtuSpinButton = gtk_spin_button_new(GTK_ADJUSTMENT (MtuSpinButton_adj), 1, 0);
  gtk_widget_show(MtuSpinButton);
  gtk_table_attach(GTK_TABLE (NetworkTable), MtuSpinButton, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (MtuSpinButton), TRUE);

  vbox39 = gtk_vbox_new(FALSE, 4);
  gtk_widget_show(vbox39);
  gtk_box_pack_start(GTK_BOX(NetworkVbox), vbox39, FALSE, FALSE, 5);

  hbox89 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox89);
  gtk_box_pack_start(GTK_BOX(vbox39), hbox89, TRUE, TRUE, 4);

  AllowRtcpCheck = gtk_check_button_new_with_mnemonic(_("Allow Clients to Send RTCP"));
  gtk_widget_show(AllowRtcpCheck);
  gtk_box_pack_start(GTK_BOX(hbox89), AllowRtcpCheck, FALSE, FALSE, 94);
  gtk_tooltips_set_tip(tooltips, AllowRtcpCheck, _("Allow clients to send RTCP - default off"), NULL);

  hbox87 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox87);
  gtk_box_pack_start(GTK_BOX(vbox39), hbox87, TRUE, TRUE, 0);

  AllowSSMCheck = gtk_check_button_new_with_mnemonic(_("Use Single Source Multicast"));
  gtk_widget_show(AllowSSMCheck);
  gtk_box_pack_start(GTK_BOX(hbox87), AllowSSMCheck, TRUE, FALSE, 0);
  gtk_widget_set_sensitive(AllowSSMCheck, FALSE);

  label170 = gtk_label_new(_("Network Settings"));
  gtk_widget_show(label170);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 1), label170);

  MP4FileSettingsVbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(MP4FileSettingsVbox);
  gtk_container_add(GTK_CONTAINER(notebook1), MP4FileSettingsVbox);
  gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(notebook1), MP4FileSettingsVbox,
                                      FALSE, FALSE, GTK_PACK_START);

  FileStatusFrame = gtk_frame_new(NULL);
  gtk_widget_show(FileStatusFrame);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), FileStatusFrame, TRUE, TRUE, 0);

  FileStatusVbox = gtk_vbox_new(FALSE, 0);
  gtk_widget_show(FileStatusVbox);
  gtk_container_add(GTK_CONTAINER(FileStatusFrame), FileStatusVbox);

  hbox90 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox90);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox90, TRUE, TRUE, 0);

  FileStatus1 = gtk_radio_button_new_with_mnemonic(NULL, _("Always overwrite existing file"));
  gtk_widget_show(FileStatus1);
  gtk_box_pack_start(GTK_BOX(hbox90), FileStatus1, TRUE, TRUE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus1), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus1));

  hbox91 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox91);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox91, FALSE, FALSE, 0);

  FileStatus2 = gtk_radio_button_new_with_mnemonic(NULL, _("Append to file"));
  gtk_widget_show(FileStatus2);
  gtk_box_pack_start(GTK_BOX(hbox91), FileStatus2, TRUE, TRUE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus2), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus2));

  hbox92 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox92);
  gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox92, FALSE, FALSE, 0);

  FileStatus3 = gtk_radio_button_new_with_mnemonic(NULL, _("Create new file based on name"));
  gtk_widget_show(FileStatus3);
  gtk_box_pack_start(GTK_BOX(hbox92), FileStatus3, FALSE, FALSE, 46);
  gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus3), FileStatus1_group);
  FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus3));

  label180 = gtk_label_new(_("File Status"));
  gtk_widget_show(label180);
  gtk_frame_set_label_widget(GTK_FRAME(FileStatusFrame), label180);

  hbox93 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox93);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox93, TRUE, TRUE, 4);

  RecordHintTrackButton = gtk_check_button_new_with_mnemonic(_("Record Hint Tracks when Finished"));
  gtk_widget_show(RecordHintTrackButton);
  gtk_box_pack_start(GTK_BOX(hbox93), RecordHintTrackButton, TRUE, FALSE, 0);
  gtk_tooltips_set_tip(tooltips, RecordHintTrackButton, _("If set, this can cause application to appear to freeze when finished"), NULL);

  hbox94 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox94);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox94, TRUE, TRUE, 4);

  OptimizeMP4FileButton = gtk_check_button_new_with_mnemonic(_("Optimize When Finished"));
  gtk_widget_show(OptimizeMP4FileButton);
  gtk_box_pack_start(GTK_BOX(hbox94), OptimizeMP4FileButton, FALSE, FALSE, 79);

  hbox95 = gtk_hbox_new(FALSE, 0);
  gtk_widget_show(hbox95);
  gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox95, TRUE, TRUE, 0);

  RecordRawDataButton = gtk_check_button_new_with_mnemonic(_("Record Raw Data "));
  gtk_widget_show(RecordRawDataButton);
  gtk_box_pack_start(GTK_BOX(hbox95), RecordRawDataButton, FALSE, FALSE, 0);

  RawFileName = gtk_entry_new();
  gtk_widget_show(RawFileName);
  gtk_box_pack_start(GTK_BOX(hbox95), RawFileName, TRUE, TRUE, 0);
  gtk_tooltips_set_tip(tooltips, RawFileName, _("Raw Data MP4 File Name"), NULL);

  RawFileNameBrowse = gtk_button_new();
  gtk_widget_show(RawFileNameBrowse);
  gtk_box_pack_start(GTK_BOX(hbox95), RawFileNameBrowse, FALSE, FALSE, 0);

  alignment26 = gtk_alignment_new(0.5, 0.5, 0, 0);
  gtk_widget_show(alignment26);
  gtk_container_add(GTK_CONTAINER(RawFileNameBrowse), alignment26);

  hbox96 = gtk_hbox_new(FALSE, 2);
  gtk_widget_show(hbox96);
  gtk_container_add(GTK_CONTAINER(alignment26), hbox96);

  image26 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show(image26);
  gtk_box_pack_start(GTK_BOX(hbox96), image26, FALSE, FALSE, 0);

  label181 = gtk_label_new_with_mnemonic(_("Browse"));
  gtk_widget_show(label181);
  gtk_box_pack_start(GTK_BOX(hbox96), label181, FALSE, FALSE, 0);

  label171 = gtk_label_new(_("MP4 File Settings"));
  gtk_widget_show(label171);
  gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 2), label171);

  dialog_action_area8 = GTK_DIALOG(PreferencesDialog)->action_area;
  gtk_widget_show(dialog_action_area8);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area8), GTK_BUTTONBOX_END);

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

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

  g_signal_connect((gpointer) PreferencesDialog, "response",
                    G_CALLBACK(on_PreferencesDialog_response),
                    NULL);
  g_signal_connect((gpointer)StreamDirectoryButton, "clicked",
		   G_CALLBACK(on_stream_directory_clicked), 
		   PreferencesDialog);
  g_signal_connect((gpointer)ProfileDirectoryButton, "clicked",
		   G_CALLBACK(on_profile_directory_clicked), 
		   PreferencesDialog);

  g_signal_connect((gpointer)RawFileNameBrowse, "clicked",
		   G_CALLBACK(on_raw_file_clicked),
		   PreferencesDialog);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, PreferencesDialog, "PreferencesDialog");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_vbox9, "dialog_vbox9");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, GenericTable, "GenericTable");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label173, "label173");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, LogLevelSpinner, "LogLevelSpinner");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, DebugCheckButton, "DebugCheckButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label174, "label174");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryHbox, "StreamDirectoryHbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectory, "StreamDirectory");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryButton, "StreamDirectoryButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment24, "alignment24");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox84, "hbox84");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image24, "image24");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label175, "label175");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label176, "label176");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryHbox, "ProfileDirectoryHbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectory, "ProfileDirectory");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryButton, "ProfileDirectoryButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment25, "alignment25");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox86, "hbox86");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image25, "image25");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label177, "label177");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label169, "label169");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkVbox, "NetworkVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkTable, "NetworkTable");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label178, "label178");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label179, "label179");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, MulticastTtlMenu, "MulticastTtlMenu");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, menu16, "menu16");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_lan, "ttl_lan");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_organization, "ttl_organization");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_regional, "ttl_regional");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_worldwide, "ttl_worldwide");
  GLADE_HOOKUP_OBJECT (PreferencesDialog, MtuSpinButton, "MtuSpinButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, vbox39, "vbox39");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox89, "hbox89");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowRtcpCheck, "AllowRtcpCheck");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox87, "hbox87");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowSSMCheck, "AllowSSMCheck");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label170, "label170");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, MP4FileSettingsVbox, "MP4FileSettingsVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusFrame, "FileStatusFrame");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusVbox, "FileStatusVbox");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox90, "hbox90");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus1, "FileStatus1");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox91, "hbox91");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus2, "FileStatus2");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox92, "hbox92");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus3, "FileStatus3");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label180, "label180");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox93, "hbox93");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordHintTrackButton, "RecordHintTrackButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox94, "hbox94");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, OptimizeMP4FileButton, "OptimizeMP4FileButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox95, "hbox95");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordRawDataButton, "RecordRawDataButton");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileName, "RawFileName");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileNameBrowse, "RawFileNameBrowse");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment26, "alignment26");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox96, "hbox96");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, image26, "image26");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label181, "label181");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, label171, "label171");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_action_area8, "dialog_action_area8");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, cancelbutton6, "cancelbutton6");
  GLADE_HOOKUP_OBJECT(PreferencesDialog, okbutton8, "okbutton8");
  GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, tooltips, "tooltips");

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(DebugCheckButton),
			       MyConfig->GetBoolValue(CONFIG_APP_DEBUG));

  const char *dir;
  char dirname[PATH_MAX];
  dir = MyConfig->GetStringValue(CONFIG_APP_STREAM_DIRECTORY);
  if (dir != NULL) {
    gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dir);
  } else {
    GetHomeDirectory(dirname);
    strcat(dirname, ".mp4live_d/Streams/");
    gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dirname);
  }
  dir = MyConfig->GetStringValue(CONFIG_APP_PROFILE_DIRECTORY);
  if (dir != NULL) {
    gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dir);
  } else {
    GetHomeDirectory(dirname);
    strcat(dirname, ".mp4live_d/");
    gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dirname);
  }

  uint ttl = MyConfig->GetIntegerValue(CONFIG_RTP_MCAST_TTL);
  uint index;
  if (ttl <= 1) {
    index = 0;
  } else if (ttl <= 15) {
    index = 1;
  } else if (ttl <= 64) {
    index = 2;
  } else 
    index = 3;
  gtk_option_menu_set_history(GTK_OPTION_MENU(MulticastTtlMenu), index);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowRtcpCheck),
			       MyConfig->GetBoolValue(CONFIG_RTP_NO_B_RR_0));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowSSMCheck),
			       MyConfig->GetBoolValue(CONFIG_RTP_USE_SSM));

  uint fstatus = MyConfig->GetIntegerValue(CONFIG_RECORD_MP4_FILE_STATUS);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus1),
			       fstatus == FILE_MP4_OVERWRITE);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus2),
			       fstatus == FILE_MP4_APPEND);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus3),
			       fstatus == FILE_MP4_CREATE_NEW);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordHintTrackButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_MP4_HINT_TRACKS));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OptimizeMP4FileButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_MP4_OPTIMIZE));
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordRawDataButton),
			       MyConfig->GetBoolValue(CONFIG_RECORD_RAW_IN_MP4));
  gtk_entry_set_text(GTK_ENTRY(RawFileName), 
		     MyConfig->GetStringValue(CONFIG_RECORD_RAW_MP4_FILE_NAME));

  gtk_widget_show(PreferencesDialog);
}
  GtkWidget*
      create_dialogAudio (void)
  {
    GtkWidget *dialogAudio;
    GtkWidget *dialog_vbox1;
    GtkWidget *vbox3;
    GtkWidget *frame3;
    GtkWidget *vbox6;
    GtkWidget *checkbuttonDRC;
    GtkWidget *hbox3;
    GtkWidget *checkbuttonTimeShift;
    GtkWidget *entryTimeshift;
    GtkWidget *label5;
    GtkWidget *frame1;
    GtkWidget *vbox4;
    GtkWidget *radiobuttonNone;
    GSList *radiobuttonNone_group = NULL;
    GtkWidget *hbox2;
    GtkWidget *radiobuttonSox;
    GtkWidget *entryFrequency;
    GtkWidget *label3;
    GtkWidget *frame2;
    GtkWidget *vbox5;
    GtkWidget *radiobutton_fpsnone;
    GSList *radiobutton_fpsnone_group = NULL;
    GtkWidget *radiobutton_fpsfilm;
    GtkWidget *radiobutton_fpsPAL;
    GtkWidget *label4;
    GtkWidget *Gain;
    GtkWidget *alignment1;
    GtkWidget *hbox4;
    GtkWidget *checkbutton1;
    GtkWidget *vbox7;
    GtkWidget *radiobuttonGainAutoPIN;
    GSList *radiobuttonGainAutoPIN_group = NULL;
    GtkWidget *hbox5;
    GtkWidget *radiobuttonGainManualPIN;
    GtkObject *spinbutton1_adj;
    GtkWidget *spinbutton1;
    GtkWidget *label7;
    GtkWidget *frame4;
    GtkWidget *combobox1;
    GtkWidget *label6;
    GtkWidget *dialog_action_area1;
    GtkWidget *cancelbutton1;
    GtkWidget *okbutton1;

    dialogAudio = gtk_dialog_new ();
    gtk_window_set_title (GTK_WINDOW (dialogAudio), _("Audio Processing"));
    gtk_window_set_type_hint (GTK_WINDOW (dialogAudio), GDK_WINDOW_TYPE_HINT_DIALOG);

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

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

    frame3 = gtk_frame_new (NULL);
    gtk_widget_show (frame3);
    gtk_box_pack_start (GTK_BOX (vbox3), frame3, FALSE, FALSE, 0);

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

    checkbuttonDRC = gtk_check_button_new_with_mnemonic (_("DRC"));
    gtk_widget_show (checkbuttonDRC);
    gtk_box_pack_start (GTK_BOX (vbox6), checkbuttonDRC, FALSE, FALSE, 0);

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

    checkbuttonTimeShift = gtk_check_button_new_with_mnemonic (_("Timeshift"));
    gtk_widget_show (checkbuttonTimeShift);
    gtk_box_pack_start (GTK_BOX (hbox3), checkbuttonTimeShift, FALSE, FALSE, 0);

    entryTimeshift = gtk_entry_new ();
    gtk_widget_show (entryTimeshift);
    gtk_box_pack_start (GTK_BOX (hbox3), entryTimeshift, TRUE, TRUE, 0);
    gtk_entry_set_max_length (GTK_ENTRY (entryTimeshift), 5);

    label5 = gtk_label_new (_("<b>Misc</b>"));
    gtk_widget_show (label5);
    gtk_frame_set_label_widget (GTK_FRAME (frame3), label5);
    gtk_label_set_use_markup (GTK_LABEL (label5), TRUE);

    frame1 = gtk_frame_new (NULL);
    gtk_widget_show (frame1);
    gtk_box_pack_start (GTK_BOX (vbox3), frame1, FALSE, FALSE, 0);

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

    radiobuttonNone = gtk_radio_button_new_with_mnemonic (NULL, _("None"));
    gtk_widget_show (radiobuttonNone);
    gtk_box_pack_start (GTK_BOX (vbox4), radiobuttonNone, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobuttonNone), radiobuttonNone_group);
    radiobuttonNone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobuttonNone));

    hbox2 = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (hbox2);
    gtk_box_pack_start (GTK_BOX (vbox4), hbox2, FALSE, FALSE, 0);

    radiobuttonSox = gtk_radio_button_new_with_mnemonic (NULL, _("Resample to hz"));
    gtk_widget_show (radiobuttonSox);
    gtk_box_pack_start (GTK_BOX (hbox2), radiobuttonSox, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobuttonSox), radiobuttonNone_group);
    radiobuttonNone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobuttonSox));

    entryFrequency = gtk_entry_new ();
    gtk_widget_show (entryFrequency);
    gtk_box_pack_start (GTK_BOX (hbox2), entryFrequency, TRUE, TRUE, 0);

    label3 = gtk_label_new (_("<b>Resampling</b>"));
    gtk_widget_show (label3);
    gtk_frame_set_label_widget (GTK_FRAME (frame1), label3);
    gtk_label_set_use_markup (GTK_LABEL (label3), TRUE);

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

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

    radiobutton_fpsnone = gtk_radio_button_new_with_mnemonic (NULL, _("None"));
    gtk_widget_show (radiobutton_fpsnone);
    gtk_box_pack_start (GTK_BOX (vbox5), radiobutton_fpsnone, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_fpsnone), radiobutton_fpsnone_group);
    radiobutton_fpsnone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_fpsnone));

    radiobutton_fpsfilm = gtk_radio_button_new_with_mnemonic (NULL, _("Film -> PAL"));
    gtk_widget_show (radiobutton_fpsfilm);
    gtk_box_pack_start (GTK_BOX (vbox5), radiobutton_fpsfilm, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_fpsfilm), radiobutton_fpsnone_group);
    radiobutton_fpsnone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_fpsfilm));

    radiobutton_fpsPAL = gtk_radio_button_new_with_mnemonic (NULL, _("PAL->Film"));
    gtk_widget_show (radiobutton_fpsPAL);
    gtk_box_pack_start (GTK_BOX (vbox5), radiobutton_fpsPAL, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_fpsPAL), radiobutton_fpsnone_group);
    radiobutton_fpsnone_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_fpsPAL));

    label4 = gtk_label_new (_("<b>Fps convert</b>"));
    gtk_widget_show (label4);
    gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
    gtk_label_set_use_markup (GTK_LABEL (label4), TRUE);

    Gain = gtk_frame_new (NULL);
    gtk_widget_show (Gain);
    gtk_box_pack_start (GTK_BOX (vbox3), Gain, FALSE, TRUE, 0);
    gtk_frame_set_shadow_type (GTK_FRAME (Gain), GTK_SHADOW_NONE);

    alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
    gtk_widget_show (alignment1);
    gtk_container_add (GTK_CONTAINER (Gain), alignment1);
    gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);

    hbox4 = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (hbox4);
    gtk_container_add (GTK_CONTAINER (alignment1), hbox4);

    checkbutton1 = gtk_check_button_new_with_mnemonic (_("Gain"));
    gtk_widget_show (checkbutton1);
    gtk_box_pack_start (GTK_BOX (hbox4), checkbutton1, FALSE, FALSE, 0);

    vbox7 = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (vbox7);
    gtk_box_pack_start (GTK_BOX (hbox4), vbox7, TRUE, TRUE, 0);

    radiobuttonGainAutoPIN = gtk_radio_button_new_with_mnemonic (NULL, _("Automatic ( max is -3dB)"));
    gtk_widget_show (radiobuttonGainAutoPIN);
    gtk_box_pack_start (GTK_BOX (vbox7), radiobuttonGainAutoPIN, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobuttonGainAutoPIN), radiobuttonGainAutoPIN_group);
    radiobuttonGainAutoPIN_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobuttonGainAutoPIN));

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

    radiobuttonGainManualPIN = gtk_radio_button_new_with_mnemonic (NULL, _("Manual (db) : "));
    gtk_widget_show (radiobuttonGainManualPIN);
    gtk_box_pack_start (GTK_BOX (hbox5), radiobuttonGainManualPIN, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobuttonGainManualPIN), radiobuttonGainAutoPIN_group);
    radiobuttonGainAutoPIN_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobuttonGainManualPIN));

    spinbutton1_adj = gtk_adjustment_new (-6, -6, 6, 0.10000000149, 1, 1);
    spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 1);
    gtk_widget_show (spinbutton1);
    gtk_box_pack_start (GTK_BOX (hbox5), spinbutton1, TRUE, TRUE, 0);
    gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton1), TRUE);

    label7 = gtk_label_new (_("<b>Gain</b>"));
    gtk_widget_show (label7);
    gtk_frame_set_label_widget (GTK_FRAME (Gain), label7);
    gtk_label_set_use_markup (GTK_LABEL (label7), TRUE);

    frame4 = gtk_frame_new (NULL);
    gtk_widget_show (frame4);
    gtk_box_pack_start (GTK_BOX (vbox3), frame4, TRUE, TRUE, 0);

    combobox1 = gtk_combo_box_new_text ();
    gtk_widget_show (combobox1);
    gtk_container_add (GTK_CONTAINER (frame4), combobox1);
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("No change"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Mono"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Surround"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Center"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Center+Surround"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo Front+Stero Rear"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("5 channels"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("5.1"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Dolby Prologic"));
    gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Dolby Prologic 2"));

    label6 = gtk_label_new (_("<b>Mixer</b>"));
    gtk_widget_show (label6);
    gtk_frame_set_label_widget (GTK_FRAME (frame4), label6);
    gtk_label_set_use_markup (GTK_LABEL (label6), TRUE);

    dialog_action_area1 = GTK_DIALOG (dialogAudio)->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 (dialogAudio), 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 (dialogAudio), okbutton1, GTK_RESPONSE_OK);
    GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialogAudio, "dialogAudio");
    GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialog_vbox1, "dialog_vbox1");
    GLADE_HOOKUP_OBJECT (dialogAudio, vbox3, "vbox3");
    GLADE_HOOKUP_OBJECT (dialogAudio, frame3, "frame3");
    GLADE_HOOKUP_OBJECT (dialogAudio, vbox6, "vbox6");
    GLADE_HOOKUP_OBJECT (dialogAudio, checkbuttonDRC, "checkbuttonDRC");
    GLADE_HOOKUP_OBJECT (dialogAudio, hbox3, "hbox3");
    GLADE_HOOKUP_OBJECT (dialogAudio, checkbuttonTimeShift, "checkbuttonTimeShift");
    GLADE_HOOKUP_OBJECT (dialogAudio, entryTimeshift, "entryTimeshift");
    GLADE_HOOKUP_OBJECT (dialogAudio, label5, "label5");
    GLADE_HOOKUP_OBJECT (dialogAudio, frame1, "frame1");
    GLADE_HOOKUP_OBJECT (dialogAudio, vbox4, "vbox4");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonNone, "radiobuttonNone");
    GLADE_HOOKUP_OBJECT (dialogAudio, hbox2, "hbox2");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonSox, "radiobuttonSox");
    GLADE_HOOKUP_OBJECT (dialogAudio, entryFrequency, "entryFrequency");
    GLADE_HOOKUP_OBJECT (dialogAudio, label3, "label3");
    GLADE_HOOKUP_OBJECT (dialogAudio, frame2, "frame2");
    GLADE_HOOKUP_OBJECT (dialogAudio, vbox5, "vbox5");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsnone, "radiobutton_fpsnone");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsfilm, "radiobutton_fpsfilm");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsPAL, "radiobutton_fpsPAL");
    GLADE_HOOKUP_OBJECT (dialogAudio, label4, "label4");
    GLADE_HOOKUP_OBJECT (dialogAudio, Gain, "Gain");
    GLADE_HOOKUP_OBJECT (dialogAudio, alignment1, "alignment1");
    GLADE_HOOKUP_OBJECT (dialogAudio, hbox4, "hbox4");
    GLADE_HOOKUP_OBJECT (dialogAudio, checkbutton1, "checkbutton1");
    GLADE_HOOKUP_OBJECT (dialogAudio, vbox7, "vbox7");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonGainAutoPIN, "radiobuttonGainAutoPIN");
    GLADE_HOOKUP_OBJECT (dialogAudio, hbox5, "hbox5");
    GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonGainManualPIN, "radiobuttonGainManualPIN");
    GLADE_HOOKUP_OBJECT (dialogAudio, spinbutton1, "spinbutton1");
    GLADE_HOOKUP_OBJECT (dialogAudio, label7, "label7");
    GLADE_HOOKUP_OBJECT (dialogAudio, frame4, "frame4");
    GLADE_HOOKUP_OBJECT (dialogAudio, combobox1, "combobox1");
    GLADE_HOOKUP_OBJECT (dialogAudio, label6, "label6");
    GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialog_action_area1, "dialog_action_area1");
    GLADE_HOOKUP_OBJECT (dialogAudio, cancelbutton1, "cancelbutton1");
    GLADE_HOOKUP_OBJECT (dialogAudio, okbutton1, "okbutton1");

    return dialogAudio;
  }
Example #4
0
GtkWidget*
create_app (void)
{
  GtkWidget *app;
  GtkWidget *dock1;
  GtkWidget *toolbar1;
  GtkWidget *tmp_toolbar_icon;
  GtkWidget *button_new;
  GtkWidget *button_open;
  GtkWidget *button_save;
  GtkWidget *button_save_as;
  GtkWidget *hexentry;
  GtkWidget *button_upload;
  GtkWidget *radiobutton_spline;
  GtkWidget *radiobutton_linear;
  GtkWidget *radiobutton_free;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *vbox2;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkObject *minx_adj;
  GtkWidget *minx;
  GtkWidget *type;
  GList *type_items = NULL;
  GtkWidget *typeentry;
  GtkObject *maxx_adj;
  GtkWidget *maxx;
  GtkObject *miny_adj;
  GtkWidget *miny;
  GtkObject *maxy_adj;
  GtkWidget *maxy;
  GtkObject *count_adj;
  GtkWidget *count;
  GtkWidget *label10;
  GtkWidget *label11;
  GtkWidget *label12;
  GtkObject *scale_adj;
  GtkWidget *scale;
  GtkObject *base_adj;
  GtkWidget *base;
  GtkWidget *label13;
  GtkWidget *scrolledwindow1;
  GtkWidget *clist;
  GtkWidget *label8;
  GtkWidget *label9;
  GtkWidget *toolbar2;
  GtkWidget *list_open;
  GtkWidget *list_save;
  GtkWidget *list_add;
  GtkWidget *list_remove;
  GtkWidget *list_use;
  GtkWidget *curve;
  GtkWidget *appbar1;

  app = gnome_app_new ("Curvegen", _("PSXDEV Curve Generator"));
  gtk_object_set_data (GTK_OBJECT (app), "app", app);

  dock1 = GNOME_APP (app)->dock;
  gtk_widget_ref (dock1);
  gtk_object_set_data_full (GTK_OBJECT (app), "dock1", dock1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dock1);

  gnome_app_create_menus (GNOME_APP (app), menubar1_uiinfo);

  gtk_widget_ref (menubar1_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "file1",
                            menubar1_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (file1_menu_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "exit1",
                            file1_menu_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (menubar1_uiinfo[1].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "help1",
                            menubar1_uiinfo[1].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  gtk_widget_ref (help1_menu_uiinfo[0].widget);
  gtk_object_set_data_full (GTK_OBJECT (app), "about1",
                            help1_menu_uiinfo[0].widget,
                            (GtkDestroyNotify) gtk_widget_unref);

  toolbar1 = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (toolbar1);
  gtk_object_set_data_full (GTK_OBJECT (app), "toolbar1", toolbar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (toolbar1);
  gnome_app_add_toolbar (GNOME_APP (app), GTK_TOOLBAR (toolbar1), "toolbar1",
                                GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
                                GNOME_DOCK_TOP, 1, 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
  gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar1), 16);
  gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_SPACE_LINE);
  gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar1), GTK_RELIEF_NONE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_NEW);
  button_new = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("New"),
                                _("New File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_new);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_new", button_new,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_new);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_OPEN);
  button_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Open"),
                                _("Open File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_open);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_open", button_open,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_open);
  gtk_widget_set_sensitive (button_open, FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE);
  button_save = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save"),
                                _("Save File"), NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_save);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_save", button_save,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_save);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE_AS);
  button_save_as = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save As"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_save_as);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_save_as", button_save_as,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_save_as);

  hexentry = gtk_entry_new ();
  gtk_widget_ref (hexentry);
  gtk_object_set_data_full (GTK_OBJECT (app), "hexentry", hexentry,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hexentry);
  gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar1), hexentry, _("Address of curve in PlayStation memory..."), NULL);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_MAIL_FWD);
  button_upload = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Upload"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (button_upload);
  gtk_object_set_data_full (GTK_OBJECT (app), "button_upload", button_upload,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button_upload);

  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar1));

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_spline = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                NULL,
                                _("SPLINE"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_spline);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_spline", radiobutton_spline,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_spline);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_spline), FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_linear = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                radiobutton_spline,
                                _("LINEAR"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_linear);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_linear", radiobutton_linear,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_linear);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_linear), FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_CONVERT);
  radiobutton_free = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
                                GTK_TOOLBAR_CHILD_RADIOBUTTON,
                                radiobutton_spline,
                                _("FREE"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (radiobutton_free);
  gtk_object_set_data_full (GTK_OBJECT (app), "radiobutton_free", radiobutton_free,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (radiobutton_free);
  gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radiobutton_free), FALSE);

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (app), "vbox1", vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gnome_app_set_contents (GNOME_APP (app), vbox1);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (app), "hbox1", hbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox2);
  gtk_object_set_data_full (GTK_OBJECT (app), "vbox2", vbox2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox2);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox2, FALSE, TRUE, 0);

  table1 = gtk_table_new (10, 2, FALSE);
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (app), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox2), table1, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (table1), 4);
  gtk_table_set_row_spacings (GTK_TABLE (table1), 1);
  gtk_table_set_col_spacings (GTK_TABLE (table1), 2);

  label1 = gtk_label_new (_("Min X"));
  gtk_widget_ref (label1);
  gtk_object_set_data_full (GTK_OBJECT (app), "label1", label1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label1), 7.45058e-09, 0.5);

  label2 = gtk_label_new (_("Max X"));
  gtk_widget_ref (label2);
  gtk_object_set_data_full (GTK_OBJECT (app), "label2", label2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 7.45058e-09, 0.5);

  label3 = gtk_label_new (_("Min Y"));
  gtk_widget_ref (label3);
  gtk_object_set_data_full (GTK_OBJECT (app), "label3", label3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 7.45058e-09, 0.5);

  label4 = gtk_label_new (_("Max Y"));
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (app), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label4), 7.45058e-09, 0.5);

  label5 = gtk_label_new (_("Count"));
  gtk_widget_ref (label5);
  gtk_object_set_data_full (GTK_OBJECT (app), "label5", label5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  label6 = gtk_label_new (_("Type"));
  gtk_widget_ref (label6);
  gtk_object_set_data_full (GTK_OBJECT (app), "label6", label6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  minx_adj = gtk_adjustment_new (0, -1e+13, 1e+13, 1, 10, 10);
  minx = gtk_spin_button_new (GTK_ADJUSTMENT (minx_adj), 1, 4);
  gtk_widget_ref (minx);
  gtk_object_set_data_full (GTK_OBJECT (app), "minx", minx,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (minx);
  gtk_table_attach (GTK_TABLE (table1), minx, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (minx), TRUE);

  type = gtk_combo_new ();
  gtk_widget_ref (type);
  gtk_object_set_data_full (GTK_OBJECT (app), "type", type,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (type);
  gtk_table_attach (GTK_TABLE (table1), type, 1, 2, 9, 10,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_combo_set_value_in_list (GTK_COMBO (type), TRUE, FALSE);
  gtk_combo_set_use_arrows_always (GTK_COMBO (type), TRUE);
  type_items = g_list_append (type_items, _("u_char"));
  type_items = g_list_append (type_items, _("char"));
  type_items = g_list_append (type_items, _("u_short"));
  type_items = g_list_append (type_items, _("short"));
  type_items = g_list_append (type_items, _("u_long"));
  type_items = g_list_append (type_items, _("long"));
  type_items = g_list_append (type_items, _("float"));
  type_items = g_list_append (type_items, _("double"));
  type_items = g_list_append (type_items, _("fixed (4+12)"));
  gtk_combo_set_popdown_strings (GTK_COMBO (type), type_items);
  g_list_free (type_items);

  typeentry = GTK_COMBO (type)->entry;
  gtk_widget_ref (typeentry);
  gtk_object_set_data_full (GTK_OBJECT (app), "typeentry", typeentry,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (typeentry);
  gtk_entry_set_editable (GTK_ENTRY (typeentry), FALSE);
  gtk_entry_set_text (GTK_ENTRY (typeentry), _("u_char"));

  maxx_adj = gtk_adjustment_new (1, -1e+13, 1e+13, 1, 10, 10);
  maxx = gtk_spin_button_new (GTK_ADJUSTMENT (maxx_adj), 1, 4);
  gtk_widget_ref (maxx);
  gtk_object_set_data_full (GTK_OBJECT (app), "maxx", maxx,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (maxx);
  gtk_table_attach (GTK_TABLE (table1), maxx, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxx), TRUE);

  miny_adj = gtk_adjustment_new (0, -1e+13, 1e+13, 1, 10, 10);
  miny = gtk_spin_button_new (GTK_ADJUSTMENT (miny_adj), 1, 4);
  gtk_widget_ref (miny);
  gtk_object_set_data_full (GTK_OBJECT (app), "miny", miny,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (miny);
  gtk_table_attach (GTK_TABLE (table1), miny, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (miny), TRUE);

  maxy_adj = gtk_adjustment_new (1, -1e+13, 1e+13, 1, 10, 10);
  maxy = gtk_spin_button_new (GTK_ADJUSTMENT (maxy_adj), 1, 4);
  gtk_widget_ref (maxy);
  gtk_object_set_data_full (GTK_OBJECT (app), "maxy", maxy,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (maxy);
  gtk_table_attach (GTK_TABLE (table1), maxy, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxy), TRUE);

  count_adj = gtk_adjustment_new (1, 1, 1e+22, 1, 10, 10);
  count = gtk_spin_button_new (GTK_ADJUSTMENT (count_adj), 1, 0);
  gtk_widget_ref (count);
  gtk_object_set_data_full (GTK_OBJECT (app), "count", count,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (count);
  gtk_table_attach (GTK_TABLE (table1), count, 1, 2, 8, 9,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label10 = gtk_label_new (_("Curve Interval:"));
  gtk_widget_ref (label10);
  gtk_object_set_data_full (GTK_OBJECT (app), "label10", label10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table1), label10, 0, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label10), 7.45058e-09, 0.5);

  label11 = gtk_label_new (_("Datatype:"));
  gtk_widget_ref (label11);
  gtk_object_set_data_full (GTK_OBJECT (app), "label11", label11,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table1), label11, 0, 2, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label11), 7.45058e-09, 0.5);

  label12 = gtk_label_new (_("Scale"));
  gtk_widget_ref (label12);
  gtk_object_set_data_full (GTK_OBJECT (app), "label12", label12,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table1), label12, 0, 1, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  scale_adj = gtk_adjustment_new (1, 1, 1e+22, 1, 10, 10);
  scale = gtk_spin_button_new (GTK_ADJUSTMENT (scale_adj), 1, 0);
  gtk_widget_ref (scale);
  gtk_object_set_data_full (GTK_OBJECT (app), "scale", scale,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scale);
  gtk_table_attach (GTK_TABLE (table1), scale, 1, 2, 6, 7,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  base_adj = gtk_adjustment_new (0, 0, 1e+22, 1, 10, 10);
  base = gtk_spin_button_new (GTK_ADJUSTMENT (base_adj), 1, 0);
  gtk_widget_ref (base);
  gtk_object_set_data_full (GTK_OBJECT (app), "base", base,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (base);
  gtk_table_attach (GTK_TABLE (table1), base, 1, 2, 7, 8,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  label13 = gtk_label_new (_("Base"));
  gtk_widget_ref (label13);
  gtk_object_set_data_full (GTK_OBJECT (app), "label13", label13,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label13);
  gtk_table_attach (GTK_TABLE (table1), label13, 0, 1, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (scrolledwindow1);
  gtk_object_set_data_full (GTK_OBJECT (app), "scrolledwindow1", scrolledwindow1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 0);
  gtk_widget_set_sensitive (scrolledwindow1, FALSE);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

  clist = gtk_clist_new (2);
  gtk_widget_ref (clist);
  gtk_object_set_data_full (GTK_OBJECT (app), "clist", clist,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (clist);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), clist);
  gtk_clist_set_column_width (GTK_CLIST (clist), 0, 28);
  gtk_clist_set_column_width (GTK_CLIST (clist), 1, 80);
  gtk_clist_column_titles_show (GTK_CLIST (clist));

  label8 = gtk_label_new (_("Type"));
  gtk_widget_ref (label8);
  gtk_object_set_data_full (GTK_OBJECT (app), "label8", label8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label8);
  gtk_clist_set_column_widget (GTK_CLIST (clist), 0, label8);

  label9 = gtk_label_new (_("Name"));
  gtk_widget_ref (label9);
  gtk_object_set_data_full (GTK_OBJECT (app), "label9", label9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label9);
  gtk_clist_set_column_widget (GTK_CLIST (clist), 1, label9);

  toolbar2 = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (toolbar2);
  gtk_object_set_data_full (GTK_OBJECT (app), "toolbar2", toolbar2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (toolbar2);
  gtk_box_pack_start (GTK_BOX (vbox2), toolbar2, FALSE, FALSE, 0);
  gtk_widget_set_sensitive (toolbar2, FALSE);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_OPEN);
  list_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Open"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_open);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_open", list_open,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_open);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_SAVE);
  list_save = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Save"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_save);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_save", list_save,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_save);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_ADD);
  list_add = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Add"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_add);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_add", list_add,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_add);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_REMOVE);
  list_remove = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Remove"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_remove);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_remove", list_remove,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_remove);

  tmp_toolbar_icon = gnome_stock_pixmap_widget (app, GNOME_STOCK_PIXMAP_EXEC);
  list_use = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar2),
                                GTK_TOOLBAR_CHILD_BUTTON,
                                NULL,
                                _("Use"),
                                NULL, NULL,
                                tmp_toolbar_icon, NULL, NULL);
  gtk_widget_ref (list_use);
  gtk_object_set_data_full (GTK_OBJECT (app), "list_use", list_use,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list_use);

  curve = gtk_curve_new ();
  gtk_widget_ref (curve);
  gtk_object_set_data_full (GTK_OBJECT (app), "curve", curve,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (curve);
  gtk_box_pack_start (GTK_BOX (hbox1), curve, TRUE, TRUE, 0);
  gtk_widget_set_usize (curve, 256, 256);
  gtk_curve_set_range (GTK_CURVE (curve), 0, 1, 0, 1);

  appbar1 = gnome_appbar_new (FALSE, TRUE, GNOME_PREFERENCES_NEVER);
  gtk_widget_ref (appbar1);
  gtk_object_set_data_full (GTK_OBJECT (app), "appbar1", appbar1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (appbar1);
  gnome_app_set_statusbar (GNOME_APP (app), appbar1);

  gtk_signal_connect (GTK_OBJECT (app), "delete_event",
                      GTK_SIGNAL_FUNC (on_app_delete_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_new), "clicked",
                      GTK_SIGNAL_FUNC (on_button_new_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_open), "clicked",
                      GTK_SIGNAL_FUNC (on_button_open_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_save), "clicked",
                      GTK_SIGNAL_FUNC (on_button_save_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_save_as), "clicked",
                      GTK_SIGNAL_FUNC (on_button_save_as_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button_upload), "clicked",
                      GTK_SIGNAL_FUNC (on_button_upload_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_spline), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_spline_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_linear), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_linear_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (radiobutton_free), "clicked",
                      GTK_SIGNAL_FUNC (on_radiobutton_free_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (minx), "changed",
                      GTK_SIGNAL_FUNC (on_minx_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (maxx), "changed",
                      GTK_SIGNAL_FUNC (on_maxx_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (miny), "changed",
                      GTK_SIGNAL_FUNC (on_miny_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (maxy), "changed",
                      GTK_SIGNAL_FUNC (on_maxy_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_open), "clicked",
                      GTK_SIGNAL_FUNC (on_list_open_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_save), "clicked",
                      GTK_SIGNAL_FUNC (on_list_save_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_add), "clicked",
                      GTK_SIGNAL_FUNC (on_list_add_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_remove), "clicked",
                      GTK_SIGNAL_FUNC (on_list_remove_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list_use), "clicked",
                      GTK_SIGNAL_FUNC (on_list_use_clicked),
                      NULL);

  return app;
}
static void toggle_numeric( GtkWidget *widget,
                            GtkSpinButton *spin )
{
  gtk_spin_button_set_numeric (spin, GTK_TOGGLE_BUTTON (widget)->active);
}
Example #6
0
/**
 * \brief Create and initialise time controller widgets.
 * \param module The parent GtkSatModule
 *
 */
void tmg_create(GtkSatModule * mod)
{
    GtkWidget      *vbox, *hbox, *table;
    GtkWidget      *image;
    GtkWidget      *label;
    gchar          *title;
    gchar          *buff;


    /* make sure controller is not already active */
    if (mod->tmgActive)
    {
        sat_log_log(SAT_LOG_LEVEL_INFO,
                    _("%s: Time Controller for %s is already active"),
                    __func__, mod->name);

        /* try to make window visible in case it is covered
           by something else */
        gtk_window_present(GTK_WINDOW(mod->tmgWin));

        return;
    }

    /* create hbox containing the controls
       the controls are implemented as radiobuttons in order
       to inherit the mutual exclusion behaviour */
    hbox = gtk_hbox_new(FALSE, 0);

    /* FWD */
    mod->tmgFwd = gtk_radio_button_new(NULL);
    gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(mod->tmgFwd), FALSE);
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod->tmgFwd), TRUE);
    image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_FORWARD,
                                     GTK_ICON_SIZE_BUTTON);
    gtk_container_add(GTK_CONTAINER(mod->tmgFwd), image);
    gtk_widget_set_tooltip_text(mod->tmgFwd, _("Play forward"));
    g_signal_connect(mod->tmgFwd, "toggled", G_CALLBACK(tmg_fwd), mod);
    gtk_box_pack_end(GTK_BOX(hbox), mod->tmgFwd, FALSE, FALSE, 0);

    /* STOP */
    mod->tmgStop =
        gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(mod->tmgFwd));
    gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(mod->tmgStop), FALSE);
    image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE,
                                     GTK_ICON_SIZE_BUTTON);
    gtk_container_add(GTK_CONTAINER(mod->tmgStop), image);
    gtk_widget_set_tooltip_text(mod->tmgStop, _("Stop"));
    g_signal_connect(mod->tmgStop, "toggled", G_CALLBACK(tmg_stop), mod);
    gtk_box_pack_end(GTK_BOX(hbox), mod->tmgStop, FALSE, FALSE, 0);

    /* BWD */
    mod->tmgBwd =
        gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(mod->tmgFwd));
    gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(mod->tmgBwd), FALSE);
    image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_REWIND,
                                     GTK_ICON_SIZE_BUTTON);
    gtk_container_add(GTK_CONTAINER(mod->tmgBwd), image);
    gtk_widget_set_tooltip_text(mod->tmgBwd, _("Play backwards"));
    g_signal_connect(mod->tmgBwd, "toggled", G_CALLBACK(tmg_bwd), mod);
    gtk_box_pack_end(GTK_BOX(hbox), mod->tmgBwd, FALSE, FALSE, 0);

    /* reset time */
    mod->tmgReset = gtk_button_new_with_label(_("Reset"));
    gtk_widget_set_tooltip_text(mod->tmgReset,
                                _("Reset to current date and time"));
    g_signal_connect(mod->tmgReset, "clicked", G_CALLBACK(tmg_reset), mod);
    gtk_box_pack_end(GTK_BOX(hbox), mod->tmgReset, FALSE, FALSE, 10);

    /* status label */
    mod->tmgState = gtk_label_new(NULL);
    gtk_misc_set_alignment(GTK_MISC(mod->tmgState), 0.0, 0.5);
    gtk_label_set_markup(GTK_LABEL(mod->tmgState), _("<b>Real-Time</b>"));
    gtk_box_pack_start(GTK_BOX(hbox), mod->tmgState, TRUE, TRUE, 10);

    /* create table containing the date and time widgets */
    table = gtk_table_new(5, 3, FALSE);
    gtk_table_set_row_spacings(GTK_TABLE(table), 0);

    mod->tmgCal = gtk_calendar_new();
    gtk_calendar_set_display_options(GTK_CALENDAR(mod->tmgCal),
                                     GTK_CALENDAR_SHOW_HEADING |
                                     GTK_CALENDAR_SHOW_DAY_NAMES |
                                     GTK_CALENDAR_WEEK_START_MONDAY);
    g_signal_connect(mod->tmgCal, "day-selected",
                     G_CALLBACK(tmg_time_set), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgCal,
                     0, 1, 0, 5, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* Time controllers.
       Note that the controllers for hours, minutes, and seconds have ranges;
       however, they can wrap around their limits in order to ensure a smooth
       and continuous control of the time
     */

    /* hour */
    label = gtk_label_new(_(" Hour:"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach(GTK_TABLE(table), label,
                     1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 5, 0);
    mod->tmgHour = gtk_spin_button_new_with_range(0, 23, 1);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(mod->tmgHour), TRUE);
    gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(mod->tmgHour),
                                      GTK_UPDATE_IF_VALID);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(mod->tmgHour), 0);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(mod->tmgHour), TRUE);
    //FIXME gtk_spin_button_set_value (GTK_SPIN_BUTTON (mod->tmgHour), 2);
    gtk_widget_set_tooltip_text(mod->tmgHour,
                                _("Use this control to set the hour"));
    g_signal_connect(mod->tmgHour, "value-changed",
                     G_CALLBACK(tmg_time_set), mod);
    g_signal_connect(mod->tmgHour, "wrapped", G_CALLBACK(tmg_hour_wrap), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgHour,
                     2, 3, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* minutes */
    label = gtk_label_new(_(" Min:"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach(GTK_TABLE(table), label,
                     1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 5, 0);
    mod->tmgMin = gtk_spin_button_new_with_range(0, 59, 1);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(mod->tmgMin), TRUE);
    gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(mod->tmgMin),
                                      GTK_UPDATE_IF_VALID);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(mod->tmgMin), 0);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(mod->tmgMin), TRUE);
    //FIXME gtk_spin_button_set_value (GTK_SPIN_BUTTON (mod->tmgMin), 2);
    gtk_widget_set_tooltip_text(mod->tmgMin,
                                _("Use this control to set the minutes"));
    g_signal_connect(mod->tmgMin, "value-changed",
                     G_CALLBACK(tmg_time_set), mod);
    g_signal_connect(mod->tmgMin, "wrapped", G_CALLBACK(tmg_min_wrap), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgMin,
                     2, 3, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* seconds */
    label = gtk_label_new(_(" Sec:"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach(GTK_TABLE(table), label,
                     1, 2, 2, 3, GTK_SHRINK, GTK_SHRINK, 5, 0);
    mod->tmgSec = gtk_spin_button_new_with_range(0, 59, 1);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(mod->tmgSec), TRUE);
    gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(mod->tmgSec),
                                      GTK_UPDATE_IF_VALID);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(mod->tmgSec), 0);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(mod->tmgSec), TRUE);
    //FIXME gtk_spin_button_set_value (GTK_SPIN_BUTTON (mod->tmgSec), 2);
    gtk_widget_set_tooltip_text(mod->tmgSec,
                                _("Use this control to set the seconds"));
    g_signal_connect(mod->tmgSec, "value-changed",
                     G_CALLBACK(tmg_time_set), mod);
    g_signal_connect(mod->tmgSec, "wrapped", G_CALLBACK(tmg_sec_wrap), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgSec,
                     2, 3, 2, 3, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* milliseconds */
    label = gtk_label_new(_(" Msec:"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach(GTK_TABLE(table), label,
                     1, 2, 3, 4, GTK_SHRINK, GTK_SHRINK, 5, 0);
    mod->tmgMsec = gtk_spin_button_new_with_range(0, 999, 1);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(mod->tmgMsec), TRUE);
    gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(mod->tmgMsec),
                                      GTK_UPDATE_IF_VALID);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(mod->tmgMsec), 0);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(mod->tmgMsec), TRUE);
    //FIXME gtk_spin_button_set_value (GTK_SPIN_BUTTON (mod->tmgMsec), 2);
    gtk_widget_set_tooltip_text(mod->tmgMsec,
                                _("Use this control to set the milliseconds"));
    g_signal_connect(mod->tmgMsec, "value-changed",
                     G_CALLBACK(tmg_time_set), mod);
    g_signal_connect(mod->tmgMsec, "wrapped", G_CALLBACK(tmg_msec_wrap), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgMsec,
                     2, 3, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* time throttle */
    label = gtk_label_new(_("Throttle:"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach(GTK_TABLE(table), label,
                     1, 2, 4, 5, GTK_SHRINK, GTK_SHRINK, 5, 0);
    mod->tmgFactor = gtk_spin_button_new_with_range(1, 100, 1);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(mod->tmgFactor), TRUE);
    gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(mod->tmgFactor),
                                      GTK_UPDATE_IF_VALID);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(mod->tmgFactor), 0);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(mod->tmgFactor), 1);
    gtk_widget_set_tooltip_text(mod->tmgFactor,
                                _("Time throttle / compression factor"));
    g_signal_connect(mod->tmgFactor, "value-changed",
                     G_CALLBACK(tmg_throttle), mod);
    gtk_table_attach(GTK_TABLE(table), mod->tmgFactor,
                     2, 3, 4, 5, GTK_SHRINK, GTK_SHRINK, 0, 0);

    /* add slider */
    mod->tmgSlider = gtk_hscale_new_with_range(-0.1, +0.1, 0.0001);     // +/- 2.5 hr
    /*gtk_widget_set_tooltip_text (mod->tmgSlider,
       _("Drag the slider to change the time up to +/- 2.5 hours.\n"\
       "Resolution is ~ 8 seconds.")); */
    gtk_scale_set_draw_value(GTK_SCALE(mod->tmgSlider), FALSE);
    gtk_range_set_value(GTK_RANGE(mod->tmgSlider), 0.0);
    g_signal_connect(mod->tmgSlider, "value-changed",
                     G_CALLBACK(slider_moved), mod);

    /* create the vertical box */
    vbox = gtk_vbox_new(FALSE, 0);

    gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), mod->tmgSlider, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

    /* create main window */
    mod->tmgWin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    title = g_strconcat(_("Time Controller"), " / ", mod->name, NULL);
    gtk_window_set_title(GTK_WINDOW(mod->tmgWin), title);
    g_free(title);
    gtk_window_set_transient_for(GTK_WINDOW(mod->tmgWin),
                                 GTK_WINDOW(gtk_widget_get_toplevel
                                            (GTK_WIDGET(mod))));
    g_signal_connect(G_OBJECT(mod->tmgWin), "delete_event",
                     G_CALLBACK(tmg_delete), mod);
    g_signal_connect(G_OBJECT(mod->tmgWin), "destroy", G_CALLBACK(tmg_destroy),
                     mod);

    /* window icon */
    buff = icon_file_name("gpredict-clock.png");
    gtk_window_set_icon_from_file(GTK_WINDOW(mod->tmgWin), buff, NULL);
    g_free(buff);

    gtk_container_add(GTK_CONTAINER(mod->tmgWin), vbox);
    gtk_widget_show_all(mod->tmgWin);

    mod->tmgActive = TRUE;

    sat_log_log(SAT_LOG_LEVEL_INFO,
                _("%s: Time Controller for %s launched"), __func__, mod->name);
}
/**
 * \fn setMe
 * @param dialog  Pointer to father dialog
 * @param opaque  Internal, Gtk table to attach to
 * @param line Line were the widget should be displayed
 */
void diaElemBitrate::setMe(void *dialog, void *opaque,uint32_t line)
{
  GtkWidget *widget;
  GtkObject *adj;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *combo;
  GtkWidget *spin;
  
#define PUT_ARRAY(x,y,widget)  gtk_table_attach (GTK_TABLE (opaque), widget, x, x+1, line+y, line+y+1, \
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), \
                    (GtkAttachOptions) (0), 0, 0);
  
  /* Add text -> encoding mode */
  label1 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Encoding mode:"));
  gtk_misc_set_alignment (GTK_MISC (label1), 0.0, 0.5);
  gtk_widget_show(label1);
  
  /* put entry in hbox */
 
  PUT_ARRAY(0,0,label1);
  
  
  /* Add text -> encoding mode */
  label2 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Bitrate (kb/s):"));
  gtk_misc_set_alignment (GTK_MISC (label2), 0.0, 0.5);
  gtk_widget_show(label2);
  /* put entry in hbox */
  PUT_ARRAY(0,1,label2);
 
  /* Add encoding menu combo */
  
  
  combo = gtk_combo_box_new_text ();
  gtk_widget_show (combo);
  
  gtk_label_set_mnemonic_widget (GTK_LABEL(label1), combo);
  if((copy.capabilities & ADM_ENC_CAP_CBR)) 
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Single pass - bitrate"));
  if((copy.capabilities & ADM_ENC_CAP_CQ))
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Single pass - constant quality"));
  if((copy.capabilities & ADM_ENC_CAP_SAME))
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Single pass - same qz as input"));
  if((copy.capabilities & ADM_ENC_CAP_AQ))
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Single pass - Average quantizer"));

  if((copy.capabilities & ADM_ENC_CAP_2PASS))
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Two pass - video size"));
  if((copy.capabilities & ADM_ENC_CAP_2PASS_BR))
	  gtk_combo_box_append_text (GTK_COMBO_BOX (combo),QT_TR_NOOP("Two pass - average bitrate"));
  
  /**/
  
   
  
  PUT_ARRAY(1,0,combo);
  
  
  /* Now add value */
  spin = gtk_spin_button_new_with_range(0,1,1);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON(spin),TRUE);
  gtk_spin_button_set_digits  (GTK_SPIN_BUTTON(spin),0);
  
  gtk_widget_show (spin);
  
    PUT_ARRAY(1,1,spin);
  /*  add button */
   gtk_label_set_mnemonic_widget (GTK_LABEL(label1), combo);
   gtk_label_set_mnemonic_widget (GTK_LABEL(label2), spin); 
   
  gtk_signal_connect(GTK_OBJECT(combo), "changed",
                      GTK_SIGNAL_FUNC(cb_mod),
                      (void *) this);
  
  GtkWidget **w;
  w=new GtkWidget*[4];
  w[0]=label1;
  w[1]=label2;
  w[2]=combo;
  w[3]=spin;
  myWidget=(void *)w;
  
  int index=0,set=-1;
#undef LOOKUP
#define LOOKUP(A,B) \
  if(copy.capabilities & ADM_ENC_CAP_##A) \
  { \
	  if(copy.mode==COMPRESS_##B) set=index; \
	  index++; \
  } \
  
  LOOKUP(CBR,CBR);
  LOOKUP(CQ,CQ);
  LOOKUP(SAME,SAME);
  LOOKUP(AQ,AQ);
  LOOKUP(2PASS,2PASS);
  LOOKUP(2PASS_BR,2PASS_BITRATE);
  if(set!=-1) gtk_combo_box_set_active(GTK_COMBO_BOX(combo),set);
}
Example #8
0
static void
gimp_palette_editor_init (GimpPaletteEditor *editor)
{
  GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
  GtkWidget      *hbox;
  GtkWidget      *label;
  GtkWidget      *spinbutton;

  editor->zoom_factor = 1.0;
  editor->col_width   = 0;
  editor->last_width  = 0;
  editor->columns     = COLUMNS;

  data_editor->view = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_set_size_request (data_editor->view, -1, PREVIEW_HEIGHT);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (data_editor->view),
                                  GTK_POLICY_AUTOMATIC,
                                  GTK_POLICY_AUTOMATIC);
  gtk_box_pack_start (GTK_BOX (editor), data_editor->view, TRUE, TRUE, 0);
  gtk_widget_show (data_editor->view);

  editor->view = gimp_view_new_full_by_types (NULL,
                                              GIMP_TYPE_PALETTE_VIEW,
                                              GIMP_TYPE_PALETTE,
                                              PREVIEW_WIDTH, PREVIEW_HEIGHT, 0,
                                              FALSE, TRUE, FALSE);
  gimp_view_renderer_palette_set_cell_size
    (GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (editor->view)->renderer), -1);
  gimp_view_renderer_palette_set_draw_grid
    (GIMP_VIEW_RENDERER_PALETTE (GIMP_VIEW (editor->view)->renderer), TRUE);

  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (data_editor->view),
                                         editor->view);
  gtk_widget_show (editor->view);

  g_signal_connect (gtk_widget_get_parent (editor->view), "size-allocate",
                    G_CALLBACK (palette_editor_viewport_size_allocate),
                    editor);

  g_signal_connect (editor->view, "entry-clicked",
                    G_CALLBACK (palette_editor_entry_clicked),
                    editor);
  g_signal_connect (editor->view, "entry-selected",
                    G_CALLBACK (palette_editor_entry_selected),
                    editor);
  g_signal_connect (editor->view, "entry-activated",
                    G_CALLBACK (palette_editor_entry_activated),
                    editor);
  g_signal_connect (editor->view, "entry-context",
                    G_CALLBACK (palette_editor_entry_context),
                    editor);
  g_signal_connect (editor->view, "color-dropped",
                    G_CALLBACK (palette_editor_color_dropped),
                    editor);

  gimp_dnd_viewable_dest_add (editor->view,
                              GIMP_TYPE_PALETTE,
                              palette_editor_drop_palette,
                              editor);
  gimp_dnd_viewable_dest_add (gtk_widget_get_parent (editor->view),
                              GIMP_TYPE_PALETTE,
                              palette_editor_drop_palette,
                              editor);

  gimp_dnd_color_dest_add (gtk_widget_get_parent (editor->view),
                           palette_editor_drop_color,
                           editor);

  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
  gtk_box_pack_start (GTK_BOX (editor), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  /*  The color name entry  */
  editor->color_name = gtk_entry_new ();
  gtk_box_pack_start (GTK_BOX (hbox), editor->color_name, TRUE, TRUE, 0);
  gtk_entry_set_text (GTK_ENTRY (editor->color_name), _("Undefined"));
  gtk_editable_set_editable (GTK_EDITABLE (editor->color_name), FALSE);
  gtk_widget_show (editor->color_name);

  g_signal_connect (editor->color_name, "changed",
                    G_CALLBACK (palette_editor_color_name_changed),
                    editor);

  label = gtk_label_new (_("Columns:"));
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_widget_show (label);

  editor->columns_adj = (GtkAdjustment *)
    gtk_adjustment_new (0, 0, 64, 1, 4, 0);
  spinbutton = gtk_spin_button_new (editor->columns_adj, 1.0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
  gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
  gtk_widget_show (spinbutton);

  g_signal_connect (editor->columns_adj, "value-changed",
                    G_CALLBACK (palette_editor_columns_changed),
                    editor);
}
Example #9
0
DateWidget::DateWidget(guint32 * seconds_since_epoch, bool showtime)
/*
By default this dialog shows the calendar only.
If showtime is true it shows the time also.
*/
{
  // Store and initialize variabeles.
  my_seconds_since_epoch = seconds_since_epoch;
  setting_date_time = false;

  // Shortcuts.
  Shortcuts shortcuts(0);

  hbox = gtk_hbox_new(FALSE, 10);
  gtk_widget_show(hbox);

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

  label_date = gtk_label_new(_("Date"));
  gtk_widget_show(label_date);
  gtk_box_pack_start(GTK_BOX(vbox2), label_date, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label_date), 0, 0.5);

  shortcuts.label(label_date);

  calendar1 = gtk_calendar_new();
  gtk_widget_show(calendar1);
  gtk_box_pack_start(GTK_BOX(vbox2), calendar1, TRUE, TRUE, 0);
  gtk_calendar_display_options(GTK_CALENDAR(calendar1), GtkCalendarDisplayOptions(GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES | GTK_CALENDAR_SHOW_WEEK_NUMBERS));

  label_time = NULL;
  if (showtime) {

    vseparator1 = gtk_vseparator_new();
    gtk_widget_show(vseparator1);
    gtk_box_pack_start(GTK_BOX(hbox), vseparator1, TRUE, TRUE, 0);

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

    label_time = gtk_label_new(_("Time"));
    gtk_widget_show(label_time);
    gtk_box_pack_start(GTK_BOX(vbox1), label_time, FALSE, FALSE, 0);
    gtk_misc_set_alignment(GTK_MISC(label_time), 0, 0.5);

    table1 = gtk_table_new(3, 2, FALSE);
    gtk_widget_show(table1);
    gtk_box_pack_start(GTK_BOX(vbox1), table1, FALSE, FALSE, 0);
    gtk_table_set_row_spacings(GTK_TABLE(table1), 8);
    gtk_table_set_col_spacings(GTK_TABLE(table1), 8);

    label_hour = gtk_label_new(_("Hour"));
    gtk_widget_show(label_hour);
    gtk_table_attach(GTK_TABLE(table1), label_hour, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label_hour), 1, 0.5);

    shortcuts.label(label_hour);

    label_minute = gtk_label_new(_("Minute"));
    gtk_widget_show(label_minute);
    gtk_table_attach(GTK_TABLE(table1), label_minute, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label_minute), 1, 0.5);

    shortcuts.label(label_minute);

    label_second = gtk_label_new(_("Second"));
    gtk_widget_show(label_second);
    gtk_table_attach(GTK_TABLE(table1), label_second, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label_second), 1, 0.5);

    shortcuts.label(label_second);

    spinbutton_minute_adj = gtk_adjustment_new(0, 0, 59, 1, 10, 0);
    spinbutton_minute = gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_minute_adj), 1, 0);
    gtk_widget_show(spinbutton_minute);
    gtk_table_attach(GTK_TABLE(table1), spinbutton_minute, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spinbutton_minute), TRUE);

    spinbutton_second_adj = gtk_adjustment_new(0, 0, 59, 1, 10, 0);
    spinbutton_second = gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_second_adj), 1, 0);
    gtk_widget_show(spinbutton_second);
    gtk_table_attach(GTK_TABLE(table1), spinbutton_second, 1, 2, 2, 3, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spinbutton_second), TRUE);

    spinbutton_hour_adj = gtk_adjustment_new(0, 0, 23, 1, 10, 0);
    spinbutton_hour = gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_hour_adj), 1, 0);
    gtk_widget_show(spinbutton_hour);
    gtk_table_attach(GTK_TABLE(table1), spinbutton_hour, 1, 2, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spinbutton_hour), TRUE);

  }

  shortcuts.process();
  
  g_signal_connect ((gpointer) calendar1, "day_selected", G_CALLBACK (on_calendar_changed), gpointer(this));
  if (showtime) {
    g_signal_connect ((gpointer) spinbutton_minute, "changed", G_CALLBACK (on_spinbutton_changed), gpointer(this));
    g_signal_connect ((gpointer) spinbutton_minute, "value_changed", G_CALLBACK (on_spinbutton_value_changed), gpointer(this));
    g_signal_connect ((gpointer) spinbutton_second, "changed", G_CALLBACK (on_spinbutton_changed), gpointer(this));
    g_signal_connect ((gpointer) spinbutton_second, "value_changed", G_CALLBACK (on_spinbutton_value_changed), gpointer(this));
    g_signal_connect ((gpointer) spinbutton_hour, "changed", G_CALLBACK (on_spinbutton_changed), gpointer(this));
    g_signal_connect ((gpointer) spinbutton_hour, "value_changed", G_CALLBACK (on_spinbutton_value_changed), gpointer(this));
  }

  gtk_label_set_mnemonic_widget(GTK_LABEL(label_date), calendar1);
  if (showtime) {
    gtk_label_set_mnemonic_widget(GTK_LABEL(label_hour), spinbutton_hour);
    gtk_label_set_mnemonic_widget(GTK_LABEL(label_minute), spinbutton_minute);
    gtk_label_set_mnemonic_widget(GTK_LABEL(label_second), spinbutton_second);
  }

  // Set the date and optionally the time.
  set_date ();
}
Example #10
0
gint register_action()
{
GtkWidget *window;
GtkWidget *label;
GtkWidget *entry_nickname, *entry_password, *entry_password2;
GtkWidget *button, *button_male, *button_female;
GtkWidget *spinner_year, *spinner_month, *spinner_day;
GtkWidget *table;
GSList *group;
GtkAdjustment *adj;
GtkWidget *image;


window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "注册");
g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (close_current_window), window);
gtk_container_set_border_width (GTK_CONTAINER (window), 20);
gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);

table = gtk_table_new (8, 17, TRUE);
gtk_table_set_row_spacing(GTK_TABLE (table), 0, 5 );
gtk_table_set_row_spacing(GTK_TABLE (table), 1, 5 );
gtk_table_set_row_spacing(GTK_TABLE (table), 2, 5 );
gtk_table_set_row_spacing(GTK_TABLE (table), 3, 5 );
gtk_container_add (GTK_CONTAINER (window), table);

image = gtk_image_new();
gtk_image_set_from_file(GTK_IMAGE(image),"aaa.png");
gtk_table_attach_defaults (GTK_TABLE (table), image, 0, 4, 0, 10);


label = gtk_label_new ("昵称:");
gtk_table_attach_defaults (GTK_TABLE (table), label, 4, 7, 0, 1);
gtk_misc_set_alignment(GTK_MISC (label), 1, 0.5);
gtk_widget_show (label);

label = gtk_label_new ("密码:");
gtk_table_attach_defaults (GTK_TABLE (table), label, 4, 7, 1, 2);
gtk_misc_set_alignment(GTK_MISC (label), 1, 0.5);
gtk_widget_show (label);

label = gtk_label_new ("确认密码:");
gtk_table_attach_defaults (GTK_TABLE (table), label, 4, 7, 2, 3);
gtk_misc_set_alignment(GTK_MISC (label), 1, 0.5);
gtk_widget_show (label);

label = gtk_label_new ("性别:");
gtk_table_attach_defaults (GTK_TABLE (table), label, 4, 7, 3, 4);
gtk_misc_set_alignment(GTK_MISC (label), 1, 0.5);
gtk_widget_show (label);

label = gtk_label_new ("生日:");
gtk_table_attach_defaults (GTK_TABLE (table), label, 4, 7, 4, 5);
gtk_misc_set_alignment(GTK_MISC (label), 1, 0.5);
gtk_widget_show (label);

entry_nickname = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (entry_nickname), 20);
g_signal_connect (G_OBJECT (entry_nickname), "activate",G_CALLBACK (enter_nickname), entry_nickname);
gtk_entry_set_text (GTK_ENTRY (entry_nickname), "");
gtk_editable_select_region (GTK_EDITABLE (entry_nickname),0, GTK_ENTRY (entry_nickname)->text_length);
gtk_table_attach_defaults (GTK_TABLE (table), entry_nickname, 7,13, 0, 1);
gtk_widget_show (entry_nickname);

entry_password = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (entry_password), 50);
gtk_entry_set_text (GTK_ENTRY (entry_password), "");
gtk_editable_select_region (GTK_EDITABLE (entry_password),0, GTK_ENTRY (entry_password)->text_length);
gtk_entry_set_visibility (GTK_ENTRY (entry_password),FALSE);// 是否***输出
gtk_table_attach_defaults (GTK_TABLE (table), entry_password, 7,13, 1, 2);
gtk_widget_show (entry_password);

entry_password2 = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (entry_password2), 50);
gtk_entry_set_text (GTK_ENTRY (entry_password2), "");
gtk_editable_select_region (GTK_EDITABLE (entry_password2),0, GTK_ENTRY (entry_password2)->text_length);
gtk_entry_set_visibility (GTK_ENTRY (entry_password2),FALSE);// 是否***输出
gtk_table_attach_defaults (GTK_TABLE (table), entry_password2, 7,13, 2, 3);
gtk_widget_show (entry_password2);

button_male = gtk_radio_button_new_with_label (NULL, "男");
gtk_table_attach_defaults (GTK_TABLE (table), button_male, 7,10, 3, 4);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_male), TRUE);
gtk_widget_show (button_male);
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button_male));
button_female = gtk_radio_button_new_with_label (group, "女");
gtk_table_attach_defaults (GTK_TABLE (table), button_female,10,13, 3, 4);
gtk_widget_show (button_female);

label = gtk_label_new ("日:");
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label,11,13, 4, 5);
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0);
spinner_day = gtk_spin_button_new (adj, 0, 0);
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (spinner_day), TRUE );
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner_day), TRUE);
gtk_table_attach_defaults (GTK_TABLE (table), spinner_day,11,13, 5, 6);

label = gtk_label_new ("月:");
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 9,11, 4, 5);
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0);
spinner_month = gtk_spin_button_new (adj, 0, 0);
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (spinner_month), TRUE );
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner_month), TRUE);
gtk_table_attach_defaults (GTK_TABLE (table), spinner_month, 9,11, 5, 6);

label = gtk_label_new ("年:");
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 7, 9, 4, 5);
adj = (GtkAdjustment *) gtk_adjustment_new (1950.0, 0.0, 2012.0, 1.0, 100.0, 0.0);
spinner_year = gtk_spin_button_new (adj, 0, 0);
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (spinner_year), TRUE );
gtk_spin_button_set_value(GTK_SPIN_BUTTON (spinner_year), 1993.0 );
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner_year), FALSE);

gtk_table_attach_defaults (GTK_TABLE (table), spinner_year, 7, 9, 5, 6);
gtk_widget_set_size_request (spinner_year, 55, -1);


button = gtk_button_new_with_label ("立即注册");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (toggle_button_callback),GTK_TOGGLE_BUTTON(button_male));
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (return_year), spinner_year);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (return_month), spinner_month);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (return_day), spinner_day);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (enter_nickname), entry_nickname);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (enter_password), entry_password);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (enter_password2), entry_password2);

g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (checkpassword), table);
//g_signal_connect_swapped (G_OBJECT (button), "clicked",
//G_CALLBACK (delete_event), window);
gtk_table_attach_defaults (GTK_TABLE (table), button, 7,13, 7, 9);

gtk_widget_show_all (window);

gtk_main ();


//if ( nickname != '\0' && password != '\0' )
//{
	struct reg *send_info;
	send_info=(struct reg *)malloc(sizeof(struct reg));
	set_register(send_info);
	printf("%d\n",send_info->photo);
	send_reg(send_info, "10.3.2.126");
	rec_reg(send_info);

	if (send_info->id != 0)
	{
		printf("%d\n",send_info->id);

		GtkWidget *window2;
		GtkWidget *table2;
		GtkWidget *button2;
		GtkWidget *label2;
		gchar* id_char;
		id_char=malloc(sizeof(char)*20);
		sprintf(id_char, "%d", send_info->id);

		window2= gtk_window_new (GTK_WINDOW_TOPLEVEL);
		gtk_window_set_position(GTK_WINDOW(window2),GTK_WIN_POS_CENTER);
		table2 = gtk_table_new (6, 4, TRUE);
		gtk_container_add (GTK_CONTAINER (window2), table2);
		gtk_widget_show(table2);

		label2 = gtk_label_new ("你的帐号是:");
		gtk_table_attach_defaults (GTK_TABLE (table2), label2, 1, 3, 1, 2);
		gtk_misc_set_alignment(GTK_MISC (label2), 1, 0.5);
		gtk_widget_show (label2);

		label2 = gtk_label_new (id_char);
		gtk_table_attach_defaults (GTK_TABLE (table2), label2, 1, 3, 2, 3);
		gtk_label_set_selectable(GTK_LABEL(label2), TRUE); 
                                                         
		gtk_misc_set_alignment(GTK_MISC (label2), 0.5, 0.5);
		gtk_widget_show (label2);

		button2 = gtk_button_new_with_label ("立即登录");
		gtk_table_attach_defaults (GTK_TABLE (table2), button2, 1, 3, 3, 4);
		g_signal_connect (G_OBJECT (button2), "clicked",
		G_CALLBACK (close_current_window), window2);
		g_signal_connect (G_OBJECT (button2), "clicked",
		G_CALLBACK (close_current_window), window);
		gtk_widget_show (button2);


		gtk_widget_show (window2);
		gtk_main ();
		}
	else
	{
		GtkWidget *window3;
		GtkWidget *table3;
		GtkWidget *button3;
		GtkWidget *label3;

		window3= gtk_window_new (GTK_WINDOW_TOPLEVEL);
		gtk_window_set_position(GTK_WINDOW(window3),GTK_WIN_POS_CENTER);
		table3 = gtk_table_new (6, 4, TRUE);
		gtk_container_add (GTK_CONTAINER (window3), table3);
		gtk_widget_show(table3);

		label3 = gtk_label_new ("注册失败");
		gtk_table_attach_defaults (GTK_TABLE (table3), label3, 1, 3, 1,3 );
		gtk_misc_set_alignment(GTK_MISC (label3), 0.5, 0.5);
		gtk_widget_show (label3);

		button3 = gtk_button_new_with_label ("重新注册");
		gtk_table_attach_defaults (GTK_TABLE (table3), button3, 1, 3, 3, 4);
		g_signal_connect (G_OBJECT (button3), "clicked",
		G_CALLBACK (close_current_window), window3);
		g_signal_connect (G_OBJECT (button3), "clicked",
		G_CALLBACK (close_current_window), window);
		gtk_widget_show (button3);

		gtk_widget_show (window3);
		gtk_main ();
	//}
}

/*
else
{
	gtk_main_quit();
}

*/

return 0;
}
GtkWidget*
create_particle_dialog (void)
{
  GtkWidget *particle_dialog;
  GtkWidget *dialogVbox;
  GtkWidget *dialogHbox;
  GtkWidget *allButButtonsHbox;
  GtkWidget *settingsOuterHbox;
  GtkWidget *settingsOuterVbox;
  GtkWidget *minAreaHbox;
  GtkWidget *minAreaLabel;
  GtkObject *minAreaSpinButton_adj;
  GtkWidget *minAreaSpinButton;
  GtkWidget *maxAreaHbox;
  GtkWidget *maxAreaLabel;
  GtkObject *maxAreaSpinButton_adj;
  GtkWidget *maxAreaSpinButton;
  GtkWidget *aboveCropSeparator;
  GtkWidget *leftCropHbox;
  GtkWidget *leftCropLabel;
  GtkObject *leftCropSpinButton_adj;
  GtkWidget *leftCropSpinButton;
  GtkWidget *rightCropHbox;
  GtkWidget *rightCropLabel;
  GtkObject *rightCropSpinButton_adj;
  GtkWidget *rightCropSpinButton;
  GtkWidget *topCropHbox;
  GtkWidget *topCropLabel;
  GtkObject *topCropSpinButton_adj;
  GtkWidget *topCropSpinButton;
  GtkWidget *bottomCropHbox;
  GtkWidget *bottomCropLabel;
  GtkObject *bottomCropSpinButton_adj;
  GtkWidget *bottomCropSpinButton;
  GtkWidget *belowCropSeparator;
  GtkWidget *outputFormatHbox;
  GtkWidget *outputFormatLabel;
  GtkWidget *outputFormatMenu;
  GtkWidget *outputFileHbox;
  GtkWidget *outputFileLabel;
  GtkWidget *outputFileEntry;
  GtkWidget *outputFileBrowseButton;
  GtkWidget *cameraNumberHbox;
  GtkWidget *cameraNumberLabel;
  GtkObject *cameraNumberSpinButton_adj;
  GtkWidget *cameraNumberSpinButton;
  GtkWidget *debugHbox;
  GtkWidget *debugLabel;
  GtkObject *debugSpinButton_adj;
  GtkWidget *debugSpinButton;
  GtkWidget *previewVboxOuter;
  GtkWidget *previewFrame;
  GtkWidget *previewAlignment;
  GtkWidget *previewVbox;
  GtkWidget *previewControlHbox;
  GtkWidget *previewOutputMenu;
  GtkWidget *previewSlider;
  GtkWidget *previewVideo;
  GtkWidget *previewLabel;
  GtkWidget *dialogButtonBox;
  GtkWidget *cancelButton;
  GtkWidget *okButton;

  particle_dialog = gtk_dialog_new ();
  //                                                NO NEED TO "FIX" THAT _("...")!!
  //                                                see handy macro near top of file.
  gtk_window_set_title (GTK_WINDOW (particle_dialog), _("Particle Detection"));
  gtk_window_set_type_hint (GTK_WINDOW (particle_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialogVbox = GTK_DIALOG (particle_dialog)->vbox;
  gtk_widget_show (dialogVbox);

  dialogHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (dialogHbox);
  gtk_box_pack_start (GTK_BOX (dialogVbox), dialogHbox, TRUE, TRUE, 0);

  allButButtonsHbox = gtk_hbox_new (FALSE, 12);
  gtk_widget_show (allButButtonsHbox);
  gtk_box_pack_start (GTK_BOX (dialogHbox), allButButtonsHbox, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (allButButtonsHbox), 8);

  settingsOuterHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (settingsOuterHbox);
  gtk_box_pack_start (GTK_BOX (allButButtonsHbox), settingsOuterHbox, FALSE, TRUE, 0);

  settingsOuterVbox = gtk_vbox_new (FALSE, 12);
  gtk_widget_show (settingsOuterVbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterHbox), settingsOuterVbox, FALSE, TRUE, 0);

  minAreaHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (minAreaHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), minAreaHbox, FALSE, TRUE, 0);

  minAreaLabel = gtk_label_new_with_mnemonic (_("Mi_nimum area for a particle to be detected:    "));
  gtk_widget_show (minAreaLabel);
  gtk_box_pack_start (GTK_BOX (minAreaHbox), minAreaLabel, FALSE, FALSE, 0);

  minAreaSpinButton_adj = gtk_adjustment_new (5, 1, 999999, 1, 1, 0);
  minAreaSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (minAreaSpinButton_adj), 1, 0);
  gtk_widget_show (minAreaSpinButton);
  gtk_box_pack_start (GTK_BOX (minAreaHbox), minAreaSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (minAreaSpinButton), TRUE);

  maxAreaHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (maxAreaHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), maxAreaHbox, FALSE, TRUE, 0);

  maxAreaLabel = gtk_label_new_with_mnemonic (_("Ma_ximum area for a particle to be detected:   "));
  gtk_widget_show (maxAreaLabel);
  gtk_box_pack_start (GTK_BOX (maxAreaHbox), maxAreaLabel, FALSE, FALSE, 0);

  maxAreaSpinButton_adj = gtk_adjustment_new (50000, 1, 999999, 1, 1, 0);
  maxAreaSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (maxAreaSpinButton_adj), 1, 0);
  gtk_widget_show (maxAreaSpinButton);
  gtk_box_pack_start (GTK_BOX (maxAreaHbox), maxAreaSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (maxAreaSpinButton), TRUE);

  aboveCropSeparator = gtk_hseparator_new ();
  gtk_widget_show (aboveCropSeparator);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), aboveCropSeparator, FALSE, TRUE, 0);

  leftCropHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (leftCropHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), leftCropHbox, FALSE, TRUE, 0);

  leftCropLabel = gtk_label_new_with_mnemonic (_("_Left side crop (ignore this many pixels on the left):        "));
  gtk_widget_show (leftCropLabel);
  gtk_box_pack_start (GTK_BOX (leftCropHbox), leftCropLabel, FALSE, FALSE, 0);

  leftCropSpinButton_adj = gtk_adjustment_new (0, 0, 2048, 1, 1, 0);
  leftCropSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (leftCropSpinButton_adj), 1, 0);
  gtk_widget_show (leftCropSpinButton);
  gtk_box_pack_start (GTK_BOX (leftCropHbox), leftCropSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (leftCropSpinButton), TRUE);

  rightCropHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (rightCropHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), rightCropHbox, FALSE, TRUE, 0);

  rightCropLabel = gtk_label_new_with_mnemonic (_("_Right side crop (ignore this many pixels on the right):     "));
  gtk_widget_show (rightCropLabel);
  gtk_box_pack_start (GTK_BOX (rightCropHbox), rightCropLabel, FALSE, FALSE, 0);

  rightCropSpinButton_adj = gtk_adjustment_new (0, 0, 2048, 1, 1, 0);
  rightCropSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (rightCropSpinButton_adj), 1, 0);
  gtk_widget_show (rightCropSpinButton);
  gtk_box_pack_start (GTK_BOX (rightCropHbox), rightCropSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rightCropSpinButton), TRUE);

  topCropHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (topCropHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), topCropHbox, FALSE, TRUE, 0);

  topCropLabel = gtk_label_new_with_mnemonic (_("_Top crop (ignore this many pixels on the top):                  "));
  gtk_widget_show (topCropLabel);
  gtk_box_pack_start (GTK_BOX (topCropHbox), topCropLabel, FALSE, FALSE, 0);

  topCropSpinButton_adj = gtk_adjustment_new (0, 0, 2048, 1, 1, 0);
  topCropSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (topCropSpinButton_adj), 1, 0);
  gtk_widget_show (topCropSpinButton);
  gtk_box_pack_start (GTK_BOX (topCropHbox), topCropSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (topCropSpinButton), TRUE);

  bottomCropHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (bottomCropHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), bottomCropHbox, FALSE, TRUE, 0);

  bottomCropLabel = gtk_label_new_with_mnemonic (_("_Bottom crop (ignore this many pixels on the bottom):   "));
  gtk_widget_show (bottomCropLabel);
  gtk_box_pack_start (GTK_BOX (bottomCropHbox), bottomCropLabel, FALSE, FALSE, 0);

  bottomCropSpinButton_adj = gtk_adjustment_new (0, 0, 2048, 1, 1, 0);
  bottomCropSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (bottomCropSpinButton_adj), 1, 0);
  gtk_widget_show (bottomCropSpinButton);
  gtk_box_pack_start (GTK_BOX (bottomCropHbox), bottomCropSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (bottomCropSpinButton), TRUE);

  belowCropSeparator = gtk_hseparator_new ();
  gtk_widget_show (belowCropSeparator);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), belowCropSeparator, FALSE, TRUE, 0);

  outputFormatHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (outputFormatHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), outputFormatHbox, FALSE, TRUE, 0);

  outputFormatLabel = gtk_label_new_with_mnemonic (_("Output _Format:   "));
  gtk_widget_show (outputFormatLabel);
  gtk_box_pack_start (GTK_BOX (outputFormatHbox), outputFormatLabel, FALSE, FALSE, 0);

  outputFormatMenu = gtk_combo_box_new_text ();
  gtk_widget_show (outputFormatMenu);
  gtk_box_pack_start (GTK_BOX (outputFormatHbox), outputFormatMenu, TRUE, TRUE, 0);

  outputFileHbox = gtk_hbox_new (FALSE, 5);
  gtk_widget_show (outputFileHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), outputFileHbox, FALSE, TRUE, 0);

  outputFileLabel = gtk_label_new_with_mnemonic (_("_Output File:"));
  gtk_widget_show (outputFileLabel);
  gtk_box_pack_start (GTK_BOX (outputFileHbox), outputFileLabel, FALSE, FALSE, 0);

  outputFileEntry = gtk_entry_new ();
  gtk_widget_show (outputFileEntry);
  gtk_box_pack_start (GTK_BOX (outputFileHbox), outputFileEntry, TRUE, TRUE, 0);
  gtk_entry_set_invisible_char (GTK_ENTRY (outputFileEntry), 8226);
  gtk_entry_set_width_chars (GTK_ENTRY (outputFileEntry), 40);

  outputFileBrowseButton = gtk_button_new_with_mnemonic (_("_Browse..."));
  gtk_widget_show (outputFileBrowseButton);
  gtk_box_pack_start (GTK_BOX (outputFileHbox), outputFileBrowseButton, FALSE, FALSE, 0);

  cameraNumberHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (cameraNumberHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), cameraNumberHbox, FALSE, TRUE, 0);

  cameraNumberLabel = gtk_label_new_with_mnemonic (_("_Camera Number for output file:      "));
  gtk_widget_show (cameraNumberLabel);
  gtk_box_pack_start (GTK_BOX (cameraNumberHbox), cameraNumberLabel, FALSE, FALSE, 0);

  cameraNumberSpinButton_adj = gtk_adjustment_new (1, 0, 99999, 1, 1, 0);
  cameraNumberSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (cameraNumberSpinButton_adj), 1, 0);
  gtk_widget_show (cameraNumberSpinButton);
  gtk_box_pack_start (GTK_BOX (cameraNumberHbox), cameraNumberSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (cameraNumberSpinButton), TRUE);

  debugHbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (debugHbox);
  gtk_box_pack_start (GTK_BOX (settingsOuterVbox), debugHbox, FALSE, TRUE, 0);

  debugLabel = gtk_label_new_with_mnemonic (_("_Debugging settings (bits):   "));
  gtk_widget_show (debugLabel);
  gtk_box_pack_start (GTK_BOX (debugHbox), debugLabel, FALSE, FALSE, 0);

  debugSpinButton_adj = gtk_adjustment_new (0, 0, 16777215, 1, 10, 0);
  debugSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (debugSpinButton_adj), 1, 0);
  gtk_widget_show (debugSpinButton);
  gtk_box_pack_start (GTK_BOX (debugHbox), debugSpinButton, TRUE, TRUE, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (debugSpinButton), TRUE);

  previewVboxOuter = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (previewVboxOuter);
  gtk_box_pack_start (GTK_BOX (allButButtonsHbox), previewVboxOuter, TRUE, TRUE, 0);

  previewFrame = gtk_frame_new (NULL);
  gtk_widget_show (previewFrame);
  gtk_box_pack_start (GTK_BOX (previewVboxOuter), previewFrame, FALSE, TRUE, 0);

  previewAlignment = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (previewAlignment);
  gtk_container_add (GTK_CONTAINER (previewFrame), previewAlignment);
  gtk_alignment_set_padding (GTK_ALIGNMENT (previewAlignment), 0, 8, 6, 8);

  previewVbox = gtk_vbox_new (FALSE, 5);
  gtk_widget_show (previewVbox);
  gtk_container_add (GTK_CONTAINER (previewAlignment), previewVbox);

  previewControlHbox = gtk_hbox_new (FALSE, 5);
  gtk_widget_show (previewControlHbox);
  gtk_box_pack_start (GTK_BOX (previewVbox), previewControlHbox, TRUE, TRUE, 0);

  previewOutputMenu = gtk_combo_box_new_text ();
  gtk_widget_show (previewOutputMenu);
  gtk_box_pack_start (GTK_BOX (previewControlHbox), previewOutputMenu, FALSE, TRUE, 0);

  previewSlider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 99, 1, 1, 0)));
  gtk_widget_show (previewSlider);
  gtk_box_pack_start (GTK_BOX (previewControlHbox), previewSlider, TRUE, TRUE, 0);
  gtk_scale_set_digits (GTK_SCALE (previewSlider), 0);

  previewVideo = gtk_drawing_area_new ();
  gtk_widget_show (previewVideo);
  gtk_box_pack_start (GTK_BOX (previewVbox), previewVideo, TRUE, TRUE, 0);
  gtk_widget_set_size_request (previewVideo, 30, 30);
  gtk_widget_set_events (previewVideo, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_PRESS_MASK);

  previewLabel = gtk_label_new (_("Preview"));
  gtk_widget_show (previewLabel);
  gtk_frame_set_label_widget (GTK_FRAME (previewFrame), previewLabel);

  dialogButtonBox = GTK_DIALOG (particle_dialog)->action_area;
  gtk_widget_show (dialogButtonBox);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialogButtonBox), GTK_BUTTONBOX_END);

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

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

  gtk_label_set_mnemonic_widget (GTK_LABEL (minAreaLabel), minAreaSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (maxAreaLabel), maxAreaSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (leftCropLabel), leftCropSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (rightCropLabel), rightCropSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (topCropLabel), topCropSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (bottomCropLabel), bottomCropSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (outputFileLabel), outputFileEntry);
  gtk_label_set_mnemonic_widget (GTK_LABEL (cameraNumberLabel), cameraNumberSpinButton);
  gtk_label_set_mnemonic_widget (GTK_LABEL (debugLabel), debugSpinButton);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (particle_dialog, particle_dialog, "particle_dialog");
  GLADE_HOOKUP_OBJECT_NO_REF (particle_dialog, dialogVbox, "dialogVbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, dialogHbox, "dialogHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, allButButtonsHbox, "allButButtonsHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, settingsOuterHbox, "settingsOuterHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, settingsOuterVbox, "settingsOuterVbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, minAreaHbox, "minAreaHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, minAreaLabel, "minAreaLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, minAreaSpinButton, "minAreaSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, maxAreaHbox, "maxAreaHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, maxAreaLabel, "maxAreaLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, maxAreaSpinButton, "maxAreaSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, aboveCropSeparator, "aboveCropSeparator");
  GLADE_HOOKUP_OBJECT (particle_dialog, leftCropHbox, "leftCropHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, leftCropLabel, "leftCropLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, leftCropSpinButton, "leftCropSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, rightCropHbox, "rightCropHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, rightCropLabel, "rightCropLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, rightCropSpinButton, "rightCropSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, topCropHbox, "topCropHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, topCropLabel, "topCropLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, topCropSpinButton, "topCropSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, bottomCropHbox, "bottomCropHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, bottomCropLabel, "bottomCropLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, bottomCropSpinButton, "bottomCropSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, belowCropSeparator, "belowCropSeparator");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFormatHbox, "outputFormatHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFormatLabel, "outputFormatLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFormatMenu, "outputFormatMenu");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFileHbox, "outputFileHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFileLabel, "outputFileLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFileEntry, "outputFileEntry");
  GLADE_HOOKUP_OBJECT (particle_dialog, outputFileBrowseButton, "outputFileBrowseButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, cameraNumberHbox, "cameraNumberHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, cameraNumberLabel, "cameraNumberLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, cameraNumberSpinButton, "cameraNumberSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, debugHbox, "debugHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, debugLabel, "debugLabel");
  GLADE_HOOKUP_OBJECT (particle_dialog, debugSpinButton, "debugSpinButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewVboxOuter, "previewVboxOuter");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewFrame, "previewFrame");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewAlignment, "previewAlignment");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewVbox, "previewVbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewControlHbox, "previewControlHbox");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewOutputMenu, "previewOutputMenu");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewSlider, "previewSlider");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewVideo, "previewVideo");
  GLADE_HOOKUP_OBJECT (particle_dialog, previewLabel, "previewLabel");
  GLADE_HOOKUP_OBJECT_NO_REF (particle_dialog, dialogButtonBox, "dialogButtonBox");
  GLADE_HOOKUP_OBJECT (particle_dialog, cancelButton, "cancelButton");
  GLADE_HOOKUP_OBJECT (particle_dialog, okButton, "okButton");

  return particle_dialog;
}
Example #12
0
static void prefs_message_create_widget(PrefsPage *_page, GtkWindow *window, 
			       	  gpointer data)
{
	MessagePage *prefs_message = (MessagePage *) _page;
	
	GtkWidget *vbox1;
	GtkWidget *vbox2;
	GtkWidget *hbox1;
	GtkWidget *checkbtn_disphdrpane;
	GtkWidget *checkbtn_disphdr;
	GtkWidget *checkbtn_dispxface;

	GtkWidget *button_edit_disphdr;
	GtkWidget *checkbtn_html;
	GtkWidget *checkbtn_html_plugin;
	GtkWidget *checkbtn_promote_html_part;
	GtkWidget *hbox_linespc;
	GtkWidget *label_linespc;
	GtkAdjustment *spinbtn_linespc_adj;
	GtkWidget *spinbtn_linespc;

	GtkWidget *frame;
	GtkWidget *vbox_scr;
	GtkWidget *checkbtn_smoothscroll;
	GtkWidget *hbox_scr;
	GtkWidget *label_scr;
	GtkAdjustment *spinbtn_scrollstep_adj;
	GtkWidget *spinbtn_scrollstep;
	GtkWidget *checkbtn_halfpage;
	GtkWidget *checkbtn_hide_quoted;

	GtkWidget *checkbtn_attach_desc;
	
	GtkWidget *frame_quote;
	GtkWidget *hbox2;
	GtkWidget *vbox_quote;
	GtkWidget *entry_quote_chars;
	GtkWidget *label_quote_chars;

	vbox1 = gtk_vbox_new (FALSE, VSPACING);
	gtk_widget_show (vbox1);
	gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);

	vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Headers"));

	PACK_CHECK_BUTTON(vbox2, checkbtn_disphdrpane,
			  _("Display header pane above message view"));

#if HAVE_LIBCOMPFACE
	PACK_CHECK_BUTTON(vbox2, checkbtn_dispxface,
			  _("Display (X-)Face in message view"));
#else
	PACK_CHECK_BUTTON(vbox2, checkbtn_dispxface,
			  _("Display Face in message view"));
#endif

	gtk_widget_set_sensitive(checkbtn_dispxface, 
		!prefs_common.display_header_pane);

	g_signal_connect(G_OBJECT(checkbtn_disphdrpane), "toggled",
			 G_CALLBACK(disphdr_pane_toggled), checkbtn_dispxface);

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

	PACK_CHECK_BUTTON(hbox1, checkbtn_disphdr,
			  _("Display headers in message view"));

	button_edit_disphdr = gtk_button_new_from_stock(GTK_STOCK_EDIT);
	gtk_widget_show (button_edit_disphdr);
	gtk_box_pack_start (GTK_BOX (hbox1), button_edit_disphdr,
			  FALSE, TRUE, 0);
	g_signal_connect (G_OBJECT (button_edit_disphdr), "clicked",
			  G_CALLBACK (prefs_display_header_open),
			  NULL);

	SET_TOGGLE_SENSITIVITY(checkbtn_disphdr, button_edit_disphdr);

	vbox2 = gtkut_get_options_frame(vbox1, &frame, _("HTML messages"));

	PACK_CHECK_BUTTON(vbox2, checkbtn_html,
			  _("Render HTML messages as text"));

	PACK_CHECK_BUTTON(vbox2, checkbtn_html_plugin,
			  _("Render HTML-only messages with plugin if possible"));
	
	PACK_CHECK_BUTTON(vbox2, checkbtn_promote_html_part,
			  _("Select the HTML part of multipart/alternative messages"));

	hbox1 = gtk_hbox_new (FALSE, 32);
	gtk_widget_show (hbox1);
	gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);

	hbox_linespc = gtk_hbox_new (FALSE, 8);
	gtk_widget_show (hbox1);
	gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);

	label_linespc = gtk_label_new (_("Line space"));
	gtk_widget_show (label_linespc);
	gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
			    FALSE, FALSE, 0);

	spinbtn_linespc_adj = GTK_ADJUSTMENT(gtk_adjustment_new (2, 0, 16, 1, 1, 0));
	spinbtn_linespc = gtk_spin_button_new
		(GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
	gtk_widget_show (spinbtn_linespc);
	gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
			    FALSE, FALSE, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);

	label_linespc = gtk_label_new (_("pixels"));
	gtk_widget_show (label_linespc);
	gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
			    FALSE, FALSE, 0);
	gtk_widget_show_all (hbox1);

	vbox_scr = gtkut_get_options_frame(vbox1, &frame, _("Scroll"));

	PACK_CHECK_BUTTON(vbox_scr, checkbtn_halfpage, _("Half page"));

	hbox1 = gtk_hbox_new (FALSE, 32);
	gtk_widget_show (hbox1);
	gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);

	PACK_CHECK_BUTTON(hbox1, checkbtn_smoothscroll, _("Smooth scroll"));

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

	label_scr = gtk_label_new (_("Step"));
	gtk_widget_show (label_scr);
	gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);

	spinbtn_scrollstep_adj = GTK_ADJUSTMENT(gtk_adjustment_new (1, 1, 100, 1, 10, 0));
	spinbtn_scrollstep = gtk_spin_button_new
		(GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
	gtk_widget_show (spinbtn_scrollstep);
	gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
			    FALSE, FALSE, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
				     TRUE);

	label_scr = gtk_label_new (_("pixels"));
	gtk_widget_show (label_scr);
	gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);

	SET_TOGGLE_SENSITIVITY (checkbtn_smoothscroll, hbox_scr)

	PACK_CHECK_BUTTON(vbox1, checkbtn_attach_desc,
			  _("Show attachment descriptions (rather than names)"));

	/* quote chars */
	PACK_FRAME (vbox1, frame_quote, _("Quotation"));

	vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
	gtk_widget_show (vbox_quote);
	gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
	gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);

	hbox1 = gtk_hbox_new (FALSE, 32);
	gtk_widget_show (hbox1);
	PACK_CHECK_BUTTON(vbox_quote, checkbtn_hide_quoted, _("Collapse quoted text on double click"));
	gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);

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

	label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks"));
	gtk_widget_show (label_quote_chars);
	gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);

	entry_quote_chars = gtk_entry_new ();
	gtk_widget_show (entry_quote_chars);
	gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
			    FALSE, FALSE, 0);
	gtk_widget_set_size_request (entry_quote_chars, 64, -1);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_disphdrpane),
		prefs_common.display_header_pane);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_dispxface),
		prefs_common.display_xface);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_disphdr),
		prefs_common.display_header);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_html),
		prefs_common.render_html);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_html_plugin),
		prefs_common.invoke_plugin_on_html);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_promote_html_part),
		prefs_common.promote_html_part);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_smoothscroll),
		prefs_common.enable_smooth_scroll);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_hide_quoted),
		prefs_common.hide_quoted);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_halfpage),
		prefs_common.scroll_halfpage);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_attach_desc),
		prefs_common.attach_desc);
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_linespc),
		prefs_common.line_space);
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_scrollstep),
		prefs_common.scroll_step);
	gtk_entry_set_text(GTK_ENTRY(entry_quote_chars), 
			prefs_common.quote_chars?prefs_common.quote_chars:"");
		
	prefs_message->window = GTK_WIDGET(window);
	prefs_message->checkbtn_disphdrpane = checkbtn_disphdrpane;
	prefs_message->checkbtn_dispxface = checkbtn_dispxface;
	prefs_message->checkbtn_disphdr = checkbtn_disphdr;
	prefs_message->checkbtn_html = checkbtn_html;
	prefs_message->checkbtn_html_plugin = checkbtn_html_plugin;
	prefs_message->checkbtn_promote_html_part = checkbtn_promote_html_part;
	prefs_message->spinbtn_linespc = spinbtn_linespc;
	prefs_message->checkbtn_smoothscroll = checkbtn_smoothscroll;
	prefs_message->checkbtn_hide_quoted = checkbtn_hide_quoted;
	prefs_message->spinbtn_scrollstep = spinbtn_scrollstep;
	prefs_message->checkbtn_halfpage = checkbtn_halfpage;
	prefs_message->checkbtn_attach_desc = checkbtn_attach_desc;
	prefs_message->entry_quote_chars = entry_quote_chars;
	
	prefs_message->page.widget = vbox1;
}
Example #13
0
static void
create_reminder_options_section (GtkWidget *reminder_opt_vbox, GUI *appGUI)
{
	GtkWidget *table, *label, *spinbutton, *entry, *valid_hbox;
	GtkObject *adjustment;
	gchar *str;
	gint i = 0;

	table = gtk_table_new (3, 4, FALSE);
	gtk_box_pack_start (GTK_BOX (reminder_opt_vbox), table, FALSE, FALSE, 0);
	gtk_table_set_col_spacings (GTK_TABLE (table), 4);
	gtk_table_set_row_spacings (GTK_TABLE (table), 8);

	label = utl_gui_create_label ("%s:", _("Postpone time"));
	gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);

	adjustment = gtk_adjustment_new (0, 0, 1440, 1, 10, 0);
	spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinbutton), config.postpone_time);
	gtk_table_attach (GTK_TABLE (table), spinbutton, 1, 2, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	g_signal_connect (G_OBJECT (spinbutton), "value-changed", G_CALLBACK (postpone_time_changed_cb), appGUI);
	appGUI->opt->postpone_time_spinbutton = spinbutton;

	str = g_strdup_printf ("%s (%s)", _("minutes"), _("0 for disable"));
	label = gtk_label_new (str);
	g_free (str);
	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
	gtk_table_attach (GTK_TABLE (table), label, 2, 3, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);

	i++;
	label = utl_gui_create_label ("%s:", _("Repeat sound alarm"));
	gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);

	adjustment = gtk_adjustment_new (0, 0, 100, 1, 10, 0);
	spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment), 1, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinbutton), config.sound_alarm_repeat);
	gtk_table_attach (GTK_TABLE (table), spinbutton, 1, 2, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
	g_signal_connect (G_OBJECT (spinbutton), "value-changed", G_CALLBACK (sound_alarm_repeat_changed_cb), appGUI);
	appGUI->opt->sound_alarm_repeat_spinbutton = spinbutton;

	str = g_strdup_printf ("%s (%s)", _("times"), _("0 for disable"));
	label = gtk_label_new (str);
	g_free (str);
	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
	gtk_table_attach (GTK_TABLE (table), label, 2, 3, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);

	i++;
	label = utl_gui_create_label ("%s:", _("Global notification command"));
	gtk_table_attach (GTK_TABLE (table), label, 0, 1, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);

	valid_hbox = gtk_hbox_new (FALSE, 2);
	gtk_table_attach (GTK_TABLE (table), valid_hbox, 1, 3, i, i+1,
	                  (GtkAttachOptions) (GTK_FILL | GTK_EXPAND), (GtkAttachOptions) (GTK_FILL), 0, 0);

	entry = gtk_entry_new ();
	gtk_entry_set_text (GTK_ENTRY (entry), config.global_notification_command);
	gtk_box_pack_start (GTK_BOX (valid_hbox), entry, TRUE, TRUE, 0);
	g_signal_connect (G_OBJECT (entry), "key_release_event",
	                  G_CALLBACK (global_notification_entry_key_release_cb), appGUI);
	appGUI->opt->global_notification_cmd_entry = entry;

	appGUI->opt->global_notification_valid_image = gtk_image_new ();
	gtk_box_pack_start (GTK_BOX (valid_hbox), appGUI->opt->global_notification_valid_image, FALSE, FALSE, 0);

	utl_gui_update_command_status (entry, appGUI->opt->global_notification_valid_image, appGUI);
}
Example #14
0
/** \brief Create and initialise widgets */
static GtkWidget *create_editor_widgets(rotor_conf_t * conf)
{
    GtkWidget      *table;
    GtkWidget      *label;

    table = gtk_table_new(7, 4, FALSE);
    gtk_container_set_border_width(GTK_CONTAINER(table), 5);
    gtk_table_set_col_spacings(GTK_TABLE(table), 5);
    gtk_table_set_row_spacings(GTK_TABLE(table), 5);

    /* Config name */
    label = gtk_label_new(_("Name"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);

    name = gtk_entry_new();
    gtk_entry_set_max_length(GTK_ENTRY(name), 25);
    gtk_widget_set_tooltip_text(name,
                                _("Enter a short name for this configuration, "
                                  " e.g. ROTOR-1.\n"
                                  "Allowed characters: 0..9, a..z, A..Z, - and _"));
    gtk_table_attach_defaults(GTK_TABLE(table), name, 1, 4, 0, 1);

    /* attach changed signal so that we can enable OK button when
       a proper name has been entered
     */
    g_signal_connect(name, "changed", G_CALLBACK(name_changed), NULL);

    /* Host */
    label = gtk_label_new(_("Host"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);

    host = gtk_entry_new();
    gtk_entry_set_max_length(GTK_ENTRY(host), 50);
    gtk_entry_set_text(GTK_ENTRY(host), "localhost");
    gtk_widget_set_tooltip_text(host,
                                _("Enter the host where rotctld is running. "
                                  "You can use both host name and IP address, "
                                  "e.g. 192.168.1.100\n\n"
                                  "If gpredict and rotctld are running on the "
                                  "same computer, use localhost"));
    gtk_table_attach_defaults(GTK_TABLE(table), host, 1, 4, 1, 2);

    /* port */
    label = gtk_label_new(_("Port"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);

    port = gtk_spin_button_new_with_range(1024, 65535, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), 4533);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(port), 0);
    gtk_widget_set_tooltip_text(port,
                                _("Enter the port number where rotctld is "
                                  "listening. Default is 4533."));
    gtk_table_attach_defaults(GTK_TABLE(table), port, 1, 2, 2, 3);

    gtk_table_attach_defaults(GTK_TABLE(table), gtk_hseparator_new(), 0, 4, 3,
                              4);

    /* Az-type */
    label = gtk_label_new(_("Az type"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 4, 5);

    aztype = gtk_combo_box_new_text();
    gtk_combo_box_append_text(GTK_COMBO_BOX(aztype),
                              "0\302\260 \342\206\222 180\302\260 \342\206\222 360\302\260");
    gtk_combo_box_append_text(GTK_COMBO_BOX(aztype),
                              "-180\302\260 \342\206\222 0\302\260 \342\206\222 +180\302\260");
    gtk_combo_box_set_active(GTK_COMBO_BOX(aztype), 0);
    gtk_widget_set_tooltip_text(aztype,
                                _("Select your azimuth range here. Note that "
                                  "gpredict assumes that 0\302\260 is at North "
                                  "and + direction is clockwise for both types"));
    gtk_table_attach_defaults(GTK_TABLE(table), aztype, 1, 3, 4, 5);
    g_signal_connect(G_OBJECT(aztype), "changed",
                     G_CALLBACK(aztype_changed_cb), NULL);

    /* Az and El limits */
    label = gtk_label_new(_(" Min Az"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 5, 6);
    minaz = gtk_spin_button_new_with_range(-200, 100, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(minaz), 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(minaz), TRUE);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(minaz), FALSE);
    gtk_table_attach_defaults(GTK_TABLE(table), minaz, 1, 2, 5, 6);

    label = gtk_label_new(_(" Max Az"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 5, 6);
    maxaz = gtk_spin_button_new_with_range(0, 450, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(maxaz), 360);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(maxaz), TRUE);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(maxaz), FALSE);
    gtk_table_attach_defaults(GTK_TABLE(table), maxaz, 3, 4, 5, 6);

    label = gtk_label_new(_(" Min El"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 6, 7);
    minel = gtk_spin_button_new_with_range(-10, 180, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(minel), 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(minel), TRUE);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(minel), FALSE);
    gtk_table_attach_defaults(GTK_TABLE(table), minel, 1, 2, 6, 7);

    label = gtk_label_new(_(" Max El"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 6, 7);
    maxel = gtk_spin_button_new_with_range(-10, 180, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(maxel), 90);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(maxel), TRUE);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(maxel), FALSE);
    gtk_table_attach_defaults(GTK_TABLE(table), maxel, 3, 4, 6, 7);



    label = gtk_label_new(_(" Azimuth end stop position"));
    gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
    gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 3, 7, 8);
    azstoppos = gtk_spin_button_new_with_range(-180, 360, 1);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(azstoppos), 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(azstoppos), TRUE);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(azstoppos), FALSE);
    gtk_widget_set_tooltip_text(azstoppos,
                                _("Set the position of the azimuth end stop "
                                  "here, where 0\302\260 is at North, "
                                  "-180\302\260 is south, etc. "
                                  "The default for a 0\302\260 \342\206\222 "
                                  "180\302\260 \342\206\222 360\302\260 rotor "
                                  "is 0\302\260, and the default for a "
                                  "-180\302\260 \342\206\222 0\302\260 "
                                  "\342\206\222 +180\302\260 rotor is -180\302\260."));
    gtk_table_attach_defaults(GTK_TABLE(table), azstoppos, 3, 4, 7, 8);

    if (conf->name != NULL)
        update_widgets(conf);

    gtk_widget_show_all(table);

    return table;
}
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkObject *spinbuttonT_adj;
  GtkWidget *spinbuttonT;
  GtkObject *spinbuttonD_adj;
  GtkWidget *spinbuttonD;
  GtkObject *spinbuttonB_adj;
  GtkWidget *spinbuttonB;
  GtkWidget *checkbuttonBF;
  GtkWidget *hscale1;
  GtkWidget *drawingarea1;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("ASharp by MarcFD"));

  dialog_vbox1 = GTK_DIALOG (dialog1)->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);

  table1 = gtk_table_new (4, 2, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0);

  label1 = gtk_label_new (QT_TR_NOOP("Threshold :"));
  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_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  label2 = gtk_label_new (QT_TR_NOOP("Strength :"));
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  label3 = gtk_label_new (QT_TR_NOOP("Block Adaptative :"));
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);

  label4 = gtk_label_new (QT_TR_NOOP("High Quality Block Filtering :"));
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);

  spinbuttonT_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0);
  spinbuttonT = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonT_adj), 1, 1);
  gtk_widget_show (spinbuttonT);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonT, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonT), TRUE);

  spinbuttonD_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0);
  spinbuttonD = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonD_adj), 1, 1);
  gtk_widget_show (spinbuttonD);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonD, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonD), TRUE);

  spinbuttonB_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0);
  spinbuttonB = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonB_adj), 1, 1);
  gtk_widget_show (spinbuttonB);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonB, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonB), TRUE);

  checkbuttonBF = gtk_check_button_new_with_mnemonic (QT_TR_NOOP(" "));
  gtk_widget_show (checkbuttonBF);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonBF, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 1, 0)));
  gtk_widget_show (hscale1);
  gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_box_pack_start (GTK_BOX (vbox1), drawingarea1, TRUE, TRUE, 0);

  dialog_action_area1 = GTK_DIALOG (dialog1)->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 (dialog1), 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 (dialog1), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonT, "spinbuttonT");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonD, "spinbuttonD");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonB, "spinbuttonB");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonBF, "checkbuttonBF");
  GLADE_HOOKUP_OBJECT (dialog1, hscale1, "hscale1");
  GLADE_HOOKUP_OBJECT (dialog1, drawingarea1, "drawingarea1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

  return dialog1;
}
Example #16
0
static void spamassassin_create_widget_func(PrefsPage * _page,
					    GtkWindow * window,
					    gpointer data)
{
	struct SpamAssassinPage *page = (struct SpamAssassinPage *) _page;
	SpamAssassinConfig *config;
	guint i, active;

	GtkWidget *vbox1, *vbox2;
	GtkWidget *frame_transport, *table_transport, *vbox_transport;
	GtkWidget *hbox_spamd, *hbox_max_size, *hbox_timeout;
	GtkWidget *hbox_process_emails, *hbox_save_spam;
	GtkWidget *hbox_mark_as_read, *hbox_whitelist;
	GtkWidget *whitelist_ab_checkbtn;
	GtkWidget *whitelist_ab_folder_combo;
	GtkWidget *whitelist_ab_select_btn;

	GtkWidget *enable_sa_checkbtn;

	GtkWidget *transport_label;
	GtkWidget *transport_optmenu;

	GtkWidget *user_label;
	GtkWidget *user_entry;

	GtkWidget *spamd_label;
	GtkWidget *spamd_hostname_entry;
	GtkWidget *spamd_colon_label;
	GtkAdjustment *spamd_port_spinbtn_adj;
	GtkWidget *spamd_port_spinbtn;
	GtkWidget *spamd_socket_entry;

	GtkWidget *max_size_label;
	GtkAdjustment *max_size_spinbtn_adj;
	GtkWidget *max_size_spinbtn;
	GtkWidget *max_size_kb_label;

	GtkWidget *timeout_label;
	GtkAdjustment *timeout_spinbtn_adj;
	GtkWidget *timeout_spinbtn;
	GtkWidget *timeout_seconds_label;

	GtkWidget *process_emails_checkbtn;

	GtkWidget *save_spam_checkbtn;
	GtkWidget *save_spam_folder_entry;
	GtkWidget *save_spam_folder_select;

	GtkWidget *mark_as_read_checkbtn;

	GtkListStore *store;
	GtkCellRenderer *renderer;
	GtkTreeIter iter;

	vbox1 = gtk_vbox_new (FALSE, VSPACING);
	gtk_widget_show (vbox1);
	gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);

	vbox2 = gtk_vbox_new (FALSE, 4);
	gtk_widget_show (vbox2);
	gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);

	enable_sa_checkbtn = gtk_check_button_new_with_label(_("Enable SpamAssassin plugin"));
	gtk_widget_show(enable_sa_checkbtn);
	gtk_box_pack_start(GTK_BOX(vbox2), enable_sa_checkbtn, TRUE, TRUE, 0);

	vbox_transport = gtkut_get_options_frame(vbox2, &frame_transport, _("Transport"));

	table_transport = gtk_table_new (3, 3, FALSE);
	gtk_widget_show (table_transport);
	gtk_box_pack_start(GTK_BOX(vbox_transport), table_transport, TRUE, TRUE, 0);
	gtk_table_set_row_spacings (GTK_TABLE (table_transport), 4);
	gtk_table_set_col_spacings (GTK_TABLE (table_transport), 8);

	transport_label = gtk_label_new(_("Type of transport"));
	gtk_widget_show(transport_label);
	gtk_table_attach (GTK_TABLE (table_transport), transport_label, 0, 1, 0, 1,
			(GtkAttachOptions) (GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);
	gtk_label_set_justify(GTK_LABEL(transport_label), GTK_JUSTIFY_RIGHT);
	gtk_misc_set_alignment(GTK_MISC(transport_label), 1, 0.5);

	store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
	transport_optmenu = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
	renderer = gtk_cell_renderer_text_new();
	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(transport_optmenu),
				   renderer, TRUE);
	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(transport_optmenu),
				       renderer, "text", 0, NULL);
	gtk_widget_show(transport_optmenu);

	gtk_table_attach (GTK_TABLE (table_transport), transport_optmenu, 1, 2, 0, 1,
			(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);

	user_label = gtk_label_new(_("User"));
	gtk_widget_show(user_label);
	gtk_table_attach (GTK_TABLE (table_transport), user_label, 0, 1, 1, 2,
			(GtkAttachOptions) (GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);
	gtk_label_set_justify(GTK_LABEL(user_label), GTK_JUSTIFY_RIGHT);
	gtk_misc_set_alignment(GTK_MISC(user_label), 1, 0.5);

	user_entry = gtk_entry_new();
	gtk_widget_show(user_entry);
	gtk_table_attach (GTK_TABLE (table_transport), user_entry, 1, 2, 1, 2,
			(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);
	CLAWS_SET_TIP(user_entry, _("User to use with spamd server"));

	spamd_label = gtk_label_new(_("spamd"));
	gtk_widget_show(spamd_label);
	gtk_table_attach (GTK_TABLE (table_transport), spamd_label, 0, 1, 2, 3,
			(GtkAttachOptions) (GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);
	gtk_label_set_justify(GTK_LABEL(spamd_label), GTK_JUSTIFY_RIGHT);
	gtk_misc_set_alignment(GTK_MISC(spamd_label), 1, 0.5);

	hbox_spamd = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_spamd);
	gtk_table_attach (GTK_TABLE (table_transport), hbox_spamd, 1, 2, 2, 3,
			(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
			(GtkAttachOptions) (0), 0, 0);

	spamd_hostname_entry = gtk_entry_new();
	gtk_widget_show(spamd_hostname_entry);
	gtk_box_pack_start(GTK_BOX(hbox_spamd), spamd_hostname_entry, TRUE, TRUE, 0);
	CLAWS_SET_TIP(spamd_hostname_entry,
			_("Hostname or IP address of spamd server"));

	spamd_colon_label = gtk_label_new(":");
	gtk_widget_show(spamd_colon_label);
	gtk_box_pack_start(GTK_BOX(hbox_spamd), spamd_colon_label, FALSE, FALSE, 0);

	spamd_port_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(783, 1, 65535, 1, 10, 0));
	spamd_port_spinbtn = gtk_spin_button_new(GTK_ADJUSTMENT(spamd_port_spinbtn_adj), 1, 0);
	gtk_widget_show(spamd_port_spinbtn);
	gtk_box_pack_start(GTK_BOX(hbox_spamd), spamd_port_spinbtn, FALSE, FALSE, 0);
	CLAWS_SET_TIP(spamd_port_spinbtn,
			_("Port of spamd server"));
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spamd_port_spinbtn), TRUE);

	spamd_socket_entry = gtk_entry_new();
	gtk_widget_show(spamd_socket_entry);
	gtk_box_pack_start(GTK_BOX(hbox_spamd), spamd_socket_entry, TRUE, TRUE, 0);
	CLAWS_SET_TIP(spamd_socket_entry, _("Path of Unix socket"));

	hbox_max_size = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_max_size);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_max_size, TRUE, TRUE, 0);

	max_size_label = gtk_label_new(_("Maximum size"));
	gtk_widget_show(max_size_label);
	gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_label, FALSE, FALSE, 0);

	max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, 10000, 10, 10, 0));
	max_size_spinbtn = gtk_spin_button_new(GTK_ADJUSTMENT(max_size_spinbtn_adj), 1, 0);
	gtk_widget_show(max_size_spinbtn);
	gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_spinbtn, FALSE, FALSE, 0);
	CLAWS_SET_TIP(max_size_spinbtn,
			_("Messages larger than this will not be checked"));
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(max_size_spinbtn), TRUE);

	max_size_kb_label = gtk_label_new(_("KB"));
	gtk_widget_show(max_size_kb_label);
	gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_kb_label, FALSE, FALSE, 0);

	hbox_timeout = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_timeout);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_timeout, TRUE, TRUE, 0);

	timeout_label = gtk_label_new(_("Timeout"));
	gtk_widget_show(timeout_label);
	gtk_box_pack_start(GTK_BOX(hbox_timeout), timeout_label, FALSE, FALSE, 0);

	timeout_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(60, 0, 10000, 10, 10, 0));
	timeout_spinbtn = gtk_spin_button_new(GTK_ADJUSTMENT(timeout_spinbtn_adj), 1, 0);
	gtk_widget_show(timeout_spinbtn);
	gtk_box_pack_start(GTK_BOX(hbox_timeout), timeout_spinbtn, FALSE, FALSE, 0);
	CLAWS_SET_TIP(timeout_spinbtn,
			_("Maximum time allowed for checking. If the check takes longer "
				"it will be aborted."));
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(timeout_spinbtn), TRUE);

	timeout_seconds_label = gtk_label_new(_("seconds"));
	gtk_widget_show(timeout_seconds_label);
	gtk_box_pack_start(GTK_BOX(hbox_timeout), timeout_seconds_label, FALSE, FALSE, 0);

	hbox_process_emails = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_process_emails);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_process_emails, TRUE, TRUE, 0);

	process_emails_checkbtn = gtk_check_button_new_with_label(
			_("Process messages on receiving"));
	gtk_widget_show(process_emails_checkbtn);
	gtk_box_pack_start(GTK_BOX(hbox_process_emails), process_emails_checkbtn, TRUE, TRUE, 0);

	hbox_save_spam = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_save_spam);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_save_spam, TRUE, TRUE, 0);

	save_spam_checkbtn = gtk_check_button_new_with_label(_("Save spam in"));
	gtk_widget_show(save_spam_checkbtn);
	gtk_box_pack_start(GTK_BOX(hbox_save_spam), save_spam_checkbtn, FALSE, FALSE, 0);

	save_spam_folder_entry = gtk_entry_new();
	gtk_widget_show (save_spam_folder_entry);
	gtk_box_pack_start (GTK_BOX (hbox_save_spam), save_spam_folder_entry, TRUE, TRUE, 0);
	CLAWS_SET_TIP(save_spam_folder_entry,
			_("Folder for storing identified spam. Leave empty to use the trash folder."));

	save_spam_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
	gtk_widget_show (save_spam_folder_select);
	gtk_box_pack_start (GTK_BOX (hbox_save_spam), save_spam_folder_select, FALSE, FALSE, 0);
	CLAWS_SET_TIP(save_spam_folder_select,
			_("Click this button to select a folder for storing spam"));

	hbox_mark_as_read = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_mark_as_read);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_mark_as_read, TRUE, TRUE, 0);

	mark_as_read_checkbtn = gtk_check_button_new_with_label(
			_("Mark spam as read"));
	gtk_widget_show(mark_as_read_checkbtn);
	gtk_box_pack_start(GTK_BOX(hbox_mark_as_read), mark_as_read_checkbtn, TRUE, TRUE, 0);

	hbox_whitelist = gtk_hbox_new(FALSE, 8);
	gtk_widget_show(hbox_whitelist);
	gtk_box_pack_start (GTK_BOX (vbox2), hbox_whitelist, TRUE, TRUE, 0);

	whitelist_ab_checkbtn = gtk_check_button_new_with_label(_("Whitelist senders found in address book/folder"));
	gtk_widget_show(whitelist_ab_checkbtn);
	gtk_box_pack_start(GTK_BOX(hbox_whitelist), whitelist_ab_checkbtn, FALSE, FALSE, 0);
	CLAWS_SET_TIP(whitelist_ab_checkbtn,
			_("Messages coming from your address book contacts will be received in the normal folder even if detected as spam"));

	whitelist_ab_folder_combo = combobox_text_new(TRUE, _("Any"), NULL);
	gtk_widget_set_size_request(whitelist_ab_folder_combo, 100, -1);
	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_folder_combo, TRUE, TRUE, 0);

	whitelist_ab_select_btn = gtk_button_new_with_label(_("Select..."));
	gtk_widget_show (whitelist_ab_select_btn);
	gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_select_btn, FALSE, FALSE, 0);
	CLAWS_SET_TIP(whitelist_ab_select_btn,
			_("Click this button to select a book or folder in the address book"));

	SET_TOGGLE_SENSITIVITY(enable_sa_checkbtn, frame_transport);
	SET_TOGGLE_SENSITIVITY(enable_sa_checkbtn, hbox_max_size);
	SET_TOGGLE_SENSITIVITY(enable_sa_checkbtn, hbox_timeout);
	SET_TOGGLE_SENSITIVITY(enable_sa_checkbtn, hbox_save_spam);
	SET_TOGGLE_SENSITIVITY(save_spam_checkbtn, save_spam_folder_entry);
	SET_TOGGLE_SENSITIVITY(save_spam_checkbtn, save_spam_folder_select);
	SET_TOGGLE_SENSITIVITY(enable_sa_checkbtn, hbox_process_emails);
	SET_TOGGLE_SENSITIVITY(save_spam_checkbtn, mark_as_read_checkbtn);
	SET_TOGGLE_SENSITIVITY(whitelist_ab_checkbtn, whitelist_ab_folder_combo);
#ifndef USE_NEW_ADDRBOOK
	SET_TOGGLE_SENSITIVITY(whitelist_ab_checkbtn, whitelist_ab_select_btn);
#endif
	config = spamassassin_get_config();

	g_signal_connect(G_OBJECT(save_spam_folder_select), "clicked",
			G_CALLBACK(foldersel_cb), page);
#ifndef USE_NEW_ADDRBOOK
	g_signal_connect(G_OBJECT (whitelist_ab_select_btn), "clicked",
			 G_CALLBACK(spamassassin_whitelist_ab_select_cb), page);
#else
	gtk_widget_set_sensitive(GTK_WIDGET(whitelist_ab_select_btn), FALSE);
#endif

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable_sa_checkbtn), config->enable);
	if (config->username != NULL)
		gtk_entry_set_text(GTK_ENTRY(user_entry), config->username);
	if (config->hostname != NULL)
		gtk_entry_set_text(GTK_ENTRY(spamd_hostname_entry), config->hostname);
	if (config->socket != NULL)
		gtk_entry_set_text(GTK_ENTRY(spamd_socket_entry), config->socket);
	if (config->whitelist_ab_folder != NULL) {
		/* translate "Any" (stored UNtranslated) */
		if (strcasecmp(config->whitelist_ab_folder, "Any") == 0)
			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
					config->whitelist_ab_folder);
		else
		/* backward compatibility (when translated "Any" was stored) */
		if (g_utf8_collate(config->whitelist_ab_folder, _("Any")) == 0)
			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
					config->whitelist_ab_folder);
		else
			gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
					config->whitelist_ab_folder);
	}
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spamd_port_spinbtn), (float) config->port);
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(max_size_spinbtn), (float) config->max_size);
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeout_spinbtn), (float) config->timeout);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(process_emails_checkbtn), config->process_emails);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(save_spam_checkbtn), config->receive_spam);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whitelist_ab_checkbtn), config->whitelist_ab);
	if (config->save_folder != NULL)
		gtk_entry_set_text(GTK_ENTRY(save_spam_folder_entry), config->save_folder);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mark_as_read_checkbtn), config->mark_as_read);

	page->enable_sa_checkbtn = enable_sa_checkbtn;
	page->transport_label = transport_label;
	page->transport_optmenu = transport_optmenu;
	page->username = user_entry;
	page->hostname = spamd_hostname_entry;
	page->colon = spamd_colon_label;
	page->port = spamd_port_spinbtn;
	page->socket = spamd_socket_entry;
	page->max_size = max_size_spinbtn;
	page->timeout = timeout_spinbtn;
	page->process_emails = process_emails_checkbtn;
	page->receive_spam = save_spam_checkbtn;
	page->save_folder = save_spam_folder_entry;
	page->save_folder_select = save_spam_folder_select;
	page->mark_as_read = mark_as_read_checkbtn;
	page->whitelist_ab = whitelist_ab_checkbtn;
	page->whitelist_ab_folder_combo = whitelist_ab_folder_combo;

	active = 0;
	for (i = 0; i < (sizeof(transports) / sizeof(struct Transport)); i++) {
		
		gtk_list_store_append(store, &iter);
		gtk_list_store_set(store, &iter,
				   0, gettext(transports[i].name),
				   1, &transports[i], -1);

		if (config->transport == transports[i].transport) {
			show_transport(page, &transports[i]);
			active = i;
		} else if (config->transport == SPAMASSASSIN_DISABLED 
			&& transports[i].transport == SPAMASSASSIN_TRANSPORT_LOCALHOST) {
			show_transport(page, &transports[i]);
			active = i;
			/* and disable via new way */
			config->enable = FALSE;
			gtk_toggle_button_set_active(
				GTK_TOGGLE_BUTTON(enable_sa_checkbtn), 
				config->enable);
		}
	}
	gtk_combo_box_set_active(GTK_COMBO_BOX(transport_optmenu), active);
	g_signal_connect(G_OBJECT(transport_optmenu), "changed",
			 G_CALLBACK(transport_sel_cb), page);

	page->page.widget = vbox1;
}
Example #17
0
static void
saa_solid_manager_init (SaaSolidManager * mgr) {
	GtkWidget * but_numero, * but_wythoff, * but_filename;
	GtkWidget * image1, * image2, * image3;
	GtkObject * sbut_numero_adj;
	const gchar * filename_path;

	gtk_table_resize(GTK_TABLE(mgr), 3, 5);
	gtk_table_set_homogeneous(GTK_TABLE(mgr), FALSE);

	gtk_table_set_row_spacings (GTK_TABLE (mgr), 5);
	gtk_table_set_col_spacings (GTK_TABLE (mgr), 5);
	gtk_container_set_border_width (GTK_CONTAINER (mgr), 5);

	// Numero
	mgr->radio_numero = gtk_radio_button_new_with_label_from_widget (NULL, _("Number:"));
	gtk_widget_set_name(mgr->radio_numero, "numero-rad");
	gtk_widget_show (mgr->radio_numero);
	gtk_table_attach (GTK_TABLE (mgr), mgr->radio_numero, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);

	sbut_numero_adj = gtk_adjustment_new (1, 1, 80, 1, 10, 0);
	mgr->spin_numero = gtk_spin_button_new (GTK_ADJUSTMENT (sbut_numero_adj), 1, 0);
	gtk_widget_set_name(mgr->spin_numero, "numero-ent");
	gtk_widget_show (mgr->spin_numero);
	gtk_table_attach (GTK_TABLE (mgr), mgr->spin_numero, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (mgr->spin_numero), TRUE);
	gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (mgr->spin_numero), TRUE);

	but_numero = gtk_button_new ();
	gtk_widget_set_name(but_numero, "numero-btn");
	gtk_widget_show (but_numero);
	gtk_table_attach (GTK_TABLE (mgr), but_numero, 2, 3, 0, 1, GTK_FILL, GTK_FILL, 0, 0);

	image1 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON);
	gtk_widget_show (image1);
	gtk_container_add (GTK_CONTAINER (but_numero), image1);

	// Wythoff
	mgr->radio_wythoff = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (mgr->radio_numero), _("Wythoff symbol:"));
	gtk_widget_set_name(mgr->radio_wythoff, "wythoff-rad");
	gtk_widget_show (mgr->radio_wythoff);
	gtk_table_attach (GTK_TABLE (mgr), mgr->radio_wythoff, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);

	mgr->entry_wythoff = gtk_entry_new ();
	gtk_widget_set_name(mgr->entry_wythoff, "wythoff-ent");
	gtk_widget_show (mgr->entry_wythoff);
	gtk_table_attach (GTK_TABLE (mgr), mgr->entry_wythoff, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
	gtk_entry_set_has_frame (GTK_ENTRY (mgr->entry_wythoff), FALSE);

	but_wythoff = gtk_button_new ();
	gtk_widget_set_name(but_wythoff, "wythoff-btn");
	gtk_widget_show (but_wythoff);
	gtk_table_attach (GTK_TABLE (mgr), but_wythoff, 2, 3, 1, 2, GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);

	image2 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON);
	gtk_widget_show (image2);
	gtk_container_add (GTK_CONTAINER (but_wythoff), image2);

	// Dual
	mgr->but_dual = gtk_toggle_button_new_with_mnemonic (_("Dual"));
	gtk_widget_set_name(mgr->but_dual, "numero-wythoff-dual-btn");
	gtk_widget_show (mgr->but_dual);
	gtk_table_attach (GTK_TABLE (mgr), mgr->but_dual, 3, 4, 0, 2, GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);

	// Filename
	mgr->radio_filename = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (mgr->radio_wythoff), _("File:"));
	gtk_widget_set_name(mgr->radio_filename, "filename-rad");
	gtk_widget_show (mgr->radio_filename);
	gtk_table_attach (GTK_TABLE (mgr), mgr->radio_filename, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0);

	mgr->but_filename = gtk_file_chooser_button_new (_("Load a solid"), GTK_FILE_CHOOSER_ACTION_OPEN);
	gtk_widget_set_name(mgr->but_filename, "filename-but");
	gtk_widget_show (mgr->but_filename);
	gtk_table_attach (GTK_TABLE (mgr), mgr->but_filename, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 0, 0);
	filename_path = g_get_user_special_dir(G_USER_DIRECTORY_DOCUMENTS);
	gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(mgr->but_filename), filename_path);


	but_filename = gtk_button_new ();
	gtk_widget_set_name(but_filename, "filename-btn");
	gtk_widget_show (but_filename);
	gtk_table_attach (GTK_TABLE (mgr), but_filename, 2, 3, 2, 3, GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);

	image3 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_BUTTON);
	gtk_widget_show (image3);
	gtk_container_add (GTK_CONTAINER (but_filename), image3);

	// Nom
	mgr->label_nom = gtk_label_new ("");
	gtk_widget_set_name(mgr->label_nom, "numero-wythoff-filename-lbl");
	gtk_widget_show (mgr->label_nom);
	gtk_table_attach (GTK_TABLE (mgr), mgr->label_nom, 0, 4, 4, 5, GTK_FILL, GTK_FILL, 0, 0);
	gtk_label_set_justify (GTK_LABEL (mgr->label_nom), GTK_JUSTIFY_CENTER);

	g_signal_connect_swapped ((gpointer) mgr->radio_numero, "toggled",
			G_CALLBACK (saa_solid_manager_radio_numero_toggled),
			mgr);
	g_signal_connect_swapped ((gpointer) mgr->radio_wythoff, "toggled",
			G_CALLBACK (saa_solid_manager_radio_wythoff_toggled),
			mgr);
	g_signal_connect_swapped ((gpointer) mgr->radio_filename, "toggled",
			G_CALLBACK (saa_solid_manager_radio_filename_toggled),
			mgr);

	g_signal_connect_swapped ((gpointer) but_numero, "clicked",
			G_CALLBACK (saa_solid_manager_numero_changed),
			mgr);

	g_signal_connect_swapped ((gpointer) but_wythoff, "clicked",
			G_CALLBACK (saa_solid_manager_wythoff_changed),
			mgr);

	g_signal_connect_swapped ((gpointer) but_filename, "clicked",
			G_CALLBACK (saa_solid_manager_filename_changed),
			mgr);

	g_signal_connect_swapped ((gpointer) mgr->but_dual, "toggled",
			G_CALLBACK (saa_solid_manager_dual_toggled),
			mgr);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mgr->radio_wythoff), TRUE);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mgr->radio_numero), TRUE);
}
static GtkContainer *
maildir_get_setup_page( XfceMailwatchMailbox *mailbox )
{
    XfceMailwatchMaildirMailbox *maildir = XFCE_MAILWATCH_MAILDIR_MAILBOX( mailbox );
    GtkWidget                   *vbox, *hbox;
    GtkWidget                   *label;
    GtkWidget                   *button;
    GtkWidget                   *spin;
    GtkSizeGroup                *sg;

    DBG( "-->>" );

    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, BORDER / 2 );
    gtk_widget_show( vbox );

    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BORDER );
    gtk_widget_show( hbox );
    gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );

    sg = gtk_size_group_new( GTK_SIZE_GROUP_HORIZONTAL );

    label = gtk_label_new_with_mnemonic( _( "Maildir _Path:" ) );
    gtk_widget_show( label );
    gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
    gtk_size_group_add_widget( sg, label );

    button = gtk_file_chooser_button_new( _("Select Maildir Folder"),
                                          GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER );
    g_mutex_lock( maildir->mutex );
    if ( maildir->path ) {
        gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( button ), maildir->path );
    }
    g_mutex_unlock( maildir->mutex );
    gtk_widget_show( button );
    gtk_box_pack_start( GTK_BOX( hbox ), button, TRUE, TRUE, 0 );
    g_signal_connect( G_OBJECT( button ), "file-set",
            G_CALLBACK( maildir_folder_set_cb ), maildir );

    gtk_label_set_mnemonic_widget( GTK_LABEL( label ), button );

    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BORDER );
    gtk_widget_show( hbox );
    gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );

    label = gtk_label_new_with_mnemonic( _( "_Interval:" ) );
    gtk_widget_show( label );
    gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
    gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
    gtk_size_group_add_widget( sg, label );

    spin = gtk_spin_button_new_with_range( 1.0, 1440.0, 1.0 );
    gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE );
    gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), FALSE );
    gtk_spin_button_set_value( GTK_SPIN_BUTTON( spin ), maildir->interval / 60 );
    gtk_widget_show( spin );
    gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, FALSE, 0 );
    g_signal_connect( G_OBJECT( spin ), "value-changed",
            G_CALLBACK( maildir_interval_changed_cb ), maildir );
    gtk_label_set_mnemonic_widget( GTK_LABEL( label ), spin );

    label = gtk_label_new( _( "minute(s)." ) );
    gtk_widget_show( label );
    gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
    
    DBG( "<<--" );
    
    return ( GTK_CONTAINER( vbox ) );
}
Example #19
0
static void
create_diagram_properties_dialog(Diagram *dia)
{
  GtkWidget *dialog_vbox;
  GtkWidget *notebook;
  GtkWidget *table;
  GtkWidget *label;
  GtkAdjustment *adj;

  dialog = gtk_dialog_new_with_buttons(
             _("Diagram Properties"),
             GTK_WINDOW(ddisplay_active()->shell),
             GTK_DIALOG_DESTROY_WITH_PARENT,
             GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
             GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
             GTK_STOCK_OK, GTK_RESPONSE_OK,
             NULL);

  gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);

  dialog_vbox = GTK_DIALOG(dialog)->vbox;

  gtk_window_set_role(GTK_WINDOW(dialog), "diagram_properties");

  g_signal_connect(G_OBJECT(dialog), "response",
		   G_CALLBACK(diagram_properties_respond),
		   NULL);
  g_signal_connect(G_OBJECT(dialog), "delete_event",
		   G_CALLBACK(gtk_widget_hide), NULL);
  g_signal_connect(G_OBJECT(dialog), "destroy",
		   G_CALLBACK(gtk_widget_destroyed), &dialog);

  notebook = gtk_notebook_new();
  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
  gtk_box_pack_start(GTK_BOX(dialog_vbox), notebook, TRUE, TRUE, 0);
  gtk_container_set_border_width(GTK_CONTAINER(notebook), 2);
  gtk_widget_show(notebook);

  /* the grid page */
  table = gtk_table_new(3,3,FALSE);
  gtk_container_set_border_width(GTK_CONTAINER(table), 2);
  gtk_table_set_row_spacings(GTK_TABLE(table), 1);
  gtk_table_set_col_spacings(GTK_TABLE(table), 2);

  dynamic_check = gtk_check_button_new_with_label(_("Dynamic grid"));
  gtk_table_attach(GTK_TABLE(table), dynamic_check, 1,2, 0,1,
		   GTK_FILL, GTK_FILL, 0, 0);
  g_signal_connect(G_OBJECT(dynamic_check), "toggled", 
		   G_CALLBACK(diagram_properties_update_sensitivity), NULL);
	    
  gtk_widget_show(dynamic_check);

  label = gtk_label_new(_("x"));
  gtk_table_attach(GTK_TABLE(table), label, 1,2, 1,2,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);
  label = gtk_label_new(_("y"));
  gtk_table_attach(GTK_TABLE(table), label, 2,3, 1,2,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  label = gtk_label_new(_("Spacing"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
  width_x_entry = gtk_spin_button_new(adj, 1.0, 3);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_x_entry), TRUE);
  gtk_table_attach(GTK_TABLE(table), width_x_entry, 1,2, 2,3,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(width_x_entry);

  adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 10.0, 0.1, 10.0, 0));
  width_y_entry = gtk_spin_button_new(adj, 1.0, 3);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(width_y_entry), TRUE);
  gtk_table_attach(GTK_TABLE(table), width_y_entry, 2,3, 2,3,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(width_y_entry);

  label = gtk_label_new(_("Visible spacing"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 3,4,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
  visible_x_entry = gtk_spin_button_new(adj, 1.0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_x_entry), TRUE);
  gtk_table_attach(GTK_TABLE(table), visible_x_entry, 1,2, 3,4,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(visible_x_entry);

  adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
  visible_y_entry = gtk_spin_button_new(adj, 1.0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(visible_y_entry), TRUE);
  gtk_table_attach(GTK_TABLE(table), visible_y_entry, 2,3, 3,4,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(visible_y_entry);

  /* Hexes! */
  hex_check = gtk_check_button_new_with_label(_("Hex grid"));
  gtk_table_attach(GTK_TABLE(table), hex_check, 1,2, 4,5,
		   GTK_FILL, GTK_FILL, 0, 0);
  g_signal_connect(G_OBJECT(hex_check), "toggled", 
		   G_CALLBACK(diagram_properties_update_sensitivity), NULL);
	    
  gtk_widget_show(hex_check);

  label = gtk_label_new(_("Hex grid size"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 5,6,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  adj = GTK_ADJUSTMENT(gtk_adjustment_new(1.0, 0.0, 100.0, 1.0, 10.0, 0));
  hex_size_entry = gtk_spin_button_new(adj, 1.0, 0);
  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(hex_size_entry), TRUE);
  gtk_table_attach(GTK_TABLE(table), hex_size_entry, 1,2, 5,6,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(hex_size_entry);

  label = gtk_label_new(_("Grid"));
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
  gtk_widget_show(table);
  gtk_widget_show(label);

  /* The background page */
  table = gtk_table_new(1,2, FALSE);
  gtk_container_set_border_width(GTK_CONTAINER(table), 2);
  gtk_table_set_row_spacings(GTK_TABLE(table), 1);
  gtk_table_set_col_spacings(GTK_TABLE(table), 2);

  label = gtk_label_new(_("Background"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 0,1,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  bg_colour = dia_color_selector_new();
  gtk_table_attach(GTK_TABLE(table), bg_colour, 1,2, 0,1,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(bg_colour);

  label = gtk_label_new(_("Grid Lines"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 1,2,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  grid_colour = dia_color_selector_new();
  gtk_table_attach(GTK_TABLE(table), grid_colour, 1,2, 1,2,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(grid_colour);

  label = gtk_label_new(_("Page Breaks"));
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  gtk_table_attach(GTK_TABLE(table), label, 0,1, 2,3,
		   GTK_FILL, GTK_FILL, 0, 0);
  gtk_widget_show(label);

  pagebreak_colour = dia_color_selector_new();
  gtk_table_attach(GTK_TABLE(table), pagebreak_colour, 1,2, 2,3,
		   GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
  gtk_widget_show(pagebreak_colour);

  label = gtk_label_new(_("Colors"));
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
  gtk_widget_show(table);
  gtk_widget_show(label);
}
Example #20
0
GtkWidget *
range_widget_create()
{
	GtkWidget *range_dialog;
	GtkWidget *dialog_vbox4;
	GtkWidget *vbox7;
	GtkWidget *hbox46;
	GtkWidget *label43;
	GtkWidget *label44;
	GtkWidget *hbox42;
	GtkWidget *hbox43;
	GtkWidget *hbox44;
	GtkObject *start_hours_adj;
	GtkObject *start_minutes_adj;
	GtkObject *start_seconds_adj;
	GtkWidget *hbox45;
	GtkObject *end_hours_adj;
	GtkObject *end_minutes_adj;
	GtkObject *end_seconds_adj;
	GtkWidget *dialog_action_area4;
	GtkWidget *cancel_button;
	GtkWidget *ok_button;
	GtkWidget *alignment55;
	GtkWidget *hbox341;
	GtkWidget *image49;
	GtkWidget *label97;
	gchar *val;

	range_dialog = gtk_dialog_new();
	gtk_window_set_title(GTK_WINDOW(range_dialog), TIMELOG_TITLE);
	gtk_window_set_modal(GTK_WINDOW(range_dialog), FALSE);
	gtk_window_set_type_hint(GTK_WINDOW(range_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);

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

	vbox7 = gtk_vbox_new(FALSE, 0);
	gtk_widget_show(vbox7);
	gtk_box_pack_start(GTK_BOX(dialog_vbox4), vbox7, TRUE, TRUE, 0);

	hbox46 = gtk_hbox_new(FALSE, 20);
	gtk_widget_show(hbox46);
	gtk_box_pack_start(GTK_BOX(vbox7), hbox46, FALSE, FALSE, 5);

	label43 = gtk_label_new(_("Start Time"));
	gtk_widget_show(label43);
	gtk_box_pack_start(GTK_BOX(hbox46), label43, TRUE, TRUE, 0);

	label44 = gtk_label_new(_("End Time"));
	gtk_widget_show(label44);
	gtk_box_pack_start(GTK_BOX(hbox46), label44, TRUE, TRUE, 0);

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

	start_calendar = gtk_calendar_new();
	gtk_widget_show(start_calendar);
	gtk_box_pack_start(GTK_BOX(hbox42), start_calendar, TRUE, TRUE, 0);
	gtk_calendar_display_options(GTK_CALENDAR(start_calendar),
			GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);

	end_calendar = gtk_calendar_new();
	gtk_widget_show(end_calendar);
	gtk_box_pack_start(GTK_BOX(hbox42), end_calendar, TRUE, TRUE, 0);
	gtk_calendar_display_options(GTK_CALENDAR(end_calendar),
			GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);

	hbox43 = gtk_hbox_new(FALSE, 20);
	gtk_widget_show(hbox43);
	gtk_box_pack_start(GTK_BOX(vbox7), hbox43, FALSE, TRUE, 10);

	hbox44 = gtk_hbox_new(FALSE, 0);
	gtk_widget_show(hbox44);
	gtk_box_pack_start(GTK_BOX(hbox43), hbox44, TRUE, TRUE, 0);

	start_hours_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	start_hours = gtk_spin_button_new(GTK_ADJUSTMENT(start_hours_adj), 1, 0);
	gtk_widget_show(start_hours);
	gtk_box_pack_start(GTK_BOX(hbox44), start_hours, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(start_hours), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(start_hours), TRUE);

	start_minutes_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	start_minutes = gtk_spin_button_new(GTK_ADJUSTMENT(start_minutes_adj), 1, 0);
	gtk_widget_show(start_minutes);
	gtk_box_pack_start(GTK_BOX(hbox44), start_minutes, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(start_minutes), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(start_minutes), TRUE);

	start_seconds_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	start_seconds = gtk_spin_button_new(GTK_ADJUSTMENT(start_seconds_adj), 1, 0);
	gtk_widget_show(start_seconds);
	gtk_box_pack_start(GTK_BOX(hbox44), start_seconds, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(start_seconds), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(start_seconds), TRUE);

	hbox45 = gtk_hbox_new(FALSE, 0);
	gtk_widget_show(hbox45);
	gtk_box_pack_start(GTK_BOX(hbox43), hbox45, TRUE, TRUE, 0);

	end_hours_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	end_hours = gtk_spin_button_new(GTK_ADJUSTMENT(end_hours_adj), 1, 0);
	gtk_widget_show(end_hours);
	gtk_box_pack_start(GTK_BOX(hbox45), end_hours, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(end_hours), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(end_hours), TRUE);

	end_minutes_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	end_minutes = gtk_spin_button_new(GTK_ADJUSTMENT(end_minutes_adj), 1, 0);
	gtk_widget_show(end_minutes);
	gtk_box_pack_start(GTK_BOX(hbox45), end_minutes, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(end_minutes), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(end_minutes), TRUE);

	end_seconds_adj = gtk_adjustment_new(0, -100, 100, 1, 10, 10);
	end_seconds = gtk_spin_button_new(GTK_ADJUSTMENT(end_seconds_adj), 1, 0);
	gtk_widget_show(end_seconds);
	gtk_box_pack_start(GTK_BOX(hbox45), end_seconds, TRUE, TRUE, 0);
	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(end_seconds), TRUE);
	gtk_spin_button_set_snap_to_ticks(GTK_SPIN_BUTTON(end_seconds), TRUE);

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

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

	ok_button = gtk_button_new();
	gtk_widget_show(ok_button);
	gtk_dialog_add_action_widget(GTK_DIALOG(range_dialog), ok_button, GTK_RESPONSE_OK);
	GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT);

	alignment55 = gtk_alignment_new(0.5, 0.5, 0, 0);
	gtk_widget_show(alignment55);
	gtk_container_add(GTK_CONTAINER(ok_button), alignment55);

	hbox341 = gtk_hbox_new(FALSE, 2);
	gtk_widget_show(hbox341);
	gtk_container_add(GTK_CONTAINER(alignment55), hbox341);

	image49 = gtk_image_new_from_stock("gtk-ok", GTK_ICON_SIZE_BUTTON);
	gtk_widget_show(image49);
	gtk_box_pack_start(GTK_BOX(hbox341), image49, FALSE, FALSE, 0);

	label97 = gtk_label_new_with_mnemonic(_("Select Time Range"));
	gtk_widget_show(label97);
	gtk_box_pack_start(GTK_BOX(hbox341), label97, FALSE, FALSE, 0);

	g_signal_connect((gpointer) start_hours, "value_changed", 
			G_CALLBACK(cb_time_value_changed), NULL);
	g_signal_connect((gpointer) start_minutes, "value_changed", 
			G_CALLBACK(cb_time_value_changed), NULL);
	g_signal_connect((gpointer) start_seconds, "value_changed",
			G_CALLBACK(cb_time_value_changed), NULL);
	g_signal_connect((gpointer) end_hours, "value_changed",
			G_CALLBACK(cb_time_value_changed), NULL);
	g_signal_connect((gpointer) end_minutes, "value_changed",
			G_CALLBACK(cb_time_value_changed), NULL);
	g_signal_connect((gpointer) end_seconds, "value_changed",
			G_CALLBACK(cb_time_value_changed), NULL);

	val = g_strdup_printf("%02d", 0);
	gtk_entry_set_text(GTK_ENTRY(start_hours), val);
	gtk_entry_set_text(GTK_ENTRY(start_minutes), val);
	gtk_entry_set_text(GTK_ENTRY(start_seconds), val);
	gtk_entry_set_text(GTK_ENTRY(end_hours), val);
	gtk_entry_set_text(GTK_ENTRY(end_minutes), val);
	gtk_entry_set_text(GTK_ENTRY(end_seconds), val);
	g_free(val);

	gtk_widget_grab_default(ok_button);

	return range_dialog;
}
Example #21
0
GtkWidget*
create_dialog1 (void)
{
    GtkWidget *dialog1;
    GtkWidget *dialog_vbox1;
    GtkWidget *vbox1;
    GtkWidget *hbox1;
    GtkWidget *label1;
    GtkObject *spinbutton1_adj;
    GtkWidget *spinbutton1;
    GtkWidget *hscale1;
    GtkWidget *hbox2;
    GtkWidget *drawingarea1;
    GtkWidget *vscale1;
    GtkWidget *dialog_action_area1;
    GtkWidget *cancelbutton1;
    GtkWidget *okbutton1;

    dialog1 = gtk_dialog_new ();
    gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Subtitle Size and Position"));
    gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);

    dialog_vbox1 = GTK_DIALOG (dialog1)->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);

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

    label1 = gtk_label_new (QT_TR_NOOP("Font Size:"));
    gtk_widget_show (label1);
    gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);

    spinbutton1_adj = gtk_adjustment_new (1, 6, 99, 1, 10, 0);
    spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 2);
    gtk_widget_show (spinbutton1);
    gtk_box_pack_start (GTK_BOX (hbox1), spinbutton1, FALSE, FALSE, 0);
    gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton1), TRUE);

    hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 99, 1, 1, 0)));
    gtk_widget_show (hscale1);
    gtk_box_pack_start (GTK_BOX (vbox1), hscale1, FALSE, FALSE, 0);

    hbox2 = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (hbox2);
    gtk_box_pack_start (GTK_BOX (vbox1), hbox2, TRUE, TRUE, 0);

    drawingarea1 = gtk_drawing_area_new ();
    gtk_widget_show (drawingarea1);
    gtk_box_pack_start (GTK_BOX (hbox2), drawingarea1, TRUE, TRUE, 0);

    vscale1 = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 100, 1, 1, 1, 0)));
    gtk_widget_show (vscale1);
    gtk_box_pack_start (GTK_BOX (hbox2), vscale1, FALSE, FALSE, 0);
    gtk_scale_set_digits (GTK_SCALE (vscale1), 0);

    dialog_action_area1 = GTK_DIALOG (dialog1)->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 (dialog1), 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 (dialog1), okbutton1, GTK_RESPONSE_OK);
    GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
    GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
    GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
    GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
    GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
    GLADE_HOOKUP_OBJECT (dialog1, spinbutton1, "spinbutton1");
    GLADE_HOOKUP_OBJECT (dialog1, hscale1, "hscale1");
    GLADE_HOOKUP_OBJECT (dialog1, hbox2, "hbox2");
    GLADE_HOOKUP_OBJECT (dialog1, drawingarea1, "drawingarea1");
    GLADE_HOOKUP_OBJECT (dialog1, vscale1, "vscale1");
    GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
    GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
    GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

    return dialog1;
}
Example #22
0
static GtkWidget *
prefs_get_property_widget(DiaPrefData *data)
{
  GtkWidget *widget = NULL;
  GtkAdjustment *adj;
  
  switch(data->type) {
  case PREF_BOOLEAN:
    widget = gtk_toggle_button_new_with_label (_("No"));
    g_signal_connect (G_OBJECT (widget), "toggled",
		      G_CALLBACK (prefs_boolean_toggle), NULL);
    break;
  case PREF_INT:
    adj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0,
					    G_MININT, G_MAXINT,
					    1.0, 10.0, 0));
    widget = gtk_spin_button_new (adj, 1.0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(widget), TRUE);
    gtk_widget_set_size_request (widget, 80, -1);
    break;
  case PREF_UINT:
    adj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0,
					    0.0, G_MAXINT,
					    1.0, 10.0, 0));
    widget = gtk_spin_button_new (adj, 1.0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(widget), TRUE);
    gtk_widget_set_size_request (widget, 80, -1);
    break;
  case PREF_REAL:
    adj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0,
					    G_MINFLOAT, G_MAXFLOAT,
					    1.0, 10.0, 0));
    widget = gtk_spin_button_new (adj, 1.0, 3);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(widget), TRUE);
    gtk_widget_set_size_request (widget, 80, -1);
    break;
  case PREF_UREAL:
    adj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0,
					    0.0, G_MAXFLOAT,
					    1.0, 10.0, 0 ));
    widget = gtk_spin_button_new (adj, 1.0, 3);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(widget), TRUE);
    gtk_widget_set_size_request (widget, 80, -1);
    break;
  case PREF_COLOUR:
    widget = dia_color_selector_new();
    break;
  case PREF_STRING:
    widget = gtk_entry_new();
    break;
  case PREF_CHOICE: {
    GList *names;
#if GTK_CHECK_VERSION(2,24,0)
    widget = gtk_combo_box_text_new ();
#else
    widget = gtk_combo_box_new_text ();
#endif
    for (names = (data->choice_list_function)(data); 
         names != NULL;
	 names = g_list_next(names)) {
#if GTK_CHECK_VERSION(2,24,0)
      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), (gchar *)names->data);
#else
      gtk_combo_box_append_text (GTK_COMBO_BOX (widget), (gchar *)names->data);
#endif
    }
    break;
  }
  case PREF_NONE:
  case PREF_END_GROUP:
    widget = NULL;
    break;
  }
  if (widget != NULL)
    gtk_widget_show(widget);
  return widget;
}
Example #23
0
static GtkWidget *
line_get_properties(Line *line)
{
  GtkWidget *vbox;
  GtkWidget *hbox;
  GtkWidget *label;
  GtkWidget *color;
  GtkWidget *linestyle;
  GtkWidget *arrow;
  GtkWidget *line_width;
  GtkWidget *align;
  GtkAdjustment *adj;

  if (line_properties_dialog == NULL) {
  
    line_properties_dialog = g_new(LinePropertiesDialog, 1);

    vbox = gtk_vbox_new(FALSE, 5);
    line_properties_dialog->vbox = vbox;

    hbox = gtk_hbox_new(FALSE, 5);
    label = gtk_label_new(_("Line width:"));
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
    gtk_widget_show (label);
    adj = (GtkAdjustment *) gtk_adjustment_new(0.1, 0.00, 10.0, 0.01, 0.0, 0.0);
    line_width = gtk_spin_button_new(adj, 1.0, 2);
    gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(line_width), TRUE);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(line_width), TRUE);
    line_properties_dialog->line_width = GTK_SPIN_BUTTON(line_width);
    gtk_box_pack_start(GTK_BOX (hbox), line_width, TRUE, TRUE, 0);
    gtk_widget_show (line_width);
    gtk_widget_show(hbox);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

    hbox = gtk_hbox_new(FALSE, 5);
    label = gtk_label_new(_("Color:"));
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
    gtk_widget_show (label);
    color = dia_color_selector_new();
    line_properties_dialog->color = DIACOLORSELECTOR(color);
    gtk_box_pack_start (GTK_BOX (hbox), color, TRUE, TRUE, 0);
    gtk_widget_show (color);
    gtk_widget_show(hbox);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

    hbox = gtk_hbox_new(FALSE, 5);
    label = gtk_label_new(_("Line style:"));
    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
    gtk_widget_show (label);
    linestyle = dia_line_style_selector_new();
    line_properties_dialog->line_style = DIALINESTYLESELECTOR(linestyle);
    gtk_box_pack_start (GTK_BOX (hbox), linestyle, TRUE, TRUE, 0);
    gtk_widget_show (linestyle);
    gtk_widget_show(hbox);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

    hbox = gtk_hbox_new(FALSE, 5);
    label = gtk_label_new(_("Start arrow:"));
    align = gtk_alignment_new(0.0,0.0,0.0,0.0);
    gtk_container_add(GTK_CONTAINER(align), label);
    gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
    gtk_widget_show (label);
    gtk_widget_show(align);
    arrow = dia_arrow_selector_new();
    line_properties_dialog->start_arrow = DIAARROWSELECTOR(arrow);
    gtk_box_pack_start (GTK_BOX (hbox), arrow, TRUE, TRUE, 0);
    gtk_widget_show (arrow);
    gtk_widget_show(hbox);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

    hbox = gtk_hbox_new(FALSE, 5);
    label = gtk_label_new(_("End arrow:"));
    align = gtk_alignment_new(0.0,0.0,0.0,0.0);
    gtk_container_add(GTK_CONTAINER(align), label);
    gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
    gtk_widget_show (label);
    gtk_widget_show(align);
    arrow = dia_arrow_selector_new();
    line_properties_dialog->end_arrow = DIAARROWSELECTOR(arrow);
    gtk_box_pack_start (GTK_BOX (hbox), arrow, TRUE, TRUE, 0);
    gtk_widget_show (arrow);
    gtk_widget_show(hbox);
    gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, 0);

    gtk_widget_show (vbox);
  }

  line_properties_dialog->line = line;

  gtk_spin_button_set_value(line_properties_dialog->line_width, line->line_width);
  dia_color_selector_set_color(line_properties_dialog->color, &line->line_color);
  dia_line_style_selector_set_linestyle(line_properties_dialog->line_style,
					line->line_style, line->dashlength);
  dia_arrow_selector_set_arrow(line_properties_dialog->start_arrow,
			       line->start_arrow);
  dia_arrow_selector_set_arrow(line_properties_dialog->end_arrow,
			       line->end_arrow);
  
  return line_properties_dialog->vbox;
}
static void
mailwatch_view_log_clicked_cb( GtkWidget *widget, gpointer user_data )
{
    XfceMailwatchPlugin     *mwp = user_data;
    static GtkWidget        *dialog = NULL;
    GtkWidget               *vbox, *hbox, *scrollw, *treeview, *button, *lbl,
                            *sbtn, *chk;
    
    if(dialog) {
        gtk_window_present(GTK_WINDOW(dialog));
        return;
    }

    mwp->log_status = 0;
    mailwatch_set_icon( mwp, mwp->newmail_icon_visible );

    dialog = gtk_dialog_new_with_buttons(_( "Mailwatch log" ),
                                         GTK_WINDOW(gtk_widget_get_toplevel(widget)),
                                         GTK_DIALOG_MODAL
                                         | GTK_DIALOG_DESTROY_WITH_PARENT
                                         | GTK_DIALOG_NO_SEPARATOR,
                                         NULL);
    gtk_widget_set_size_request(dialog, 480, 240 );
    g_signal_connect(G_OBJECT(dialog), "response",
                     G_CALLBACK(mailwatch_log_window_response_cb), mwp->loglist);
    g_signal_connect_swapped(G_OBJECT(dialog), "destroy",
                     G_CALLBACK(mailwatch_zero_pointer), &dialog);
    
    vbox = gtk_vbox_new(FALSE, BORDER/2);
    gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER/2);
    gtk_widget_show(vbox);
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, TRUE, TRUE, 0);

    scrollw = gtk_scrolled_window_new( NULL, NULL );
    gtk_widget_show( scrollw );
    gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrollw ),
                                    GTK_POLICY_AUTOMATIC,
                                    GTK_POLICY_AUTOMATIC );
    gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scrollw ),
                                         GTK_SHADOW_IN );
    gtk_box_pack_start( GTK_BOX( vbox ), scrollw, TRUE, TRUE, 0 );
    
    treeview = gtk_tree_view_new_with_model( GTK_TREE_MODEL( mwp->loglist ) );
    gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( treeview ), FALSE );
    gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( treeview ),
                                                 -1,
                                                 "Level",
                                                 gtk_cell_renderer_pixbuf_new(),
                                                 "pixbuf", LOGLIST_COLUMN_PIXBUF,
                                                 NULL );
    gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1,
                                                "Timestamp",
                                                gtk_cell_renderer_text_new(),
                                                "text", LOGLIST_COLUMN_TIME,
                                                NULL);
    gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( treeview ),
                                                 -1,
                                                 "Message",
                                                 gtk_cell_renderer_text_new(),
                                                 "text", LOGLIST_COLUMN_MESSAGE,
                                                 NULL );
    g_object_set(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), 0)),
                 "expand", FALSE, NULL);
    g_object_set(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), 1)),
                 "expand", FALSE, NULL);
    g_object_set(G_OBJECT(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), 2)),
                 "expand", TRUE, NULL);
    gtk_widget_show( treeview );
    gtk_container_add( GTK_CONTAINER( scrollw ), treeview );
    
    hbox = gtk_hbox_new(FALSE, BORDER/2);
    gtk_widget_show(hbox);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
    
    lbl = gtk_label_new_with_mnemonic(_("Log _lines:"));
    gtk_widget_show(lbl);
    gtk_box_pack_start(GTK_BOX(hbox), lbl, FALSE, FALSE, 0);
    
    sbtn = gtk_spin_button_new_with_range(0.0, G_MAXDOUBLE, 1.0);
    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(sbtn), 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(sbtn), TRUE);
    gtk_spin_button_set_value(GTK_SPIN_BUTTON(sbtn), mwp->log_lines);
    gtk_widget_show(sbtn);
    gtk_box_pack_start(GTK_BOX(hbox), sbtn, FALSE, FALSE, 0);
    g_signal_connect(G_OBJECT(sbtn), "value-changed",
                     G_CALLBACK(mailwatch_log_lines_changed_cb), mwp);
    gtk_label_set_mnemonic_widget(GTK_LABEL(lbl), sbtn);
    
    chk = gtk_check_button_new_with_mnemonic(_("Show log _status in icon"));
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chk), mwp->show_log_status);
    gtk_widget_show(chk);
    gtk_box_pack_start(GTK_BOX(vbox), chk, FALSE, FALSE, 0);
    g_signal_connect(G_OBJECT(chk), "toggled",
                     G_CALLBACK(mailwatch_log_status_toggled_cb), mwp);
    
    button = gtk_button_new_from_stock(GTK_STOCK_CLEAR);
    gtk_widget_show( button );
    gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button,
                                 XFCE_MAILWATCH_RESPONSE_CLEAR);
    
    button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
    gtk_widget_show( button );
    gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_ACCEPT);
    
    gtk_widget_show(dialog);
}
Example #25
0
void ir_configure(void)
{
	GtkWidget *vbox, *notebook, *box, *frame, *table, *vbox2, *label,
	         *button, *label_codelen;
	GtkAdjustment *adj;
	gint i;

	irapp_read_config();
	if (!irconf_mainwin)
	{

		irconf_mainwin = gtk_window_new(GTK_WINDOW_DIALOG);
		gtk_signal_connect(GTK_OBJECT(irconf_mainwin), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &irconf_mainwin);
		gtk_window_set_title(GTK_WINDOW(irconf_mainwin), _("XMMS IRman Configuration"));
		gtk_window_set_policy(GTK_WINDOW(irconf_mainwin), FALSE, FALSE, FALSE);
		gtk_window_set_position(GTK_WINDOW(irconf_mainwin), GTK_WIN_POS_MOUSE);
		gtk_container_border_width(GTK_CONTAINER(irconf_mainwin), 10);

		vbox = gtk_vbox_new(FALSE, 10);
		gtk_container_add(GTK_CONTAINER(irconf_mainwin), vbox);

		notebook = gtk_notebook_new();
		gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);

		box = gtk_vbox_new(FALSE, 5);
		gtk_container_set_border_width(GTK_CONTAINER(box), 5);

		frame = gtk_frame_new(_("Device:"));
		gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0);

		table = gtk_table_new(2, 1, FALSE);
		gtk_container_set_border_width(GTK_CONTAINER(table), 5);
		gtk_container_add(GTK_CONTAINER(frame), table);
		gtk_table_set_row_spacings(GTK_TABLE(table), 5);
		gtk_table_set_col_spacings(GTK_TABLE(table), 5);

		label = gtk_label_new(_("Device: "));
		gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
		gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
		gtk_widget_show(label);

		dev_entry = gtk_entry_new();
		gtk_entry_set_text(GTK_ENTRY(dev_entry), ircfg.device);
		gtk_table_attach_defaults(GTK_TABLE(table), dev_entry, 1, 2, 0, 1);
		gtk_widget_show(dev_entry);

                label_codelen = gtk_label_new(_("IR code length: "));
		gtk_misc_set_alignment(GTK_MISC(label_codelen), 1.0, 0.5);
		gtk_table_attach_defaults(GTK_TABLE(table), label_codelen, 0, 1, 1, 2);
		gtk_widget_show(label_codelen);

		codelen_entry = gtk_entry_new();
		gtk_entry_set_text(GTK_ENTRY(codelen_entry), g_strdup_printf("%d", ircfg.codelen));
		gtk_table_attach_defaults(GTK_TABLE(table), codelen_entry, 1, 2, 1, 2);
		gtk_widget_show(codelen_entry);

		gtk_widget_show(table);
		gtk_widget_show(frame);

		frame = gtk_frame_new(_("Controls:"));
		gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0);

		vbox2 = gtk_vbox_new(FALSE, 0);
		gtk_container_add(GTK_CONTAINER(frame), vbox2);

		table = gtk_table_new(5, 3, TRUE);
		gtk_container_set_border_width(GTK_CONTAINER(table), 5);
		gtk_table_set_row_spacings(GTK_TABLE(table), 5);
		gtk_table_set_col_spacings(GTK_TABLE(table), 5);
		gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0);

		for (i = 0; i < 13; i++)
		{
			button = gtk_button_new_with_label(_(ir_control[i]));
			gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(irconf_control_cb), ir_control[i]);
			gtk_table_attach_defaults(GTK_TABLE(table), button, i % 3, (i % 3) + 1, i / 3, (i / 3) + 1);
			gtk_widget_show(button);
		}
		gtk_widget_show(table);
		gtk_widget_show(frame);

		table = gtk_table_new(2, 5, FALSE);
		gtk_container_set_border_width(GTK_CONTAINER(table), 5);
		gtk_table_set_row_spacings(GTK_TABLE(table), 0);
		gtk_table_set_col_spacings(GTK_TABLE(table), 0);
		gtk_box_pack_start(GTK_BOX(vbox2), table, FALSE, FALSE, 0);

		for (i = 0; i < 10; i++)
		{
			button = gtk_button_new_with_label(_(ir_playlist[i]));
			gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(irconf_control_cb), ir_playlist[i]);
			gtk_table_attach_defaults(GTK_TABLE(table), button, i % 5, (i % 5) + 1, i / 5, (i / 5) + 1);
			gtk_widget_show(button);
		}
		gtk_widget_show(table);
		gtk_widget_show(frame);

		frame = gtk_frame_new(_("Playlists:"));
		gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 0);

		table = gtk_table_new(2, 1, FALSE);
		gtk_container_set_border_width(GTK_CONTAINER(table), 5);
		gtk_container_add(GTK_CONTAINER(frame), table);
		gtk_table_set_row_spacings(GTK_TABLE(table), 5);
		gtk_table_set_col_spacings(GTK_TABLE(table), 5);

		adj = (GtkAdjustment *) gtk_adjustment_new(0, 0, 99, 1, 5, 0);
		playlist_spin = gtk_spin_button_new(adj, 0, 0);
		gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(playlist_spin), TRUE);
		gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(playlist_spin), GTK_UPDATE_IF_VALID);
		gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(playlist_spin), FALSE);
		gtk_table_attach_defaults(GTK_TABLE(table), playlist_spin, 0, 1, 0, 1);
		gtk_signal_connect(GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC(spin_change_cb), (gpointer) playlist_spin);
		gtk_widget_show(playlist_spin);

		playlist_entry = gtk_entry_new();
		gtk_entry_set_text(GTK_ENTRY(playlist_entry), ircfg.playlist[0]);
		gtk_signal_connect(GTK_OBJECT(playlist_entry), "changed", GTK_SIGNAL_FUNC(pl_entry_change_cb), (gpointer) playlist_spin);
		gtk_table_attach_defaults(GTK_TABLE(table), playlist_entry, 1, 2, 0, 1);
		gtk_widget_show(playlist_entry);

		gtk_widget_show(table);
		gtk_widget_show(frame);
		gtk_widget_show(vbox2);
		gtk_widget_show(box);

		gtk_notebook_append_page(GTK_NOTEBOOK(notebook), box, gtk_label_new(_("General")));
		gtk_widget_show(notebook);

		box = gtk_hbutton_box_new();
		gtk_button_box_set_layout(GTK_BUTTON_BOX(box), GTK_BUTTONBOX_END);
		gtk_button_box_set_spacing(GTK_BUTTON_BOX(box), 5);
		gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 0);

		button = gtk_button_new_with_label(_("OK"));
		gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(irconf_ok_cb), NULL);
		GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
		gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0);
		gtk_widget_grab_default(button);
		gtk_widget_show(button);

		button = gtk_button_new_with_label(_("Cancel"));
		gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(irconf_cancel_cb), NULL);
		GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
		gtk_box_pack_start(GTK_BOX(box), button, TRUE, TRUE, 0);
		gtk_widget_show(button);
		gtk_widget_show(box);
		gtk_widget_show(vbox);
		gtk_widget_show(irconf_mainwin);
	}
}
bool TimeChooserGtk::createDateTimeChooserWidget()
{
    struct timeval timeVal;
    gettimeofday(&timeVal, 0);
    struct tm* currentTime = localtime( &timeVal.tv_sec);
    String stringBuffer;

    GtkWidget* label = NULL; 
    
    GtkWidget* containerBox = NULL; //main container box
    GtkWidget* containerSubBox = NULL; //sub container box for date chooser and time chooser
    GtkWidget* containerButtonBox = NULL;
    
    GtkAdjustment* adjHour = NULL;
    GtkAdjustment* adjMinute = NULL;
    
    m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    if(!m_window) 
		return false;
   
    gtk_window_set_title(GTK_WINDOW(m_window), "TimeChooser");
    gtk_window_set_default_size(GTK_WINDOW(m_window), WIDGET_DEFAULT_HEIGHT, WIDGET_DEFAULT_WIDTH);
    gtk_window_set_resizable (GTK_WINDOW(m_window), false);
    gtk_window_set_position(GTK_WINDOW(m_window), GTK_WIN_POS_CENTER);
  

    containerBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
    gtk_container_add(GTK_CONTAINER(m_window), containerBox);
    if(!containerBox) 
		return false;

    adjHour = gtk_adjustment_new(1, 1, 13, 1, 1, 1);  //set spinbuttonHour value range
    adjMinute = gtk_adjustment_new (1, 0, 60, 1, 1, 1 ); //set spinbuttonMinute value range
    m_comboboxAmPm = gtk_combo_box_text_new();
    if(!adjHour || !adjMinute || !m_comboboxAmPm) 
		return false;

    m_spinbuttonHour = gtk_spin_button_new(adjHour, 1, 0);
    m_spinbuttonMinute = gtk_spin_button_new(adjMinute,1, 0);
    if(!m_spinbuttonHour || !m_spinbuttonMinute) 
		return false;
    
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(m_spinbuttonHour), TRUE);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(m_spinbuttonMinute), TRUE);
    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(m_comboboxAmPm), AM);
    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(m_comboboxAmPm), PM);

    gtk_spin_button_set_value (GTK_SPIN_BUTTON(m_spinbuttonMinute), currentTime->tm_min);
    
    if(currentTime->tm_hour > NOON) // afternoon
    {
        stringBuffer = String::format("%s %s %d : %d", "Current Time : ", PM, currentTime->tm_hour-12, currentTime->tm_min);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(m_spinbuttonHour), currentTime->tm_hour-12);
        gtk_combo_box_set_active (GTK_COMBO_BOX(m_comboboxAmPm), 1);
        setPastValues(0, 0, 0, currentTime->tm_hour-12, currentTime->tm_min, PM);
  
    }  
    else //morning
    {
        stringBuffer = String::format("%s %s %d : %d", "Current Time : ", AM, currentTime->tm_hour, currentTime->tm_min);
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(m_spinbuttonHour), currentTime->tm_hour);
        gtk_combo_box_set_active (GTK_COMBO_BOX(m_comboboxAmPm), 0);
        setPastValues(0, 0, 0, currentTime->tm_hour, currentTime->tm_min, AM);
    }
    
    m_labelCurrentTime = gtk_label_new(stringBuffer.utf8().data());
    if(!m_labelCurrentTime) 
		return false;
    
    gtk_box_pack_start(GTK_BOX(containerBox), m_labelCurrentTime, FALSE, FALSE, 0);
    
    containerSubBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
    if(!containerSubBox) 
		return false;
    
    gtk_box_set_spacing(GTK_BOX(containerSubBox), 1); 
    label = gtk_label_new(":");
    if(!label) 
		return false;
    
    gtk_box_pack_start(GTK_BOX(containerBox), containerSubBox, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(containerSubBox), m_comboboxAmPm, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(containerSubBox), m_spinbuttonHour, TRUE, TRUE, 0);
    gtk_box_pack_start(GTK_BOX(containerSubBox), label, FALSE, FALSE, 0);
    gtk_box_pack_start(GTK_BOX(containerSubBox), m_spinbuttonMinute, TRUE, TRUE, 0);
    
    //buttons
    containerButtonBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
    if(!containerButtonBox) 
		return false;    
    
    gtk_box_pack_start(GTK_BOX(containerBox), containerButtonBox, TRUE, TRUE, 0);

    m_buttonOk = gtk_button_new_with_label("Ok");
    m_buttonCancle = gtk_button_new_with_label("Cancle");

    if(!m_buttonOk || !m_buttonCancle) 
		return false;
    
    gtk_box_pack_start(GTK_BOX(containerButtonBox), m_buttonOk, TRUE, TRUE, 0);
    gtk_box_pack_end(GTK_BOX(containerButtonBox), m_buttonCancle, TRUE, TRUE, 0);
    gtk_box_set_homogeneous(GTK_BOX(containerButtonBox), TRUE);

    //button's listener
    g_signal_connect(GTK_WIDGET(m_buttonOk), "clicked", G_CALLBACK(TimeChooserOkButtonPressedCallback), (gpointer)this);
    g_signal_connect(GTK_WIDGET(m_buttonCancle), "clicked", G_CALLBACK(TimeChooserCancleButtonPressedCallback), (gpointer)this);

    //calender's listener
    g_signal_connect(GTK_WIDGET(m_window), "delete_event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);

    gtk_widget_show_all(m_window);

    return TRUE;
}
Example #27
0
static void prefs_wrapping_create_widget(PrefsPage *_page, GtkWindow *window, 
			       	  gpointer data)
{
	WrappingPage *prefs_wrapping = (WrappingPage *) _page;
	
	GtkWidget *vbox1;
	GtkWidget *vbox2;
	GtkWidget *label_linewrap;
	GtkAdjustment *spinbtn_linewrap_adj;
	GtkWidget *spinbtn_linewrap;
	GtkWidget *checkbtn_wrapquote;
	GtkWidget *checkbtn_wrappastes;
	GtkWidget *checkbtn_autowrap;
	GtkWidget *checkbtn_autoindent;
	GtkWidget *hbox1;

	vbox1 = gtk_vbox_new (FALSE, VSPACING);
	gtk_widget_show (vbox1);
	gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);

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

	PACK_CHECK_BUTTON (vbox2, checkbtn_autowrap, _("Auto wrapping"));
  	PACK_CHECK_BUTTON (vbox2, checkbtn_wrapquote, _("Wrap quotation"));
  	PACK_CHECK_BUTTON (vbox2, checkbtn_wrappastes, _("Wrap pasted text"));
  	PACK_CHECK_BUTTON (vbox2, checkbtn_autoindent, _("Auto indent"));

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

	label_linewrap = gtk_label_new (_("Wrap text at"));
	gtk_widget_show (label_linewrap);
	gtk_box_pack_start (GTK_BOX (hbox1), label_linewrap, FALSE, FALSE, 4);

	spinbtn_linewrap_adj = GTK_ADJUSTMENT(gtk_adjustment_new (72, 20, 1024, 1, 10, 0));
	spinbtn_linewrap = gtk_spin_button_new
		(GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
	gtk_widget_set_size_request (spinbtn_linewrap, 64, -1);
	gtk_widget_show (spinbtn_linewrap);
	gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_linewrap, FALSE, FALSE, 0);
	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);

	label_linewrap = gtk_label_new (_("characters"));
	gtk_widget_show (label_linewrap);
  	gtk_box_pack_start (GTK_BOX (hbox1), label_linewrap, FALSE, FALSE, 0);

	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_autowrap),
				     prefs_common.autowrap);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_wrapquote),
				     prefs_common.linewrap_quote);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_wrappastes),
				     prefs_common.linewrap_pastes);
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_autoindent),
				     prefs_common.auto_indent);
	gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_linewrap),
				  prefs_common.linewrap_len);

	prefs_wrapping->window			= GTK_WIDGET(window);
	prefs_wrapping->spinbtn_linewrap	= spinbtn_linewrap;
	prefs_wrapping->checkbtn_wrapquote	= checkbtn_wrapquote;
	prefs_wrapping->checkbtn_wrappastes	= checkbtn_wrappastes;
	prefs_wrapping->checkbtn_autowrap	= checkbtn_autowrap;
	prefs_wrapping->checkbtn_autoindent	= checkbtn_autoindent;

	prefs_wrapping->page.widget = vbox1;
}
/*
	Almost straigh out of glade2

*/
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *hbox1;
  GtkWidget *label_sub;
  GtkWidget *button_sub;
  GtkWidget *image1;
  GtkWidget *hbox2;
  GtkWidget *label_font;
  GtkWidget *button_font;
  GtkWidget *image2;
  GtkWidget *optionmenu1;
  GtkWidget *menu1;
  GtkWidget *enc_ascii;
  /*
  GtkWidget *enc_8859;
  GtkWidget *ebc_cyrillic;
  GtkWidget *enc_german;
  */
  GtkObject *spinbutton_fontsize_adj;
  GtkWidget *spinbutton_fontsize;
  GtkWidget *label5;
  GtkWidget *button_color;
  GtkWidget *hbox3;
  GtkWidget *drawingarea1;
  GtkWidget *vscale1;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *applybutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Subtitle selector"));

  dialog_vbox1 = GTK_DIALOG (dialog1)->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);

  table1 = gtk_table_new (5, 2, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0);

  label1 = gtk_label_new (_("Subtitle file "));
  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_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  label2 = gtk_label_new (_("Font (TTF)"));
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  label3 = gtk_label_new (_("Encoding "));
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);

  label4 = gtk_label_new (_("Font Size"));
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_table_attach (GTK_TABLE (table1), hbox1, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  label_sub = gtk_label_new (_("sub"));
  gtk_widget_show (label_sub);
  gtk_box_pack_start (GTK_BOX (hbox1), label_sub, TRUE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label_sub), GTK_JUSTIFY_LEFT);

  button_sub = gtk_button_new ();
  gtk_widget_show (button_sub);
  gtk_box_pack_start (GTK_BOX (hbox1), button_sub, FALSE, FALSE, 0);

  image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image1);
  gtk_container_add (GTK_CONTAINER (button_sub), image1);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox2);
  gtk_table_attach (GTK_TABLE (table1), hbox2, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);

  label_font = gtk_label_new (_("font"));
  gtk_widget_show (label_font);
  gtk_box_pack_start (GTK_BOX (hbox2), label_font, TRUE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label_font), GTK_JUSTIFY_LEFT);

  button_font = gtk_button_new ();
  gtk_widget_show (button_font);
  gtk_box_pack_start (GTK_BOX (hbox2), button_font, FALSE, FALSE, 0);

  image2 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image2);
  gtk_container_add (GTK_CONTAINER (button_font), image2);

  optionmenu1 = gtk_option_menu_new ();
  gtk_widget_show (optionmenu1);
  gtk_table_attach (GTK_TABLE (table1), optionmenu1, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  menu1 = gtk_menu_new ();

  enc_ascii = gtk_menu_item_new_with_mnemonic (_("Ascii"));
  gtk_widget_show (enc_ascii);
  gtk_container_add (GTK_CONTAINER (menu1), enc_ascii);
/*
  enc_8859 = gtk_menu_item_new_with_mnemonic (_("Iso 8859-1 (Czech...)"));
  gtk_widget_show (enc_8859);
  gtk_container_add (GTK_CONTAINER (menu1), enc_8859);

  ebc_cyrillic = gtk_menu_item_new_with_mnemonic (_("Cyrillic"));
  gtk_widget_show (ebc_cyrillic);
  gtk_container_add (GTK_CONTAINER (menu1), ebc_cyrillic);

  enc_german = gtk_menu_item_new_with_mnemonic (_("German"));
  gtk_widget_show (enc_german);
  gtk_container_add (GTK_CONTAINER (menu1), enc_german);
*/
  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu1), menu1);

  spinbutton_fontsize_adj = gtk_adjustment_new (26, 8, 100, 1, 10, 10);
  spinbutton_fontsize = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_fontsize_adj), 1, 0);
  gtk_widget_show (spinbutton_fontsize);
  gtk_table_attach (GTK_TABLE (table1), spinbutton_fontsize, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_fontsize), TRUE);

  label5 = gtk_label_new (_("Select color"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  button_color = gtk_button_new_with_mnemonic (_("Select"));
  gtk_widget_show (button_color);
  gtk_table_attach (GTK_TABLE (table1), button_color, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

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

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_box_pack_start (GTK_BOX (hbox3), drawingarea1, TRUE, TRUE, 0);
  gtk_widget_set_size_request (drawingarea1, 352, 288);

  vscale1 = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 1, 576, 1, 1, 1)));
  gtk_widget_show (vscale1);
  gtk_box_pack_start (GTK_BOX (hbox3), vscale1, FALSE, TRUE, 0);

  dialog_action_area1 = GTK_DIALOG (dialog1)->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 (dialog1), cancelbutton1, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);

  applybutton1 = gtk_button_new_from_stock ("gtk-apply");
  gtk_widget_show (applybutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), applybutton1, GTK_RESPONSE_APPLY);
  GTK_WIDGET_SET_FLAGS (applybutton1, GTK_CAN_DEFAULT);

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

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, label_sub, "label_sub");
  GLADE_HOOKUP_OBJECT (dialog1, button_sub, "button_sub");
  GLADE_HOOKUP_OBJECT (dialog1, image1, "image1");
  GLADE_HOOKUP_OBJECT (dialog1, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (dialog1, label_font, "label_font");
  GLADE_HOOKUP_OBJECT (dialog1, button_font, "button_font");
  GLADE_HOOKUP_OBJECT (dialog1, image2, "image2");
  GLADE_HOOKUP_OBJECT (dialog1, optionmenu1, "optionmenu1");
  GLADE_HOOKUP_OBJECT (dialog1, menu1, "menu1");
  GLADE_HOOKUP_OBJECT (dialog1, enc_ascii, "enc_ascii");
  /*
  GLADE_HOOKUP_OBJECT (dialog1, enc_8859, "enc_8859");
  GLADE_HOOKUP_OBJECT (dialog1, ebc_cyrillic, "ebc_cyrillic");
  GLADE_HOOKUP_OBJECT (dialog1, enc_german, "enc_german");
  */
  GLADE_HOOKUP_OBJECT (dialog1, spinbutton_fontsize, "spinbutton_fontsize");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, button_color, "button_color");
  GLADE_HOOKUP_OBJECT (dialog1, hbox3, "hbox3");
  GLADE_HOOKUP_OBJECT (dialog1, drawingarea1, "drawingarea1");
  GLADE_HOOKUP_OBJECT (dialog1, vscale1, "vscale1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dialog1, applybutton1, "applybutton1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");

  return dialog1;
}
Example #29
0
GtkWidget*
create_MainWindow (void)
{
  GtkWidget *MainWindow;
  GtkWidget *dialog_vbox1;
  GtkWidget *notebook1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *frame1;
  GtkWidget *calendar1;
  GtkWidget *label3;
  GtkWidget *frame2;
  GtkWidget *table1;
  GtkWidget *label6;
  GtkWidget *label7;
  GtkWidget *label8;
  GtkWidget *label9;
  GtkWidget *label10;
  GtkObject *spinbutton1_adj;
  GtkWidget *spinbutton1;
  GtkObject *spinbutton2_adj;
  GtkWidget *spinbutton2;
  GtkObject *spinbutton3_adj;
  GtkWidget *spinbutton3;
  GtkWidget *label4;
  GtkWidget *frame3;
  GtkWidget *vbox2;
  GtkWidget *label11;
  GtkWidget *checkbutton1;
  GtkWidget *hbox2;
  GtkWidget *label12;
  GtkWidget *combo1;
  GtkWidget *combo_entry1;
  GtkWidget *label5;
  GtkWidget *label1;
  GtkWidget *vbox3;
  GtkWidget *label13;
  GtkWidget *drawingarea1;
  GtkWidget *label14;
  GtkWidget *hseparator1;
  GtkWidget *scrolledwindow1;
  GtkWidget *treeview1;
  GtkWidget *checkbutton2;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *helpbutton1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  MainWindow = gtk_dialog_new ();
  gtk_widget_set_size_request (MainWindow, 500, 650);
  gtk_window_set_title (GTK_WINDOW (MainWindow), _("Date / Time Properties"));
  gtk_window_set_position (GTK_WINDOW (MainWindow), GTK_WIN_POS_CENTER);

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

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

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

  hbox1 = gtk_hbox_new (TRUE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame1), 8);

  calendar1 = gtk_calendar_new ();
  gtk_widget_show (calendar1);
  gtk_container_add (GTK_CONTAINER (frame1), calendar1);
  gtk_calendar_display_options (GTK_CALENDAR (calendar1),
                                GTK_CALENDAR_SHOW_HEADING
                                | GTK_CALENDAR_SHOW_DAY_NAMES);

  label3 = gtk_label_new (_("Date"));
  gtk_widget_show (label3);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label3);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame2), 8);

  table1 = gtk_table_new (4, 2, TRUE);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (frame2), table1);

  label6 = gtk_label_new (_("Current Time:"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  label7 = gtk_label_new (_("00:00:00"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table1), label7, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  label8 = gtk_label_new (_("Hour:"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  label9 = gtk_label_new (_("Minute:"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label10 = gtk_label_new (_("Second:"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table1), label10, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  spinbutton1_adj = gtk_adjustment_new (22, 0, 23, 1, 10, 10);
  spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 0);
  gtk_widget_show (spinbutton1);
  gtk_table_attach (GTK_TABLE (table1), spinbutton1, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton1), TRUE);
  gtk_spin_button_set_snap_to_ticks (GTK_SPIN_BUTTON (spinbutton1), TRUE);
  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinbutton1), TRUE);

  spinbutton2_adj = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
  spinbutton2 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton2_adj), 1, 0);
  gtk_widget_show (spinbutton2);
  gtk_table_attach (GTK_TABLE (table1), spinbutton2, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton2), TRUE);
  gtk_spin_button_set_snap_to_ticks (GTK_SPIN_BUTTON (spinbutton2), TRUE);
  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinbutton2), TRUE);

  spinbutton3_adj = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
  spinbutton3 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton3_adj), 1, 0);
  gtk_widget_show (spinbutton3);
  gtk_table_attach (GTK_TABLE (table1), spinbutton3, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton3), TRUE);
  gtk_spin_button_set_snap_to_ticks (GTK_SPIN_BUTTON (spinbutton3), TRUE);
  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinbutton3), TRUE);

  label4 = gtk_label_new (_("Time"));
  gtk_widget_show (label4);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label4);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);

  frame3 = gtk_frame_new (NULL);
  gtk_widget_show (frame3);
  gtk_box_pack_start (GTK_BOX (vbox1), frame3, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame3), 8);

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

  label11 = gtk_label_new (_("Your computer can synchronize its clock with a remote time server using the Network Time Protocol"));
  gtk_widget_show (label11);
  gtk_box_pack_start (GTK_BOX (vbox2), label11, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_LEFT);
  gtk_label_set_line_wrap (GTK_LABEL (label11), TRUE);

  checkbutton1 = gtk_check_button_new_with_mnemonic (_("_Enable Network Time Protocol"));
  gtk_widget_show (checkbutton1);
  gtk_box_pack_start (GTK_BOX (vbox2), checkbutton1, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (checkbutton1), 8);

  hbox2 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox2);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox2), 8);

  label12 = gtk_label_new (_("Server: "));
  gtk_widget_show (label12);
  gtk_box_pack_start (GTK_BOX (hbox2), label12, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT);

  combo1 = gtk_combo_new ();
  g_object_set_data (G_OBJECT (GTK_COMBO (combo1)->popwin),
                     "GladeParentKey", combo1);
  gtk_widget_show (combo1);
  gtk_box_pack_start (GTK_BOX (hbox2), combo1, TRUE, TRUE, 0);

  combo_entry1 = GTK_COMBO (combo1)->entry;
  gtk_widget_show (combo_entry1);

  label5 = gtk_label_new (_("Network Time Protocol"));
  gtk_widget_show (label5);
  gtk_frame_set_label_widget (GTK_FRAME (frame3), label5);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);

  label1 = gtk_label_new (_("Date & Time"));
  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_LEFT);

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

  label13 = gtk_label_new (_("Please select the nearest city in your timezone:"));
  gtk_widget_show (label13);
  gtk_box_pack_start (GTK_BOX (vbox3), label13, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT);

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_box_pack_start (GTK_BOX (vbox3), drawingarea1, FALSE, TRUE, 0);
  gtk_widget_set_size_request (drawingarea1, 480, 240);

  label14 = gtk_label_new ("");
  gtk_widget_show (label14);
  gtk_box_pack_start (GTK_BOX (vbox3), label14, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_LEFT);

  hseparator1 = gtk_hseparator_new ();
  gtk_widget_show (hseparator1);
  gtk_box_pack_start (GTK_BOX (vbox3), hseparator1, FALSE, FALSE, 8);

  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow1);
  gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow1), 8);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  treeview1 = gtk_tree_view_new ();
  gtk_widget_show (treeview1);
  gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview1);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);

  checkbutton2 = gtk_check_button_new_with_mnemonic (_("_System clock uses UTC"));
  gtk_widget_show (checkbutton2);
  gtk_box_pack_start (GTK_BOX (vbox3), checkbutton2, FALSE, FALSE, 0);

  label2 = gtk_label_new (_("Timezone"));
  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_LEFT);

  dialog_action_area1 = GTK_DIALOG (MainWindow)->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 (MainWindow), 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 (MainWindow), 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 (MainWindow), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) MainWindow, "delete_event",
                    G_CALLBACK (on_MainWindow_close),
                    NULL);
  g_signal_connect ((gpointer) calendar1, "day_selected",
                    G_CALLBACK (on_calendar1_day_selected),
                    NULL);
  g_signal_connect ((gpointer) calendar1, "month_changed",
                    G_CALLBACK (on_calendar1_month_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton1, "changed",
                    G_CALLBACK (on_spinbutton1_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton2, "changed",
                    G_CALLBACK (on_spinbutton2_changed),
                    NULL);
  g_signal_connect ((gpointer) spinbutton3, "changed",
                    G_CALLBACK (on_spinbutton3_changed),
                    NULL);
  g_signal_connect ((gpointer) checkbutton1, "toggled",
                    G_CALLBACK (on_checkbutton1_toggled),
                    NULL);
  g_signal_connect ((gpointer) combo_entry1, "changed",
                    G_CALLBACK (on_combo_entry1_changed),
                    NULL);
  g_signal_connect ((gpointer) drawingarea1, "motion_notify_event",
                    G_CALLBACK (on_drawingarea1_motion_notify_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea1, "button_press_event",
                    G_CALLBACK (on_drawingarea1_button_press_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea1, "leave_notify_event",
                    G_CALLBACK (on_drawingarea1_leave_notify_event),
                    NULL);
  g_signal_connect ((gpointer) drawingarea1, "expose_event",
                    G_CALLBACK (on_drawingarea1_expose_event),
                    NULL);
  g_signal_connect ((gpointer) treeview1, "row_activated",
                    G_CALLBACK (on_treeview1_row_activated),
                    NULL);
  g_signal_connect ((gpointer) checkbutton2, "toggled",
                    G_CALLBACK (on_checkbutton2_toggled),
                    NULL);
  g_signal_connect ((gpointer) helpbutton1, "clicked",
                    G_CALLBACK (on_helpbutton1_clicked),
                    NULL);
  g_signal_connect ((gpointer) cancelbutton1, "clicked",
                    G_CALLBACK (on_cancelbutton1_clicked),
                    NULL);
  g_signal_connect ((gpointer) okbutton1, "clicked",
                    G_CALLBACK (on_okbutton1_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (MainWindow, MainWindow, "MainWindow");
  GLADE_HOOKUP_OBJECT_NO_REF (MainWindow, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (MainWindow, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (MainWindow, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (MainWindow, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (MainWindow, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (MainWindow, calendar1, "calendar1");
  GLADE_HOOKUP_OBJECT (MainWindow, label3, "label3");
  GLADE_HOOKUP_OBJECT (MainWindow, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (MainWindow, table1, "table1");
  GLADE_HOOKUP_OBJECT (MainWindow, label6, "label6");
  GLADE_HOOKUP_OBJECT (MainWindow, label7, "label7");
  GLADE_HOOKUP_OBJECT (MainWindow, label8, "label8");
  GLADE_HOOKUP_OBJECT (MainWindow, label9, "label9");
  GLADE_HOOKUP_OBJECT (MainWindow, label10, "label10");
  GLADE_HOOKUP_OBJECT (MainWindow, spinbutton1, "spinbutton1");
  GLADE_HOOKUP_OBJECT (MainWindow, spinbutton2, "spinbutton2");
  GLADE_HOOKUP_OBJECT (MainWindow, spinbutton3, "spinbutton3");
  GLADE_HOOKUP_OBJECT (MainWindow, label4, "label4");
  GLADE_HOOKUP_OBJECT (MainWindow, frame3, "frame3");
  GLADE_HOOKUP_OBJECT (MainWindow, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (MainWindow, label11, "label11");
  GLADE_HOOKUP_OBJECT (MainWindow, checkbutton1, "checkbutton1");
  GLADE_HOOKUP_OBJECT (MainWindow, hbox2, "hbox2");
  GLADE_HOOKUP_OBJECT (MainWindow, label12, "label12");
  GLADE_HOOKUP_OBJECT (MainWindow, combo1, "combo1");
  GLADE_HOOKUP_OBJECT (MainWindow, combo_entry1, "combo_entry1");
  GLADE_HOOKUP_OBJECT (MainWindow, label5, "label5");
  GLADE_HOOKUP_OBJECT (MainWindow, label1, "label1");
  GLADE_HOOKUP_OBJECT (MainWindow, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (MainWindow, label13, "label13");
  GLADE_HOOKUP_OBJECT (MainWindow, drawingarea1, "drawingarea1");
  GLADE_HOOKUP_OBJECT (MainWindow, label14, "label14");
  GLADE_HOOKUP_OBJECT (MainWindow, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (MainWindow, scrolledwindow1, "scrolledwindow1");
  GLADE_HOOKUP_OBJECT (MainWindow, treeview1, "treeview1");
  GLADE_HOOKUP_OBJECT (MainWindow, checkbutton2, "checkbutton2");
  GLADE_HOOKUP_OBJECT (MainWindow, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (MainWindow, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (MainWindow, helpbutton1, "helpbutton1");
  GLADE_HOOKUP_OBJECT (MainWindow, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (MainWindow, okbutton1, "okbutton1");

  return MainWindow;
}
GtkWidget *create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkWidget *label7;
  GtkWidget *label8;
  GtkObject *spinbuttonTreshold_adj;
  GtkWidget *spinbuttonTreshold;
  GtkObject *spinbuttonNoise_adj;
  GtkWidget *spinbuttonNoise;
  GtkObject *spinbuttonIdentical_adj;
  GtkWidget *spinbuttonIdentical;
  GtkWidget *checkbuttonShow;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Blend removal / Hard pulldown removal"));
  gtk_window_set_type_hint (GTK_WINDOW (dialog1), GDK_WINDOW_TYPE_HINT_DIALOG);

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

  table1 = gtk_table_new (4, 3, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), table1, TRUE, TRUE, 0);

  label1 = gtk_label_new (_("%"));
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  label2 = gtk_label_new (_("%"));
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  label3 = gtk_label_new (_("%"));
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table1), label3, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);

  label4 = gtk_label_new (_(" "));
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table1), label4, 2, 3, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);

  label5 = gtk_label_new (_("Threshold :"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);

  label6 = gtk_label_new (_("Noise threshold :"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  label7 = gtk_label_new (_("Identical threshold :"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  label8 = gtk_label_new (_("Show metrics"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  spinbuttonTreshold_adj = gtk_adjustment_new (1, 1, 99, 1, 10, 10);
  spinbuttonTreshold = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonTreshold_adj), 1, 0);
  gtk_widget_show (spinbuttonTreshold);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonTreshold, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, spinbuttonTreshold, _("If the image is closer than treshold, is it considered valid, smaller means more false detection"), NULL);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonTreshold), TRUE);

  spinbuttonNoise_adj = gtk_adjustment_new (1, 1, 99, 1, 10, 10);
  spinbuttonNoise = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonNoise_adj), 1, 0);
  gtk_widget_show (spinbuttonNoise);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonNoise, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, spinbuttonNoise, _("If pixels are closer than noise threshold, they are considered identical"), NULL);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonNoise), TRUE);

  spinbuttonIdentical_adj = gtk_adjustment_new (1, 1, 99, 1, 10, 10);
  spinbuttonIdentical = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonIdentical_adj), 1, 0);
  gtk_widget_show (spinbuttonIdentical);
  gtk_table_attach (GTK_TABLE (table1), spinbuttonIdentical, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, spinbuttonIdentical, _("If the picture are less than identical threshold, they are considered identical"), NULL);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonIdentical), TRUE);

  checkbuttonShow = gtk_check_button_new_with_mnemonic ("");
  gtk_widget_show (checkbuttonShow);
  gtk_table_attach (GTK_TABLE (table1), checkbuttonShow, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_tooltips_set_tip (tooltips, checkbuttonShow, _("Show metrics in picture (debug only)"), NULL);

  dialog_action_area1 = GTK_DIALOG (dialog1)->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 (dialog1), 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 (dialog1), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonTreshold, "spinbuttonTreshold");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonNoise, "spinbuttonNoise");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonIdentical, "spinbuttonIdentical");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonShow, "checkbuttonShow");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, tooltips, "tooltips");

  return dialog1;
}