blob: da231842c74b3acc02efd3a2b2857b8cfb331fe2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/***************************************************************************
kmymoneyfileinfodlg.cpp - description
-------------------
begin : Sun Oct 9 2005
copyright : (C) 2005 by Thomas Baumgart
email : Thomas Baumgart <[email protected]>
***************************************************************************/
/***************************************************************************
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// ----------------------------------------------------------------------------
// QT Includes
#include <tqlabel.h>
// ----------------------------------------------------------------------------
// KDE Includes
#include <kpushbutton.h>
#include <tdelistview.h>
// ----------------------------------------------------------------------------
// Project Includes
#include "kmymoneyfileinfodlg.h"
#include <kmymoney/imymoneystorage.h>
#include <kmymoney/mymoneyfile.h>
#include <kmymoney/kmymoneyutils.h>
KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(TQWidget *parent, const char *name )
: KMyMoneyFileInfoDlgDecl(parent, name)
{
// Hide the unused buttons.
buttonCancel->hide();
buttonHelp->hide();
// Now fill the fields with data
IMyMoneyStorage* storage = MyMoneyFile::instance()->storage();
m_creationDate->setText(storage->creationDate().toString(Qt::ISODate));
m_lastModificationDate->setText(storage->lastModificationDate().toString(Qt::ISODate));
m_baseCurrency->setText(storage->value("kmm-baseCurrency"));
m_payeeCount->setText(TQString("%1").arg(storage->payeeList().count()));
m_institutionCount->setText(TQString("%1").arg(storage->institutionList().count()));
TQValueList<MyMoneyAccount> a_list;
storage->accountList(a_list);
m_accountCount->setText(TQString("%1").arg(a_list.count()));
TQMap<MyMoneyAccount::accountTypeE, int> accountMap;
TQMap<MyMoneyAccount::accountTypeE, int> accountMapClosed;
TQValueList<MyMoneyAccount>::const_iterator it_a;
for(it_a = a_list.begin(); it_a != a_list.end(); ++it_a) {
accountMap[(*it_a).accountType()] = accountMap[(*it_a).accountType()] + 1;
accountMapClosed[(*it_a).accountType()] = accountMapClosed[(*it_a).accountType()] + 0;
if((*it_a).isClosed())
accountMapClosed[(*it_a).accountType()] = accountMapClosed[(*it_a).accountType()] + 1;
}
TQMap<MyMoneyAccount::accountTypeE, int>::const_iterator it_m;
for(it_m = accountMap.begin(); it_m != accountMap.end(); ++it_m) {
new TDEListViewItem(m_accountView, KMyMoneyUtils::accountTypeToString(it_m.key()), TQString("%1").arg(*it_m), TQString("%1").arg(accountMapClosed[it_m.key()]));
}
MyMoneyTransactionFilter filter;
filter.setReportAllSplits(false);
m_transactionCount->setText(TQString("%1").arg(storage->transactionList(filter).count()));
filter.setReportAllSplits(true);
m_splitCount->setText(TQString("%1").arg(storage->transactionList(filter).count()));
m_scheduleCount->setText(TQString("%1").arg(storage->scheduleList().count()));
MyMoneyPriceList list = storage->priceList();
MyMoneyPriceList::const_iterator it_p;
int pCount = 0;
for(it_p = list.begin(); it_p != list.end(); ++it_p)
pCount += (*it_p).count();
m_priceCount->setText(TQString("%1").arg(pCount));
}
KMyMoneyFileInfoDlg::~KMyMoneyFileInfoDlg()
{
}
#include "kmymoneyfileinfodlg.moc"
|