[99923] trunk/dports/kde/kmymoney4-devel
mk at macports.org
mk at macports.org
Tue Nov 20 23:33:38 PST 2012
Revision: 99923
https://trac.macports.org/changeset/99923
Author: mk at macports.org
Date: 2012-11-20 23:33:37 -0800 (Tue, 20 Nov 2012)
Log Message:
-----------
kmymoney4-devel: git version update + patch for opt-in configurable online-status columns in homepage accounts table
Modified Paths:
--------------
trunk/dports/kde/kmymoney4-devel/Portfile
trunk/dports/kde/kmymoney4-devel/files/patch_kmymoney-views-khomeview.cpp.diff
Modified: trunk/dports/kde/kmymoney4-devel/Portfile
===================================================================
--- trunk/dports/kde/kmymoney4-devel/Portfile 2012-11-21 07:33:05 UTC (rev 99922)
+++ trunk/dports/kde/kmymoney4-devel/Portfile 2012-11-21 07:33:37 UTC (rev 99923)
@@ -8,10 +8,10 @@
fetch.type git
git.url git://anongit.kde.org/kmymoney
-git.branch b71e8d38fc210519f30ba716d699daaab5f669de
+git.branch ee1804f00cf94ea1a0b1ee1ddfa29e6c97110249
name kmymoney4-devel
-version 4.6-20121118
+version 4.6-20121120
categories kde kde4 finance
maintainers mk pixilla openmaintainer
Modified: trunk/dports/kde/kmymoney4-devel/files/patch_kmymoney-views-khomeview.cpp.diff
===================================================================
--- trunk/dports/kde/kmymoney4-devel/files/patch_kmymoney-views-khomeview.cpp.diff 2012-11-21 07:33:05 UTC (rev 99922)
+++ trunk/dports/kde/kmymoney4-devel/files/patch_kmymoney-views-khomeview.cpp.diff 2012-11-21 07:33:37 UTC (rev 99923)
@@ -1,85 +1,156 @@
+diff --git a/kmymoney/dialogs/settings/ksettingshomedecl.ui b/kmymoney/dialogs/settings/ksettingshomedecl.ui
+index df9b95c..1193561 100644
+--- a/kmymoney/dialogs/settings/ksettingshomedecl.ui
++++ b/kmymoney/dialogs/settings/ksettingshomedecl.ui
+@@ -183,12 +183,19 @@ Use the buttons and checkboxes to customize the layout of the home page.</string
+ <string>Information display</string>
+ </property>
+ <layout class="QGridLayout">
+- <item row="0" column="0" rowspan="1" colspan="3">
++ <item row="0" column="0" colspan="3">
+ <widget class="QCheckBox" name="kcfg_ShowLimitInfo">
+ <property name="text">
+ <string>Show Account Limit Information</string>
+ </property>
+ </widget>
++ </item>
++ <item row="1" column="0" colspan="3">
++ <widget class="QCheckBox" name="kcfg_ShowBalanceStatusOfOnlineAccounts">
++ <property name="text">
++ <string>Show balance-status of mapped online accounts</string>
++ </property>
++ </widget>
+ </item>
+ </layout>
+ </widget>
+diff --git a/kmymoney/kmymoney.kcfg b/kmymoney/kmymoney.kcfg
+index 5b66586..a60ccad 100644
+--- a/kmymoney/kmymoney.kcfg
++++ b/kmymoney/kmymoney.kcfg
+@@ -175,6 +175,10 @@
+ <label>Show account limit information on the Homepage</label>
+ <default>true</default>
+ </entry>
++ <entry name="ShowBalanceStatusOfOnlineAccounts" type="Bool">
++ <label>Show balance-status of mapped online accounts on the Homepage</label>
++ <default>false</default>
++ </entry>
+ </group>
+ <group name="List Options">
+ <entry name="HideUnusedCategory" type="Bool">
diff --git a/kmymoney/views/khomeview.cpp b/kmymoney/views/khomeview.cpp
-index 15d630b..7a92361 100644
+index 498e4a5..403f0ed 100644
--- a/kmymoney/views/khomeview.cpp
+++ b/kmymoney/views/khomeview.cpp
-@@ -841,6 +841,22 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney&
+@@ -841,11 +841,31 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney&
tmp = QString("<td>") +
link(VIEW_LEDGER, QString("?id=%1").arg(acc.id())) + acc.name() + linkend() + "</td>";
+
-+ //show account's online-status
+ QString tmp_os, pathOK, pathNotOK;
-+ KIconLoader::global()->loadIcon(QString("dialog-ok-apply"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathOK);
-+ KIconLoader::global()->loadIcon(QString("dialog-cancel"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathNotOK);
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts())
++ {
++ //show account's online-status
++ KIconLoader::global()->loadIcon(QString("dialog-ok-apply"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathOK);
++ KIconLoader::global()->loadIcon(QString("dialog-cancel"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathNotOK);
+
-+ if(acc.value("lastImportedTransactionDate").isEmpty() || acc.value("lastStatementBalance").isEmpty())
-+ tmp_os="-";
-+ else if(file->hasMatchingOnlineBalance(acc))
-+ tmp_os=QString("<img src=\"%1\" border=\"0\"></a>").arg(pathOK);
-+ else
-+ tmp_os=QString("<img src=\"%1\" border=\"0\"></a>").arg(pathNotOK);
++ if(acc.value("lastImportedTransactionDate").isEmpty() || acc.value("lastStatementBalance").isEmpty())
++ tmp_os="-";
++ else if(file->hasMatchingOnlineBalance(acc))
++ tmp_os=QString("<img src=\"%1\" border=\"0\"></a>").arg(pathOK);
++ else
++ tmp_os=QString("<img src=\"%1\" border=\"0\"></a>").arg(pathNotOK);
+
-+ tmp += QString("<td class=\"center\">%1</td>").arg(tmp_os);
++ tmp += QString("<td class=\"center\">%1</td>").arg(tmp_os);
++ }
+
+
//show account balance
tmp += QString("<td class=\"right\">%1</td>").arg(showColoredAmount(amount, value.isNegative()));
-@@ -848,10 +864,10 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney&
+ //show minimum balance column if requested
if (showMinBal) {
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts()) tmp +=QString("<td></td>");
//if it is an investment, show minimum balance empty
if (acc.accountType() == MyMoneyAccount::Investment) {
-- tmp += QString("<td class=\"right\"> </td>");
-+ tmp += QString("<td></td><td class=\"right\"> </td>");
- } else {
- //show minimum balance entry
-- tmp += QString("<td class=\"right\">%1</td>").arg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative()));
-+ tmp += QString("<td></td><td class=\"right\">%1</td>").arg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative()));
- }
- }
- // qDebug("accountEntry = '%s'", tmp.toLatin1());
-@@ -1225,6 +1241,9 @@ void KHomeView::showAssetsLiabilities(void)
+ tmp += QString("<td class=\"right\"> </td>");
+@@ -1218,6 +1238,14 @@ void KHomeView::showAssetsLiabilities(void)
+
+ //only do it if we have assets or liabilities account
+ if (nameAssetsIdx.count() > 0 || nameLiabilitiesIdx.count() > 0) {
++ QString statusHeader;
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts())
++ {
++ QString pathStatusHeader;
++ KIconLoader::global()->loadIcon(QString("online-banking"), KIconLoader::Small, KIconLoader::SizeSmall, KIconLoader::DefaultState, QStringList(), &pathStatusHeader);
++ statusHeader=QString("<img src=\"%1\" border=\"0\"></a>").arg(pathStatusHeader);
++ }
++
+ //print header
+ d->m_html += "<div class=\"shadow\"><div class=\"displayblock\"><div class=\"summaryheader\">" + i18n("Assets and Liabilities Summary") + "</div>\n<div class=\"gap\"> </div>\n";
+ d->m_html += "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" class=\"summarytable\" >";
+@@ -1225,6 +1253,11 @@ void KHomeView::showAssetsLiabilities(void)
d->m_html += "<tr class=\"item\"><td class=\"left\" width=\"30%\">";
d->m_html += i18n("Asset Accounts");
d->m_html += "</td>";
-+ d->m_html += "<td class=\"setcolor\">";
-+ d->m_html += i18n("Status");
-+ d->m_html += "</td>";
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts()) {
++ d->m_html += "<td class=\"setcolor\">";
++ d->m_html += statusHeader;
++ d->m_html += "</td>";
++ }
d->m_html += "<td width=\"15%\" class=\"right\">";
d->m_html += i18n("Current Balance");
d->m_html += "</td>";
-@@ -1233,6 +1252,9 @@ void KHomeView::showAssetsLiabilities(void)
+@@ -1233,10 +1266,18 @@ void KHomeView::showAssetsLiabilities(void)
d->m_html += "<td class=\"left\" width=\"30%\">";
d->m_html += i18n("Liability Accounts");
d->m_html += "</td>";
-+ d->m_html += "<td class=\"setcolor\">";
-+ d->m_html += i18n("Status");
-+ d->m_html += "</td>";
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts()) {
++ d->m_html += "<td class=\"setcolor\">";
++ d->m_html += statusHeader;
++ d->m_html += "</td>";
++ }
d->m_html += "<td width=\"15%\" class=\"right\">";
d->m_html += i18n("Current Balance");
d->m_html += "</td></tr>";
-@@ -1292,7 +1314,7 @@ void KHomeView::showAssetsLiabilities(void)
+
++ QString tmp_os;
++ if(KMyMoneyGlobalSettings::showBalanceStatusOfOnlineAccounts()) tmp_os="<td></td>";
++
+ //get asset and liability accounts
+ QMap<QString, MyMoneyAccount>::const_iterator asset_it = nameAssetsIdx.constBegin();
+ QMap<QString, MyMoneyAccount>::const_iterator liabilities_it = nameLiabilitiesIdx.constBegin();
+@@ -1267,7 +1308,7 @@ void KHomeView::showAssetsLiabilities(void)
+ ++asset_it;
+ } else {
+ //write a white space if we don't
+- d->m_html += "<td></td><td></td>";
++ d->m_html += QString("<td></td>%1<td></td>").arg(tmp_os);
+ }
+
+ //leave the intermediate column empty
+@@ -1292,7 +1333,7 @@ void KHomeView::showAssetsLiabilities(void)
++liabilities_it;
} else {
//leave the space empty if we run out of liabilities
- d->m_html += "<td></td><td></td>";
-+ d->m_html += "<td></td><td></td><td></td>";
++ d->m_html += QString("<td></td>%1<td></td>").arg(tmp_os);
}
d->m_html += "</tr>";
}
-@@ -1311,20 +1333,20 @@ void KHomeView::showAssetsLiabilities(void)
+@@ -1311,20 +1352,20 @@ void KHomeView::showAssetsLiabilities(void)
d->m_html += QString("<tr class=\"row-%1\" style=\"font-weight:bold;\">").arg(i++ & 0x01 ? "even" : "odd");
//print total for assets
- d->m_html += QString("<td class=\"left\">%1</td><td align=\"right\">%2</td>").arg(i18n("Total Assets")).arg(showColoredAmount(amountAssets, netAssets.isNegative()));
-+ d->m_html += QString("<td class=\"left\">%1</td><td></td><td align=\"right\">%2</td>").arg(i18n("Total Assets")).arg(showColoredAmount(amountAssets, netAssets.isNegative()));
++ d->m_html += QString("<td class=\"left\">%1</td>%2<td align=\"right\">%3</td>").arg(i18n("Total Assets")).arg(tmp_os).arg(showColoredAmount(amountAssets, netAssets.isNegative()));
//leave the intermediate column empty
d->m_html += "<td class=\"setcolor\"></td>";
//print total liabilities
- d->m_html += QString("<td class=\"left\">%1</td><td align=\"right\">%2</td>").arg(i18n("Total Liabilities")).arg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()));
-+ d->m_html += QString("<td class=\"left\">%1</td><td></td><td align=\"right\">%2</td>").arg(i18n("Total Liabilities")).arg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()));
++ d->m_html += QString("<td class=\"left\">%1</td>%2<td align=\"right\">%3</td>").arg(i18n("Total Liabilities")).arg(tmp_os).arg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()));
d->m_html += "</tr>";
//print net worth
@@ -87,8 +158,8 @@
- d->m_html += "<td></td><td></td><td class=\"setcolor\"></td>";
- d->m_html += QString("<td class=\"left\">%1</td><td align=\"right\">%2</td>").arg(i18n("Net Worth")).arg(showColoredAmount(amountNetWorth, netWorth.isNegative()));
-+ d->m_html += "<td></td><td></td><td></td><td class=\"setcolor\"></td>";
-+ d->m_html += QString("<td class=\"left\">%1</td><td></td><td align=\"right\">%2</td>").arg(i18n("Net Worth")).arg(showColoredAmount(amountNetWorth, netWorth.isNegative()));
++ d->m_html += QString("<td></td><td></td>%1<td class=\"setcolor\"></td>").arg(tmp_os);
++ d->m_html += QString("<td class=\"left\">%1</td>%2<td align=\"right\">%3</td>").arg(i18n("Net Worth")).arg(tmp_os).arg(showColoredAmount(amountNetWorth, netWorth.isNegative()));
d->m_html += "</tr>";
d->m_html += "</table>";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121120/4f8bce95/attachment-0001.html>
More information about the macports-changes
mailing list