ocarina: Added update library button
This button will call the new library::update() function
This commit is contained in:
parent
c4cdfbe4b3
commit
61153a0580
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue