libkpimexchange Library API Documentation

exchangeprogress.cpp

00001 /* 00002 This file is part of libkpimexchange 00003 Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 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"
KDE Logo
This file is part of the documentation for libkpimexchange Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:51:24 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003