From kde-commits Mon Dec 31 19:08:38 2012 From: Montel Laurent Date: Mon, 31 Dec 2012 19:08:38 +0000 To: kde-commits Subject: [kdepim] kmail: Add more infos Message-Id: <20121231190838.226B7A6091 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=135698093013220 Git commit 33d90623782c59e9bf0c37a566e1d1a05b9d00de by Montel Laurent. Committed on 31/12/2012 at 20:08. Pushed by mlaurent into branch 'master'. Add more infos M +21 -5 kmail/collectionquotapage_p.cpp M +3 -0 kmail/collectionquotapage_p.h http://commits.kde.org/kdepim/33d90623782c59e9bf0c37a566e1d1a05b9d00de diff --git a/kmail/collectionquotapage_p.cpp b/kmail/collectionquotapage_p.= cpp index 1360b2c..8b1c5ed 100644 --- a/kmail/collectionquotapage_p.cpp +++ b/kmail/collectionquotapage_p.cpp @@ -2,6 +2,8 @@ * * Copyright (c) 2006 Till Adam * + * Copyright (c) 2012 Laurent Montel + * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,14 +32,15 @@ = #include "collectionquotapage_p.h" = -#include -#include = #include "kmkernel.h" -#include "klocale.h" -#include "kdebug.h" + +#include #include = +#include +#include +#include = QuotaWidget::QuotaWidget( QWidget* parent ) :QWidget( parent ) @@ -47,8 +50,20 @@ QuotaWidget::QuotaWidget( QWidget* parent ) QGridLayout* layout =3D new QGridLayout( stuff ); layout->setMargin( KDialog::marginHint() ); layout->setSpacing( KDialog::spacingHint() ); + + QLabel *lab =3D new QLabel(i18n("Usage:")); + layout->addWidget( lab, 0, 0 ); + + mUsage =3D new QLabel; + layout->addWidget( mUsage, 0, 1 ); + + + QLabel *Status =3D new QLabel(i18n("Status:")); + layout->addWidget( Status, 1, 0 ); mProgressBar =3D new QProgressBar( stuff ); - layout->addWidget( mProgressBar, 2, 1 ); + // xgettext: no-c-format + mProgressBar->setFormat(i18n("%p% full")); + layout->addWidget( mProgressBar, 1, 1 ); box->addWidget( stuff ); box->addStretch( 2 ); } @@ -57,6 +72,7 @@ void QuotaWidget::setQuotaInfo( qint64 current, qint64 ma= xValue ) { mProgressBar->setMaximum( maxValue ); mProgressBar->setValue( current ); + mUsage->setText(i18n("%1 of %2 KB used",current, maxValue)); } = #include "collectionquotapage_p.moc" diff --git a/kmail/collectionquotapage_p.h b/kmail/collectionquotapage_p.h index ed657b6..c3b2e1f 100644 --- a/kmail/collectionquotapage_p.h +++ b/kmail/collectionquotapage_p.h @@ -37,6 +37,8 @@ #include = class QProgressBar; +class QLabel; + class QuotaWidget : public QWidget { = Q_OBJECT @@ -48,6 +50,7 @@ public: = private: QProgressBar* mProgressBar; + QLabel *mUsage; }; = #endif /* COLLECTIONQUOTAPAGE_P_H */