kmail

folderdiaquotatab_p.cpp

00001 
00032 #include "folderdiaquotatab_p.h"
00033 
00034 #include <qlayout.h>
00035 #include <qlabel.h>
00036 #include <qprogressbar.h>
00037 #include <qwhatsthis.h>
00038 #include <qcombobox.h>
00039 
00040 #include <math.h>
00041 
00042 #include "kmkernel.h"
00043 #include "klocale.h"
00044 #include "kconfig.h"
00045 #include "kdebug.h"
00046 #include "kdialog.h"
00047 #include "globalsettings.h"
00048 #include "quotajobs.h"
00049 
00050 using namespace KMail;
00051 
00052 struct QuotaInfo;
00053 
00054 QuotaWidget::QuotaWidget( QWidget* parent, const char* name )
00055         :QWidget( parent, name )
00056 {
00057       QVBoxLayout *box = new QVBoxLayout(this);
00058       QWidget *stuff = new QWidget( this );
00059       QGridLayout* layout =
00060           new QGridLayout( stuff, 3, 3,
00061                            KDialog::marginHint(),
00062                            KDialog::spacingHint() );
00063       mInfoLabel = new QLabel("", stuff );
00064       mRootLabel = new QLabel("", stuff );
00065       mProgressBar = new QProgressBar( stuff );
00066       layout->addWidget( new QLabel( i18n("Root:" ), stuff ), 0, 0 );
00067       layout->addWidget( mRootLabel, 0, 1 );
00068       layout->addWidget( new QLabel( i18n("Usage:"), stuff ), 1, 0 );
00069       //layout->addWidget( new QLabel( i18n("Status:"), stuff ), 2, 0 );
00070       layout->addWidget( mInfoLabel, 1, 1 );
00071       layout->addWidget( mProgressBar, 2, 1 );
00072       box->addWidget( stuff );
00073       box->addStretch( 2 );
00074 }
00075 
00076 void QuotaWidget::setQuotaInfo( const QuotaInfo& info )
00077 {
00078       // we are assuming only to get STORAGE type info here, thus
00079       // casting to int is safe
00080       int current = info.current().toInt();
00081       int max = info.max().toInt();
00082       mProgressBar->setProgress( current, max );
00083       mInfoLabel->setText( info.toString() );
00084       mRootLabel->setText( info.root() );
00085 }
00086 
00087 
00088 #include "folderdiaquotatab_p.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys