
#include <ocarina/settings.h>
#include <ocarina/body.h>
#include <ocarina/gtk.h>

static GtkWidget *settings_tabs = NULL;

void settings_init()
{
	GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,
						    GTK_ICON_SIZE_MENU);
	settings_tabs = gtk_notebook_new();

	gtk_widget_show(image);
	gtk_widget_show(settings_tabs);
	add_page(image, settings_tabs, false);

	library_settings_init();
}

void add_settings_page(string label_text, GtkWidget *page)
{
	GtkWidget *label  = gtk_label_new(label_text.c_str());
	GtkWidget *window = gtk_scrolled_window_new(NULL, NULL);

	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(window),
				       GTK_POLICY_AUTOMATIC,
				       GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(window),
					      page);
	gtk_notebook_append_page(GTK_NOTEBOOK(settings_tabs), window, label);

	gtk_widget_show(window);
	gtk_widget_show(label);
}
