示例#1
0
文件: statistics.c 项目: aufau/xqf
void statistics_dialog (void) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *page;
	GtkWidget *hbox;
	GtkWidget *label;
	GtkWidget *button;
	int page_num = 0;

	server_stats_create ();
	collect_statistics ();

	window = dialog_create_modal_transient_window (_("Statistics"), 
			TRUE, TRUE, GTK_SIGNAL_FUNC(statistics_save_geometry));

	statistics_restore_geometry(window);

	main_vbox = gtk_vbox_new (FALSE, 8);
	gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	label = gtk_label_new (_("Statistics"));
	gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, FALSE, 8);
	gtk_widget_show (label);

	stat_notebook = gtk_notebook_new ();
	gtk_notebook_set_tab_pos (GTK_NOTEBOOK (stat_notebook), GTK_POS_TOP);
	gtk_notebook_set_tab_hborder (GTK_NOTEBOOK (stat_notebook), 4);
	gtk_box_pack_start (GTK_BOX (main_vbox), stat_notebook, TRUE, TRUE, 0);

	page = server_stats_page ();
	label = gtk_label_new (_(srv_label));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label);

	page = archs_stats_page ();
	label = gtk_label_new (_(arch_label));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label);

#ifdef USE_GEOIP
	page = country_stats_page ();
	label = gtk_label_new (_(country_label));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (stat_notebook), page, label);
#endif

	page_num = config_get_int ("/" CONFIG_FILE "/Statistics/page");

	gtk_notebook_set_page (GTK_NOTEBOOK (stat_notebook), page_num);

	gtk_widget_show (stat_notebook);

	/* Close Button */

	hbox = gtk_hbox_new (FALSE, 8);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

	button = gtk_button_new_with_label (_("Close"));
	gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_widget_set_usize (button, 80, -1);
	gtk_signal_connect (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (grab_defaults), NULL);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_grab_default (button);
	gtk_widget_show (button);

	gtk_widget_show (hbox);
	gtk_widget_show (main_vbox);
	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);

	server_stats_destroy ();
}
示例#2
0
文件: addmaster.c 项目: IR4T4/xqf
struct master *add_master_dialog (struct master *m) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *table;
	GtkWidget *option_menu;
	GtkWidget *hbox;
	GtkWidget *label;
	GtkWidget *button;
	GtkWidget *hseparator;
	char *typestr;
	enum master_query_type i;
	struct master *master_to_edit;
	char *windowtitle;

	master_name_result = NULL;
	master_addr_result = NULL;
	current_master_query_type = MASTER_NATIVE;

	master_to_edit = NULL;
	master_to_add = NULL;

	for (i=MASTER_NATIVE;i<MASTER_NUM_QUERY_TYPES;i++)
		master_query_type_radios[i]=NULL;

	master_to_edit = m;

	if (master_to_edit) {
		current_master_query_type = master_to_edit->master_type;
		master_type = master_to_edit->type;
	}
	else {
		// Get last game type added (stored in master_okbutton_callback)
		typestr = config_get_string ("/" CONFIG_FILE "/Add Master/game");
		if (typestr) {
			master_type = id2type (typestr);
			g_free (typestr);
		}
		else {
			master_type = QW_SERVER;
		}
	}

	if (master_to_edit) {
		windowtitle=_("Rename Master");
	}
	else {
		windowtitle=_("Add Master");
	}
	window = dialog_create_modal_transient_window(windowtitle, TRUE, FALSE, NULL);
	main_vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	table = gtk_table_new (2, 2, FALSE);
	gtk_table_set_row_spacings (GTK_TABLE (table), 2);
	gtk_table_set_col_spacings (GTK_TABLE (table), 4);
	gtk_container_set_border_width (GTK_CONTAINER (table), 16);
	gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);

	/* Master Name (Description) */

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

	hbox = gtk_hbox_new (FALSE, 4);
	gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 0, 1);

	master_name_combo = gtk_combo_new ();
	gtk_widget_set_usize (master_name_combo, 200, -1);
	gtk_box_pack_start (GTK_BOX (hbox), master_name_combo, TRUE, TRUE, 0);
	gtk_entry_set_max_length (GTK_ENTRY (GTK_COMBO (master_name_combo)->entry), 256);
	gtk_combo_set_case_sensitive (GTK_COMBO (master_name_combo), TRUE);
	gtk_combo_set_use_arrows_always (GTK_COMBO (master_name_combo), TRUE);
	gtk_combo_disable_activate (GTK_COMBO (master_name_combo));
	gtk_signal_connect(
			GTK_OBJECT (GTK_COMBO (master_name_combo)->entry), "activate",
			GTK_SIGNAL_FUNC (master_okbutton_callback), GTK_OBJECT (window));

	GTK_WIDGET_SET_FLAGS (GTK_COMBO (master_name_combo)->entry, GTK_CAN_FOCUS);
	GTK_WIDGET_UNSET_FLAGS (GTK_COMBO (master_name_combo)->button, GTK_CAN_FOCUS);
	gtk_widget_grab_focus (GTK_COMBO (master_name_combo)->entry);

	gtk_widget_show (master_name_combo);

	if (master_history_name->items)
		combo_set_vals (master_name_combo, master_history_name->items, "");

	if (master_to_edit) {
		gtk_entry_set_text(GTK_ENTRY (GTK_COMBO (master_name_combo)->entry), master_to_edit->name);
	}


	/* Master Type Option Menu */

	option_menu = create_server_type_menu (master_type, create_server_type_menu_filter_configured, GTK_SIGNAL_FUNC(select_master_type_callback));

	gtk_box_pack_start (GTK_BOX (hbox), option_menu, FALSE, FALSE, 0);

	if (master_to_edit) {
		gtk_widget_set_state (option_menu, GTK_STATE_NORMAL);
		gtk_widget_set_sensitive (GTK_WIDGET(option_menu),FALSE);
	}

	gtk_widget_show (option_menu);

	gtk_widget_show (hbox);

	/* Master Address */

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

	master_addr_combo = gtk_combo_new ();
	gtk_table_attach_defaults (GTK_TABLE (table), master_addr_combo, 1, 2, 1, 2);
	gtk_entry_set_max_length (GTK_ENTRY (GTK_COMBO (master_addr_combo)->entry), 4096);
	gtk_combo_set_case_sensitive (GTK_COMBO (master_addr_combo), TRUE);
	gtk_combo_set_use_arrows_always (GTK_COMBO (master_addr_combo), TRUE);
	gtk_combo_disable_activate (GTK_COMBO (master_addr_combo));
	gtk_signal_connect (
			GTK_OBJECT (GTK_COMBO (master_addr_combo)->entry), "activate",
			GTK_SIGNAL_FUNC (master_okbutton_callback), GTK_OBJECT (window));
	gtk_signal_connect (
			GTK_OBJECT (GTK_COMBO (master_addr_combo)->list),
			"selection-changed",
			GTK_SIGNAL_FUNC
			(master_address_from_history_selected_callback),NULL);

	GTK_WIDGET_SET_FLAGS (GTK_COMBO (master_addr_combo)->entry, GTK_CAN_FOCUS);
	GTK_WIDGET_UNSET_FLAGS (GTK_COMBO (master_addr_combo)->button, GTK_CAN_FOCUS);
	// gtk_widget_grab_focus (GTK_COMBO (master_addr_combo)->entry);

	gtk_widget_show (master_addr_combo);

	if (master_history_addr->items)
		combo_set_vals (master_addr_combo, master_history_addr->items, "");

	if (master_to_edit) {
		char* url = master_to_url(master_to_edit);
		gtk_entry_set_text(GTK_ENTRY (GTK_COMBO (master_addr_combo)->entry), url);
		gtk_widget_set_state (master_addr_combo, GTK_STATE_NORMAL);
		gtk_widget_set_sensitive (GTK_WIDGET(master_addr_combo),FALSE);
		g_free(url);
	}

	gtk_widget_show (table);

	/* query type */
	hbox = gtk_hbox_new (TRUE, 8);
	for (i=MASTER_NATIVE;i<MASTER_NUM_QUERY_TYPES;i++) {
		master_query_type_radios[i] =
			gtk_radio_button_new_with_label_from_widget(
					i==MASTER_NATIVE?NULL:GTK_RADIO_BUTTON(master_query_type_radios[MASTER_NATIVE]),
					_(master_designation[i]));
		if (master_to_edit) {
			gtk_widget_set_sensitive (GTK_WIDGET(master_query_type_radios[i]),FALSE);
		}
		gtk_signal_connect(GTK_OBJECT (master_query_type_radios[i]), "toggled",
				GTK_SIGNAL_FUNC (master_type_radio_callback), (gpointer)i);

		gtk_widget_show (master_query_type_radios[i]);
		gtk_box_pack_start (GTK_BOX (hbox),master_query_type_radios[i], FALSE, FALSE, 0);
	}
	if (master_to_edit) {
		master_activate_radio_for_type(current_master_query_type);
	}
	else if (!games[master_type].default_master_port &&
			current_master_query_type == MASTER_NATIVE) {
		gtk_widget_set_state (master_query_type_radios[MASTER_NATIVE], GTK_STATE_NORMAL);
		gtk_widget_set_sensitive
			(GTK_WIDGET(master_query_type_radios[MASTER_NATIVE]),FALSE);
		gtk_toggle_button_set_active
			(GTK_TOGGLE_BUTTON(master_query_type_radios[MASTER_GAMESPY]),TRUE);
	}

	gtk_widget_show (hbox);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

	/* Separator */

	hseparator = gtk_hseparator_new ();
	gtk_box_pack_start (GTK_BOX (main_vbox), hseparator, FALSE, FALSE, 0);
	gtk_widget_show (hseparator);

	/* Buttons */

	hbox = gtk_hbox_new (FALSE, 8);
	gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

	/* Cancel Button */

	button = gtk_button_new_with_label (_("Cancel"));
	gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_widget_set_usize (button, 80, -1);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_show (button);

	/* OK Button */

	button = gtk_button_new_with_label ("OK");
	gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_widget_set_usize (button, 80, -1);
	gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC(master_okbutton_callback), window);
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_grab_default (button);
	gtk_widget_show (button);

	gtk_widget_show (hbox);

	gtk_widget_show (main_vbox);
	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);

	return master_to_add;
}
示例#3
0
文件: dialogs.c 项目: aufau/xqf
void dialog_ok (const char *title, const char *fmt, ...) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *vbox;
	GtkWidget *hbox;
	GtkWidget *button;
	GtkWidget *label;
	char buf[2048];
	va_list ap;

	if (!fmt)
		return;

	va_start (ap, fmt);
	g_vsnprintf (buf, 2048, fmt, ap);
	va_end (ap);

	window = dialog_create_modal_transient_window (
			(title)? title : _("XQF: Warning!"),
			TRUE, FALSE, NULL);

	main_vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	/* Message */

	vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (vbox), 32);
	gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0);

	label = gtk_label_new (buf);
	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
	gtk_widget_show (label);

	gtk_widget_show (vbox);

	/* Buttons */

	hbox = gtk_hbox_new (TRUE, 4);
	gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0);

	button = gtk_button_new_with_label (_("OK"));
	gtk_widget_set_usize (button, 96, -1);
	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_grab_default (button);
	gtk_widget_show (button);

	gtk_widget_show (hbox);

	gtk_widget_show (main_vbox);

	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);
}
示例#4
0
文件: dialogs.c 项目: aufau/xqf
static char *va_enter_string_dialog (int visible, char *optstr, int *optval, char *fmt, va_list ap) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *hbox;
	GtkWidget *button;
	GtkWidget *label;
	char buf[2048];

	g_vsnprintf (buf, 2048, fmt, ap);

	enter_string_res = NULL;
	enter_string_optval = optval;

	window = dialog_create_modal_transient_window (buf, TRUE, FALSE, NULL);

	main_vbox = gtk_vbox_new (FALSE, 8);
	gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 16);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	hbox = gtk_hbox_new (FALSE, 8);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

	/* Message */

	label = gtk_label_new (buf);
	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
	gtk_widget_show (label);

	/* Entry */

	enter_string_entry = gtk_entry_new_with_max_length (128);
	gtk_entry_set_visibility (GTK_ENTRY (enter_string_entry), visible);
	gtk_widget_set_usize (enter_string_entry, 128, -1);
	gtk_box_pack_start (GTK_BOX (hbox), enter_string_entry, TRUE, TRUE, 0);
	gtk_signal_connect (GTK_OBJECT (enter_string_entry), "activate",
			GTK_SIGNAL_FUNC (enter_string_activate_callback), NULL);
	gtk_signal_connect_object (GTK_OBJECT (enter_string_entry), "activate",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	gtk_widget_grab_focus (enter_string_entry);
	gtk_widget_show (enter_string_entry);

	/* OK Button */

	button = gtk_button_new_with_label (_("OK"));
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (enter_string_activate_callback),
			GTK_OBJECT (enter_string_entry));
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_widget_show (button);

	/* Cancel Button */

	button = gtk_button_new_with_label (_("Cancel"));
	gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	gtk_widget_show (button);

	gtk_widget_show (hbox);

	/* Option */

	if (optstr) {
		hbox = gtk_hbox_new (FALSE, 8);
		gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

		enter_string_opt_button = gtk_check_button_new_with_label (optstr);

		if (optval) {
			gtk_toggle_button_set_active (
					GTK_TOGGLE_BUTTON (enter_string_opt_button), *optval);
		}
		else {
			gtk_widget_set_sensitive (enter_string_opt_button, FALSE);
		}

		gtk_box_pack_start (GTK_BOX (hbox), enter_string_opt_button, 
				FALSE, FALSE, 8);
		gtk_widget_show (enter_string_opt_button);

		gtk_widget_show (hbox);
	}

	gtk_widget_show (main_vbox);
	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);

	return enter_string_res;
}
示例#5
0
文件: dialogs.c 项目: aufau/xqf
int dialog_yesnoredial (const char *title, int defbutton, char *yes, char *no, char *redial,
		char *fmt, ...) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *vbox;
	GtkWidget *hbox;
	GtkWidget *button;
	GtkWidget *label;
	int res = 0;
	char buf[2048];
	va_list ap;

	if (!fmt)
		return res;

	va_start (ap, fmt);
	g_vsnprintf (buf, 2048, fmt, ap);
	va_end (ap);

	window = dialog_create_modal_transient_window (
			(title)? title : _("XQF: Warning!"),
			TRUE, TRUE, NULL);

	main_vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	/* Message */

	vbox = gtk_vbox_new (FALSE, 0);
	gtk_container_set_border_width (GTK_CONTAINER (vbox), 32);
	gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0);

	label = gtk_label_new (buf);
	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
	gtk_widget_show (label);

	gtk_widget_show (vbox);

	/* Buttons */

	hbox = gtk_hbox_new (TRUE, 4);
	gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0);

	button = gtk_button_new_with_label ((yes)? yes : _("Yes"));
	gtk_widget_set_usize (button, 96, -1);
	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
	gtk_signal_connect (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (yes_button_clicked_callback), &res);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	if (defbutton == 0)
		gtk_widget_grab_default (button);
	gtk_widget_show (button);

	button = gtk_button_new_with_label ((no)? no : _("No"));
	gtk_widget_set_usize (button, 96, -1);
	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	if (defbutton == 1)
		gtk_widget_grab_default (button);
	gtk_widget_show (button);

	button = gtk_button_new_with_label ((redial)? redial : _("Redial"));
	gtk_widget_set_usize (button, 96, -1);
	gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, FALSE, 0);
	gtk_signal_connect (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (redial_button_clicked_callback), &res);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	if (defbutton == 2)
		gtk_widget_grab_default (button);
	gtk_widget_show (button);

	gtk_widget_show (hbox);

	gtk_widget_show (main_vbox);

	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);

	return res;
}
示例#6
0
文件: srv-prop.c 项目: IR4T4/xqf
void properties_dialog (struct server *s) {
	GtkWidget *window;
	GtkWidget *main_vbox;
	GtkWidget *hbox;
	GtkWidget *hbox2;
	GtkWidget *notebook;
	GtkWidget *page;
	GtkWidget *button;
	GtkWidget *pixmap;
	GtkWidget *label;
	char buf[256];

	window = dialog_create_modal_transient_window (_("Properties"), 
			TRUE, FALSE, NULL);
	main_vbox = gtk_vbox_new (FALSE, 8);
	gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 8);
	gtk_container_add (GTK_CONTAINER (window), main_vbox);

	/*
	 *  Server Name 
	 */

	hbox = gtk_hbox_new (FALSE, 0);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 8);

	hbox2 = gtk_hbox_new (FALSE, 4);
	gtk_box_pack_start (GTK_BOX (hbox), hbox2, TRUE, FALSE, 0);

	if (games[s->type].pix) {
		pixmap = gtk_pixmap_new (games[s->type].pix->pix, 
				games[s->type].pix->mask);
		gtk_box_pack_start (GTK_BOX (hbox2), pixmap, FALSE, FALSE, 0);
		gtk_widget_show (pixmap);
	}

	if (s->name) {
		label = gtk_label_new (s->name);
	}
	else {
		g_snprintf (buf, 256, "%s:%d", inet_ntoa (s->host->ip), s->port);
		label = gtk_label_new (buf);
	}
	gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
	gtk_widget_show (label);

	gtk_widget_show (hbox2);
	gtk_widget_show (hbox);

	/*
	 *  Notebook 
	 */

	notebook = gtk_notebook_new ();
	gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
	gtk_box_pack_start (GTK_BOX (main_vbox), notebook, FALSE, FALSE, 0);

	page = server_info_page (s);
	label = gtk_label_new (_("Info"));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);

	page = server_passwords_page (s);
	label = gtk_label_new (_("Passwords"));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);

	page = server_comment_page(s);
	label = gtk_label_new (_("Comment"));
	gtk_widget_show (label);
	gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);

	gtk_notebook_set_page (GTK_NOTEBOOK (notebook), 0);

	gtk_widget_show (notebook);

	/* 
	 *  Buttons at the bottom
	 */

	hbox = gtk_hbox_new (FALSE, 8);
	gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);

	button = gtk_button_new_with_label (_("Cancel"));
	gtk_widget_set_usize (button, 80, -1);
	gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_show (button);

	button = gtk_button_new_with_label (_("OK"));
	gtk_widget_set_usize (button, 80, -1);
	gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
	gtk_signal_connect (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (set_new_properties), (gpointer) s);
	gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (window));
	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
	gtk_widget_grab_default (button);
	gtk_widget_show (button);

	gtk_widget_show (hbox);

	gtk_widget_show (main_vbox);

	gtk_widget_show (window);

	gtk_main ();

	unregister_window (window);
}