Archive / / / / / ProgressPane.cc
2008-10-08 03:41:21 UTC
previous next
/* Echo Media Player * Copyright (C) 2008 Shane O'Connell * * [ The original file includes a copyright header in this location describing * the file as being released under the terms of the GNU General Public * License. It has been removed in order to display the file as part of the * archive. ] */ #include "ProgressPane.h" ProgressPane::ProgressPane() { m_progressbar.set_ellipsize(Pango::ELLIPSIZE_START); // Good for filenames m_progressbar.set_pulse_step(0.05); pack_start(m_text); pack_start(m_progressbar); show_all(); } void ProgressPane::set_main_text(const Glib::ustring& text) { m_text.set_label(text); } void ProgressPane::set_progress_text(const Glib::ustring& progress_text) { m_progressbar.set_text(progress_text); } void ProgressPane::set_fraction_done(double fraction) { if (fraction < 0) m_progressbar.pulse(); else m_progressbar.set_fraction(fraction); } void ProgressPane::pulse(const Glib::ustring& progress_text) { m_progressbar.set_text(progress_text); m_progressbar.pulse(); }