~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to kmail/folderdialogquotatab_p.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * folderdialogquotatab_p.cpp
3
 
 *
4
 
 * Copyright (c) 2006 Till Adam <adam@kde.org>
5
 
 *
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; version 2 of the License
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License along
17
 
 *  with this program; if not, write to the Free Software Foundation, Inc.,
18
 
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 
 *
20
 
 *  In addition, as a special exception, the copyright holders give
21
 
 *  permission to link the code of this program with any edition of
22
 
 *  the Qt library by Trolltech AS, Norway (or with modified versions
23
 
 *  of Qt that use the same license as Qt), and distribute linked
24
 
 *  combinations including the two.  You must obey the GNU General
25
 
 *  Public License in all respects for all of the code used other than
26
 
 *  Qt.  If you modify this file, you may extend this exception to
27
 
 *  your version of the file, but you are not obligated to do so.  If
28
 
 *  you do not wish to do so, delete this exception statement from
29
 
 *  your version.
30
 
 */
31
 
 
32
 
#include "folderdialogquotatab_p.h"
33
 
 
34
 
#include <qlayout.h>
35
 
#include <qlabel.h>
36
 
#include <qprogressbar.h>
37
 
#include <qwhatsthis.h>
38
 
#include <qcombobox.h>
39
 
 
40
 
#include <math.h>
41
 
 
42
 
#include "kmkernel.h"
43
 
#include "klocale.h"
44
 
#include "kconfig.h"
45
 
#include "kdebug.h"
46
 
#include "kdialog.h"
47
 
#include "globalsettings.h"
48
 
#include "quotajobs.h"
49
 
 
50
 
namespace KMail { class QuotaInfo; }
51
 
 
52
 
using namespace KMail;
53
 
 
54
 
QuotaWidget::QuotaWidget( QWidget* parent, const char* name )
55
 
        :QWidget( parent )
56
 
{
57
 
      setObjectName( name );
58
 
      QVBoxLayout *box = new QVBoxLayout( this );
59
 
      QWidget *stuff = new QWidget( this );
60
 
      QGridLayout* layout = new QGridLayout( stuff );
61
 
      layout->setMargin( KDialog::marginHint() );
62
 
      layout->setSpacing( KDialog::spacingHint() );
63
 
      mInfoLabel = new QLabel("", stuff );
64
 
      mRootLabel = new QLabel("", stuff );
65
 
      mProgressBar = new QProgressBar( stuff );
66
 
      layout->addWidget( new QLabel( i18n("Root:" ), stuff ), 0, 0 );
67
 
      layout->addWidget( mRootLabel, 0, 1 );
68
 
      layout->addWidget( new QLabel( i18n("Usage:"), stuff ), 1, 0 );
69
 
      //layout->addWidget( new QLabel( 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
 
 
76
 
void 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->setMaximum( max );
83
 
      mProgressBar->setValue( current );
84
 
      mInfoLabel->setText( info.toString() );
85
 
      mRootLabel->setText( info.root() );
86
 
}
87
 
 
88
 
 
89
 
#include "folderdialogquotatab_p.moc"