summaryrefslogtreecommitdiffabout
path: root/kmicromail/statuswidget.cpp
blob: 19cf635f755ead51bff015fc8fa11fdad8de37df (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 <qprogressbar.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,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();
    }
}