kmail

folderdiaquotatab_p.cpp
1
32#include "folderdiaquotatab_p.h"
33
34#include <tqlayout.h>
35#include <tqlabel.h>
36#include <tqprogressbar.h>
37#include <tqwhatsthis.h>
38#include <tqcombobox.h>
39
40#include <math.h>
41
42#include "kmkernel.h"
43#include "tdelocale.h"
44#include "tdeconfig.h"
45#include "kdebug.h"
46#include "kdialog.h"
47#include "globalsettings.h"
48#include "quotajobs.h"
49
50using namespace KMail;
51
52struct QuotaInfo;
53
54QuotaWidget::QuotaWidget( TQWidget* parent, const char* name )
55 :TQWidget( parent, name )
56{
57 TQVBoxLayout *box = new TQVBoxLayout(this);
58 TQWidget *stuff = new TQWidget( this );
59 TQGridLayout* layout =
60 new TQGridLayout( stuff, 3, 3,
61 KDialog::marginHint(),
62 KDialog::spacingHint() );
63 mInfoLabel = new TQLabel("", stuff );
64 mRootLabel = new TQLabel("", stuff );
65 mProgressBar = new TQProgressBar( stuff );
66 layout->addWidget( new TQLabel( i18n("Root:" ), stuff ), 0, 0 );
67 layout->addWidget( mRootLabel, 0, 1 );
68 layout->addWidget( new TQLabel( i18n("Usage:"), stuff ), 1, 0 );
69 //layout->addWidget( new TQLabel( i18n("Status:"), stuff ), 2, 0 );
70 layout->addWidget( mInfoLabel, 1, 1 );
71 layout->addWidget( mProgressBar, 2, 1 );
72 box->addWidget( stuff );
73 box->addStretch( 2 );
74}
75
76void QuotaWidget::setQuotaInfo( const QuotaInfo& info )
77{
78 // we are assuming only to get STORAGE type info here, thus
79 // casting to int is safe
80 int current = info.current().toInt();
81 int max = info.max().toInt();
82 mProgressBar->setProgress( current, max );
83 mInfoLabel->setText( info.toString() );
84 mRootLabel->setText( info.root() );
85}
86
87
88#include "folderdiaquotatab_p.moc"
folderdiaquotatab.h
Definition: aboutdata.cpp:40