• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • collectionpage
collectionquotawidget.cpp
Go to the documentation of this file.
1 
33 #include "collectionquotawidget.h"
34 
35 
36 #include "kmkernel.h"
37 
38 #include <KLocalizedString>
39 #include <KDialog>
40 #include <KLocale>
41 
42 #include <QLabel>
43 #include <qlayout.h>
44 #include <qprogressbar.h>
45 
46 CollectionQuotaWidget::CollectionQuotaWidget( QWidget* parent )
47  :QWidget( parent )
48 {
49  QVBoxLayout *box = new QVBoxLayout( this );
50  QWidget *stuff = new QWidget( this );
51  QGridLayout* layout = new QGridLayout( stuff );
52  layout->setMargin( KDialog::marginHint() );
53  layout->setSpacing( KDialog::spacingHint() );
54 
55  QLabel *lab = new QLabel(i18n("Usage:"));
56  layout->addWidget( lab, 0, 0 );
57 
58  mUsage = new QLabel;
59  layout->addWidget( mUsage, 0, 1 );
60 
61 
62  QLabel *Status = new QLabel(i18n("Status:"));
63  layout->addWidget( Status, 1, 0 );
64  mProgressBar = new QProgressBar( stuff );
65  // xgettext: no-c-format
66  mProgressBar->setFormat(i18n("%p% full"));
67  layout->addWidget( mProgressBar, 1, 1 );
68  box->addWidget( stuff );
69  box->addStretch( 2 );
70 }
71 
72 void CollectionQuotaWidget::setQuotaInfo( qint64 current, qint64 maxValue )
73 {
74  mProgressBar->setMaximum( maxValue );
75  mProgressBar->setValue( current );
76  mUsage->setText(i18n("%1 of %2 used", KGlobal::locale()->formatByteSize( qMax( 0LL, current ) ), KGlobal::locale()->formatByteSize( qMax( 0LL, maxValue ) ) ) );
77 }
78 
QWidget::layout
QLayout * layout() const
QProgressBar
QWidget
QProgressBar::setMaximum
void setMaximum(int maximum)
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
QGridLayout
QProgressBar::setValue
void setValue(int value)
QGridLayout::setSpacing
void setSpacing(int spacing)
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
CollectionQuotaWidget::setQuotaInfo
void setQuotaInfo(qint64 currentValue, qint64 maxValue)
Definition: collectionquotawidget.cpp:72
QVBoxLayout
QLabel::setText
void setText(const QString &)
QLayout::setMargin
void setMargin(int margin)
kmkernel.h
QProgressBar::setFormat
void setFormat(const QString &format)
QBoxLayout::addStretch
void addStretch(int stretch)
QWidget::QWidget
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
CollectionQuotaWidget::CollectionQuotaWidget
CollectionQuotaWidget(QWidget *parent)
Copyright (c) 2006 Till Adam adam@kde.org
Definition: collectionquotawidget.cpp:46
QLabel
collectionquotawidget.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal