X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fmainwindow.cpp;h=66a11441d5883a2e6aa758f5b280c68b277eee92;hb=948d715655a84b93d8292e64731ea3c32b45deb7;hp=f2adbf240c94a6e42afe8a2238553075f7cfcc38;hpb=db2997d7290315086635ec914137b80f855cee37;p=nageru diff --git a/nageru/mainwindow.cpp b/nageru/mainwindow.cpp index f2adbf2..66a1144 100644 --- a/nageru/mainwindow.cpp +++ b/nageru/mainwindow.cpp @@ -198,7 +198,7 @@ MainWindow::MainWindow() global_mainwindow = this; ui->setupUi(this); - global_disk_space_estimator = new DiskSpaceEstimator(bind(&MainWindow::report_disk_space, this, _1, _2)); + global_disk_space_estimator = new DiskSpaceEstimator(bind(&MainWindow::report_disk_space, this, _1, _2, _3)); disk_free_label = new QLabel(this); disk_free_label->setStyleSheet("QLabel {padding-right: 5px;}"); ui->menuBar->setCornerWidget(disk_free_label); @@ -786,7 +786,7 @@ void MainWindow::update_cutoff_labels(float cutoff_hz) } } -void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_left) +void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_left, double file_length_seconds) { char time_str[256]; if (estimated_seconds_left < 60.0) { @@ -811,7 +811,9 @@ void MainWindow::report_disk_space(off_t free_bytes, double estimated_seconds_le char buf[256]; snprintf(buf, sizeof(buf), "Disk free: %'.0f MB (approx. %s)", free_bytes / 1048576.0, time_str); - std::string label = buf; + // NOTE: The default formatter does not use file_length_seconds for anything, + // but the theme might want to do so. + std::string label = global_mixer->format_status_line(buf, file_length_seconds); post_to_main_thread([this, label]{ disk_free_label->setText(QString::fromStdString(label));