summaryrefslogtreecommitdiffabout
path: root/kmicromail/statuswidget.cpp
blob: 6da6f54c2a1fe8204c36aa1e807333f46c604ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <qtimer.h>
#include <q3progressbar.h>
#include <qlabel.h>

#include "statuswidget.h"

// the current problem I see is "locking": used exclusive by one sender


StatusWidget::StatusWidget( QWidget* parent, const char* name,Qt::WFlags fl )
    : StatusWidgetUI( parent, name, fl ) {

        setMaximumHeight( 15 );
        // hide for now since nothing reports decent progress data yet.
        statusProgress->hide();
    }

StatusWidget::~StatusWidget() {
}

void StatusWidget::setText( const QString& text ) {
    show();
    statusText->setText(  text );
    QTimer::singleShot( 5000, this, SLOT( hide() ) );
}

void StatusWidget::setProgress( int progress ) {
    show();
    statusProgress->setProgress( progress );
    if ( progress == 100 ) {
        hide();
    }
}