[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim] kmail: Add more infos
From:       Montel Laurent <montel () kde ! org>
Date:       2012-12-31 19:08:38
Message-ID: 20121231190838.226B7A6091 () git ! kde ! org
[Download RAW message or body]

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 <adam@kde.org>
  *
+ * Copyright (c) 2012 Laurent Montel <montel@kde.or>
+ *
  *
  *  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 <qlayout.h>
-#include <qprogressbar.h>
 
 #include "kmkernel.h"
-#include "klocale.h"
-#include "kdebug.h"
+
+#include <KLocale>
 #include <KDialog>
 
+#include <QLabel>
+#include <qlayout.h>
+#include <qprogressbar.h>
 
 QuotaWidget::QuotaWidget( QWidget* parent )
   :QWidget( parent )
@@ -47,8 +50,20 @@ QuotaWidget::QuotaWidget( QWidget* parent )
   QGridLayout* layout = new QGridLayout( stuff );
   layout->setMargin( KDialog::marginHint() );
   layout->setSpacing( KDialog::spacingHint() );
+
+  QLabel *lab = new QLabel(i18n("Usage:"));
+  layout->addWidget( lab, 0, 0 );
+
+  mUsage = new QLabel;
+  layout->addWidget( mUsage, 0, 1 );
+
+
+  QLabel *Status = new QLabel(i18n("Status:"));
+  layout->addWidget( Status, 1, 0 );
   mProgressBar = 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 maxValue )
 {
   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 <QWidget>
 
 class QProgressBar;
+class QLabel;
+
 class QuotaWidget : public QWidget {
 
   Q_OBJECT
@@ -48,6 +50,7 @@ public:
 
 private:
   QProgressBar* mProgressBar;
+  QLabel *mUsage;
 };
 
 #endif /* COLLECTIONQUOTAPAGE_P_H */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic