ocarina: Added update library button

This button will call the new library::update() function
This commit is contained in:
Bryan Schumaker 2011-10-20 13:23:36 -04:00
parent c4cdfbe4b3
commit 61153a0580
1 changed files with 18 additions and 4 deletions

View File

@ -22,6 +22,11 @@ static void on_click_add(GtkWidget *b, GdkEvent *e, gpointer d)
}
}
static void on_click_update(GtkWidget *b, GdkEvent *e, gpointer d)
{
libsaria::library::update();
}
static GtkWidget *make_add_button()
{
return make_text_button(GTK_STOCK_ADD,
@ -30,6 +35,14 @@ static GtkWidget *make_add_button()
true);
}
static GtkWidget *make_update_button()
{
return make_text_button(GTK_STOCK_REFRESH,
"Update Library",
on_click_update,
true);
}
static GtkWidget *markup_label(string markup)
{
GtkWidget *label = gtk_label_new("");
@ -77,15 +90,16 @@ static void add_library_path(struct libsaria::library::PathInfo &info)
void library_settings_init()
{
GtkWidget *add_button = gtk_hbox_new(FALSE, 0);
GtkWidget *button_row = gtk_hbox_new(FALSE, 0);
library_settings = gtk_vbox_new(FALSE, 0);
libsaria::library::for_each_path(add_library_path);
box_pack_start(library_settings, add_button, FALSE, FALSE, 0);
box_pack_end(add_button, make_add_button(), FALSE, FALSE, 0);
box_pack_start(library_settings, button_row, FALSE, FALSE, 0);
box_pack_end(button_row, make_add_button(), FALSE, FALSE, 0);
box_pack_end(button_row, make_update_button(), FALSE, FALSE, 0);
gtk_widget_show(library_settings);
gtk_widget_show(add_button);
gtk_widget_show(button_row);
add_settings_page("Library", library_settings);
}