[Kmymoney-devel] [PATCH 2/4] payee: Added payee_merge KAction
Felipe F. Tonello
eu at felipetonello.com
Wed Apr 24 07:19:41 UTC 2013
From: "Felipe F. Tonello" <eu at felipetonello.com>
Added KAction to the context menu and connected to the slotPayeeMerge().
Signed-off-by: Felipe F. Tonello <eu at felipetonello.com>
---
kmymoney/kmymoney.cpp | 7 +++++++
kmymoney/kmymoneyui.rc | 1 +
2 files changed, 8 insertions(+)
diff --git a/kmymoney/kmymoney.cpp b/kmymoney/kmymoney.cpp
index 05b74d6..c79dba2 100644
--- a/kmymoney/kmymoney.cpp
+++ b/kmymoney/kmymoney.cpp
@@ -948,6 +948,11 @@ void KMyMoneyApp::initActions(void)
payee_delete->setIcon(KIcon("list-remove-user"));
connect(payee_delete, SIGNAL(triggered()), this, SLOT(slotPayeeDelete()));
+ KAction *payee_merge = actionCollection()->addAction("payee_merge");
+ payee_merge->setText(i18n("Merge payees"));
+ payee_merge->setIcon(KIcon("merge"));
+ connect(payee_merge, SIGNAL(triggered()), this, SLOT(slotPayeeMerge()));
+
//Tags
KAction *tag_new = actionCollection()->addAction("tag_new");
tag_new->setText(i18n("New tag"));
@@ -6343,6 +6348,7 @@ void KMyMoneyApp::slotUpdateActions(void)
action("payee_delete")->setEnabled(false);
action("payee_rename")->setEnabled(false);
+ action("payee_merge")->setEnabled(false);
action("tag_delete")->setEnabled(false);
action("tag_rename")->setEnabled(false);
@@ -6637,6 +6643,7 @@ void KMyMoneyApp::slotUpdateActions(void)
if (d->m_selectedPayees.count() >= 1) {
action("payee_rename")->setEnabled(d->m_selectedPayees.count() == 1);
+ action("payee_merge")->setEnabled(d->m_selectedPayees.count() > 1);
action("payee_delete")->setEnabled(true);
}
diff --git a/kmymoney/kmymoneyui.rc b/kmymoney/kmymoneyui.rc
index f353641..9f40617 100644
--- a/kmymoney/kmymoneyui.rc
+++ b/kmymoney/kmymoneyui.rc
@@ -161,6 +161,7 @@
<Action name="payee_new" />
<Action name="payee_rename" />
<Action name="payee_delete" />
+ <Action name="payee_merge" />
</Menu>
<Menu name="tag_context_menu">
<title>Tag options</title>
--
1.7.11.7
More information about the KMyMoney-devel
mailing list