2 Copyright (c) 2012 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #include "importmailswidget.h"
19 #include "ui_importmailswidget.h"
21 #include <QTextDocument>
22 #include <QAbstractTextDocumentLayout>
25 using namespace MailImporter
;
29 ImportMailsWidget::ImportMailsWidget(QWidget
*parent
) :
31 ui(new Ui::ImportMailsWidget
)
36 ImportMailsWidget::~ImportMailsWidget()
41 void ImportMailsWidget::setStatusMessage( const QString
&status
)
43 ui
->textStatus
->setText( status
);
46 void ImportMailsWidget::setFrom( const QString
&from
)
48 ui
->from
->setText( from
);
51 void ImportMailsWidget::setTo( const QString
&to
)
53 ui
->to
->setText( to
);
56 void ImportMailsWidget::setCurrent( const QString
¤t
)
58 ui
->current
->setText( current
);
61 void ImportMailsWidget::setCurrent( int percent
)
63 ui
->done_current
->setValue( percent
);
66 void ImportMailsWidget::setOverall( int percent
)
68 ui
->done_overall
->setValue( percent
);
71 void ImportMailsWidget::addItem( QListWidgetItem
* item
)
73 ui
->log
->addItem(item
);
76 void ImportMailsWidget::setLastCurrentItem()
78 ui
->log
->setCurrentItem(ui
->log
->item(ui
->log
->count() - 1 ));
81 void ImportMailsWidget::addInfoLogEntry( const QString
&log
)
83 ui
->log
->addInfoLogEntry( log
);
86 void ImportMailsWidget::addErrorLogEntry( const QString
&log
)
88 ui
->log
->addErrorLogEntry( log
);
91 void ImportMailsWidget::clear()
96 setCurrent( QString() );