diff --git a/ocarina/settings/library.cpp b/ocarina/settings/library.cpp index a76e6c5a..bcb26bea 100644 --- a/ocarina/settings/library.cpp +++ b/ocarina/settings/library.cpp @@ -15,6 +15,7 @@ struct PathInfo { GtkWidget *widget; GtkWidget *remove; + GtkWidget *update; string path; }; @@ -37,6 +38,18 @@ static void on_click_update(GtkWidget *b, GdkEvent *e, gpointer d) libsaria::library::update(); } +static void on_click_update_path(GtkWidget *b, GdkEvent *e, gpointer d) +{ + list::iterator it; + for (it = path_widgets.begin(); it != path_widgets.end(); it++) { + if ((*it).update == b) { + libsaria::library::update_path((*it).path); + break; + } + } + +} + static void on_click_remove(GtkWidget *b, GdkEvent *e, gpointer d) { list::iterator it; @@ -64,6 +77,15 @@ static GtkWidget *make_update_button() true); } +static GtkWidget *make_update_path_button() +{ + return make_text_button(GTK_STOCK_REFRESH, + "Update Path", + on_click_update_path, + true); +} + + static GtkWidget *make_remove_button() { return make_text_button(GTK_STOCK_REMOVE, @@ -101,9 +123,12 @@ static GtkWidget *add_buttons(GtkWidget *info_box, struct PathInfo &path) { GtkWidget *button_box = gtk_hbox_new(FALSE, 0); GtkWidget *remove_btn = make_remove_button(); + GtkWidget *update_btn = make_update_path_button(); path.remove = remove_btn; + path.update = update_btn; box_pack_start(button_box, info_box, TRUE, TRUE, 0); + box_pack_start(button_box, update_btn, FALSE, FALSE, 0); box_pack_start(button_box, remove_btn, FALSE, FALSE, 0); return button_box; }