Update GUI, use new Archive progress API
This commit is contained in:
parent
c9929698ee
commit
56176bb627
@ -174,12 +174,12 @@ LibraryDownloadDialog::install (std::string const & path, Gtk::TreePath const &
|
||||
std::string destdir = Glib::path_get_dirname (path);
|
||||
|
||||
inflater = new Inflater (path, destdir);
|
||||
//inflater->progress.connect (install_connection, invalidator(*this), boost::bind (&LibraryDownloadDialog::install_progress, this, _1, _2, path, treepath), gui_context());
|
||||
inflater->Progress.connect (install_connection, invalidator(*this), boost::bind (&LibraryDownloadDialog::install_progress, this, _1, path, treepath), gui_context());
|
||||
inflater->start (); /* starts unpacking in a thread */
|
||||
}
|
||||
|
||||
void
|
||||
LibraryDownloadDialog::install_progress (size_t nread, size_t total, std::string path, Gtk::TreePath treepath)
|
||||
LibraryDownloadDialog::install_progress (float p, std::string path, Gtk::TreePath treepath)
|
||||
{
|
||||
Gtk::TreeModel::iterator row = _model->get_iter (treepath);
|
||||
|
||||
@ -192,7 +192,7 @@ LibraryDownloadDialog::install_progress (size_t nread, size_t total, std::string
|
||||
return;
|
||||
}
|
||||
|
||||
(*row)[_columns.progress] = (int) round ((double) nread / total);
|
||||
(*row)[_columns.progress] = (int) round (100.0 * p);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -112,7 +112,7 @@ class LibraryDownloadDialog : public ArdourDialog
|
||||
|
||||
PBD::Inflater* inflater;
|
||||
void install (std::string const & path, Gtk::TreePath const & treepath);
|
||||
void install_progress (size_t, size_t, std::string, Gtk::TreePath);
|
||||
void install_progress (float, std::string, Gtk::TreePath);
|
||||
void install_finished (Gtk::TreeModel::iterator row, std::string path, int status);
|
||||
PBD::ScopedConnection install_connection;
|
||||
|
||||
|
@ -555,7 +555,7 @@ TemplateManager::export_all_templates ()
|
||||
|
||||
_current_action = _("Exporting templates");
|
||||
|
||||
PBD::FileArchive ar (filename);
|
||||
PBD::FileArchive ar (filename, this);
|
||||
PBD::ScopedConnectionList progress_connection;
|
||||
ar.create (filemap);
|
||||
|
||||
@ -583,7 +583,7 @@ TemplateManager::import_template_set ()
|
||||
|
||||
_current_action = _("Importing templates");
|
||||
|
||||
FileArchive ar (dialog.get_filename ());
|
||||
FileArchive ar (dialog.get_filename (), this);
|
||||
PBD::ScopedConnectionList progress_connection;
|
||||
|
||||
for (std::string fn = ar.next_file_name(); !fn.empty(); fn = ar.next_file_name()) {
|
||||
|
Loading…
Reference in New Issue
Block a user