exchangeprogress.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <qlayout.h>
00022 #include <qlabel.h>
00023 #include <qcombobox.h>
00024
00025 #include <klocale.h>
00026 #include <kmessagebox.h>
00027 #include <kapplication.h>
00028 #include <kglobal.h>
00029 #include <kconfig.h>
00030 #include <kstandarddirs.h>
00031 #include <ksimpleconfig.h>
00032
00033 #include "exchangeprogress.h"
00034 using namespace KPIM;
00035
00036 ExchangeProgress::ExchangeProgress(QWidget *parent)
00037 : KProgressDialog(parent, "", i18n("Exchange Download Progress"), i18n("Exchange Plugin"), "text" )
00038 {
00039 m_finished = 0;
00040 m_total = 0;
00041 setAutoClose( false );
00042 setLabel( i18n( "Listing appointments" ) );
00043 }
00044
00045 ExchangeProgress::~ExchangeProgress()
00046 {
00047 }
00048
00049 void ExchangeProgress::slotTransferStarted()
00050 {
00051 m_total++;
00052 progressBar()->setTotalSteps( m_total );
00053 updateLabel();
00054 }
00055
00056 void ExchangeProgress::slotTransferFinished()
00057 {
00058 m_finished++;
00059 updateLabel();
00060 if ( m_finished == m_total ) {
00061 emit complete( this );
00062 }
00063 }
00064
00065 void ExchangeProgress::updateLabel()
00066 {
00067 progressBar()->setValue( m_finished );
00068 QString str = i18n( "Downloading, %1 of %2" ).arg( m_finished ).arg( m_total );
00069 setLabel( str );
00070 }
00071
00072 #include "exchangeprogress.moc"
This file is part of the documentation for libkpimexchange Library Version 3.2.2.