waitwidget.cpp 1.56 KB
Newer Older
Mehrdad Momeny's avatar
Mehrdad Momeny committed
1 2 3
/*
    This file is part of Blogilo, A KDE Blogging Client

4 5
    Copyright (C) 2008-2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
    Copyright (C) 2008-2010 Golnaz Nilieh <g382nilieh@gmail.com>
Mehrdad Momeny's avatar
Mehrdad Momeny committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of
    the License or (at your option) version 3 or any later version
    accepted by the membership of KDE e.V. (or its successor approved
    by the membership of KDE e.V.), which shall act as a proxy
    defined in Section 14 of version 3 of the license.

    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, see http://www.gnu.org/licenses/
*/
23 24 25

#include "waitwidget.h"

Laurent Montel's avatar
Laurent Montel committed
26
#include "blogilo_debug.h"
27

Laurent Montel's avatar
Laurent Montel committed
28
WaitWidget::WaitWidget(QWidget *parent)
Laurent Montel's avatar
Cleanup  
Laurent Montel committed
29
    : QDialog(parent)
30
{
Laurent Montel's avatar
Laurent Montel committed
31

32 33 34 35 36
    setupUi(this);
}

WaitWidget::~WaitWidget()
{
Laurent Montel's avatar
Laurent Montel committed
37

38 39
}

Laurent Montel's avatar
Laurent Montel committed
40
void WaitWidget::setText(const QString &text)
41
{
Laurent Montel's avatar
Laurent Montel committed
42

Laurent Montel's avatar
Laurent Montel committed
43 44
    operationNameLabel->setText(text);
    setWindowTitle(text);
45 46
}

Laurent Montel's avatar
Laurent Montel committed
47
void WaitWidget::setMaxJobs(int max)
48
{
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
    progressBar->setMaximum(max);
51 52 53 54
}

void WaitWidget::jobDone()
{
Laurent Montel's avatar
Laurent Montel committed
55

Laurent Montel's avatar
Laurent Montel committed
56
    progressBar->setValue(progressBar->value() + 1);
57 58 59 60
}

void WaitWidget::setBusyState()
{
Laurent Montel's avatar
Laurent Montel committed
61 62
    progressBar->setMinimum(0);
    progressBar->setMaximum(0);
63 64
}