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

List:       kde-commits
Subject:    extragear/office/kmymoney/kmymoney/views
From:       Cristian OneČ› <onet.cristian () gmail ! com>
Date:       2010-07-23 19:00:47
Message-ID: 20100723190047.143E3AC7E2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1153680 by conet:

Display the account value including subaccounts when the account is collapsed.

 M  +23 -0     kforecastview.cpp  
 M  +4 -0      kforecastview.h  


--- trunk/extragear/office/kmymoney/kmymoney/views/kforecastview.cpp #1153679:1153680
@@ -67,6 +67,13 @@
   m_budgetList->setAllColumnsShowFocus(true);
   m_advancedList->setAlternatingRowColors(true);
 
+  connect(m_forecastList, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, \
SLOT(itemExpanded(QTreeWidgetItem*))); +  connect(m_forecastList, \
SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, \
SLOT(itemCollapsed(QTreeWidgetItem*))); +  connect(m_summaryList, \
SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(itemExpanded(QTreeWidgetItem*))); \
+  connect(m_summaryList, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, \
SLOT(itemCollapsed(QTreeWidgetItem*))); +  connect(m_budgetList, \
SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(itemExpanded(QTreeWidgetItem*))); \
+  connect(m_budgetList, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, \
SLOT(itemCollapsed(QTreeWidgetItem*))); +
   m_forecastChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
   m_chartLayout = m_tabChart->layout();
   m_chartLayout->setSpacing(6);
@@ -960,6 +967,22 @@
   item->setTextAlignment(column, Qt::AlignRight | Qt::AlignVCenter);
 }
 
+void KForecastView::itemExpanded(QTreeWidgetItem *item)
+{
+  if (!item->parent() || !item->parent()->parent())
+    return;
+  for (int i = 1; i < item->columnCount(); ++i) {
+    showAmount(item, i, item->data(i, AmountRole).value<MyMoneyMoney>(), \
MyMoneyFile::instance()->security(item->data(0, \
AccountRole).value<MyMoneyAccount>().currencyId())); +  }
+}
+
+void KForecastView::itemCollapsed(QTreeWidgetItem *item)
+{
+  for (int i = 1; i < item->columnCount(); ++i) {
+    showAmount(item, i, item->data(i, ValueRole).value<MyMoneyMoney>(), \
MyMoneyFile::instance()->baseCurrency()); +  }
+}
+
 void KForecastView::loadChartView(void)
 {
   MyMoneyReport::EDetailLevel detailLevel[4] = { MyMoneyReport::eDetailAll, \
MyMoneyReport::eDetailTop, MyMoneyReport::eDetailGroup, MyMoneyReport::eDetailTotal \
                };
--- trunk/extragear/office/kmymoney/kmymoney/views/kforecastview.h #1153679:1153680
@@ -126,6 +126,10 @@
    */
   QList<MyMoneyPrice> getAccountPrices(const MyMoneyAccount& acc);
 
+private slots:
+  void itemExpanded(QTreeWidgetItem *item);
+  void itemCollapsed(QTreeWidgetItem *item);
+
 private:
   void addAssetLiabilityRows(const MyMoneyForecast& forecast);
   void addIncomeExpenseRows(const MyMoneyForecast& forecast);


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

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