- static int get_connection_details(struct gui_entry *ge)
- {
- GtkWidget *dialog, *box, *vbox, *hbox, *frame, *pentry;
- struct connection_widgets cw;
- struct gui *ui = ge->ui;
- char *typeentry;
-
- if (ge->host)
- return 0;
-
- dialog = gtk_dialog_new_with_buttons("Connection details",
- GTK_WINDOW(ui->window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
-
- frame = gtk_frame_new("Hostname / socket name");
- /* gtk_dialog_get_content_area() is 2.14 and newer */
- vbox = GTK_DIALOG(dialog)->vbox;
- gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
-
- box = gtk_vbox_new(FALSE, 6);
- gtk_container_add(GTK_CONTAINER(frame), box);
-
- hbox = gtk_hbox_new(TRUE, 10);
- gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
- cw.hentry = gtk_entry_new();
- gtk_entry_set_text(GTK_ENTRY(cw.hentry), "localhost");
- gtk_box_pack_start(GTK_BOX(hbox), cw.hentry, TRUE, TRUE, 0);
-
- frame = gtk_frame_new("Port");
- gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
- box = gtk_vbox_new(FALSE, 10);
- gtk_container_add(GTK_CONTAINER(frame), box);
-
- hbox = gtk_hbox_new(TRUE, 4);
- gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
- pentry = create_spinbutton(hbox, 1, 65535, FIO_NET_PORT);
-
- frame = gtk_frame_new("Type");
- gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
- box = gtk_vbox_new(FALSE, 10);
- gtk_container_add(GTK_CONTAINER(frame), box);
-
- hbox = gtk_hbox_new(TRUE, 4);
- gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
-
- cw.combo = gtk_combo_box_new_text();
- gtk_combo_box_append_text(GTK_COMBO_BOX(cw.combo), "IPv4");
- gtk_combo_box_append_text(GTK_COMBO_BOX(cw.combo), "IPv6");
- gtk_combo_box_append_text(GTK_COMBO_BOX(cw.combo), "local socket");
- gtk_combo_box_set_active(GTK_COMBO_BOX(cw.combo), 0);
-
- gtk_container_add(GTK_CONTAINER(hbox), cw.combo);
-
- frame = gtk_frame_new("Options");
- gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
- box = gtk_vbox_new(FALSE, 10);
- gtk_container_add(GTK_CONTAINER(frame), box);
-
- hbox = gtk_hbox_new(TRUE, 4);
- gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
-
- cw.button = gtk_check_button_new_with_label("Auto-spawn fio backend");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cw.button), 1);
- gtk_widget_set_tooltip_text(cw.button, "When running fio locally, it is necessary to have the backend running on the same system. If this is checked, gfio will start the backend automatically for you if it isn't already running.");
- gtk_box_pack_start(GTK_BOX(hbox), cw.button, FALSE, FALSE, 6);