gui: collection manager fixes
- Fill out the list of library paths - Update size during scan Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
00ff9cd08f
commit
ec2bd92bef
|
@ -104,7 +104,7 @@ static void on_library_add(unsigned int id, Library *library)
|
|||
row[collection_cols.c_col_path] = library->root_path;
|
||||
}
|
||||
|
||||
/*static void on_library_update(unsigned int id, Library *library)
|
||||
static void on_library_update(unsigned int id, Library *library)
|
||||
{
|
||||
Gtk::TreeModel::Row row;
|
||||
Glib::RefPtr<Gtk::ListStore> list = get_collection_list();
|
||||
|
@ -116,20 +116,16 @@ static void on_library_add(unsigned int id, Library *library)
|
|||
if (row[collection_cols.c_col_id] == id)
|
||||
row[collection_cols.c_col_size] = library->count;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void collection_mgr_init()
|
||||
{
|
||||
//struct Callbacks *cb = get_callbacks();
|
||||
|
||||
Gtk::TreeView *treeview = get_widget<Gtk::TreeView>("o_collection_treeview");
|
||||
Glib::RefPtr<Gtk::ListStore> list = get_collection_list();
|
||||
Glib::RefPtr<Gtk::CellRendererToggle> toggle;
|
||||
|
||||
toggle = get_object<Gtk::CellRendererToggle>("o_collection_toggle");
|
||||
|
||||
//cb->on_library_update = on_library_update;
|
||||
|
||||
connect_button("o_collection_ok", on_collection_ok);
|
||||
connect_button("o_collection_update", on_collection_update);
|
||||
|
||||
|
@ -138,3 +134,23 @@ void collection_mgr_init()
|
|||
treeview->signal_key_press_event().connect(sigc::ptr_fun(on_collection_key_pressed));
|
||||
toggle->signal_toggled().connect(sigc::ptr_fun(on_collection_toggled));
|
||||
}
|
||||
|
||||
void collection_mgr_init2()
|
||||
{
|
||||
Database<Library> *db;
|
||||
Database<Library>::iterator it;
|
||||
|
||||
db = &tagdb :: get_library_db();
|
||||
for (it = db->begin(); it != db->end(); it = db->next(it))
|
||||
on_library_add((*it)->id, *it);
|
||||
}
|
||||
|
||||
void collection_mgr_update()
|
||||
{
|
||||
Database<Library> *db;
|
||||
Database<Library>::iterator it;
|
||||
|
||||
db = &tagdb :: get_library_db();
|
||||
for (it = db->begin(); it != db->end(); it = db->next(it))
|
||||
on_library_update((*it)->id, *it);
|
||||
}
|
||||
|
|
|
@ -194,6 +194,8 @@ bool on_idle()
|
|||
prog->show();
|
||||
prog->set_fraction(idle::get_progress());
|
||||
}
|
||||
|
||||
collection_mgr_update();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ Gtk::Window *ocarina_init(int *argc, char ***argv)
|
|||
playlist :: select("Favorites");
|
||||
share_file("ocarina6.glade");
|
||||
post_init_tabs();
|
||||
collection_mgr_init2();
|
||||
return window;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
/* collection_mgr.cpp */
|
||||
void collection_mgr_init();
|
||||
void collection_mgr_init2();
|
||||
void collection_mgr_update();
|
||||
|
||||
|
||||
/* main.cpp */
|
||||
|
|
Loading…
Reference in New Issue