summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/sendmailprogress.cpp
blob: 6cd6409d6f70600163cd30e636168382d93866e8 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "sendmailprogress.h"
#include <q3progressbar.h>
#include <qlabel.h>
#include <klocale.h>

progressMailSend::progressMailSend(QWidget*parent, const char * name)
    :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0)
{
}

progressMailSend::~progressMailSend()
{
}

void progressMailSend::setMaxMails(unsigned int aMaxMails)
{
    m_max_mail = aMaxMails;
    allMailProgressBar->setTotalSteps(aMaxMails);
    setMails();
}

void progressMailSend::setCurrentMails(unsigned int aCurrent)
{
    m_current_mail = aCurrent;
    allMailProgressBar->setProgress(aCurrent);
    setMails();
}
    
void progressMailSend::setSingleMail(unsigned int aCurrent,unsigned int aMax)
{
    m_current_single = aCurrent;
    m_max_single = aMax;
    setSingle();
}

void progressMailSend::setSingle()
{
    QString text = QString(i18n("%1 of %2 bytes send")).arg(m_current_single).arg(m_max_single);
    singleMailLabel->setText(text);
    singleMailProgressBar->setTotalSteps(m_max_single);
    singleMailProgressBar->setProgress(m_current_single);
}

void progressMailSend::setMails()
{
    QString text = QString(i18n("Sending mail %1 of %2")).arg(m_current_mail+1).arg(m_max_mail);
    allMailLabel->setText(text);
}