summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-07-10 15:12:23 -0700
committerDaniel Burrows <dburrows@debian.org>2010-07-10 15:12:23 -0700
commit819c9845ec2651f8797b0d13f5ffd0d5d1df685e (patch)
treed0ebade43dad741bc9111c85ee25ae6e5cd5ee70 /src
parent885057a516509a1d740042102f0839bdfa08e112 (diff)
downloadaptitude-819c9845ec2651f8797b0d13f5ffd0d5d1df685e.tar.gz
Add a complete() routine to the download progress view that's invoked when the whole download process is complete.
Necessary to fully expose the events generated by download_signal_log.
Diffstat (limited to 'src')
-rw-r--r--src/cmdline/cmdline_download_progress_display.cc10
-rw-r--r--src/generic/views/download_progress.h18
2 files changed, 27 insertions, 1 deletions
diff --git a/src/cmdline/cmdline_download_progress_display.cc b/src/cmdline/cmdline_download_progress_display.cc
index 9dfae061..fe70982f 100644
--- a/src/cmdline/cmdline_download_progress_display.cc
+++ b/src/cmdline/cmdline_download_progress_display.cc
@@ -94,6 +94,10 @@ namespace aptitude
void media_change(const std::string &media,
const std::string &drive,
const sigc::slot1<void, bool> &k);
+
+ virtual void complete(double fetched_bytes,
+ unsigned long elapsed_time,
+ double latest_download_rate);
};
download_progress::download_progress(bool _display_messages,
@@ -223,6 +227,12 @@ namespace aptitude
k(true);
}
+ void download_progress::complete(double fetched_bytes,
+ unsigned long elapsed_time,
+ double latest_download_rate)
+ {
+ }
+
class dummy_status_display : public views::download_status_display
{
dummy_status_display();
diff --git a/src/generic/views/download_progress.h b/src/generic/views/download_progress.h
index 9c10fb33..20130d3c 100644
--- a/src/generic/views/download_progress.h
+++ b/src/generic/views/download_progress.h
@@ -211,7 +211,11 @@ namespace aptitude
const boost::optional<unsigned long> &id,
const status &current_status) = 0;
- /** \brief Invoked when the download is complete.
+ /** \brief Invoked when each stage of the download is complete.
+ *
+ * The whole download process might not be done; for instance,
+ * we might need to change to a new CD. complete() is invoked
+ * after the entire download finishes.
*
* \param fetched_bytes The number of bytes that were downloaded.
*
@@ -240,6 +244,18 @@ namespace aptitude
virtual void media_change(const std::string &media,
const std::string &drive,
const sigc::slot1<void, bool> &k) = 0;
+
+ /** \brief Invoked when the whole download finishes.
+ *
+ * \param fetched_bytes The number of bytes that were downloaded.
+ *
+ * \param elapsed_time How long (in seconds) the download lasted.
+ *
+ * \param latest_download_rate The final estimated download rate.
+ */
+ virtual void complete(double fetched_bytes,
+ unsigned long elapsed_time,
+ double latest_download_rate) = 0;
};
std::ostream &operator<<(std::ostream &out,