/*
Copyright (C) 2022 Lari Varjonen <[email protected]>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "processing.h"
#include "ui_processing.h"
Processing::Processing(QWidget *parent) :
QDialog(parent),
ui(new Ui::Processing)
{
ui->setupUi(this);
setWindowTitle(window_title);
}
Processing::~Processing()
{
delete ui;
}
void Processing::set_max(unsigned int max)
{
ui->progress_bar->setMaximum(max);
this->progress_bar_max = max;
}
void Processing::set_value(unsigned int new_value,
double current_frame,
double end_frame)
{
QString new_window_title = window_title;
title_text_dot_count++;
if (title_text_dot_count > 3)
{
title_text_dot_count = 0;
}
for (int i = 0; i < title_text_dot_count; i++)
{
new_window_title.append(".");
}
setWindowTitle(new_window_title);
ui->progress_bar->setValue(new_value);
ui->progress_bar->setFormat(QString("(%1/%2) %3/%4")
.arg(new_value)
.arg(progress_bar_max)
.arg(current_frame)
.arg(end_frame));
}
void Processing::on_cancel_button_clicked()
{
close();
}
/* Copyright (C) 2022 Lari Varjonen <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "processing.h" #include "ui_processing.h" Processing::Processing(QWidget *parent) : QDialog(parent), ui(new Ui::Processing) { ui->setupUi(this); setWindowTitle(window_title); } Processing::~Processing() { delete ui; } void Processing::set_max(unsigned int max) { ui->progress_bar->setMaximum(max); this->progress_bar_max = max; } void Processing::set_value(unsigned int new_value, double current_frame, double end_frame) { QString new_window_title = window_title; title_text_dot_count++; if (title_text_dot_count > 3) { title_text_dot_count = 0; } for (int i = 0; i < title_text_dot_count; i++) { new_window_title.append("."); } setWindowTitle(new_window_title); ui->progress_bar->setValue(new_value); ui->progress_bar->setFormat(QString("(%1/%2) %3/%4") .arg(new_value) .arg(progress_bar_max) .arg(current_frame) .arg(end_frame)); } void Processing::on_cancel_button_clicked() { close(); }
/*
    Copyright (C) 2022 Lari Varjonen <[email protected]>

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    version 2 as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#include "processing.h"
#include "ui_processing.h"


Processing::Processing(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Processing)
{
    ui->setupUi(this);
    setWindowTitle(window_title);
}

Processing::~Processing()
{
    delete ui;
}

void Processing::set_max(unsigned int max)
{
    ui->progress_bar->setMaximum(max);
    this->progress_bar_max = max;
}

void Processing::set_value(unsigned int new_value,
                           double current_frame,
                           double end_frame)
{
    QString new_window_title = window_title;
    title_text_dot_count++;
    if (title_text_dot_count > 3)
    {
        title_text_dot_count = 0;
    }
    for (int i = 0; i < title_text_dot_count; i++)
    {
        new_window_title.append(".");
    }
    setWindowTitle(new_window_title);

    ui->progress_bar->setValue(new_value);
    ui->progress_bar->setFormat(QString("(%1/%2) %3/%4")
                                .arg(new_value)
                                .arg(progress_bar_max)
                                .arg(current_frame)
                                .arg(end_frame));
}

void Processing::on_cancel_button_clicked()
{
    close();
}