예제 #1
0
GtkWidget*
create_bsv_viewer_pref_dlg (void)
{
  GtkWidget *bsv_viewer_pref_dlg;
  GtkWidget *dialog_vbox1;
  GtkWidget *notebook1;
  GtkWidget *vbox2;
  GtkWidget *hbox19;
  GtkWidget *label3;
  GtkObject *chanperscreen_spinb_adj;
  GtkWidget *chanperscreen_spinb;
  GtkWidget *hbox20;
  GtkWidget *label4;
  GtkObject *hrange_spinb_adj;
  GtkWidget *hrange_spinb;
  GtkWidget *label5;
  GtkWidget *label1;
  GtkWidget *vbox3;
  GtkWidget *hbox21;
  GtkWidget *label6;
  GtkWidget *logfile_entry;
  GtkWidget *button15;
  GtkWidget *image17;
  GtkWidget *hbox22;
  GtkWidget *label7;
  GtkWidget *patid_entry;
  GtkWidget *hbox23;
  GtkWidget *label8;
  GtkWidget *recid_entry;
  GtkWidget *label2;
  GtkWidget *dialog_action_area1;
  GtkWidget *okbutton1;

  bsv_viewer_pref_dlg = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (bsv_viewer_pref_dlg), _("Viewer Preferences"));

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

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

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

  label3 = gtk_label_new (_("Channels per Screen: "));
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (hbox19), label3, FALSE, FALSE, 0);

  chanperscreen_spinb_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
  chanperscreen_spinb = gtk_spin_button_new (GTK_ADJUSTMENT (chanperscreen_spinb_adj), 1, 0);
  gtk_widget_show (chanperscreen_spinb);
  gtk_box_pack_start (GTK_BOX (hbox19), chanperscreen_spinb, FALSE, TRUE, 0);

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

  label4 = gtk_label_new (_("Horizontal Time Range: "));
  gtk_widget_show (label4);
  gtk_box_pack_start (GTK_BOX (hbox20), label4, FALSE, FALSE, 0);

  hrange_spinb_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
  hrange_spinb = gtk_spin_button_new (GTK_ADJUSTMENT (hrange_spinb_adj), 1, 0);
  gtk_widget_show (hrange_spinb);
  gtk_box_pack_start (GTK_BOX (hbox20), hrange_spinb, FALSE, TRUE, 0);

  label5 = gtk_label_new (_(" sec"));
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox20), label5, FALSE, FALSE, 0);

  label1 = gtk_label_new (_("Viewer"));
  gtk_widget_show (label1);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);

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

  hbox21 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox21);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox21, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox21), 2);

  label6 = gtk_label_new (_("GDF Logfile: "));
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (hbox21), label6, FALSE, FALSE, 0);

  logfile_entry = gtk_entry_new ();
  gtk_widget_show (logfile_entry);
  gtk_box_pack_start (GTK_BOX (hbox21), logfile_entry, TRUE, TRUE, 0);

  button15 = gtk_button_new ();
  gtk_widget_show (button15);
  gtk_box_pack_start (GTK_BOX (hbox21), button15, FALSE, FALSE, 0);

  image17 = gtk_image_new_from_stock ("gtk-floppy", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image17);
  gtk_container_add (GTK_CONTAINER (button15), image17);

  hbox22 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox22);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox22, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox22), 2);

  label7 = gtk_label_new (_("Patient ID: "));
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (hbox22), label7, FALSE, FALSE, 0);

  patid_entry = gtk_entry_new ();
  gtk_widget_show (patid_entry);
  gtk_box_pack_start (GTK_BOX (hbox22), patid_entry, TRUE, TRUE, 0);

  hbox23 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox23);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox23, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox23), 2);

  label8 = gtk_label_new (_("Record ID: "));
  gtk_widget_show (label8);
  gtk_box_pack_start (GTK_BOX (hbox23), label8, FALSE, FALSE, 0);

  recid_entry = gtk_entry_new ();
  gtk_widget_show (recid_entry);
  gtk_box_pack_start (GTK_BOX (hbox23), recid_entry, TRUE, TRUE, 0);

  label2 = gtk_label_new (_("Logfile"));
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);

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

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

  g_signal_connect ((gpointer) bsv_viewer_pref_dlg, "delete_event",
                    G_CALLBACK (update_viewer_settings),
                    NULL);
  g_signal_connect ((gpointer) button15, "clicked",
                    G_CALLBACK (show_fs_dlg),
                    NULL);
  g_signal_connect ((gpointer) okbutton1, "clicked",
                    G_CALLBACK (update_viewer_settings_but),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, bsv_viewer_pref_dlg, "bsv_viewer_pref_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox19, "hbox19");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label3, "label3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, chanperscreen_spinb, "chanperscreen_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label4, "label4");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hrange_spinb, "hrange_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label5, "label5");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label1, "label1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox21, "hbox21");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label6, "label6");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, logfile_entry, "logfile_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, button15, "button15");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, image17, "image17");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox22, "hbox22");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label7, "label7");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, patid_entry, "patid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox23, "hbox23");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label8, "label8");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, recid_entry, "recid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, okbutton1, "okbutton1");

  return bsv_viewer_pref_dlg;
}
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *drawingarea1;
  GtkWidget *gui_scale;
  GtkWidget *hbox1;
  GtkWidget *curve1;
  GtkWidget *vbox2;
  GtkWidget *drawingarea_histin;
  GtkWidget *drawingarea_histout;
  GtkWidget *dialog_action_area1;
  GtkWidget *button1;
  GtkWidget *button2;
  GtkWidget *button3;
  GtkWidget *button4;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Equalizer"));
  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);

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

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

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

  curve1 = gtk_curve_new ();
  gtk_widget_show (curve1);
  gtk_box_pack_start (GTK_BOX (hbox1), curve1, TRUE, TRUE, 0);
  gtk_curve_set_range (GTK_CURVE (curve1), 0, 1, 0, 1);

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

  drawingarea_histin = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea_histin);
  gtk_box_pack_start (GTK_BOX (vbox2), drawingarea_histin, TRUE, TRUE, 0);

  drawingarea_histout = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea_histout);
  gtk_box_pack_start (GTK_BOX (vbox2), drawingarea_histout, 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);

  button1 = gtk_button_new_from_stock ("gtk-clear");
  gtk_widget_show (button1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), button1, A_RESET);
  GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);

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

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

  button4 = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (button4);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), button4, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (button4, 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, drawingarea1, "drawingarea1");
  GLADE_HOOKUP_OBJECT (dialog1, gui_scale, "gui_scale");
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, curve1, "curve1");
  GLADE_HOOKUP_OBJECT (dialog1, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog1, drawingarea_histin, "drawingarea_histin");
  GLADE_HOOKUP_OBJECT (dialog1, drawingarea_histout, "drawingarea_histout");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, button1, "button1");
  GLADE_HOOKUP_OBJECT (dialog1, button2, "button2");
  GLADE_HOOKUP_OBJECT (dialog1, button3, "button3");
  GLADE_HOOKUP_OBJECT (dialog1, button4, "button4");

  return dialog1;
}
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *vbox3;
  GtkWidget *label1;
  GtkWidget *hscaleContrast;
  GtkWidget *label2;
  GtkWidget *hscaleBright;
  GtkWidget *vbox2;
  GtkWidget *checkLuma;
  GtkWidget *checkbuttonU;
  GtkWidget *checkbuttonV;
  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("Contrast"));
  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, TRUE, TRUE, 0);

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

  label1 = gtk_label_new (QT_TR_NOOP("Contrast"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (vbox3), label1, FALSE, FALSE, 0);

  hscaleContrast = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.5, 1.5, 0.1, 0.1, 0)));
  gtk_widget_show (hscaleContrast);
  gtk_box_pack_start (GTK_BOX (vbox3), hscaleContrast, FALSE, TRUE, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleContrast), GTK_POS_LEFT);

  label2 = gtk_label_new (QT_TR_NOOP("Brightness"));
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (vbox3), label2, FALSE, FALSE, 0);

  hscaleBright = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -127, 127, 1, 1, 0)));
  gtk_widget_show (hscaleBright);
  gtk_box_pack_start (GTK_BOX (vbox3), hscaleBright, FALSE, TRUE, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleBright), GTK_POS_LEFT);
  gtk_scale_set_digits (GTK_SCALE (hscaleBright), 0);

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

  checkLuma = gtk_check_button_new_with_mnemonic (QT_TR_NOOP("Luma"));
  gtk_widget_show (checkLuma);
  gtk_box_pack_start (GTK_BOX (vbox2), checkLuma, FALSE, FALSE, 0);

  checkbuttonU = gtk_check_button_new_with_mnemonic (QT_TR_NOOP("Chroma U"));
  gtk_widget_show (checkbuttonU);
  gtk_box_pack_start (GTK_BOX (vbox2), checkbuttonU, FALSE, FALSE, 0);

  checkbuttonV = gtk_check_button_new_with_mnemonic (QT_TR_NOOP("Chroma v"));
  gtk_widget_show (checkbuttonV);
  gtk_box_pack_start (GTK_BOX (vbox2), checkbuttonV, FALSE, FALSE, 0);

  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, TRUE, TRUE, 0);

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_box_pack_start (GTK_BOX (vbox1), drawingarea1, TRUE, TRUE, 0);
  gtk_widget_set_size_request (drawingarea1, -1, 300);

  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, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleContrast, "hscaleContrast");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleBright, "hscaleBright");
  GLADE_HOOKUP_OBJECT (dialog1, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog1, checkLuma, "checkLuma");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonU, "checkbuttonU");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonV, "checkbuttonV");
  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;
}
예제 #4
0
GtkWidget*
create_ChromaShift (void)
{
  GtkWidget *ChromaShift;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkObject *spinbutton_U_adj;
  GtkWidget *spinbutton_U;
  GtkObject *spinbutton_V_adj;
  GtkWidget *spinbutton_V;
  GtkWidget *hscale;
  GtkWidget *frame1;
  GtkWidget *alignment1;
  GtkWidget *drawingarea1;
  GtkWidget *label3;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *applybutton1;
  GtkWidget *okbutton1;

  ChromaShift = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (ChromaShift), QT_TR_NOOP("ChromaShift"));
  gtk_window_set_type_hint (GTK_WINDOW (ChromaShift), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (ChromaShift)->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 (2, 2, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, FALSE, FALSE, 0);

  label1 = gtk_label_new (QT_TR_NOOP("U Shift :"));
  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);

  label2 = gtk_label_new (QT_TR_NOOP("V Shift :"));
  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);

  spinbutton_U_adj = gtk_adjustment_new (0, -32, 32, 1, 10, 10);
  spinbutton_U = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_U_adj), 1, 0);
  gtk_widget_show (spinbutton_U);
  gtk_table_attach (GTK_TABLE (table1), spinbutton_U, 1, 2, 0, 1,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_U), TRUE);

  spinbutton_V_adj = gtk_adjustment_new (0, -32, 32, 1, 10, 10);
  spinbutton_V = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_V_adj), 1, 0);
  gtk_widget_show (spinbutton_V);
  gtk_table_attach (GTK_TABLE (table1), spinbutton_V, 1, 2, 1, 2,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_V), TRUE);

  hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 1, 1)));
  gtk_widget_show (hscale);
  gtk_box_pack_start (GTK_BOX (vbox1), hscale, FALSE, FALSE, 0);
  gtk_scale_set_digits (GTK_SCALE (hscale), 0);

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

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

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_container_add (GTK_CONTAINER (alignment1), drawingarea1);

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

  dialog_action_area1 = GTK_DIALOG (ChromaShift)->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 (ChromaShift), 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 (ChromaShift), 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 (ChromaShift), 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 (ChromaShift, ChromaShift, "ChromaShift");
  GLADE_HOOKUP_OBJECT_NO_REF (ChromaShift, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (ChromaShift, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (ChromaShift, table1, "table1");
  GLADE_HOOKUP_OBJECT (ChromaShift, label1, "label1");
  GLADE_HOOKUP_OBJECT (ChromaShift, label2, "label2");
  GLADE_HOOKUP_OBJECT (ChromaShift, spinbutton_U, "spinbutton_U");
  GLADE_HOOKUP_OBJECT (ChromaShift, spinbutton_V, "spinbutton_V");
  GLADE_HOOKUP_OBJECT (ChromaShift, hscale, "hscale");
  GLADE_HOOKUP_OBJECT (ChromaShift, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (ChromaShift, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (ChromaShift, drawingarea1, "drawingarea1");
  GLADE_HOOKUP_OBJECT (ChromaShift, label3, "label3");
  GLADE_HOOKUP_OBJECT_NO_REF (ChromaShift, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (ChromaShift, cancelbutton1, "cancelbutton1");
  GLADE_HOOKUP_OBJECT (ChromaShift, applybutton1, "applybutton1");
  GLADE_HOOKUP_OBJECT (ChromaShift, okbutton1, "okbutton1");

  return ChromaShift;
}
예제 #5
0
GtkWidget*
DIA_ocr (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *frame5;
  GtkWidget *table1;
  GtkWidget *labelNbGlyphs;
  GtkWidget *labelTime;
  GtkWidget *labelNbLines;
  GtkWidget *label9;
  GtkWidget *label15;
  GtkWidget *label8;
  GtkWidget *label7;
  GtkWidget *frameBitmap;
  GtkWidget *vbox7;
  GtkWidget *table2;
  GtkWidget *label13;
  GtkWidget *drawingareaSmall;
  GtkWidget *label14;
  GtkWidget *labelText;
  GtkWidget *entry;
  GtkWidget *hbuttonbox1;
  GtkWidget *buttonCalibrate;
  GtkWidget *buttonSkipAll;
  GtkWidget *buttonSkip;
  GtkWidget *buttonIgnore;
  GtkWidget *buttonOk;
  GtkWidget *drawingareaBitmap;
  GtkWidget *hseparator1;
  GtkWidget *label12;
  GtkWidget *dialog_action_area1;
  GtkWidget *closebutton1;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Mini OCR"));
  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);

  frame5 = gtk_frame_new (NULL);
  gtk_widget_show (frame5);
  gtk_box_pack_start (GTK_BOX (vbox1), frame5, FALSE, FALSE, 0);

  table1 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (frame5), table1);

  labelNbGlyphs = gtk_label_new (QT_TR_NOOP("0"));
  gtk_widget_show (labelNbGlyphs);
  gtk_table_attach (GTK_TABLE (table1), labelNbGlyphs, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (labelNbGlyphs), 0, 0.5);

  labelTime = gtk_label_new (QT_TR_NOOP("0:0:0"));
  gtk_widget_show (labelTime);
  gtk_table_attach (GTK_TABLE (table1), labelTime, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (labelTime), 0, 0.5);

  labelNbLines = gtk_label_new (QT_TR_NOOP("0"));
  gtk_widget_show (labelNbLines);
  gtk_table_attach (GTK_TABLE (table1), labelNbLines, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (labelNbLines), 0, 0.5);

  label9 = gtk_label_new (QT_TR_NOOP("# of lines"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 1, 2,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_FILL);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label15 = gtk_label_new (QT_TR_NOOP("TimeCode:"));
  gtk_widget_show (label15);
  gtk_table_attach (GTK_TABLE (table1), label15, 0, 1, 2, 3,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_FILL);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);

  label8 = gtk_label_new (QT_TR_NOOP("# of Glyphs :"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_FILL);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  label7 = gtk_label_new (QT_TR_NOOP("<b>Stats</b>"));
  gtk_widget_show (label7);
  gtk_frame_set_label_widget (GTK_FRAME (frame5), label7);
  gtk_label_set_use_markup (GTK_LABEL (label7), TRUE);

  frameBitmap = gtk_frame_new (NULL);
  gtk_widget_show (frameBitmap);
  gtk_box_pack_start (GTK_BOX (vbox1), frameBitmap, FALSE, FALSE, 0);

  vbox7 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox7);
  gtk_container_add (GTK_CONTAINER (frameBitmap), vbox7);

  table2 = gtk_table_new (2, 2, FALSE);
  gtk_widget_show (table2);
  gtk_box_pack_start (GTK_BOX (vbox7), table2, FALSE, FALSE, 0);

  label13 = gtk_label_new (QT_TR_NOOP("Current Glyph"));
  gtk_widget_show (label13);
  gtk_table_attach (GTK_TABLE (table2), label13, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);

  drawingareaSmall = gtk_drawing_area_new ();
  gtk_widget_show (drawingareaSmall);
  gtk_table_attach (GTK_TABLE (table2), drawingareaSmall, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);

  label14 = gtk_label_new (QT_TR_NOOP(" Text:"));
  gtk_widget_show (label14);
  gtk_table_attach (GTK_TABLE (table2), label14, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label14), 0, 0.5);

  labelText = gtk_label_new (QT_TR_NOOP(" "));
  gtk_widget_show (labelText);
  gtk_table_attach (GTK_TABLE (table2), labelText, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (labelText), 0, 0.5);

  entry = gtk_entry_new ();
  gtk_widget_show (entry);
  gtk_box_pack_start (GTK_BOX (vbox7), entry, FALSE, FALSE, 0);

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

  buttonCalibrate = gtk_button_new_with_mnemonic (QT_TR_NOOP("_Calibrate"));
  gtk_widget_show (buttonCalibrate);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonCalibrate);
  GTK_WIDGET_SET_FLAGS (buttonCalibrate, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonCalibrate, QT_TR_NOOP("If the glyphs are too thin, enter a lower value here"), NULL);

  buttonSkipAll = gtk_button_new_with_mnemonic (QT_TR_NOOP("S_kip all"));
  gtk_widget_show (buttonSkipAll);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonSkipAll);
  GTK_WIDGET_SET_FLAGS (buttonSkipAll, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonSkipAll, QT_TR_NOOP("Skip the whole image"), NULL);

  buttonSkip = gtk_button_new_with_mnemonic (QT_TR_NOOP("Skip Glyph"));
  gtk_widget_show (buttonSkip);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonSkip);
  GTK_WIDGET_SET_FLAGS (buttonSkip, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonSkip, QT_TR_NOOP("Skip the current letter/glyph"), NULL);

  buttonIgnore = gtk_button_new_with_mnemonic (QT_TR_NOOP("_Ignore glyph"));
  gtk_widget_show (buttonIgnore);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonIgnore);
  GTK_WIDGET_SET_FLAGS (buttonIgnore, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, buttonIgnore, QT_TR_NOOP("This glyph will be ignored from now on"), NULL);

  buttonOk = gtk_button_new_with_mnemonic (QT_TR_NOOP("Ok"));
  gtk_widget_show (buttonOk);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonOk);
  GTK_WIDGET_SET_FLAGS (buttonOk, GTK_CAN_DEFAULT);

  drawingareaBitmap = gtk_drawing_area_new ();
  gtk_widget_show (drawingareaBitmap);
  gtk_box_pack_start (GTK_BOX (vbox7), drawingareaBitmap, TRUE, TRUE, 0);
  gtk_widget_set_size_request (drawingareaBitmap, 5, 11);

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

  label12 = gtk_label_new (QT_TR_NOOP("<b>Bitmap</b>"));
  gtk_widget_show (label12);
  gtk_frame_set_label_widget (GTK_FRAME (frameBitmap), label12);
  gtk_label_set_use_markup (GTK_LABEL (label12), 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);

  closebutton1 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (closebutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), closebutton1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (closebutton1, 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, frame5, "frame5");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, labelNbGlyphs, "labelNbGlyphs");
  GLADE_HOOKUP_OBJECT (dialog1, labelTime, "labelTime");
  GLADE_HOOKUP_OBJECT (dialog1, labelNbLines, "labelNbLines");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label15, "label15");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, frameBitmap, "frameBitmap");
  GLADE_HOOKUP_OBJECT (dialog1, vbox7, "vbox7");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label13, "label13");
  GLADE_HOOKUP_OBJECT (dialog1, drawingareaSmall, "drawingareaSmall");
  GLADE_HOOKUP_OBJECT (dialog1, label14, "label14");
  GLADE_HOOKUP_OBJECT (dialog1, labelText, "labelText");
  GLADE_HOOKUP_OBJECT (dialog1, entry, "entry");
  GLADE_HOOKUP_OBJECT (dialog1, hbuttonbox1, "hbuttonbox1");
  GLADE_HOOKUP_OBJECT (dialog1, buttonCalibrate, "buttonCalibrate");
  GLADE_HOOKUP_OBJECT (dialog1, buttonSkipAll, "buttonSkipAll");
  GLADE_HOOKUP_OBJECT (dialog1, buttonSkip, "buttonSkip");
  GLADE_HOOKUP_OBJECT (dialog1, buttonIgnore, "buttonIgnore");
  GLADE_HOOKUP_OBJECT (dialog1, buttonOk, "buttonOk");
  GLADE_HOOKUP_OBJECT (dialog1, drawingareaBitmap, "drawingareaBitmap");
  GLADE_HOOKUP_OBJECT (dialog1, hseparator1, "hseparator1");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, closebutton1, "closebutton1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, tooltips, "tooltips");

  return dialog1;
}
예제 #6
0
static void
xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
{
  GtkBox *box = GTK_BOX (GTK_DIALOG (obj)->vbox);
  XfburnPreferencesDialogPrivate *priv = XFBURN_PREFERENCES_DIALOG_GET_PRIVATE (obj);
  
  GtkWidget *vbox, *vbox2, *vbox3, *hbox;
  GtkWidget *label;
  GtkWidget *frame;
  GtkWidget *scrolled_window;
  GtkListStore *icon_store, *store;
  gint x,y;
  GdkPixbuf *icon = NULL;
  GtkTreeIter iter;
  GtkTreeViewColumn *column_name;
  GtkCellRenderer *cell_icon, *cell_name;
  GtkWidget *button_close;
  gint idx;
  
  gtk_window_set_title (GTK_WINDOW (obj), _("Preferences"));
  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (obj), _("Tune how Xfburn behaves"));
  gtk_window_set_default_size (GTK_WINDOW (obj), 775, 400);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (obj), TRUE);
  gtk_window_set_icon_name (GTK_WINDOW (obj), GTK_STOCK_PREFERENCES);
  gtk_dialog_set_has_separator (GTK_DIALOG (obj), FALSE);
  
  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (box, hbox, TRUE, TRUE, 0);
  gtk_widget_show (hbox);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  g_object_set (G_OBJECT (scrolled_window),
                "hscrollbar-policy", GTK_POLICY_NEVER,
                "shadow-type", GTK_SHADOW_IN,
                "vscrollbar-policy", GTK_POLICY_NEVER,
                NULL);
  gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, FALSE, FALSE, 0);
  gtk_widget_show (scrolled_window);

  /* icon bar */
  icon_store = gtk_list_store_new (SETTINGS_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
  priv->icon_bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (icon_store));
  exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_PIXBUF_COLUMN);
  exo_icon_bar_set_text_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_TEXT_COLUMN);
  gtk_container_add (GTK_CONTAINER (scrolled_window), priv->icon_bar);
  gtk_widget_show (priv->icon_bar);
  
  /* notebook */
  priv->notebook = gtk_notebook_new ();
  gtk_container_set_border_width (GTK_CONTAINER (priv->notebook), BORDER);
  g_object_set (G_OBJECT (priv->notebook),
                "show-border", FALSE,
                "show-tabs", FALSE,
                NULL);
  gtk_box_pack_start (GTK_BOX (hbox), priv->notebook, TRUE, TRUE, BORDER);
  gtk_widget_show (priv->notebook);

  /* general tab */
  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
  idx = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
  gtk_widget_show (vbox);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("Temporary directory"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
  gtk_widget_show (frame);

  priv->chooser_button = gtk_file_chooser_button_new (_("Temporary directory"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
  gtk_box_pack_start (GTK_BOX (vbox2), priv->chooser_button, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->chooser_button);

  priv->check_clean_tmpdir = gtk_check_button_new_with_mnemonic (_("_Clean temporary directory on exit"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_clean_tmpdir, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_clean_tmpdir);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("File browser"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, BORDER);
  gtk_widget_show (frame);

  priv->check_show_hidden = gtk_check_button_new_with_mnemonic (_("Show _hidden files"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_hidden, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_show_hidden);
  g_signal_connect (G_OBJECT (priv->check_show_hidden), "clicked", G_CALLBACK (cb_show_hidden_clicked), NULL);

  priv->check_show_human_readable = gtk_check_button_new_with_mnemonic (_("Show human_readable filesizes"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_show_human_readable, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_show_human_readable);

  icon = gtk_widget_render_icon (GTK_WIDGET (priv->icon_bar),
                                 GTK_STOCK_PROPERTIES,
                                 GTK_ICON_SIZE_DIALOG,
                                 NULL);
  gtk_list_store_append (icon_store, &iter);
  gtk_list_store_set (icon_store, &iter,
                      SETTINGS_LIST_PIXBUF_COLUMN, icon,
                      SETTINGS_LIST_TEXT_COLUMN, _("General"),
                      SETTINGS_LIST_INDEX_COLUMN, idx,
                      -1);
  g_object_unref (G_OBJECT (icon));
  
  /* devices tab */
  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
  idx = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), vbox, NULL);
  gtk_widget_show (vbox);

  label = gtk_label_new (_("Devices"));
  gtk_widget_show (label);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (priv->notebook),
                              gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 1), label);
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);

  vbox2 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox2);

  frame = xfce_gtk_frame_box_new_with_content (_("Detected devices"), vbox2);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
  gtk_widget_show (frame);

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
  gtk_widget_show (scrolled_window);
  gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, BORDER);

  store = gtk_list_store_new (DEVICE_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
                              G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
                              G_TYPE_BOOLEAN);
  priv->treeview_devices = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), DEVICE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->treeview_devices), TRUE);
  gtk_widget_show (priv->treeview_devices);
  gtk_container_add (GTK_CONTAINER (scrolled_window), priv->treeview_devices);
  g_object_unref (store);
  
  /* add columns */
  column_name = gtk_tree_view_column_new ();
  gtk_tree_view_column_set_title (column_name, _("Name"));
  gtk_tree_view_column_set_expand (column_name, TRUE);

  cell_icon = gtk_cell_renderer_pixbuf_new ();
  gtk_tree_view_column_pack_start (column_name, cell_icon, FALSE);
  gtk_tree_view_column_set_attributes (column_name, cell_icon, "pixbuf", DEVICE_LIST_COLUMN_ICON, NULL);
  g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);

  cell_name = gtk_cell_renderer_text_new ();
  gtk_tree_view_column_pack_start (column_name, cell_name, TRUE);
  gtk_tree_view_column_set_attributes (column_name, cell_name, "text", DEVICE_LIST_COLUMN_NAME, NULL);

  gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview_devices), column_name);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Node"),
                                               gtk_cell_renderer_text_new (), "text", DEVICE_LIST_COLUMN_NODE, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDR, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-RW"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDRW,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDR,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-RAM"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDRAM,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write Blu-ray"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_BD,
                                               NULL);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, BORDER);
  gtk_widget_show (hbox);

  priv->button_scan = xfce_gtk_button_new_mixed (GTK_STOCK_CDROM, _("Sc_an for devices"));
  gtk_box_pack_end (GTK_BOX (hbox), priv->button_scan, FALSE, FALSE, BORDER);
  g_signal_connect (G_OBJECT (priv->button_scan), "clicked", G_CALLBACK (scan_button_clicked_cb), obj);
  gtk_widget_show (priv->button_scan);

  gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
  icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-optical", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-cdrom", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), GTK_STOCK_CDROM, x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);

  
  gtk_list_store_append (icon_store, &iter);
  gtk_list_store_set (icon_store, &iter,
                      SETTINGS_LIST_PIXBUF_COLUMN, icon,
                      SETTINGS_LIST_TEXT_COLUMN, _("Devices"),
                      SETTINGS_LIST_INDEX_COLUMN, idx,
                      -1);
  if (icon)
    g_object_unref (G_OBJECT (icon));
  
  exo_mutual_binding_new (G_OBJECT (priv->notebook), "page", G_OBJECT (priv->icon_bar), "active");


  /* below the device list */
#if 0
  priv->check_empty_speed_list = gtk_check_button_new_with_mnemonic (_("Show warning on _empty speed list"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_empty_speed_list, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_empty_speed_list);
#endif

  /* fifo */
  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox3);

  frame = xfce_gtk_frame_box_new_with_content (_("FIFO buffer size (in kb)"), vbox3);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
  gtk_widget_show (frame);

  priv->scale_fifo = gtk_hscale_new_with_range (0.0, FIFO_MAX_SIZE, 32.0);
  gtk_scale_set_value_pos (GTK_SCALE (priv->scale_fifo), GTK_POS_LEFT);
  gtk_range_set_value (GTK_RANGE (priv->scale_fifo), 0);
  gtk_box_pack_start (GTK_BOX (vbox3), priv->scale_fifo, FALSE, FALSE, BORDER/2);
  gtk_widget_show (priv->scale_fifo);

  
  /* action buttons */
  button_close = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button_close);
  gtk_dialog_add_action_widget (GTK_DIALOG (obj), button_close, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
  gtk_widget_grab_focus (button_close);
  gtk_widget_grab_default (button_close);

  g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_preferences_dialog_response_cb), priv);
  
  refresh_devices_list (obj);
  
  g_object_unref (icon_store);
}
예제 #7
0
uint8_t  DIA_v2v(char **vobname, char **ifoname,char **vobsubname)
{
uint8_t ret=0;
char *tmp=NULL,*tmp2=NULL,*tmp3=NULL;

        GtkWidget *dialog;

        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonVob),actionVOB);
        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonIfo),actionIFO);
        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonVobSub),actionVOBSUB);

#define ENTRY_SET(x,y) {gtk_write_entry_string(WID(x),*y);}

        ENTRY_SET(entryIfo,ifoname);
        ENTRY_SET(entryVob,vobname);
        ENTRY_SET(entryVobSub,vobsubname);

        while(1)
        {
                switch(gtk_dialog_run(GTK_DIALOG(dialog)))
                {
                        case actionVOB:
                                        {
                                        
                                        int r;
                                                GUI_FileSelRead(_("Select Vob file to scan"),&tmp);
                                                if(!tmp) continue;
                                                gtk_editable_delete_text(GTK_EDITABLE(WID(entryVob)), 0,-1);
                                                gtk_editable_insert_text(GTK_EDITABLE(WID(entryVob)), tmp, strlen(tmp), &r);
                                                ADM_dealloc(tmp);
                                        }
                                        break;
                        case actionIFO:
                                        {
                                        
                                        int r;
                                                GUI_FileSelRead(_("Select ifo file to use"),&tmp);
                                                if(!tmp) continue;
                                                gtk_editable_delete_text(GTK_EDITABLE(WID(entryIfo)), 0,-1);
                                                gtk_editable_insert_text(GTK_EDITABLE(WID(entryIfo)), tmp, strlen(tmp), &r);
                                                ADM_dealloc(tmp);
                                        }
                                        break;
                        case actionVOBSUB:
                                        {
                                        
                                        int r;
                                                GUI_FileSelWrite(_("Select vobsub to write"),&tmp);
                                                if(!tmp) continue;
                                                gtk_editable_delete_text(GTK_EDITABLE(WID(entryVobSub)), 0,-1);
                                                gtk_editable_insert_text(GTK_EDITABLE(WID(entryVobSub)), tmp, strlen(tmp), &r);
                                                ADM_dealloc(tmp);
                                        }
                                        break;

                                        break;
                        case GTK_RESPONSE_OK: 
                                        {
                                           tmp=gtk_editable_get_chars(GTK_EDITABLE (WID(entryVob)), 0, -1);
                                           if(!tmp || !*tmp)
                                           {
                                             GUI_Error_HIG(_("Invalid vobname"),_("Please select or enter a valid vob name"));
                                                        continue;
                                            }
                                           tmp2=gtk_editable_get_chars(GTK_EDITABLE (WID(entryIfo)), 0, -1);
                                           if(!tmp2 || !*tmp2)
                                           {
                                             GUI_Error_HIG(_("Invalid ifo"),_("Please select or enter a valid ifo file"));
                                                        continue;
                                            }
                                           tmp3=gtk_editable_get_chars(GTK_EDITABLE (WID(entryVobSub)), 0, -1);
                                           if(!tmp3 || !*tmp3 )
                                           {
                                             GUI_Error_HIG(_("Invalid vobsubname"),_("Please select or enter a valid vobsub file"));
                                                        continue;
                                            }
                                            if(*vobname) ADM_dealloc(*vobname);
                                            if(*ifoname) ADM_dealloc(*ifoname);
                                            if(*vobsubname) ADM_dealloc(*vobsubname);

                                             *vobname=*ifoname=*vobsubname=NULL;

                                            *vobname=ADM_strdup(tmp);
                                            *ifoname=ADM_strdup(tmp2);
                                            *vobsubname=(char *)ADM_alloc(strlen(tmp3)+5); //ADM_strdup(tmp3);
                                            strcpy(*vobsubname,tmp3);
                                            if(tmp3[strlen(tmp3)-1]!='x') strcat(*vobsubname,".idx");
                                            ret=1;
                                        }
                        default: goto _nxt;
                }
        }
_nxt:
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        return ret;
}
예제 #8
0
TextReplacementDialog::TextReplacementDialog(int dummy)
{
  // Get configurations.
  extern Settings *settings;

  // Shortcuts.
  Shortcuts shortcuts(0);

  textreplacementdialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(textreplacementdialog), _("Text Replacement"));
  gtk_window_set_position(GTK_WINDOW(textreplacementdialog), GTK_WIN_POS_CENTER_ON_PARENT);
  gtk_window_set_modal(GTK_WINDOW(textreplacementdialog), TRUE);
  gtk_window_set_type_hint(GTK_WINDOW(textreplacementdialog), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG(textreplacementdialog));
  gtk_widget_show(dialog_vbox1);

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

  checkbutton1 = gtk_check_button_new_with_mnemonic(_("Replace text when printing and exporting"));
  gtk_widget_show(checkbutton1);
  gtk_box_pack_start(GTK_BOX(vbox1), checkbutton1, FALSE, FALSE, 0);

  shortcuts.button(checkbutton1);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton1), settings->genconfig.text_replacement_get());

  scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
  gtk_widget_show(scrolledwindow1);
  gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_SHADOW_IN);

  treeview1 = gtk_tree_view_new();
  gtk_widget_show(treeview1);
  gtk_container_add(GTK_CONTAINER(scrolledwindow1), treeview1);
  gtk_tree_view_set_reorderable(GTK_TREE_VIEW(treeview1), TRUE);

  dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG(textreplacementdialog));
  gtk_widget_show(dialog_action_area1);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);

  new InDialogHelp(textreplacementdialog, NULL, &shortcuts, "menu-preferences/text-replacement");

  cancelbutton1 = gtk_button_new_from_stock("gtk-cancel");
  gtk_widget_show(cancelbutton1);
  gtk_dialog_add_action_widget(GTK_DIALOG(textreplacementdialog), cancelbutton1, GTK_RESPONSE_CANCEL);
  gtk_widget_set_can_default (GTK_WIDGET (cancelbutton1), true);

  shortcuts.stockbutton(cancelbutton1);

  okbutton1 = gtk_button_new_from_stock("gtk-ok");
  gtk_widget_show(okbutton1);
  gtk_dialog_add_action_widget(GTK_DIALOG(textreplacementdialog), okbutton1, GTK_RESPONSE_OK);
  gtk_widget_set_can_default (GTK_WIDGET (okbutton1), true);

  shortcuts.stockbutton(okbutton1);

  shortcuts.process();

  g_signal_connect((gpointer) checkbutton1, "toggled", G_CALLBACK(on_checkbutton1_toggled), gpointer(this));
  g_signal_connect((gpointer) okbutton1, "clicked", G_CALLBACK(on_okbutton1_clicked), gpointer(this));

  gtk_widget_grab_focus(okbutton1);
  gtk_widget_grab_default(okbutton1);

  // Toggle button.
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton1), settings->genconfig.text_replacement_get());

  // Storage, renderer, column and selection.
  model = gtk_list_store_new(NUM_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_BOOLEAN);
  gtk_tree_view_set_model(GTK_TREE_VIEW(treeview1), GTK_TREE_MODEL(model));
  g_object_unref(model);
  GtkCellRenderer *renderer1 = gtk_cell_renderer_text_new();
  g_signal_connect(renderer1, "edited", G_CALLBACK(cell_text_edited), gpointer(this));

  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview1), -1, "Texts", renderer1, "text", COLUMN_ORIGINALS, "editable", COLUMN_EDITABLE1, NULL);

  GtkCellRenderer *renderer2 = gtk_cell_renderer_text_new();
  g_signal_connect(renderer2, "edited", G_CALLBACK(cell_replacement_edited), gpointer(this));

  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview1), -1, "Replacements", renderer2, "text", COLUMN_REPLACEMENTS, "editable", COLUMN_EDITABLE2, NULL);

  gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview1)), GTK_SELECTION_SINGLE);

  // Load texts and replacements - these get initialized to defaults if there were none.
  vector < ustring > originals;
  vector < ustring > replacements;
  text_replacement_get_words(originals, replacements);

  GtkTreeIter iter;
  for (unsigned int i = 0; i < originals.size(); i++) {
    gtk_list_store_append(model, &iter);
    gtk_list_store_set(model, &iter, COLUMN_ORIGINALS, originals[i].c_str(), COLUMN_EDITABLE1, 1, COLUMN_REPLACEMENTS, replacements[i].c_str(), COLUMN_EDITABLE2, 1, -1);
  }

  gui();

  new DialogAutoScaler (textreplacementdialog, G_MAXINT);
}
예제 #9
0
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *frame1;
  GtkWidget *table2;
  GtkWidget *label4;
  GtkWidget *label5;
  GtkWidget *hscaleBrightness;
  GtkWidget *hscaleSaturation;
  GtkWidget *hscaleContrast;
  GtkWidget *label3;
  GtkWidget *label1;
  GtkWidget *frame2;
  GtkWidget *table3;
  GtkWidget *label6;
  GtkWidget *hscaleGamma;
  GtkWidget *hscaleGammaR;
  GtkWidget *label8;
  GtkWidget *hscaleGammaG;
  GtkWidget *label9;
  GtkWidget *label10;
  GtkWidget *label7;
  GtkWidget *hscaleGammaB;
  GtkWidget *hscaleGammaWeight;
  GtkWidget *label2;
  GtkWidget *hscale1;
  GtkWidget *drawingarea1;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_container_set_border_width (GTK_CONTAINER (dialog1), 6);
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("MPlayer eq2"));
  gtk_window_set_resizable (GTK_WINDOW (dialog1), FALSE);

  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);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  table2 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (frame1), table2);
  gtk_container_set_border_width (GTK_CONTAINER (table2), 12);
  gtk_table_set_row_spacings (GTK_TABLE (table2), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table2), 12);

  label4 = gtk_label_new_with_mnemonic (QT_TR_NOOP("Brigh_tness:"));
  gtk_widget_show (label4);
  gtk_table_attach (GTK_TABLE (table2), label4, 0, 1, 1, 2,
                    (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);

  label5 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Saturation:"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table2), label5, 0, 1, 2, 3,
                    (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);

  hscaleBrightness = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, -1, 1, 0.05, 1, 0)));
  gtk_widget_show (hscaleBrightness);
  gtk_table_attach (GTK_TABLE (table2), hscaleBrightness, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleBrightness, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleBrightness), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleBrightness), 2);

  hscaleSaturation = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleSaturation);
  gtk_table_attach (GTK_TABLE (table2), hscaleSaturation, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleSaturation, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleSaturation), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleSaturation), 2);

  hscaleContrast = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, -2, 2, 0.05, 1, 0)));
  gtk_widget_show (hscaleContrast);
  gtk_table_attach (GTK_TABLE (table2), hscaleContrast, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleContrast, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleContrast), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleContrast), 2);

  label3 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Contrast:"));
  gtk_widget_show (label3);
  gtk_table_attach (GTK_TABLE (table2), label3, 0, 1, 0, 1,
                    (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);

  label1 = gtk_label_new ("");
  gtk_widget_show (label1);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);
  gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_show (frame2);
  gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);

  table3 = gtk_table_new (5, 2, FALSE);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (frame2), table3);
  gtk_container_set_border_width (GTK_CONTAINER (table3), 12);
  gtk_table_set_row_spacings (GTK_TABLE (table3), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table3), 12);

  label6 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Initial:"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table3), label6, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  hscaleGamma = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.1, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleGamma);
  gtk_table_attach (GTK_TABLE (table3), hscaleGamma, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGamma, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGamma), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGamma), 2);

  hscaleGammaR = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.1, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaR);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaR, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaR, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaR), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaR), 2);

  label8 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Red:"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table3), label8, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

  hscaleGammaG = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.1, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaG);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaG, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaG, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaG), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaG), 2);

  label9 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Green:"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label10 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Blue:"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table3), label10, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  label7 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Weight:"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table3), label7, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  hscaleGammaB = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.1, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaB);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaB, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaB, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaB), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaB), 2);

  hscaleGammaWeight = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 1, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaWeight);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaWeight, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaWeight, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaWeight), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaWeight), 2);

  label2 = gtk_label_new (QT_TR_NOOP("<b>Gamma</b>"));
  gtk_widget_show (label2);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
  gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  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, FALSE, FALSE, 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);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label4), hscaleBrightness);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label5), hscaleSaturation);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label3), hscaleContrast);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label6), hscaleGamma);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label8), hscaleGammaR);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label9), hscaleGammaG);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label10), hscaleGammaB);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label7), hscaleGammaWeight);

  /* 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, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleBrightness, "hscaleBrightness");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleSaturation, "hscaleSaturation");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleContrast, "hscaleContrast");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (dialog1, table3, "table3");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGamma, "hscaleGamma");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaR, "hscaleGammaR");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaG, "hscaleGammaG");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaB, "hscaleGammaB");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaWeight, "hscaleGammaWeight");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  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;
}
예제 #10
0
WordlistDialog::WordlistDialog(int dummy)
{
  extern Settings *settings;

  Shortcuts shortcuts(0);

  wordlistdialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(wordlistdialog), _("Wordlists"));
  gtk_window_set_position(GTK_WINDOW(wordlistdialog), GTK_WIN_POS_CENTER_ON_PARENT);
  gtk_window_set_modal(GTK_WINDOW(wordlistdialog), TRUE);

  dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (wordlistdialog));
  gtk_widget_show(dialog_vbox1);

  label1 = gtk_label_new(_("This updates the word list entries in the text and generates lists of them"));
  gtk_widget_show(label1);
  gtk_box_pack_start(GTK_BOX(dialog_vbox1), label1, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);

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

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

  checkbutton_wordlist = gtk_check_button_new_with_mnemonic(_("Process general word list"));
  gtk_widget_show(checkbutton_wordlist);
  gtk_box_pack_start(GTK_BOX(vbox2), checkbutton_wordlist, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_wordlist);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_wordlist), settings->genconfig.wordlist_process_general_get());

  label3 = gtk_label_new(_("Insert list between markers \\zopenwordlist and \\zclosewordlist"));
  gtk_widget_show(label3);
  gtk_box_pack_start(GTK_BOX(vbox2), label3, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);

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

  checkbutton_asterisk_general = gtk_check_button_new_with_mnemonic(_("Add an asterisk to each word entry"));
  gtk_widget_show(checkbutton_asterisk_general);
  gtk_box_pack_start(GTK_BOX(hbox1), checkbutton_asterisk_general, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_asterisk_general);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_asterisk_general), settings->genconfig.wordlist_general_asterisk_get());

  checkbutton_general_first_time = gtk_check_button_new_with_mnemonic(_("the first time it occurs in a section"));
  gtk_widget_show(checkbutton_general_first_time);
  gtk_box_pack_start(GTK_BOX(hbox1), checkbutton_general_first_time, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_general_first_time);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_general_first_time), settings->genconfig.wordlist_general_asterisk_first_get());

  hseparator3 = gtk_hseparator_new();
  gtk_widget_show(hseparator3);
  gtk_box_pack_start(GTK_BOX(dialog_vbox1), hseparator3, TRUE, TRUE, 0);

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

  checkbutton_hebrew_wordlist = gtk_check_button_new_with_mnemonic(_("Process Hebrew word list"));
  gtk_widget_show(checkbutton_hebrew_wordlist);
  gtk_box_pack_start(GTK_BOX(vbox3), checkbutton_hebrew_wordlist, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_hebrew_wordlist);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_hebrew_wordlist), settings->genconfig.wordlist_process_hebrew_get());

  label4 = gtk_label_new(_("Insert the list between markers \\zopenhebrewwordlist and \\zclosehebrewwordlist"));
  gtk_widget_show(label4);
  gtk_box_pack_start(GTK_BOX(vbox3), label4, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label4), 0, 0.5);

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

  checkbutton_asterisk_hebrew = gtk_check_button_new_with_mnemonic(_("Add an asterisk to each word entry"));
  gtk_widget_show(checkbutton_asterisk_hebrew);
  gtk_box_pack_start(GTK_BOX(hbox2), checkbutton_asterisk_hebrew, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_asterisk_hebrew);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_asterisk_hebrew), settings->genconfig.wordlist_hebrew_asterisk_get());

  checkbutton_hebrew_firsttime = gtk_check_button_new_with_mnemonic(_("the first time it occurs in a section"));
  gtk_widget_show(checkbutton_hebrew_firsttime);
  gtk_box_pack_start(GTK_BOX(hbox2), checkbutton_hebrew_firsttime, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_hebrew_firsttime);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_hebrew_firsttime), settings->genconfig.wordlist_hebrew_asterisk_first_get());

  hseparator4 = gtk_hseparator_new();
  gtk_widget_show(hseparator4);
  gtk_box_pack_start(GTK_BOX(dialog_vbox1), hseparator4, TRUE, TRUE, 0);

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

  checkbutton_greek_wordlist = gtk_check_button_new_with_mnemonic(_("Process Greek word list"));
  gtk_widget_show(checkbutton_greek_wordlist);
  gtk_box_pack_start(GTK_BOX(vbox4), checkbutton_greek_wordlist, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_greek_wordlist);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_greek_wordlist), settings->genconfig.wordlist_process_greek_get());

  label5 = gtk_label_new(_("Insert the list between markers \\zopengreekwordlist and \\zclosegreekwordlist"));
  gtk_widget_show(label5);
  gtk_box_pack_start(GTK_BOX(vbox4), label5, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5);

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

  checkbutton_asterisk_greek = gtk_check_button_new_with_mnemonic(_("Add an asterisk to each word entry"));
  gtk_widget_show(checkbutton_asterisk_greek);
  gtk_box_pack_start(GTK_BOX(hbox3), checkbutton_asterisk_greek, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_asterisk_greek);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_asterisk_greek), settings->genconfig.wordlist_greek_asterisk_get());

  checkbutton_greek_first_time = gtk_check_button_new_with_mnemonic(_("the first time it occurs in a section"));
  gtk_widget_show(checkbutton_greek_first_time);
  gtk_box_pack_start(GTK_BOX(hbox3), checkbutton_greek_first_time, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_greek_first_time);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_greek_first_time), settings->genconfig.wordlist_greek_asterisk_first_get());

  hseparator6 = gtk_hseparator_new();
  gtk_widget_show(hseparator6);
  gtk_box_pack_start(GTK_BOX(dialog_vbox1), hseparator6, TRUE, TRUE, 0);

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

  checkbutton_index = gtk_check_button_new_with_mnemonic(_("Process index"));
  gtk_widget_show(checkbutton_index);
  gtk_box_pack_start(GTK_BOX(vbox6), checkbutton_index, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_index);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_index), settings->genconfig.wordlist_process_index_get());

  label6 = gtk_label_new(_("Insert the list between markers \\zopenindex and \\zcloseindex"));
  gtk_widget_show(label6);
  gtk_box_pack_start(GTK_BOX(vbox6), label6, FALSE, FALSE, 0);
  gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);

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

  checkbutton_asterisk_index = gtk_check_button_new_with_mnemonic(_("Add an asterisk to each word entry"));
  gtk_widget_show(checkbutton_asterisk_index);
  gtk_box_pack_start(GTK_BOX(hbox6), checkbutton_asterisk_index, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_asterisk_index);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_asterisk_index), settings->genconfig.wordlist_index_asterisk_get());

  checkbutton_index_first_time = gtk_check_button_new_with_mnemonic(_("the first time it occurs in a chapter"));
  gtk_widget_show(checkbutton_index_first_time);
  gtk_box_pack_start(GTK_BOX(hbox6), checkbutton_index_first_time, FALSE, FALSE, 0);

  shortcuts.button(checkbutton_index_first_time);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_index_first_time), settings->genconfig.wordlist_index_asterisk_first_get());

  dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG(wordlistdialog));
  gtk_widget_show(dialog_action_area1);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);

  new InDialogHelp(wordlistdialog, NULL, &shortcuts, "tools/generate-word-lists");

  cancelbutton = gtk_button_new_from_stock("gtk-cancel");
  gtk_widget_show(cancelbutton);
  gtk_dialog_add_action_widget(GTK_DIALOG(wordlistdialog), cancelbutton, GTK_RESPONSE_CANCEL);
  gtk_widget_set_can_default (GTK_WIDGET (cancelbutton), true);

  okbutton = gtk_button_new_from_stock("gtk-ok");
  gtk_widget_show(okbutton);
  gtk_dialog_add_action_widget(GTK_DIALOG(wordlistdialog), okbutton, GTK_RESPONSE_OK);
  gtk_widget_set_can_default (GTK_WIDGET (okbutton), true);

  shortcuts.stockbutton(cancelbutton);
  shortcuts.stockbutton(okbutton);
  shortcuts.process();

  g_signal_connect((gpointer) checkbutton_wordlist, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_asterisk_general, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_hebrew_wordlist, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_asterisk_hebrew, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_greek_wordlist, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_asterisk_greek, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_index, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) checkbutton_asterisk_index, "toggled", G_CALLBACK(on_checkbutton_toggled), gpointer(this));
  g_signal_connect((gpointer) okbutton, "clicked", G_CALLBACK(on_okbutton_clicked), gpointer(this));

  gtk_widget_grab_focus(okbutton);
  gtk_widget_grab_default(okbutton);

  gui();
}
예제 #11
0
static void
rejilla_tool_dialog_init (RejillaToolDialog *obj)
{
	GtkWidget *title;
	GtkWidget *content_area;
	gchar *title_str;
	RejillaToolDialogPrivate *priv;

	priv = REJILLA_TOOL_DIALOG_PRIVATE (obj);

	/* upper part */
	priv->upper_box = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (GTK_WIDGET (priv->upper_box));

	priv->selector = rejilla_medium_selection_new ();
	gtk_widget_show (GTK_WIDGET (priv->selector));

	title_str = g_strdup_printf ("<b>%s</b>", _("Select a disc"));
	gtk_box_pack_start (GTK_BOX (priv->upper_box),
			    rejilla_utils_pack_properties (title_str,
							   priv->selector,
							   NULL),
			    FALSE, FALSE, 0);
	g_free (title_str);

	rejilla_medium_selection_show_media_type (REJILLA_MEDIUM_SELECTION (priv->selector),
						  REJILLA_MEDIA_TYPE_REWRITABLE|
						  REJILLA_MEDIA_TYPE_WRITABLE|
						  REJILLA_MEDIA_TYPE_AUDIO|
						  REJILLA_MEDIA_TYPE_DATA);

	content_area = gtk_dialog_get_content_area (GTK_DIALOG (obj));
	gtk_box_pack_start (GTK_BOX (content_area),
			    priv->upper_box,
			    FALSE,
			    FALSE,
			    0);

	/* lower part */
	priv->lower_box = gtk_vbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (priv->lower_box), 12);
	gtk_widget_set_sensitive (priv->lower_box, FALSE);
	gtk_widget_show (priv->lower_box);

	gtk_box_pack_start (GTK_BOX (content_area),
			    priv->lower_box,
			    FALSE,
			    FALSE,
			    0);

	title_str = g_strdup_printf ("<b>%s</b>", _("Progress"));
	title = gtk_label_new (title_str);
	g_free (title_str);

	gtk_label_set_use_markup (GTK_LABEL (title), TRUE);
	gtk_misc_set_alignment (GTK_MISC (title), 0.0, 0.5);
	gtk_misc_set_padding(GTK_MISC (title), 0, 6);
	gtk_widget_show (title);
	gtk_box_pack_start (GTK_BOX (priv->lower_box),
			    title,
			    FALSE,
			    FALSE,
			    0);

	priv->progress = rejilla_burn_progress_new ();
	gtk_widget_show (priv->progress);
	g_object_set (G_OBJECT (priv->progress),
		      "show-info", FALSE,
		      NULL);

	gtk_box_pack_start (GTK_BOX (content_area),
			    priv->progress,
			    FALSE,
			    FALSE,
			    0);

	/* buttons */
	priv->cancel = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
	gtk_widget_show (priv->cancel);
	gtk_dialog_add_action_widget (GTK_DIALOG (obj),
				      priv->cancel,
				      GTK_RESPONSE_CANCEL);

	g_signal_connect (G_OBJECT (priv->selector),
			  "medium-changed",
			  G_CALLBACK (rejilla_tool_dialog_drive_changed_cb),
			  obj);

	g_signal_connect (obj,
			  "response",
			  G_CALLBACK (rejilla_tool_dialog_response),
			  NULL);

	gtk_window_resize (GTK_WINDOW (obj), 10, 10);
}
예제 #12
0
RevertDialog::RevertDialog(Reference * reference)
{
  // Save variables.
  extern Settings *settings;
  project = settings->genconfig.project_get();
  ProjectConfiguration *projectconfig = settings->projectconfig(project);
  language = projectconfig->language_get();
  reference_chapter = reference->chapter_get();
  revisionloaded = false;
  branch = 0;

  // Build dialog.
  Shortcuts shortcuts(0);

  revertdialog = gtk_dialog_new();
  gtk_window_set_title(GTK_WINDOW(revertdialog), _("Revert"));
  gtk_window_set_position(GTK_WINDOW(revertdialog), GTK_WIN_POS_CENTER_ON_PARENT);
  gtk_window_set_type_hint(GTK_WINDOW(revertdialog), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG (revertdialog));
  gtk_widget_show(dialog_vbox1);

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

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

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

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

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

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

  shortcuts.label(labelbook);

  gtk_label_set_mnemonic_widget(GTK_LABEL(labelbook), comboboxbook);

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

  shortcuts.label(labelchapter);

  gtk_label_set_mnemonic_widget(GTK_LABEL(labelchapter), comboboxchapter);

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

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

  shortcuts.label(labelrevisions);

  scrolledwindowrevisions = gtk_scrolled_window_new(NULL, NULL);
  gtk_widget_show(scrolledwindowrevisions);
  gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindowrevisions, TRUE, TRUE, 0);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindowrevisions), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindowrevisions), GTK_SHADOW_IN);

  treeviewrevisions = gtk_tree_view_new();
  gtk_widget_show(treeviewrevisions);
  gtk_container_add(GTK_CONTAINER(scrolledwindowrevisions), treeviewrevisions);
  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeviewrevisions), FALSE);

  gtk_label_set_mnemonic_widget(GTK_LABEL(labelrevisions), treeviewrevisions);

  // Create treeview related stuff.
  store = gtk_list_store_new(1, G_TYPE_STRING);
  gtk_tree_view_set_model(GTK_TREE_VIEW(treeviewrevisions), GTK_TREE_MODEL(store));
  g_object_unref(store);
  GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
  column = gtk_tree_view_column_new_with_attributes("", renderer, "text", 0, NULL);
  gtk_tree_view_append_column(GTK_TREE_VIEW(treeviewrevisions), column);
  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeviewrevisions));
  gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);

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

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

  GSList *radiobutton_current_group = NULL;

  radiobutton_current = gtk_radio_button_new_with_mnemonic (NULL, _("View current version"));
  gtk_widget_show (radiobutton_current);
  gtk_box_pack_start (GTK_BOX (vbox2), radiobutton_current, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_current), radiobutton_current_group);
  radiobutton_current_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_current));

  shortcuts.button(radiobutton_current);

  radiobutton_previous = gtk_radio_button_new_with_mnemonic (NULL, _("View previous revision"));
  gtk_widget_show (radiobutton_previous);
  gtk_box_pack_start (GTK_BOX (vbox2), radiobutton_previous, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_previous), radiobutton_current_group);
  radiobutton_current_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_previous));

  shortcuts.button(radiobutton_previous);

  radiobutton_changes = gtk_radio_button_new_with_mnemonic (NULL, _("View changes if reverting to previous revision"));
  gtk_widget_show (radiobutton_changes);
  gtk_box_pack_start (GTK_BOX (vbox2), radiobutton_changes, FALSE, FALSE, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_changes), radiobutton_current_group);
  radiobutton_current_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_changes));

  shortcuts.button(radiobutton_changes);
 
  changes_gui = new DisplayChangesGui (vbox2);

  gtk_widget_set_size_request(changes_gui->textview, 450, 500);

  dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG(revertdialog));
  gtk_widget_show(dialog_action_area1);
  gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);

  new InDialogHelp(revertdialog, NULL, &shortcuts, "edit/revert");

  cancelbutton1 = gtk_button_new_from_stock("gtk-cancel");
  gtk_widget_show(cancelbutton1);
  gtk_dialog_add_action_widget(GTK_DIALOG(revertdialog), cancelbutton1, GTK_RESPONSE_CANCEL);
  gtk_widget_set_can_default (GTK_WIDGET (cancelbutton1), true);

  okbutton1 = gtk_button_new_from_stock("gtk-ok");
  gtk_widget_show(okbutton1);
  gtk_dialog_add_action_widget(GTK_DIALOG(revertdialog), okbutton1, GTK_RESPONSE_OK);
  gtk_widget_set_can_default (GTK_WIDGET (okbutton1), true);

  shortcuts.stockbutton(cancelbutton1);
  shortcuts.stockbutton(okbutton1);
  shortcuts.process();

  g_signal_connect((gpointer) comboboxbook, "changed", G_CALLBACK(on_comboboxbook_changed), gpointer(this));
  g_signal_connect((gpointer) comboboxchapter, "changed", G_CALLBACK(on_comboboxchapter_changed), gpointer(this));
  g_signal_connect((gpointer) treeviewrevisions, "row_activated", G_CALLBACK(on_treeviewrevisions_row_activated), gpointer(this));
  g_signal_connect((gpointer) okbutton1, "clicked", G_CALLBACK(on_okbutton1_clicked), gpointer(this));
  g_signal_connect ((gpointer) radiobutton_current, "toggled",  G_CALLBACK (on_radiobutton_toggled), gpointer(this));
  g_signal_connect ((gpointer) radiobutton_previous, "toggled",  G_CALLBACK (on_radiobutton_toggled), gpointer(this));
  g_signal_connect ((gpointer) radiobutton_changes, "toggled",  G_CALLBACK (on_radiobutton_toggled), gpointer(this));

  gtk_widget_grab_focus(okbutton1);
  gtk_widget_grab_default(okbutton1);

  // Load books. This also loads the chapters through the callback.
  vector < unsigned int >books = project_get_books(project);
  vector < ustring > localbooks;
  for (unsigned int i = 0; i < books.size(); i++) {
    localbooks.push_back(books_id_to_name(language, books[i]));
  }
  combobox_set_strings(comboboxbook, localbooks);
  combobox_set_string(comboboxbook, books_id_to_name(language, reference->book_get()));
  
  // By default view changes.
  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_changes), true);
}
예제 #13
0
uint8_t DIA_vobsub(vobSubParam *param)
{
    char *name=NULL;
    int32_t shift;
    int ret,ext,r;

    ret=0;
    ext=0;

    if(param->subname)
        name=ADM_strdup(param->subname);
    shift=param->subShift;

    while(!ext)
    {
        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        //gtk_transient(dialog);
        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonSelect), GTK_RESPONSE_APPLY);


        fq=new GtkWidget*[ADM_MAX_LANGUAGE];

        // Upload if any
        if(name)
        {
            update(name,param->index);
        }
        else
        {
            gtk_label_set_text(GTK_LABEL(WID(labelVobsub)),QT_TR_NOOP("none"));
        }
        gtk_write_entry(WID(entryShift),shift);
        r=gtk_dialog_run(GTK_DIALOG(dialog));
        shift=gtk_read_entry(WID(entryShift));
        switch(r)
        {
        case GTK_RESPONSE_APPLY:
        {
            char *file;
            GUI_FileSelRead(QT_TR_NOOP("Select .idx file"),&file);
            if(file)
            {
                if(name) ADM_dealloc(name);
                name=NULL;
                name=ADM_strdup(file); // Leak ?
            }
        }
        break;
        case GTK_RESPONSE_OK:
            ret=1;
            ext=1;
            if(name)
            {
                ADM_dealloc(name);
            }
            name=ADM_strdup(gtk_label_get_text(GTK_LABEL(WID(labelVobsub))));
            if(param->subname)
                ADM_dealloc(param->subname);
            param->subname=name;
            //

            param->index=indeces[getRangeInMenu(WID(optionmenu1))];
            param->subShift=shift;
            break;
        case GTK_RESPONSE_CANCEL:
            ret=0;
            ext=1;
            break;
        default:
            break;
        }
        delete [] fq;
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);

    }

    return ret;
}
예제 #14
0
GtkWidget*
create_dialog1 (void)
{
    GtkWidget *dialog1;
    GtkWidget *dialog_vbox1;
    GtkWidget *vbox1;
    GtkWidget *frame1;
    GtkWidget *table1;
    GtkWidget *buttonSelect;
    GtkWidget *labelVobsub;
    GtkWidget *label4;
    GtkWidget *optionmenu1;
    GtkWidget *label2;
    GtkWidget *frame2;
    GtkWidget *table2;
    GtkWidget *label6;
    GtkObject *spinbutton1_adj;
    GtkWidget *spinbutton1;
    GtkWidget *label7;
    GtkWidget *entryShift;
    GtkWidget *label5;
    GtkWidget *dialog_action_area1;
    GtkWidget *cancelbutton1;
    GtkWidget *okbutton1;

    dialog1 = gtk_dialog_new ();
    gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("VobSub Settings"));

    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);

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

    table1 = gtk_table_new (2, 2, FALSE);
    gtk_widget_show (table1);
    gtk_container_add (GTK_CONTAINER (frame1), table1);

    buttonSelect = gtk_button_new_with_mnemonic (QT_TR_NOOP("Select .idx"));
    gtk_widget_show (buttonSelect);
    gtk_table_attach (GTK_TABLE (table1), buttonSelect, 1, 2, 0, 1,
                      (GtkAttachOptions) (GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);

    labelVobsub = gtk_label_new (QT_TR_NOOP("None"));
    gtk_widget_show (labelVobsub);
    gtk_table_attach (GTK_TABLE (table1), labelVobsub, 0, 1, 0, 1,
                      (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);
    gtk_label_set_justify (GTK_LABEL (labelVobsub), GTK_JUSTIFY_LEFT);
    gtk_misc_set_alignment (GTK_MISC (labelVobsub), 0, 0.5);

    label4 = gtk_label_new (QT_TR_NOOP("Select Language :"));
    gtk_widget_show (label4);
    gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
                      (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);

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

    label2 = gtk_label_new (QT_TR_NOOP("Select Sub"));
    gtk_widget_show (label2);
    gtk_frame_set_label_widget (GTK_FRAME (frame1), label2);
    gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

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

    table2 = gtk_table_new (2, 2, FALSE);
    gtk_widget_show (table2);
    gtk_container_add (GTK_CONTAINER (frame2), table2);

    label6 = gtk_label_new (QT_TR_NOOP("Extra Shrink Factor :"));
    gtk_widget_show (label6);
    gtk_table_attach (GTK_TABLE (table2), label6, 0, 1, 0, 1,
                      (GtkAttachOptions) (GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);
    gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
    gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

    spinbutton1_adj = gtk_adjustment_new (1, 1, 2, 0.1, 0.2, 0.2);
    spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 0);
    gtk_widget_show (spinbutton1);
    gtk_table_attach (GTK_TABLE (table2), spinbutton1, 1, 2, 0, 1,
                      (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);

    label7 = gtk_label_new (QT_TR_NOOP("Shift (ms) :"));
    gtk_widget_show (label7);
    gtk_table_attach (GTK_TABLE (table2), label7, 0, 1, 1, 2,
                      (GtkAttachOptions) (GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);
    gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
    gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

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

    label5 = gtk_label_new (QT_TR_NOOP("Extra Settings"));
    gtk_widget_show (label5);
    gtk_frame_set_label_widget (GTK_FRAME (frame2), label5);
    gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);

    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, frame1, "frame1");
    GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
    GLADE_HOOKUP_OBJECT (dialog1, buttonSelect, "buttonSelect");
    GLADE_HOOKUP_OBJECT (dialog1, labelVobsub, "labelVobsub");
    GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
    GLADE_HOOKUP_OBJECT (dialog1, optionmenu1, "optionmenu1");
    GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
    GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
    GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
    GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
    GLADE_HOOKUP_OBJECT (dialog1, spinbutton1, "spinbutton1");
    GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
    GLADE_HOOKUP_OBJECT (dialog1, entryShift, "entryShift");
    GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
    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;
}
예제 #15
0
static void
gfilter_dialog(GFilterArgs *args,
              GwyContainer *data,
              GwyDataField *dfield,
              GwyDataField *mfield,
              gint id,
              GQuark mquark)
{
    GtkWidget *dialog, *table, *vbox, *hbox, *scwin, *hbox2, *label;
    GtkTreeView *treeview;
    GtkTreeSelection *selection;
    GFilterControls controls;
    gint response, row, i;
    GwySIUnit *siunit;
    GwyPixmapLayer *layer;

    controls.args = args;
    controls.mask = mfield;
    controls.in_init = TRUE;
    controls.computed = FALSE;

    siunit = gwy_si_unit_new(NULL);
    for (i = 0; i < NQUANTITIES; i++) {
        controls.vf[i]
            = gwy_si_unit_get_format_with_digits(siunit,
                                                 GWY_SI_UNIT_FORMAT_VFMARKUP,
                                                 1.0, 4, NULL);
    }
    g_object_unref(siunit);

    dialog = gtk_dialog_new_with_buttons(_("Filter Grains"),
                                         NULL, 0, NULL);
    gtk_dialog_add_action_widget(GTK_DIALOG(dialog),
                                 gwy_stock_like_button_new(_("_Update"),
                                                           GTK_STOCK_EXECUTE),
                                 RESPONSE_PREVIEW);
    gtk_dialog_add_button(GTK_DIALOG(dialog),
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
    gtk_dialog_add_button(GTK_DIALOG(dialog),
                          GTK_STOCK_OK, GTK_RESPONSE_OK);
    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
    gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), RESPONSE_PREVIEW,
                                      !args->update);
    gwy_help_add_to_proc_dialog(GTK_DIALOG(dialog), GWY_HELP_DEFAULT);
    controls.dialog = dialog;

    hbox = gtk_hbox_new(FALSE, 2);

    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, TRUE, TRUE, 4);

    vbox = gtk_vbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 4);

    controls.mydata = gwy_container_new();
    gwy_container_set_object_by_name(controls.mydata, "/0/data", dfield);
    mfield = gwy_data_field_duplicate(mfield);
    gwy_container_set_object_by_name(controls.mydata, "/0/mask", mfield);
    g_object_unref(mfield);
    gwy_app_sync_data_items(data, controls.mydata, id, 0, FALSE,
                            GWY_DATA_ITEM_PALETTE,
                            GWY_DATA_ITEM_MASK_COLOR,
                            GWY_DATA_ITEM_RANGE,
                            GWY_DATA_ITEM_REAL_SQUARE,
                            0);
    controls.view = gwy_data_view_new(controls.mydata);
    layer = gwy_layer_basic_new();
    g_object_set(layer,
                 "data-key", "/0/data",
                 "gradient-key", "/0/base/palette",
                 "range-type-key", "/0/base/range-type",
                 "min-max-key", "/0/base",
                 NULL);
    gwy_data_view_set_data_prefix(GWY_DATA_VIEW(controls.view), "/0/data");
    gwy_data_view_set_base_layer(GWY_DATA_VIEW(controls.view), layer);
    layer = gwy_layer_mask_new();
    gwy_pixmap_layer_set_data_key(layer, "/0/mask");
    gwy_layer_mask_set_color_key(GWY_LAYER_MASK(layer), "/0/mask");
    gwy_data_view_set_alpha_layer(GWY_DATA_VIEW(controls.view), layer);
    gwy_set_data_preview_size(GWY_DATA_VIEW(controls.view), PREVIEW_SIZE);

    gtk_box_pack_start(GTK_BOX(vbox), controls.view, FALSE, FALSE, 0);

    controls.update = gtk_check_button_new_with_mnemonic(_("I_nstant updates"));
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(controls.update),
                                 args->update);
    gtk_box_pack_start(GTK_BOX(vbox), controls.update, FALSE, FALSE, 0);
    g_signal_connect_swapped(controls.update, "toggled",
                             G_CALLBACK(update_changed), &controls);

    hbox2 = gtk_hbox_new(FALSE, 6);
    gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);

    label = gtk_label_new_with_mnemonic(_("_Mask color:"));
    gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);

    controls.color_button = gwy_color_button_new();
    gwy_color_button_set_use_alpha(GWY_COLOR_BUTTON(controls.color_button),
                                   TRUE);
    load_mask_color(controls.color_button,
                    gwy_data_view_get_data(GWY_DATA_VIEW(controls.view)));
    gtk_label_set_mnemonic_widget(GTK_LABEL(label), controls.color_button);
    gtk_box_pack_start(GTK_BOX(hbox2), controls.color_button, FALSE, FALSE, 0);
    g_signal_connect(controls.color_button, "clicked",
                     G_CALLBACK(mask_color_changed), &controls);

    table = gtk_table_new(10, 4, FALSE);
    gtk_table_set_row_spacings(GTK_TABLE(table), 2);
    gtk_table_set_col_spacings(GTK_TABLE(table), 6);
    gtk_container_set_border_width(GTK_CONTAINER(table), 4);
    gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 4);
    controls.table = table;
    row = 0;

    scwin = gtk_scrolled_window_new(NULL, NULL);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scwin),
                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
    gtk_table_attach(GTK_TABLE(table), scwin, 0, 4, row, row+1,
                     GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);

    controls.values = gwy_grain_value_tree_view_new(FALSE,
                                                    "name", "symbol_markup",
                                                    NULL);
    treeview = GTK_TREE_VIEW(controls.values);
    gtk_widget_set_size_request(scwin, -1, 120);
    gtk_tree_view_set_headers_visible(treeview, FALSE);
    selection = gtk_tree_view_get_selection(treeview);
    gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
    gwy_grain_value_tree_view_set_same_units(treeview, args->units_equal);
    gwy_grain_value_tree_view_set_expanded_groups(treeview, args->expanded);
    gtk_container_add(GTK_CONTAINER(scwin), controls.values);
    row++;

    hbox2 = gtk_hbox_new(FALSE, 0);
    for (i = 0; i < NQUANTITIES; i++) {
        gchar buf[2];
        buf[0] = 'A' + i;
        buf[1] = '\0';
        controls.set_as[i] = gtk_button_new_with_label(buf);
        gtk_box_pack_start(GTK_BOX(hbox2), controls.set_as[i], FALSE, FALSE, 0);
        g_object_set_data(G_OBJECT(controls.set_as[i]),
                          "id", GUINT_TO_POINTER(i));
        g_signal_connect_swapped(controls.set_as[i], "clicked",
                                 G_CALLBACK(set_as_clicked), &controls);
    }
    gwy_table_attach_hscale(table, row++,
                            _("Set selected as:"), NULL,
                            GTK_OBJECT(hbox2), GWY_HSCALE_WIDGET_NO_EXPAND);

    controls.logical_op
        = gwy_enum_combo_box_newl(G_CALLBACK(logical_op_changed), &controls,
                                  args->logical,
                                  "A", GRAIN_LOGICAL_A,
                                  "A ∧ B", GRAIN_LOGICAL_A_AND_B,
                                  "A ∨ B", GRAIN_LOGICAL_A_OR_B,
                                  "A ∧ B ∧ C", GRAIN_LOGICAL_A_AND_B_AND_C,
                                  "A ∨ B ∨ C", GRAIN_LOGICAL_A_OR_B_OR_C,
                                  "(A ∧ B) ∨ C", GRAIN_LOGICAL_A_AND_B_OR_C,
                                  "(A ∨ B) ∧ C", GRAIN_LOGICAL_A_OR_B_AND_C,
                                  NULL);
    gwy_table_attach_hscale(table, row++,
                            _("Keep grains satisfying:"), NULL,
                            GTK_OBJECT(controls.logical_op),
                            GWY_HSCALE_WIDGET);

    for (i = 0; i < NQUANTITIES; i++) {
        gtk_table_set_row_spacing(GTK_TABLE(table), row-1, 8);

        controls.header[i] = gtk_label_new(NULL);
        gtk_misc_set_alignment(GTK_MISC(controls.header[i]), 0.0, 0.5);
        gtk_table_attach(GTK_TABLE(table), controls.header[i],
                         0, 4, row, row+1, GTK_FILL, 0, 0, 0);
        row++;

        /* The values are set properly later. */
        controls.lower_label[i] = gtk_label_new(_("Lower threshold:"));
        gtk_misc_set_alignment(GTK_MISC(controls.lower_label[i]), 0.0, 0.5);
        gtk_table_attach(GTK_TABLE(table), controls.lower_label[i],
                         0, 1, row, row+1, GTK_FILL, 0, 0, 0);

        controls.lower[i] = gtk_adjustment_new(0.0, 0.0, 0.0,
                                               1.0, 10.0, 0.0);
        g_object_set_data(G_OBJECT(controls.lower[i]), "id",
                          GUINT_TO_POINTER(i));
        g_signal_connect_swapped(controls.lower[i], "value-changed",
                                 G_CALLBACK(threshold_changed), &controls);
        controls.lower_scale[i]
            = gtk_hscale_new(GTK_ADJUSTMENT(controls.lower[i]));
        gtk_scale_set_draw_value(GTK_SCALE(controls.lower_scale[i]), FALSE);
        gtk_widget_set_size_request(controls.lower_scale[i],
                                    GWY_HSCALE_WIDTH, -1);
        gtk_table_attach(GTK_TABLE(table), controls.lower_scale[i],
                         1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0);

        controls.lower_entry[i] = gtk_entry_new();
        gtk_entry_set_width_chars(GTK_ENTRY(controls.lower_entry[i]), 8);
        gtk_table_attach(GTK_TABLE(table), controls.lower_entry[i],
                         2, 3, row, row+1, GTK_FILL, 0, 0, 0);
        gwy_widget_set_activate_on_unfocus(controls.lower_entry[i], TRUE);
        g_object_set_data(G_OBJECT(controls.lower_entry[i]), "id",
                          GUINT_TO_POINTER(i));
        g_signal_connect_swapped(controls.lower_entry[i], "activate",
                                 G_CALLBACK(threshold_activated), &controls);

        controls.lower_units[i] = gtk_label_new(NULL);
        gtk_misc_set_alignment(GTK_MISC(controls.lower_units[i]), 0.0, 0.5);
        gtk_table_attach(GTK_TABLE(table), controls.lower_units[i],
                         3, 4, row, row+1, GTK_FILL, 0, 0, 0);
        row++;

        controls.upper_label[i] = gtk_label_new(_("Upper threshold:"));
        gtk_misc_set_alignment(GTK_MISC(controls.upper_label[i]), 0.0, 0.5);
        gtk_table_attach(GTK_TABLE(table), controls.upper_label[i],
                         0, 1, row, row+1, GTK_FILL, 0, 0, 0);

        controls.upper[i] = gtk_adjustment_new(0.0, 0.0, 0.0,
                                               1.0, 10.0, 0.0);
        g_object_set_data(G_OBJECT(controls.upper[i]), "id",
                          GUINT_TO_POINTER(i | IS_UPPER));
        g_signal_connect_swapped(controls.upper[i], "value-changed",
                                 G_CALLBACK(threshold_changed), &controls);
        controls.upper_scale[i]
            = gtk_hscale_new(GTK_ADJUSTMENT(controls.upper[i]));
        gtk_scale_set_draw_value(GTK_SCALE(controls.upper_scale[i]), FALSE);
        gtk_widget_set_size_request(controls.upper_scale[i],
                                    GWY_HSCALE_WIDTH, -1);
        gtk_table_attach(GTK_TABLE(table), controls.upper_scale[i],
                         1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0);

        controls.upper_entry[i] = gtk_entry_new();
        gtk_entry_set_width_chars(GTK_ENTRY(controls.upper_entry[i]), 8);
        gtk_table_attach(GTK_TABLE(table), controls.upper_entry[i],
                         2, 3, row, row+1, GTK_FILL, 0, 0, 0);
        gwy_widget_set_activate_on_unfocus(controls.upper_entry[i], TRUE);
        g_object_set_data(G_OBJECT(controls.upper_entry[i]), "id",
                          GUINT_TO_POINTER(i | IS_UPPER));
        g_signal_connect_swapped(controls.upper_entry[i], "activate",
                                 G_CALLBACK(threshold_activated), &controls);

        controls.upper_units[i] = gtk_label_new(NULL);
        gtk_misc_set_alignment(GTK_MISC(controls.upper_units[i]), 0.0, 0.5);
        gtk_table_attach(GTK_TABLE(table), controls.upper_units[i],
                         3, 4, row, row+1, GTK_FILL, 0, 0, 0);
        row++;
    }

    for (i = 0; i < NQUANTITIES; i++) {
        GwyInventory *inventory;
        GwyGrainValue *gvalue;

        inventory = gwy_grain_values();
        gvalue = gwy_inventory_get_item(inventory, args->ranges[i].quantity);
        set_up_quantity(&controls, gvalue, i);
    }
    logical_op_changed(GTK_COMBO_BOX(controls.logical_op), &controls);

    /* finished initializing, allow instant updates */
    controls.in_init = FALSE;
    gfilter_invalidate(&controls);

    gtk_widget_show_all(dialog);
    do {
        response = gtk_dialog_run(GTK_DIALOG(dialog));
        switch (response) {
            case GTK_RESPONSE_CANCEL:
            case GTK_RESPONSE_DELETE_EVENT:
            args->expanded = gwy_grain_value_tree_view_get_expanded_groups
                                             (GTK_TREE_VIEW(controls.values));
            for (i = 0; i < NQUANTITIES; i++)
                gwy_si_unit_value_format_free(controls.vf[i]);
            gtk_widget_destroy(dialog);
            case GTK_RESPONSE_NONE:
            g_object_unref(controls.mydata);
            gfilter_save_args(gwy_app_settings_get(), args);
            return;
            break;

            case GTK_RESPONSE_OK:
            break;

            case RESPONSE_PREVIEW:
            preview(&controls);
            break;

            default:
            g_assert_not_reached();
            break;
        }
    } while (response != GTK_RESPONSE_OK);

    for (i = 0; i < NQUANTITIES; i++)
        gwy_si_unit_value_format_free(controls.vf[i]);
    args->expanded = gwy_grain_value_tree_view_get_expanded_groups
                                             (GTK_TREE_VIEW(controls.values));
    gwy_app_sync_data_items(controls.mydata, data, 0, id, FALSE,
                            GWY_DATA_ITEM_MASK_COLOR,
                            0);
    gtk_widget_destroy(dialog);

    gfilter_save_args(gwy_app_settings_get(), args);

    if (controls.computed) {
        mfield = gwy_container_get_object_by_name(controls.mydata, "/0/mask");
        gwy_app_undo_qcheckpointv(data, 1, &mquark);
        gwy_container_set_object(data, mquark, mfield);
        g_object_unref(controls.mydata);
    }
    else {
        g_object_unref(controls.mydata);
        run_noninteractive(args, data, controls.mask, mquark);
    }

    gwy_app_channel_log_add_proc(data, id, id);
}
예제 #16
0
파일: project.c 프로젝트: cirne100/geany
void project_new(void)
{
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *image;
	GtkWidget *button;
	GtkWidget *bbox;
	GtkWidget *label;
	PropertyDialogElements *e;

	if (! project_ask_close())
		return;

	g_return_if_fail(app->project == NULL);

	e = g_new0(PropertyDialogElements, 1);
	e->dialog = gtk_dialog_new_with_buttons(_("New Project"), GTK_WINDOW(main_widgets.window),
										 GTK_DIALOG_DESTROY_WITH_PARENT,
										 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);

	gtk_widget_set_name(e->dialog, "GeanyDialogProject");
	bbox = gtk_hbox_new(FALSE, 0);
	button = gtk_button_new();
	image = gtk_image_new_from_stock(GTK_STOCK_NEW, GTK_ICON_SIZE_BUTTON);
	label = gtk_label_new_with_mnemonic(_("C_reate"));
	gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 3);
	gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 3);
	gtk_container_add(GTK_CONTAINER(button), bbox);
	gtk_dialog_add_action_widget(GTK_DIALOG(e->dialog), button, GTK_RESPONSE_OK);

	vbox = ui_dialog_vbox_new(GTK_DIALOG(e->dialog));

	entries_modified = FALSE;

	table = gtk_table_new(3, 2, FALSE);
	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
	gtk_table_set_col_spacings(GTK_TABLE(table), 10);

	label = gtk_label_new(_("Name:"));
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	e->name = gtk_entry_new();
	ui_entry_add_clear_icon(GTK_ENTRY(e->name));
	gtk_entry_set_max_length(GTK_ENTRY(e->name), MAX_NAME_LEN);

	ui_table_add_row(GTK_TABLE(table), 0, label, e->name, NULL);

	label = gtk_label_new(_("Filename:"));
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	e->file_name = gtk_entry_new();
	ui_entry_add_clear_icon(GTK_ENTRY(e->file_name));
	gtk_entry_set_width_chars(GTK_ENTRY(e->file_name), 30);
	button = gtk_button_new();
	g_signal_connect(button, "clicked", G_CALLBACK(on_file_save_button_clicked), e);
	image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
	gtk_container_add(GTK_CONTAINER(button), image);
	bbox = gtk_hbox_new(FALSE, 6);
	gtk_box_pack_start_defaults(GTK_BOX(bbox), e->file_name);
	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);

	ui_table_add_row(GTK_TABLE(table), 1, label, bbox, NULL);

	label = gtk_label_new(_("Base path:"));
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	e->base_path = gtk_entry_new();
	ui_entry_add_clear_icon(GTK_ENTRY(e->base_path));
	gtk_widget_set_tooltip_text(e->base_path,
		_("Base directory of all files that make up the project. "
		"This can be a new path, or an existing directory tree. "
		"You can use paths relative to the project filename."));
	bbox = ui_path_box_new(_("Choose Project Base Path"),
		GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(e->base_path));

	ui_table_add_row(GTK_TABLE(table), 2, label, bbox, NULL);

	gtk_container_add(GTK_CONTAINER(vbox), table);

	/* signals */
	g_signal_connect(e->name, "changed", G_CALLBACK(on_name_entry_changed), e);
	/* run the callback manually to initialise the base_path and file_name fields */
	on_name_entry_changed(GTK_EDITABLE(e->name), e);

	g_signal_connect(e->file_name, "changed", G_CALLBACK(on_entries_changed), e);
	g_signal_connect(e->base_path, "changed", G_CALLBACK(on_entries_changed), e);

	gtk_widget_show_all(e->dialog);

	while (gtk_dialog_run(GTK_DIALOG(e->dialog)) == GTK_RESPONSE_OK)
	{
		if (update_config(e, TRUE))
		{
			if (!write_config(TRUE))
				SHOW_ERR(_("Project file could not be written"));
			else
			{
				ui_set_statusbar(TRUE, _("Project \"%s\" created."), app->project->name);

				ui_add_recent_project_file(app->project->file_name);
				break;
			}
		}
	}
	gtk_widget_destroy(e->dialog);
	g_free(e);
}
예제 #17
0
GtkWidget	*create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *label1;
  GtkWidget *hscaleQual;
  GtkWidget *checkbuttonUV;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Mjpeg Codec settings"));

  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);

  label1 = gtk_label_new (_("Quality"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  hscaleAdj=gtk_adjustment_new (0, 0, 100, 0, 0, 0);
  hscaleQual = gtk_hscale_new (GTK_ADJUSTMENT (hscaleAdj));
  gtk_widget_show (hscaleQual);
  gtk_box_pack_start (GTK_BOX (vbox1), hscaleQual, FALSE, FALSE, 0);
  gtk_scale_set_digits (GTK_SCALE (hscaleQual), 0);

  checkbuttonUV = gtk_check_button_new_with_mnemonic (_("Swap U & V"));
  gtk_widget_show (checkbuttonUV);
  gtk_box_pack_start (GTK_BOX (vbox1), checkbuttonUV, FALSE, FALSE, 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, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleQual, "hscaleQual");
  GLADE_HOOKUP_OBJECT (dialog1, checkbuttonUV, "checkbuttonUV");
  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;
}
예제 #18
0
void
greeter_session_init (void)
{
    GtkWidget *w = NULL;
    GtkWidget *hbox = NULL;
    GtkWidget *main_vbox = NULL;
    GtkWidget *vbox = NULL;
    GtkWidget *cat_vbox = NULL;
    GtkWidget *radio;
    GtkWidget *dialog;
    GtkWidget *button;
    GList *tmp;
    static GtkTooltips *tooltips = NULL;
    GtkRequisition req;
    char *s;
    int num = 1;
    char *label;

    greeter_set_session (NULL);

    session_dialog = dialog = gtk_dialog_new ();
    if (tooltips == NULL)
        tooltips = gtk_tooltips_new ();

    gtk_dialog_add_button (GTK_DIALOG (dialog),
                           GTK_STOCK_CANCEL,
                           GTK_RESPONSE_CANCEL);

    button = gtk_button_new_with_mnemonic (_("Change _Session"));
    GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
    gtk_widget_show (button);
    gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
                                  GTK_RESPONSE_OK);

    gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
    gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
    gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
    gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);

    main_vbox = gtk_vbox_new (FALSE, 18);
    gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 5);
    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
                        main_vbox,
                        FALSE, FALSE, 0);

    cat_vbox = gtk_vbox_new (FALSE, 6);
    gtk_box_pack_start (GTK_BOX (main_vbox),
                        cat_vbox,
                        FALSE, FALSE, 0);

    s = g_strdup_printf ("<b>%s</b>", _("Sessions"));
    w = gtk_label_new (s);
    gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
    g_free (s);
    gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
    gtk_box_pack_start (GTK_BOX (cat_vbox), w, FALSE, FALSE, 0);

    hbox = gtk_hbox_new (FALSE, 0);
    gtk_box_pack_start (GTK_BOX (cat_vbox),
                        hbox, FALSE, FALSE, 0);
    gtk_box_pack_start (GTK_BOX (hbox),
                        gtk_label_new ("    "),
                        FALSE, FALSE, 0);
    vbox = gtk_vbox_new (FALSE, 6);
    /* we will pack this later depending on size */

    if (mdm_config_get_bool (MDM_KEY_SHOW_LAST_SESSION))
    {
        greeter_set_session (LAST_SESSION);

        radio = gtk_radio_button_new_with_mnemonic (session_group, _("_Last session"));
        g_object_set_data (G_OBJECT (radio),
                           SESSION_NAME,
                           LAST_SESSION);
        session_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
        gtk_tooltips_set_tip (tooltips, radio,
                              _("Log in using the session that you have used "
                                "last time you logged in"),
                              NULL);
        gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
        gtk_widget_show (radio);
    }

    mdm_session_list_init ();

    for (tmp = sessions; tmp != NULL; tmp = tmp->next)
    {
        MdmSession *session;
        char *file;

        file = (char *) tmp->data;
        session = g_hash_table_lookup (sessnames, file);

        if (num < 10 &&
                (strcmp (file, MDM_SESSION_FAILSAFE_GNOME) != 0) &&
                (strcmp (file, MDM_SESSION_FAILSAFE_XTERM) != 0))
            label = g_strdup_printf ("_%d. %s", num, session->name);
        else
            label = g_strdup (session->name);
        num++;

        radio = gtk_radio_button_new_with_mnemonic (session_group, label);
        g_free (label);
        g_object_set_data_full (G_OBJECT (radio), SESSION_NAME,
                                file, (GDestroyNotify) g_free);
        session_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
        gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
        gtk_widget_show (radio);

        if (! ve_string_empty (session->comment))
            gtk_tooltips_set_tip
            (tooltips, GTK_WIDGET (radio), session->comment, NULL);
    }

    gtk_widget_show_all (vbox);
    gtk_widget_size_request (vbox, &req);

    /* if too large */
    if (req.height > 0.7 * mdm_wm_screen.height) {
        GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL);
        gtk_widget_set_size_request (sw,
                                     req.width,
                                     0.7 * mdm_wm_screen.height);
        gtk_scrolled_window_set_shadow_type
        (GTK_SCROLLED_WINDOW (sw),
         GTK_SHADOW_NONE);
        gtk_scrolled_window_set_policy
        (GTK_SCROLLED_WINDOW (sw),
         GTK_POLICY_NEVER,
         GTK_POLICY_AUTOMATIC);
        gtk_scrolled_window_add_with_viewport
        (GTK_SCROLLED_WINDOW (sw), vbox);
        gtk_widget_show (sw);
        gtk_box_pack_start (GTK_BOX (hbox),
                            sw,
                            TRUE, TRUE, 0);
    } else {
        gtk_box_pack_start (GTK_BOX (hbox),
                            vbox,
                            TRUE, TRUE, 0);
    }
}
예제 #19
0
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *entryVob;
  GtkWidget *entryIfo;
  GtkWidget *entryVobSub;
  GtkWidget *buttonVob;
  GtkWidget *buttonIfo;
  GtkWidget *buttonVobSub;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Vob to Vobsub"));
  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 (3, 3, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), table1, TRUE, TRUE, 0);

  label1 = gtk_label_new (_("Vob :"));
  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);

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

  label3 = gtk_label_new (_("Output vobsub (.idx) :"));
  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);

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

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

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

  buttonVob = gtk_button_new_from_stock ("gtk-open");
  gtk_widget_show (buttonVob);
  gtk_table_attach (GTK_TABLE (table1), buttonVob, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  buttonIfo = gtk_button_new_from_stock ("gtk-open");
  gtk_widget_show (buttonIfo);
  gtk_table_attach (GTK_TABLE (table1), buttonIfo, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  buttonVobSub = gtk_button_new_from_stock ("gtk-open");
  gtk_widget_show (buttonVobSub);
  gtk_table_attach (GTK_TABLE (table1), buttonVobSub, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 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, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, entryVob, "entryVob");
  GLADE_HOOKUP_OBJECT (dialog1, entryIfo, "entryIfo");
  GLADE_HOOKUP_OBJECT (dialog1, entryVobSub, "entryVobSub");
  GLADE_HOOKUP_OBJECT (dialog1, buttonVob, "buttonVob");
  GLADE_HOOKUP_OBJECT (dialog1, buttonIfo, "buttonIfo");
  GLADE_HOOKUP_OBJECT (dialog1, buttonVobSub, "buttonVobSub");
  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;
}
예제 #20
0
void create_TextProfileDialog (CTextProfile *tp)
{
    GtkWidget *TextEncoderDialog;
    GtkWidget *dialog_vbox11;
    GtkWidget *table8;
    GtkWidget *TextEncodingOptionMenu;
    GtkWidget *label211;
    GtkWidget *label212;
    GtkObject *TextRepeatTimeSpinner_adj;
    GtkWidget *TextRepeatTimeSpinner;
    GtkWidget *label213;
    GtkWidget *TextProfileEntry;
    GtkWidget *dialog_action_area10;
    GtkWidget *cancelbutton8;
    GtkWidget *okbutton10;

    TextEncoderDialog = gtk_dialog_new();
    gtk_window_set_title(GTK_WINDOW(TextEncoderDialog), _("Text Encoder"));
    gtk_window_set_modal(GTK_WINDOW(TextEncoderDialog), TRUE);
    gtk_window_set_resizable(GTK_WINDOW(TextEncoderDialog), FALSE);

    dialog_vbox11 = GTK_DIALOG(TextEncoderDialog)->vbox;
    gtk_widget_show(dialog_vbox11);

    table8 = gtk_table_new(3, 2, TRUE);
    gtk_widget_show(table8);
    gtk_box_pack_start(GTK_BOX(dialog_vbox11), table8, TRUE, TRUE, 0);
    gtk_table_set_row_spacings(GTK_TABLE(table8), 11);
    gtk_table_set_col_spacings(GTK_TABLE(table8), 7);

    TextEncodingOptionMenu = gtk_option_menu_new();
    gtk_widget_show(TextEncodingOptionMenu);
    gtk_table_attach(GTK_TABLE(table8), TextEncodingOptionMenu, 1, 2, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);

    label211 = gtk_label_new(_("Text Encoder:"));
    gtk_widget_show(label211);
    gtk_table_attach(GTK_TABLE(table8), label211, 0, 1, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label211), 0, 0.5);

    label212 = gtk_label_new(_("Repeat Time:"));
    gtk_widget_show(label212);
    gtk_table_attach(GTK_TABLE(table8), label212, 0, 1, 2, 3,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label212), 0, 0.5);

    TextRepeatTimeSpinner_adj = gtk_adjustment_new(tp != NULL ? tp->GetFloatValue(CFG_TEXT_REPEAT_TIME_SECS) : 1, 0, 100, 1, 10, 10);
    TextRepeatTimeSpinner = gtk_spin_button_new(GTK_ADJUSTMENT(TextRepeatTimeSpinner_adj), 1, 1);
    gtk_widget_show(TextRepeatTimeSpinner);
    gtk_table_attach(GTK_TABLE(table8), TextRepeatTimeSpinner, 1, 2, 2, 3,
                     (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(TextRepeatTimeSpinner), TRUE);

    label213 = gtk_label_new(_("Text Profile:"));
    gtk_widget_show(label213);
    gtk_table_attach(GTK_TABLE(table8), label213, 0, 1, 0, 1,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label213), 0, 0.5);

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

    dialog_action_area10 = GTK_DIALOG(TextEncoderDialog)->action_area;
    gtk_widget_show(dialog_action_area10);
    gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area10), GTK_BUTTONBOX_END);

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

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

    g_signal_connect((gpointer) TextEncoderDialog, "response",
                     G_CALLBACK(on_TextEncoderDialog_response),
                     tp);

    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, TextEncoderDialog, "TextEncoderDialog");
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, dialog_vbox11, "dialog_vbox11");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, table8, "table8");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, TextEncodingOptionMenu, "TextEncodingOptionMenu");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, label211, "label211");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, label212, "label212");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, TextRepeatTimeSpinner, "TextRepeatTimeSpinner");
    GLADE_HOOKUP_OBJECT (TextEncoderDialog, label213, "label213");
    GLADE_HOOKUP_OBJECT (TextEncoderDialog, TextProfileEntry, "TextProfileEntry");
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, dialog_action_area10, "dialog_action_area10");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, cancelbutton8, "cancelbutton8");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, okbutton10, "okbutton10");

    uint encoderIndex = 0;
    uint ix = 0;
    encoderNames = (const char **)malloc(text_encoder_table_size *
                                         sizeof(const char *));
    for (ix = 0; ix < text_encoder_table_size; ix++) {
        if (tp != NULL &&
                strcasecmp(tp->GetStringValue(CFG_TEXT_ENCODING),
                           text_encoder_table[ix].text_encoding) == 0) {
            encoderIndex = ix;
        }
        encoderNames[ix] = text_encoder_table[ix].dialog_selection_name;
    }
    CreateOptionMenu(TextEncodingOptionMenu,
                     encoderNames,
                     text_encoder_table_size,
                     encoderIndex);
    if (tp != NULL) {
        gtk_entry_set_text(GTK_ENTRY(TextProfileEntry),
                           tp->GetStringValue(CFG_TEXT_PROFILE_NAME));
        gtk_widget_set_sensitive(TextProfileEntry, false);
    }
    gtk_widget_show(TextEncoderDialog);

}
예제 #21
0
void
create_login (HWND hwnd, LPCSTR username, LPCSTR password, LPCSTR dsn,
    TLOGIN *log_t)
{
  GtkWidget *login;
  GtkWidget *dialog_vbox8;
  GtkWidget *frame99;
  GtkWidget *alignment83;
  GtkWidget *table9;
  GtkWidget *label165;
  GtkWidget *t_user;
  GtkWidget *t_password;
  GtkWidget *label164;
  GtkWidget *dialog_action_area8;
  GtkWidget *b_ok;
  GtkWidget *b_cancel;
  char buff[1024];

  if (hwnd == (HWND) - 1L)
    {
      gtk_init (0, NULL);
      hwnd = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    }

  if (hwnd == NULL || !GTK_IS_WIDGET (hwnd))
    return;

  login = gtk_dialog_new ();
  gtk_widget_set_name (login, "login");
  gtk_widget_set_size_request (login, 400, 150);
  sprintf (buff, "Login for DSN %s ...", (dsn) ? dsn : "Unknown");
  gtk_window_set_title (GTK_WINDOW (login), buff);
  gtk_window_set_position (GTK_WINDOW (login), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (login), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (login), 400, 150);
  gtk_window_set_type_hint (GTK_WINDOW (login), GDK_WINDOW_TYPE_HINT_DIALOG);

#if GTK_CHECK_VERSION(2,0,0)
  gtk_widget_show (login);
#endif

  dialog_vbox8 = GTK_DIALOG (login)->vbox;
  gtk_widget_set_name (dialog_vbox8, "dialog_vbox8");
  gtk_widget_show (dialog_vbox8);

  frame99 = gtk_frame_new (NULL);
  gtk_widget_set_name (frame99, "frame99");
  gtk_widget_show (frame99);
  gtk_box_pack_start (GTK_BOX (dialog_vbox8), frame99, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame99), GTK_SHADOW_NONE);

  alignment83 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_set_name (alignment83, "alignment83");
  gtk_widget_show (alignment83);
  gtk_container_add (GTK_CONTAINER (frame99), alignment83);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment83), 4, 0, 6, 7);

  table9 = gtk_table_new (2, 2, FALSE);
  gtk_widget_set_name (table9, "table9");
  gtk_widget_show (table9);
  gtk_container_add (GTK_CONTAINER (alignment83), table9);
  gtk_table_set_row_spacings (GTK_TABLE (table9), 10);
  gtk_table_set_col_spacings (GTK_TABLE (table9), 6);

  label165 = gtk_label_new (_("Password :"******"label165");
  gtk_widget_show (label165);
  gtk_table_attach (GTK_TABLE (table9), label165, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label165), 0, 0.5);

  t_user = gtk_entry_new ();
  gtk_widget_set_name (t_user, "t_user");
  gtk_widget_show (t_user);
  gtk_table_attach (GTK_TABLE (table9), t_user, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  if (username && STRLEN (username))
    gtk_entry_set_text (GTK_ENTRY (t_user), username);

  t_password = gtk_entry_new ();
  gtk_widget_set_name (t_password, "t_password");
  gtk_widget_show (t_password);
  gtk_table_attach (GTK_TABLE (table9), t_password, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_entry_set_visibility (GTK_ENTRY (t_password), FALSE);
  if (password && STRLEN (password))
    gtk_entry_set_text (GTK_ENTRY (t_password), password);

  label164 = gtk_label_new (_("Username :"******"label164");
  gtk_widget_show (label164);
  gtk_table_attach (GTK_TABLE (table9), label164, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label164), 0, 0.5);

  dialog_action_area8 = GTK_DIALOG (login)->action_area;
  gtk_widget_set_name (dialog_action_area8, "dialog_action_area8");
  gtk_widget_show (dialog_action_area8);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area8), GTK_BUTTONBOX_END);

  b_cancel = gtk_button_new_from_stock ("gtk-cancel");
  gtk_widget_set_name (b_cancel, "b_cancel");
  gtk_widget_show (b_cancel);
  gtk_dialog_add_action_widget (GTK_DIALOG (login), b_cancel, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (b_cancel, GTK_CAN_DEFAULT);

  b_ok = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_set_name (b_ok, "b_ok");
  gtk_widget_show (b_ok);
  gtk_dialog_add_action_widget (GTK_DIALOG (login), b_ok, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (b_ok, GTK_CAN_DEFAULT);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (login, login, "login");
  GLADE_HOOKUP_OBJECT_NO_REF (login, dialog_vbox8, "dialog_vbox8");
  GLADE_HOOKUP_OBJECT (login, frame99, "frame99");
  GLADE_HOOKUP_OBJECT (login, alignment83, "alignment83");
  GLADE_HOOKUP_OBJECT (login, table9, "table9");
  GLADE_HOOKUP_OBJECT (login, label165, "label165");
  GLADE_HOOKUP_OBJECT (login, t_user, "t_user");
  GLADE_HOOKUP_OBJECT (login, t_password, "t_password");
  GLADE_HOOKUP_OBJECT (login, label164, "label164");
  GLADE_HOOKUP_OBJECT_NO_REF (login, dialog_action_area8, "dialog_action_area8");
  GLADE_HOOKUP_OBJECT (login, b_ok, "b_ok");
  GLADE_HOOKUP_OBJECT (login, b_cancel, "b_cancel");

  /* Ok button events */
  gtk_signal_connect (GTK_OBJECT (b_ok), "clicked",
      GTK_SIGNAL_FUNC (login_ok_clicked), log_t);
  /* Cancel button events */
  gtk_signal_connect (GTK_OBJECT (b_cancel), "clicked",
      GTK_SIGNAL_FUNC (login_cancel_clicked), log_t);
  /* Close window button events */
  gtk_signal_connect (GTK_OBJECT (login), "delete_event",
      GTK_SIGNAL_FUNC (delete_event), log_t);
  gtk_signal_connect (GTK_OBJECT (login), "destroy",
      GTK_SIGNAL_FUNC (gtk_main_quit), NULL);

  log_t->username = t_user;
  log_t->password = t_password;
  log_t->user = log_t->pwd = NULL;
  log_t->mainwnd = login;

  gtk_widget_show_all (login);
  gtk_main ();
}
예제 #22
0
void create_TextSourceDialog (void)
{
    GtkWidget *TextSourceDialog;
    GtkWidget *dialog_vbox10;
    GtkWidget *table7;
    GtkWidget *label193;
    GtkWidget *TextSourceMenu;
    GtkWidget *menu17;
    GtkWidget *text_entry_dialog1;
    GtkWidget *timed_from_file1;
    GtkWidget *file_with_queued_dialog1;
    GtkWidget *label194;
    GtkWidget *hbox103;
    GtkWidget *TextFileEntry;
    GtkWidget *FileBrowseButton;
    GtkWidget *alignment27;
    GtkWidget *hbox104;
    GtkWidget *image33;
    GtkWidget *label195;
    GtkWidget *dialog_action_area9;
    GtkWidget *cancelbutton7;
    GtkWidget *okbutton9;

    TextSourceDialog = gtk_dialog_new();
    gtk_window_set_title(GTK_WINDOW(TextSourceDialog), _("Text Source"));
    gtk_window_set_modal(GTK_WINDOW(TextSourceDialog), TRUE);

    dialog_vbox10 = GTK_DIALOG(TextSourceDialog)->vbox;
    gtk_widget_show(dialog_vbox10);

    table7 = gtk_table_new(2, 2, FALSE);
    gtk_widget_show(table7);
    gtk_box_pack_start(GTK_BOX(dialog_vbox10), table7, TRUE, TRUE, 2);
    gtk_table_set_row_spacings(GTK_TABLE(table7), 9);
    gtk_table_set_col_spacings(GTK_TABLE(table7), 17);

    label193 = gtk_label_new(_("Text Source:"));
    gtk_widget_show(label193);
    gtk_table_attach(GTK_TABLE(table7), label193, 0, 1, 0, 1,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label193), 0, 0.5);

    TextSourceMenu = gtk_option_menu_new();
    gtk_widget_show(TextSourceMenu);
    gtk_table_attach(GTK_TABLE(table7), TextSourceMenu, 1, 2, 0, 1,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);

    menu17 = gtk_menu_new();

    text_entry_dialog1 = gtk_menu_item_new_with_mnemonic(_("Dialog with Text Entry"));
    gtk_widget_show(text_entry_dialog1);
    gtk_container_add(GTK_CONTAINER(menu17), text_entry_dialog1);

    timed_from_file1 = gtk_menu_item_new_with_mnemonic(_("File with Timing Info"));
    gtk_widget_show(timed_from_file1);
    gtk_container_add(GTK_CONTAINER(menu17), timed_from_file1);

    file_with_queued_dialog1 = gtk_menu_item_new_with_mnemonic(_("Dialog Using File"));
    gtk_widget_show(file_with_queued_dialog1);
    gtk_container_add(GTK_CONTAINER(menu17), file_with_queued_dialog1);

    gtk_option_menu_set_menu(GTK_OPTION_MENU(TextSourceMenu), menu17);

    label194 = gtk_label_new(_("File:"));
    gtk_widget_show(label194);
    gtk_table_attach(GTK_TABLE(table7), label194, 0, 1, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label194), 0, 0.5);

    hbox103 = gtk_hbox_new(FALSE, 0);
    gtk_widget_show(hbox103);
    gtk_table_attach(GTK_TABLE(table7), hbox103, 1, 2, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(GTK_FILL), 0, 0);

    TextFileEntry = gtk_entry_new();
    gtk_widget_show(TextFileEntry);
    gtk_box_pack_start(GTK_BOX(hbox103), TextFileEntry, TRUE, TRUE, 0);

    FileBrowseButton = gtk_button_new();
    gtk_widget_show(FileBrowseButton);
    gtk_box_pack_start(GTK_BOX(hbox103), FileBrowseButton, FALSE, FALSE, 0);

    alignment27 = gtk_alignment_new(0.5, 0.5, 0, 0);
    gtk_widget_show(alignment27);
    gtk_container_add(GTK_CONTAINER(FileBrowseButton), alignment27);

    hbox104 = gtk_hbox_new(FALSE, 2);
    gtk_widget_show(hbox104);
    gtk_container_add(GTK_CONTAINER(alignment27), hbox104);

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

    label195 = gtk_label_new_with_mnemonic(_("Browse"));
    gtk_widget_show(label195);
    gtk_box_pack_start(GTK_BOX(hbox104), label195, FALSE, FALSE, 0);

    dialog_action_area9 = GTK_DIALOG(TextSourceDialog)->action_area;
    gtk_widget_show(dialog_action_area9);
    gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area9), GTK_BUTTONBOX_END);

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

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

    g_signal_connect((gpointer) TextSourceDialog, "response",
                     G_CALLBACK(on_TextSourceDialog_response),
                     NULL);
    g_signal_connect((gpointer) TextSourceMenu, "changed",
                     G_CALLBACK(on_TextSourceMenu_changed),
                     TextSourceDialog);
    g_signal_connect((gpointer) FileBrowseButton, "clicked",
                     G_CALLBACK(on_FileBrowseButton_clicked),
                     TextSourceDialog);

    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF(TextSourceDialog, TextSourceDialog, "TextSourceDialog");
    GLADE_HOOKUP_OBJECT_NO_REF(TextSourceDialog, dialog_vbox10, "dialog_vbox10");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, table7, "table7");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, label193, "label193");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, TextSourceMenu, "TextSourceMenu");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, menu17, "menu17");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, text_entry_dialog1, "text_entry_dialog1");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, timed_from_file1, "timed_from_file1");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, file_with_queued_dialog1, "file_with_queued_dialog1");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, label194, "label194");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, hbox103, "hbox103");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, TextFileEntry, "TextFileEntry");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, FileBrowseButton, "FileBrowseButton");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, alignment27, "alignment27");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, hbox104, "hbox104");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, image33, "image33");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, label195, "label195");
    GLADE_HOOKUP_OBJECT_NO_REF(TextSourceDialog, dialog_action_area9, "dialog_action_area9");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, cancelbutton7, "cancelbutton7");
    GLADE_HOOKUP_OBJECT(TextSourceDialog, okbutton9, "okbutton9");

    const char *type = MyConfig->GetStringValue(CONFIG_TEXT_SOURCE_TYPE);
    uint index = 0;
    if (strcmp(type, TEXT_SOURCE_TIMED_FILE) == 0) {
        index = 1;
    } else if (strcmp(type, TEXT_SOURCE_DIALOG) == 0) {
        index = 0;
    } else if (strcmp(type, TEXT_SOURCE_FILE_WITH_DIALOG) == 0) {
        index = 2;
    }
    gtk_option_menu_set_history(GTK_OPTION_MENU(TextSourceMenu), index);
    const char *file = MyConfig->GetStringValue(CONFIG_TEXT_SOURCE_FILE_NAME);
    if (file != NULL) {
        gtk_entry_set_text(GTK_ENTRY(TextFileEntry), file);
    }
    EnableFromTextMenu(TextSourceDialog, index);
    gtk_widget_show(TextSourceDialog);
}
dialogo_propiedades_red_t * dialogo_propiedades_red_crear() {
    dialogo_propiedades_red_t * dialogo_propiedades_red =
        (dialogo_propiedades_red_t*)malloc(sizeof(dialogo_propiedades_red_t));

    dialogo_propiedades_red->rbt_ordenes_group = NULL;
    dialogo_propiedades_red->dlg_propiedades_red = gtk_dialog_new ();
    gtk_window_set_title (GTK_WINDOW (dialogo_propiedades_red->dlg_propiedades_red), "Propiedades de la red");

    dialogo_propiedades_red->dialog_vbox1 = GTK_DIALOG (dialogo_propiedades_red->dlg_propiedades_red)->vbox;
    gtk_widget_show (dialogo_propiedades_red->dialog_vbox1);

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

    dialogo_propiedades_red->label1 = gtk_label_new_with_mnemonic ("_Ruta del archivo:");
    gtk_widget_show (dialogo_propiedades_red->label1);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->vbox1), dialogo_propiedades_red->label1, FALSE, FALSE, 0);

    dialogo_propiedades_red->hbox1 = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (dialogo_propiedades_red->hbox1);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->vbox1), dialogo_propiedades_red->hbox1, TRUE, TRUE, 0);

    dialogo_propiedades_red->entry_ruta = gtk_entry_new ();
    gtk_widget_show (dialogo_propiedades_red->entry_ruta);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->hbox1), dialogo_propiedades_red->entry_ruta, TRUE, TRUE, 0);

    dialogo_propiedades_red->button1 = gtk_button_new ();
    gtk_widget_show (dialogo_propiedades_red->button1);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->hbox1), dialogo_propiedades_red->button1, FALSE, FALSE, 0);

    dialogo_propiedades_red->alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
    gtk_widget_show (dialogo_propiedades_red->alignment1);
    gtk_container_add (GTK_CONTAINER (dialogo_propiedades_red->button1), dialogo_propiedades_red->alignment1);

    dialogo_propiedades_red->hbox2 = gtk_hbox_new (FALSE, 2);
    gtk_widget_show (dialogo_propiedades_red->hbox2);
    gtk_container_add (GTK_CONTAINER (dialogo_propiedades_red->alignment1), dialogo_propiedades_red->hbox2);

    dialogo_propiedades_red->image1 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON);
    gtk_widget_show (dialogo_propiedades_red->image1);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->hbox2), dialogo_propiedades_red->image1, FALSE, FALSE, 0);

    dialogo_propiedades_red->label4 = gtk_label_new_with_mnemonic ("_...");
    gtk_widget_show (dialogo_propiedades_red->label4);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->hbox2), dialogo_propiedades_red->label4, FALSE, FALSE, 0);

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

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

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

    dialogo_propiedades_red->rbt_ordenes = gtk_radio_button_new_with_mnemonic (NULL, "\303\223_rdenes");
    gtk_widget_show (dialogo_propiedades_red->rbt_ordenes);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->vbox2), dialogo_propiedades_red->rbt_ordenes, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (dialogo_propiedades_red->rbt_ordenes), dialogo_propiedades_red->rbt_ordenes_group);
    dialogo_propiedades_red->rbt_ordenes_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (dialogo_propiedades_red->rbt_ordenes));

    dialogo_propiedades_red->rbt_parametros = gtk_radio_button_new_with_mnemonic (NULL, "P_ar\303\241metros");
    gtk_widget_show (dialogo_propiedades_red->rbt_parametros);
    gtk_box_pack_start (GTK_BOX (dialogo_propiedades_red->vbox2), dialogo_propiedades_red->rbt_parametros, FALSE, FALSE, 0);
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (dialogo_propiedades_red->rbt_parametros), dialogo_propiedades_red->rbt_ordenes_group);
    dialogo_propiedades_red->rbt_ordenes_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (dialogo_propiedades_red->rbt_parametros));

    dialogo_propiedades_red->label3 = gtk_label_new ("M\303\263dulo");
    gtk_widget_show (dialogo_propiedades_red->label3);
    gtk_frame_set_label_widget (GTK_FRAME (dialogo_propiedades_red->frame1), dialogo_propiedades_red->label3);

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

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

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

    g_signal_connect((gpointer) dialogo_propiedades_red->button1, "clicked",
                     G_CALLBACK(boton_abrir), dialogo_propiedades_red);

    return dialogo_propiedades_red;

}
예제 #24
0
GtkWidget*
create_vmmstatus (void)
{
  GtkWidget *vmmstatus;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *label1;
  GtkWidget *label5;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *dialog_action_area1;
  GtkWidget *closebutton1;

  vmmstatus = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (vmmstatus), _("VMM Status"));
  gtk_window_set_default_size (GTK_WINDOW (vmmstatus), 384, 384);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (vmmstatus), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (vmmstatus), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (vmmstatus)->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, TRUE, 0);

  label1 = gtk_label_new (_("Status:"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label1), 12, 12);

  label5 = gtk_label_new ("");
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox1), label5, TRUE, FALSE, 0);

  label2 = gtk_label_new ("");
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label2), 12, 12);

  label3 = gtk_label_new ("");
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (vbox1), label3, TRUE, TRUE, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0);
  gtk_misc_set_padding (GTK_MISC (label3), 12, 12);

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

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

  g_signal_connect ((gpointer) vmmstatus, "destroy",
                    G_CALLBACK (on_dialog1_destroy),
                    NULL);
  g_signal_connect ((gpointer) closebutton1, "clicked",
                    G_CALLBACK (on_closebutton1_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, vmmstatus, "vmmstatus");
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, label1, "label1");
  GLADE_HOOKUP_OBJECT (vmmstatus, label5, "label5");
  GLADE_HOOKUP_OBJECT (vmmstatus, label2, "label2");
  GLADE_HOOKUP_OBJECT (vmmstatus, label3, "label3");
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (vmmstatus, closebutton1, "closebutton1");

  return vmmstatus;
}
예제 #25
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;
}
예제 #26
0
static void
build_dialog_ui (GtkAppChooserDialog *self)
{
  GtkWidget *vbox;
  GtkWidget *vbox2;
  GtkWidget *label;
  GtkWidget *button, *w;

  gtk_container_set_border_width (GTK_CONTAINER (self), 5);

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
  gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (self))), vbox, TRUE, TRUE, 0);
  gtk_widget_show (vbox);

  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
  gtk_box_pack_start (GTK_BOX (vbox), vbox2, TRUE, TRUE, 0);
  gtk_widget_show (vbox2);

  self->priv->label = gtk_label_new ("");
  gtk_misc_set_alignment (GTK_MISC (self->priv->label), 0, 0.5);
  gtk_label_set_line_wrap (GTK_LABEL (self->priv->label), TRUE);
  gtk_box_pack_start (GTK_BOX (vbox2), self->priv->label,
                      FALSE, FALSE, 0);
  gtk_widget_show (self->priv->label);

  self->priv->app_chooser_widget =
    gtk_app_chooser_widget_new (self->priv->content_type);
  gtk_box_pack_start (GTK_BOX (vbox2), self->priv->app_chooser_widget, TRUE, TRUE, 0);
  gtk_widget_show (self->priv->app_chooser_widget);

  g_signal_connect (self->priv->app_chooser_widget, "application-selected",
                    G_CALLBACK (widget_application_selected_cb), self);
  g_signal_connect (self->priv->app_chooser_widget, "application-activated",
                    G_CALLBACK (widget_application_activated_cb), self);
  g_signal_connect (self->priv->app_chooser_widget, "notify::show-other",
                    G_CALLBACK (widget_notify_for_button_cb), self);
  g_signal_connect (self->priv->app_chooser_widget, "populate-popup",
                    G_CALLBACK (widget_populate_popup_cb), self);

  button = gtk_button_new_with_label (_("Show other applications"));
  self->priv->show_more_button = button;
  w = gtk_image_new_from_stock (GTK_STOCK_ADD,
                                GTK_ICON_SIZE_BUTTON);
  gtk_button_set_image (GTK_BUTTON (button), w);
  gtk_box_pack_start (GTK_BOX (self->priv->app_chooser_widget), button, FALSE, FALSE, 6);
  gtk_widget_show_all (button);

  g_signal_connect (button, "clicked",
                    G_CALLBACK (show_more_button_clicked_cb), self);

  gtk_dialog_add_button (GTK_DIALOG (self),
                         GTK_STOCK_CANCEL,
                         GTK_RESPONSE_CANCEL);

  /* Create a custom stock icon */
  self->priv->button = gtk_button_new ();

  label = gtk_label_new_with_mnemonic (_("_Select"));
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (self->priv->button));
  gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
  gtk_widget_show (label);
  self->priv->open_label = label;

  gtk_container_add (GTK_CONTAINER (self->priv->button),
                     self->priv->open_label);

  gtk_widget_show (self->priv->button);
  gtk_widget_set_can_default (self->priv->button, TRUE);

  gtk_dialog_add_action_widget (GTK_DIALOG (self),
                                self->priv->button, GTK_RESPONSE_OK);

  gtk_dialog_set_default_response (GTK_DIALOG (self),
                                   GTK_RESPONSE_OK);
}
예제 #27
0
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox2;
  GtkWidget *label24;
  GtkWidget *table4;
  GtkWidget *label25;
  GtkWidget *label26;
  GtkWidget *label_phasis;
  GtkWidget *label_frame;
  GtkWidget *label10;
  GtkWidget *label12;
  GtkWidget *label21;
  GtkWidget *label23;
  GtkWidget *Quantizer;
  GtkWidget *label15;
  GtkWidget *label17;
  GtkWidget *label19;
  GtkWidget *label_vcodec;
  GtkWidget *label_acodec;
  GtkWidget *label_fps;
  GtkWidget *label_bitrate;
  GtkWidget *label_quant;
  GtkWidget *label_vsize;
  GtkWidget *label_asize;
  GtkWidget *label_size;
  GtkWidget *label34;
  GtkWidget *label_eta;
  GtkWidget *progressbar1;
  GtkWidget *dialog_action_area1;
  GtkWidget *closebutton1;
  GtkWidget *alignment1;
  GtkWidget *hbox1;
  GtkWidget *image1;
  GtkWidget *label33;
  
   GtkWidget *label_c1,*label_container,*label90;

  dialog1 = gtk_dialog_new ();
  gtk_widget_set_size_request (dialog1, 500, -1);
  gtk_container_set_border_width (GTK_CONTAINER (dialog1), 13);
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Encoding in Progress"));
  gtk_dialog_set_has_separator (GTK_DIALOG (dialog1), FALSE);

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

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

  label24 = gtk_label_new (_("<b><big>Encoding files</big></b>"));
  gtk_widget_show (label24);
  gtk_box_pack_start (GTK_BOX (vbox2), label24, FALSE, FALSE, 0);
  gtk_label_set_use_markup (GTK_LABEL (label24), TRUE);
  gtk_label_set_justify (GTK_LABEL (label24), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5);

  table4 = gtk_table_new (11, 2, FALSE);
  gtk_widget_show (table4);
  gtk_box_pack_start (GTK_BOX (vbox2), table4, TRUE, TRUE, 0);
  gtk_table_set_row_spacings (GTK_TABLE (table4), 3);
  gtk_table_set_col_spacings (GTK_TABLE (table4), 5);

  label25 = gtk_label_new (_("<b>Phasis:</b>"));
  gtk_widget_show (label25);
  gtk_table_attach (GTK_TABLE (table4), label25, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label25), TRUE);
  gtk_label_set_justify (GTK_LABEL (label25), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label25), 12, 0);

  label26 = gtk_label_new (_("<b>Frame:</b>"));
  gtk_widget_show (label26);
  gtk_table_attach (GTK_TABLE (table4), label26, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label26), TRUE);
  gtk_label_set_justify (GTK_LABEL (label26), GTK_JUSTIFY_RIGHT);
  gtk_misc_set_alignment (GTK_MISC (label26), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label26), 12, 0);

  label_phasis = gtk_label_new (_("None"));
  gtk_widget_show (label_phasis);
  gtk_table_attach (GTK_TABLE (table4), label_phasis, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_phasis), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_phasis), 0, 0.5);

  label_frame = gtk_label_new (_("00000/00000"));
  gtk_widget_show (label_frame);
  gtk_table_attach (GTK_TABLE (table4), label_frame, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_frame), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_frame), 0, 0.5);

  label10 = gtk_label_new (_("<b>Vid codec:</b>"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table4), label10, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_set_size_request (label10, 75, -1);
  gtk_label_set_use_markup (GTK_LABEL (label10), TRUE);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label10), 12, 0);

  label12 = gtk_label_new (_("<b>Aud Codec:</b>"));
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table4), label12, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label12), TRUE);
  gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label12), 12, 0);

  label21 = gtk_label_new (_("<b>FPS:</b>"));
  gtk_widget_show (label21);
  gtk_table_attach (GTK_TABLE (table4), label21, 0, 1, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label21), TRUE);
  gtk_label_set_justify (GTK_LABEL (label21), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label21), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label21), 12, 0);

  label23 = gtk_label_new (_("<b>Vid Bitrate:</b>"));
  gtk_widget_show (label23);
  gtk_table_attach (GTK_TABLE (table4), label23, 0, 1, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label23), TRUE);
  gtk_label_set_justify (GTK_LABEL (label23), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label23), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label23), 12, 0);

  Quantizer = gtk_label_new (_("<b>Quantizer:</b>"));
  gtk_widget_show (Quantizer);
  gtk_table_attach (GTK_TABLE (table4), Quantizer, 0, 1, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (Quantizer), TRUE);
  gtk_label_set_justify (GTK_LABEL (Quantizer), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (Quantizer), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (Quantizer), 12, 0);

  label15 = gtk_label_new (_("<b>Video Size:</b>"));
  gtk_widget_show (label15);
  gtk_table_attach (GTK_TABLE (table4), label15, 0, 1, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_widget_set_size_request (label15, 75, -1);
  gtk_label_set_use_markup (GTK_LABEL (label15), TRUE);
  gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label15), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label15), 12, 0);

  label17 = gtk_label_new (_("<b>Audio Size:</b>"));
  gtk_widget_show (label17);
  gtk_table_attach (GTK_TABLE (table4), label17, 0, 1, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label17), TRUE);
  gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label17), 12, 0);

  label19 = gtk_label_new (_("<b>Total Size:</b>"));
  gtk_widget_show (label19);
  gtk_table_attach (GTK_TABLE (table4), label19, 0, 1, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label19), TRUE);
  gtk_label_set_justify (GTK_LABEL (label19), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label19), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label19), 12, 0);

  label_vcodec = gtk_label_new (_("None"));
  gtk_widget_show (label_vcodec);
  gtk_table_attach (GTK_TABLE (table4), label_vcodec, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_vcodec), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_vcodec), 0, 0.5);

  label_acodec = gtk_label_new (_("None"));
  gtk_widget_show (label_acodec);
  gtk_table_attach (GTK_TABLE (table4), label_acodec, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_acodec), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_acodec), 0, 0.5);

  label_fps = gtk_label_new (_("0"));
  gtk_widget_show (label_fps);
  gtk_table_attach (GTK_TABLE (table4), label_fps, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_fps), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_fps), 0, 0.5);

  label_bitrate = gtk_label_new (_("0"));
  gtk_widget_show (label_bitrate);
  gtk_table_attach (GTK_TABLE (table4), label_bitrate, 1, 2, 5, 6,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_bitrate), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_bitrate), 0, 0.5);

  label_quant = gtk_label_new (_("31"));
  gtk_widget_show (label_quant);
  gtk_table_attach (GTK_TABLE (table4), label_quant, 1, 2, 6, 7,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_quant), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_quant), 0, 0.5);

  label_vsize = gtk_label_new (_("0"));
  gtk_widget_show (label_vsize);
  gtk_table_attach (GTK_TABLE (table4), label_vsize, 1, 2, 7, 8,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_vsize), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_vsize), 0, 0.5);

  label_asize = gtk_label_new (_("0"));
  gtk_widget_show (label_asize);
  gtk_table_attach (GTK_TABLE (table4), label_asize, 1, 2, 8, 9,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_asize), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_asize), 0, 0.5);

  label_size = gtk_label_new (_("0"));
  gtk_widget_show (label_size);
  gtk_table_attach (GTK_TABLE (table4), label_size, 1, 2, 9, 10,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_size), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_size), 0, 0.5);

  label34 = gtk_label_new (_("<b>ETA:</b>"));
  gtk_widget_show (label34);
  gtk_table_attach (GTK_TABLE (table4), label34, 0, 1, 10, 11,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label34), TRUE);
  gtk_label_set_justify (GTK_LABEL (label34), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label34), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label34), 12, 0);

  label_eta = gtk_label_new (_("0 h 0 mn 0 s"));
  gtk_widget_show (label_eta);
  gtk_table_attach (GTK_TABLE (table4), label_eta, 1, 2, 10, 11,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_eta), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_eta), 0, 0.5);
/*

*/
  label90 = gtk_label_new (_("<b>Container:</b>"));
  gtk_widget_show (label90);
  gtk_table_attach (GTK_TABLE (table4), label90, 0, 1, 11, 12,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_use_markup (GTK_LABEL (label90), TRUE);
  gtk_label_set_justify (GTK_LABEL (label90), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label90), 0, 0.5);
  gtk_misc_set_padding (GTK_MISC (label90), 12, 0);

  label_container = gtk_label_new (_("None"));
  gtk_widget_show (label_container);
  gtk_table_attach (GTK_TABLE (table4), label_container, 1, 2, 11, 12,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label_container), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label_container), 0, 0.5);
/*

*/  

  progressbar1 = gtk_progress_bar_new ();
  gtk_widget_show (progressbar1);
  gtk_box_pack_start (GTK_BOX (vbox2), progressbar1, FALSE, FALSE, 0);
  gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progressbar1), _("00:00:00 Time Left"));

  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);

  closebutton1 = gtk_button_new ();
  gtk_widget_show (closebutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), closebutton1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (closebutton1, GTK_CAN_DEFAULT);

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

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

  image1 = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image1);
  gtk_box_pack_start (GTK_BOX (hbox1), image1, FALSE, FALSE, 0);

  label33 = gtk_label_new_with_mnemonic (_("Pause / Abort"));
  gtk_widget_show (label33);
  gtk_box_pack_start (GTK_BOX (hbox1), label33, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label33), GTK_JUSTIFY_LEFT);

  /* 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, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (dialog1, label24, "label24");
  GLADE_HOOKUP_OBJECT (dialog1, table4, "table4");
  GLADE_HOOKUP_OBJECT (dialog1, label25, "label25");
  GLADE_HOOKUP_OBJECT (dialog1, label26, "label26");
  GLADE_HOOKUP_OBJECT (dialog1, label_phasis, "label_phasis");
  GLADE_HOOKUP_OBJECT (dialog1, label_frame, "label_frame");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT (dialog1, label21, "label21");
  GLADE_HOOKUP_OBJECT (dialog1, label23, "label23");
  GLADE_HOOKUP_OBJECT (dialog1, Quantizer, "Quantizer");
  GLADE_HOOKUP_OBJECT (dialog1, label15, "label15");
  GLADE_HOOKUP_OBJECT (dialog1, label17, "label17");
  GLADE_HOOKUP_OBJECT (dialog1, label19, "label19");
  GLADE_HOOKUP_OBJECT (dialog1, label_vcodec, "label_vcodec");
  GLADE_HOOKUP_OBJECT (dialog1, label_acodec, "label_acodec");
  GLADE_HOOKUP_OBJECT (dialog1, label_fps, "label_fps");
  GLADE_HOOKUP_OBJECT (dialog1, label_bitrate, "label_bitrate");
  GLADE_HOOKUP_OBJECT (dialog1, label_quant, "label_quant");
  GLADE_HOOKUP_OBJECT (dialog1, label_vsize, "label_vsize");
  GLADE_HOOKUP_OBJECT (dialog1, label_asize, "label_asize");
  GLADE_HOOKUP_OBJECT (dialog1, label_size, "label_size");
  GLADE_HOOKUP_OBJECT (dialog1, label34, "label34");
  GLADE_HOOKUP_OBJECT (dialog1, label_eta, "label_eta");
  GLADE_HOOKUP_OBJECT (dialog1, progressbar1, "progressbar1");
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (dialog1, closebutton1, "closebutton1");
  GLADE_HOOKUP_OBJECT (dialog1, alignment1, "alignment1");
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, image1, "image1");
  GLADE_HOOKUP_OBJECT (dialog1, label33, "label33");
  GLADE_HOOKUP_OBJECT (dialog1, label_container, "label_container");

  return dialog1;
}
예제 #28
0
GtkWidget *create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *notebook1;
  GtkWidget *table1;
  GtkWidget *radioCQ;
  GSList *radioCQ_group = NULL;
  GtkWidget *radioCBR;
  GtkWidget *radio2Pass;
  GtkWidget *entryCQ;
  GtkWidget *entryCBR;
  GtkWidget *entry2Pass;
  GtkWidget *label1;
  GtkWidget *table2;
  GtkWidget *label5;
  GtkWidget *label6;
  GtkWidget *label7;
  GtkObject *spinbuttonMaxIFrame_adj;
  GtkWidget *spinbuttonMaxIFrame;
  GtkWidget *label8;
  GtkObject *spinbuttonMinIFrame_adj;
  GtkWidget *spinbuttonMinIFrame;
  GtkWidget *optionME;
  GtkWidget *menu4;
  GtkWidget *_0___none1;
  GtkWidget *_1__very_low1;
  GtkWidget *_2__low1;
  GtkWidget *_3__medium1;
  GtkWidget *_4__high1;
  GtkWidget *_5__very_high1;
  GtkWidget *_6__ultra_high1;
  GtkWidget *optionQzer;
  GtkWidget *menu5;
  GtkWidget *h263_quantizer1;
  GtkWidget *mpeg_quantizer1;
  GtkWidget *label2;
  GtkWidget *table3;
  GtkWidget *label9;
  GtkWidget *label10;
  GtkWidget *label11;
  GtkWidget *label12;
  GtkObject *spinImin_adj;
  GtkWidget *spinImin;
  GtkObject *spinImax_adj;
  GtkWidget *spinImax;
  GtkObject *spinPmin_adj;
  GtkWidget *spinPmin;
  GtkObject *spinPmax_adj;
  GtkWidget *spinPmax;
  GtkWidget *label3;
  GtkWidget *label13;
  GtkWidget *label4;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Xvid Encoder"));

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

  table1 = gtk_table_new (3, 2, FALSE);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (notebook1), table1);

  radioCQ = gtk_radio_button_new_with_mnemonic (NULL, QT_TR_NOOP("Constant Quantizer"));
  gtk_widget_show (radioCQ);
  gtk_table_attach (GTK_TABLE (table1), radioCQ, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioCQ), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioCQ));

  radioCBR = gtk_radio_button_new_with_mnemonic (NULL, QT_TR_NOOP("Constant Bitrate (kbps)"));
  gtk_widget_show (radioCBR);
  gtk_table_attach (GTK_TABLE (table1), radioCBR, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radioCBR), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radioCBR));

  radio2Pass = gtk_radio_button_new_with_mnemonic (NULL, QT_TR_NOOP("Dual pass (MBytes)"));
  gtk_widget_show (radio2Pass);
  gtk_table_attach (GTK_TABLE (table1), radio2Pass, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio2Pass), radioCQ_group);
  radioCQ_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio2Pass));

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

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

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

  label1 = gtk_label_new (QT_TR_NOOP("Basic"));
  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);

  table2 = gtk_table_new (4, 2, FALSE);
  gtk_widget_show (table2);
  gtk_container_add (GTK_CONTAINER (notebook1), table2);

  label5 = gtk_label_new (QT_TR_NOOP("Motion Search"));
  gtk_widget_show (label5);
  gtk_table_attach (GTK_TABLE (table2), label5, 0, 1, 0, 1,
                    (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);

  label6 = gtk_label_new (QT_TR_NOOP("Quantization"));
  gtk_widget_show (label6);
  gtk_table_attach (GTK_TABLE (table2), label6, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);

  label7 = gtk_label_new (QT_TR_NOOP("Max I frame interval "));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table2), label7, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);

  spinbuttonMaxIFrame_adj = gtk_adjustment_new (300, 0, 600, 1, 10, 0);
  spinbuttonMaxIFrame = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonMaxIFrame_adj), 1, 0);
  gtk_widget_show (spinbuttonMaxIFrame);
  gtk_table_attach (GTK_TABLE (table2), spinbuttonMaxIFrame, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonMaxIFrame), TRUE);

  label8 = gtk_label_new (QT_TR_NOOP("Min I frame interval"));
  gtk_widget_show (label8);
  gtk_table_attach (GTK_TABLE (table2), label8, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label8), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);

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

  optionME = gtk_option_menu_new ();
  gtk_widget_show (optionME);
  gtk_table_attach (GTK_TABLE (table2), optionME, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  menu4 = gtk_menu_new ();

  _0___none1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("0 - None"));
  gtk_widget_show (_0___none1);
  gtk_container_add (GTK_CONTAINER (menu4), _0___none1);

  _1__very_low1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("1- Very low"));
  gtk_widget_show (_1__very_low1);
  gtk_container_add (GTK_CONTAINER (menu4), _1__very_low1);

  _2__low1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("2- Low"));
  gtk_widget_show (_2__low1);
  gtk_container_add (GTK_CONTAINER (menu4), _2__low1);

  _3__medium1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("3- Medium"));
  gtk_widget_show (_3__medium1);
  gtk_container_add (GTK_CONTAINER (menu4), _3__medium1);

  _4__high1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("4- High"));
  gtk_widget_show (_4__high1);
  gtk_container_add (GTK_CONTAINER (menu4), _4__high1);

  _5__very_high1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("5- Very High"));
  gtk_widget_show (_5__very_high1);
  gtk_container_add (GTK_CONTAINER (menu4), _5__very_high1);

  _6__ultra_high1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("6- Ultra High"));
  gtk_widget_show (_6__ultra_high1);
  gtk_container_add (GTK_CONTAINER (menu4), _6__ultra_high1);

  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionME), menu4);

  optionQzer = gtk_option_menu_new ();
  gtk_widget_show (optionQzer);
  gtk_table_attach (GTK_TABLE (table2), optionQzer, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

  menu5 = gtk_menu_new ();

 h263_quantizer1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("H263 Quantizer"));
  gtk_widget_show (h263_quantizer1);
  gtk_container_add (GTK_CONTAINER (menu5), h263_quantizer1);


  mpeg_quantizer1 = gtk_menu_item_new_with_mnemonic (QT_TR_NOOP("MPEG Quantizer"));
  gtk_widget_show (mpeg_quantizer1);
  gtk_container_add (GTK_CONTAINER (menu5), mpeg_quantizer1);


  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionQzer), menu5);

  label2 = gtk_label_new (QT_TR_NOOP("Advanced"));
  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);

  table3 = gtk_table_new (4, 2, FALSE);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (notebook1), table3);

  label9 = gtk_label_new (QT_TR_NOOP("Min I Frame Qzer"));
  gtk_widget_show (label9);
  gtk_table_attach (GTK_TABLE (table3), label9, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label9), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);

  label10 = gtk_label_new (QT_TR_NOOP("Max I Frame Qzer"));
  gtk_widget_show (label10);
  gtk_table_attach (GTK_TABLE (table3), label10, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  label11 = gtk_label_new (QT_TR_NOOP("Min P Frame Qzer"));
  gtk_widget_show (label11);
  gtk_table_attach (GTK_TABLE (table3), label11, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label11), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);

  label12 = gtk_label_new (QT_TR_NOOP("Max P Frame Qzer"));
  gtk_widget_show (label12);
  gtk_table_attach (GTK_TABLE (table3), label12, 0, 1, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label12), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);

  spinImin_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinImin = gtk_spin_button_new (GTK_ADJUSTMENT (spinImin_adj), 1, 0);
  gtk_widget_show (spinImin);
  gtk_table_attach (GTK_TABLE (table3), spinImin, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinImin), TRUE);

  spinImax_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinImax = gtk_spin_button_new (GTK_ADJUSTMENT (spinImax_adj), 1, 0);
  gtk_widget_show (spinImax);
  gtk_table_attach (GTK_TABLE (table3), spinImax, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinImax), TRUE);

  spinPmin_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinPmin = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmin_adj), 1, 0);
  gtk_widget_show (spinPmin);
  gtk_table_attach (GTK_TABLE (table3), spinPmin, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmin), TRUE);

  spinPmax_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinPmax = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmax_adj), 1, 0);
  gtk_widget_show (spinPmax);
  gtk_table_attach (GTK_TABLE (table3), spinPmax, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmax), TRUE);

  label3 = gtk_label_new (QT_TR_NOOP("Quantizer"));
  gtk_widget_show (label3);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  label13 = gtk_label_new (QT_TR_NOOP("Not Yet!"));
  gtk_widget_show (label13);
  gtk_container_add (GTK_CONTAINER (notebook1), label13);
  gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT);

  label4 = gtk_label_new (QT_TR_NOOP("B Frames"));
  gtk_widget_show (label4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);

  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, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, radioCQ, "radioCQ");
  GLADE_HOOKUP_OBJECT (dialog1, radioCBR, "radioCBR");
  GLADE_HOOKUP_OBJECT (dialog1, radio2Pass, "radio2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, entryCQ, "entryCQ");
  GLADE_HOOKUP_OBJECT (dialog1, entryCBR, "entryCBR");
  GLADE_HOOKUP_OBJECT (dialog1, entry2Pass, "entry2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMaxIFrame, "spinbuttonMaxIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMinIFrame, "spinbuttonMinIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, optionME, "optionME");
  GLADE_HOOKUP_OBJECT (dialog1, menu4, "menu4");
  GLADE_HOOKUP_OBJECT (dialog1, _0___none1, "_0___none1");
  GLADE_HOOKUP_OBJECT (dialog1, _1__very_low1, "_1__very_low1");
  GLADE_HOOKUP_OBJECT (dialog1, _2__low1, "_2__low1");
  GLADE_HOOKUP_OBJECT (dialog1, _3__medium1, "_3__medium1");
  GLADE_HOOKUP_OBJECT (dialog1, _4__high1, "_4__high1");
  GLADE_HOOKUP_OBJECT (dialog1, _5__very_high1, "_5__very_high1");
  GLADE_HOOKUP_OBJECT (dialog1, _6__ultra_high1, "_6__ultra_high1");
  GLADE_HOOKUP_OBJECT (dialog1, optionQzer, "optionQzer");
  GLADE_HOOKUP_OBJECT (dialog1, menu5, "menu5");
  GLADE_HOOKUP_OBJECT (dialog1, h263_quantizer1, "h263_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, mpeg_quantizer1, "mpeg_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, table3, "table3");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT (dialog1, spinImin, "spinImin");
  GLADE_HOOKUP_OBJECT (dialog1, spinImax, "spinImax");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmin, "spinPmin");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmax, "spinPmax");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label13, "label13");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  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;
}
예제 #29
0
void
create_error (HWND hwnd, LPCSTR dsn, LPCSTR text, LPCSTR errmsg)
{
  GtkWidget *error, *dialog_vbox1, *hbox1, *pixmap1, *vbox1;
  GtkWidget *l_text, *l_error, *dialog_action_area1, *hbuttonbox1, *b_ok;
  GtkAccelGroup *accel_group;
  GdkPixmap *pixmap;
  GdkBitmap *mask;
  GtkStyle *style;
  guint b_ok_key;
  char msg[1024];

  if (hwnd == NULL || !GTK_IS_WIDGET (hwnd))
    return;

  accel_group = gtk_accel_group_new ();

  error = gtk_dialog_new ();
  if (dsn)
    sprintf (msg, "Error : %s", dsn);
  else
    sprintf (msg, "Error ...");

  gtk_object_set_data (GTK_OBJECT (error), "error", error);
  gtk_window_set_title (GTK_WINDOW (error), msg);
  gtk_widget_set_size_request (error, 400, 150);
  gtk_window_set_position (GTK_WINDOW (error), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (error), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (error), 400, 150);
  gtk_window_set_type_hint (GTK_WINDOW (error), GDK_WINDOW_TYPE_HINT_DIALOG);

#if GTK_CHECK_VERSION(2,0,0)
  gtk_widget_show (error);
#endif

  dialog_vbox1 = GTK_DIALOG (error)->vbox;
  gtk_object_set_data (GTK_OBJECT (error), "dialog_vbox1", dialog_vbox1);
  gtk_widget_show (dialog_vbox1);

  hbox1 = gtk_hbox_new (FALSE, 6);
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (error), "hbox1", hbox1,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox1), 6);

#if GTK_CHECK_VERSION(2,0,0)
  style = gtk_widget_get_style (error);
  pixmap =
      gdk_pixmap_create_from_xpm_d (error->window, &mask,
      &style->bg[GTK_STATE_NORMAL], (gchar **) error_xpm);
#else
  style = gtk_widget_get_style (GTK_WIDGET (hwnd));
  pixmap =
      gdk_pixmap_create_from_xpm_d (GTK_WIDGET (hwnd)->window, &mask,
      &style->bg[GTK_STATE_NORMAL], (gchar **) error_xpm);
#endif

  pixmap1 = gtk_pixmap_new (pixmap, mask);
  gtk_widget_ref (pixmap1);
  gtk_object_set_data_full (GTK_OBJECT (error), "pixmap1", pixmap1,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (pixmap1);
  gtk_box_pack_start (GTK_BOX (hbox1), pixmap1, FALSE, FALSE, 0);

  vbox1 = gtk_vbox_new (TRUE, 0);
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (error), "vbox1", vbox1,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gtk_box_pack_start (GTK_BOX (hbox1), vbox1, TRUE, TRUE, 0);

  l_text = gtk_label_new ("");
  gtk_label_parse_uline (GTK_LABEL (l_text), (text) ? text : "");
  gtk_widget_ref (l_text);
  gtk_object_set_data_full (GTK_OBJECT (error), "l_text", l_text,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (l_text);
  gtk_box_pack_start (GTK_BOX (vbox1), l_text, FALSE, TRUE, 0);
  gtk_label_set_justify (GTK_LABEL (l_text), GTK_JUSTIFY_LEFT);
  gtk_label_set_line_wrap (GTK_LABEL (l_text), TRUE);

  l_error = gtk_label_new ("");
  gtk_label_parse_uline (GTK_LABEL (l_error), (errmsg) ? errmsg : "");
  gtk_widget_ref (l_error);
  gtk_object_set_data_full (GTK_OBJECT (error), "l_error", l_error,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (l_error);
  gtk_box_pack_start (GTK_BOX (vbox1), l_error, FALSE, TRUE, 0);
  gtk_label_set_justify (GTK_LABEL (l_error), GTK_JUSTIFY_LEFT);
  gtk_label_set_line_wrap (GTK_LABEL (l_error), TRUE);

  dialog_action_area1 = GTK_DIALOG (error)->action_area;
  gtk_object_set_data (GTK_OBJECT (error), "dialog_action_area1",
      dialog_action_area1);
  gtk_widget_show (dialog_action_area1);
  gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 5);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox1);
  gtk_object_set_data_full (GTK_OBJECT (error), "hbuttonbox1", hbuttonbox1,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (dialog_action_area1), hbuttonbox1, TRUE, TRUE,
      0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
  gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10);

  b_ok = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_ref (b_ok);
  gtk_object_set_data_full (GTK_OBJECT (error), "b_ok", b_ok,
      (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (b_ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), b_ok);
  gtk_dialog_add_action_widget (GTK_DIALOG (error), b_ok, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (b_ok, GTK_CAN_DEFAULT);

  /* Ok button events */
  gtk_signal_connect (GTK_OBJECT (b_ok), "clicked",
      GTK_SIGNAL_FUNC (error_ok_clicked), error);
  /* Close window button events */
  gtk_signal_connect (GTK_OBJECT (error), "delete_event",
      GTK_SIGNAL_FUNC (delete_event), NULL);
  gtk_signal_connect (GTK_OBJECT (error), "destroy",
      GTK_SIGNAL_FUNC (gtk_main_quit), NULL);

  gtk_window_add_accel_group (GTK_WINDOW (error), accel_group);

  gtk_widget_show_all (error);
  gtk_main ();
}
예제 #30
0
GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *label1;
  GtkWidget *entryName;
  GtkWidget *label2;
  GtkWidget *entryParam;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Pipe to"));

  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);

  label1 = gtk_label_new (QT_TR_NOOP("Application path/name (/usr/bin/sox...)"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  entryName = gtk_entry_new ();
  gtk_widget_show (entryName);
  gtk_box_pack_start (GTK_BOX (vbox1), entryName, FALSE, FALSE, 0);

  label2 = gtk_label_new (QT_TR_NOOP("Full parameter line"));
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (vbox1), label2, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  entryParam = gtk_entry_new ();
  gtk_widget_show (entryParam);
  gtk_box_pack_start (GTK_BOX (vbox1), entryParam, FALSE, FALSE, 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, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, entryName, "entryName");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, entryParam, "entryParam");
  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;
}