diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-01 17:25:32 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-01 17:25:32 -0600 |
commit | 89d8c2baa9b51d8da8511a54b9962155aa29c4c0 (patch) | |
tree | 5af383305d44c31dd8e499fe01c067f32e101029 /kmymoney2/dialogs/kselecttransactionsdlg.cpp | |
parent | a6000c6f2f1a03b34f15d1948f63f0c894f09451 (diff) | |
download | kmymoney-89d8c2baa9b51d8da8511a54b9962155aa29c4c0.tar.gz kmymoney-89d8c2baa9b51d8da8511a54b9962155aa29c4c0.zip |
Fix FTBFS
Diffstat (limited to 'kmymoney2/dialogs/kselecttransactionsdlg.cpp')
-rw-r--r-- | kmymoney2/dialogs/kselecttransactionsdlg.cpp | 178 |
1 files changed, 0 insertions, 178 deletions
diff --git a/kmymoney2/dialogs/kselecttransactionsdlg.cpp b/kmymoney2/dialogs/kselecttransactionsdlg.cpp deleted file mode 100644 index 51968f1..0000000 --- a/kmymoney2/dialogs/kselecttransactionsdlg.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/*************************************************************************** - kselecttransactionsdlg.cpp - ------------------- - begin : Wed May 16 2007 - copyright : (C) 2007 by Thomas Baumgart - email : ipwizard@users.sourceforge.net - ***************************************************************************/ - -/*************************************************************************** - * * - * 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. * - * * - ***************************************************************************/ - -// ---------------------------------------------------------------------------- -// QT Includes - -// ---------------------------------------------------------------------------- -// KDE Includes - -#include <kpushbutton.h> -#include <kstdguiitem.h> -#include <kapplication.h> -#include <kactivelabel.h> -#include <klocale.h> - -// ---------------------------------------------------------------------------- -// Project Includes - -#include <kmymoney/mymoneyfile.h> -#include <kmymoney/mymoneytransaction.h> -#include <kmymoney/kmymoneyglobalsettings.h> - -#include "kmergetransactionsdlg.h" - -TDESelectTransactionsDlg::TDESelectTransactionsDlg(const MyMoneyAccount& _account, TQWidget* parent, const char* name) : - TDESelectTransactionsDlgDecl(parent, name), - m_account(_account) -{ - // setup descriptive texts - setCaption(i18n("Select Transaction")); - m_description->setText(i18n("Select a transaction and press the OK button or use Cancel to select none.")); - - // clear current register contents - m_register->clear(); - - // no selection possible - m_register->setSelectionMode(TQTable::Single); - - // setup header font - TQFont font = KMyMoneyGlobalSettings::listHeaderFont(); - TQFontMetrics fm( font ); - int height = fm.lineSpacing()+6; - m_register->horizontalHeader()->setMinimumHeight(height); - m_register->horizontalHeader()->setMaximumHeight(height); - m_register->horizontalHeader()->setFont(font); - - // setup cell font - font = KMyMoneyGlobalSettings::listCellFont(); - m_register->setFont(font); - - // ... setup the register columns ... - m_register->setupRegister(m_account); - - // setup buttons - m_helpButton->setGuiItem(KStdGuiItem::help()); - buttonOk->setGuiItem(KStdGuiItem::ok()); - buttonCancel->setGuiItem(KStdGuiItem::cancel()); - - // default is to need at least one transaction selected - buttonOk->setDisabled(true); - - // catch some events from the register - m_register->installEventFilter(this); - - connect(m_register, TQT_SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotEnableOk(const KMyMoneyRegister::SelectedTransactions&))); - connect(m_register, TQT_SIGNAL(editTransaction()), this, TQT_SLOT(accept())); - - connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); -} - -void TDESelectTransactionsDlg::slotEnableOk(const KMyMoneyRegister::SelectedTransactions& list) -{ - buttonOk->setEnabled(list.count() != 0); -} - -void TDESelectTransactionsDlg::addTransaction(const MyMoneyTransaction& t) -{ - TQValueList<MyMoneySplit>::const_iterator it_s; - for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { - if((*it_s).accountId() == m_account.id()) { - KMyMoneyRegister::Transaction* tr = KMyMoneyRegister::Register::transactionFactory(m_register, t, (*it_s), 0); - // force full detail display - tr->setNumRowsRegister(tr->numRowsRegister(true)); - break; - } - } -} - -int TDESelectTransactionsDlg::exec(void) -{ - m_register->updateRegister(true); - m_register->updateContents(); - - m_register->setFocus(); - - return TDESelectTransactionsDlgDecl::exec(); -} - -void TDESelectTransactionsDlg::slotHelp(void) -{ - // kapp->invokeHelp("details.ledgers.match"); -} - -void TDESelectTransactionsDlg::show(void) -{ - TDESelectTransactionsDlgDecl::show(); - m_register->resize(KMyMoneyRegister::DetailColumn); -} - -void TDESelectTransactionsDlg::resizeEvent(TQResizeEvent* ev) -{ - // don't forget the resizer - TDESelectTransactionsDlgDecl::resizeEvent(ev); - - // resize the register - m_register->resize(KMyMoneyRegister::DetailColumn); -} - -MyMoneyTransaction TDESelectTransactionsDlg::transaction(void) const -{ - MyMoneyTransaction t; - - TQValueList<KMyMoneyRegister::RegisterItem*> list; - list = m_register->selectedItems(); - if(list.count()) { - KMyMoneyRegister::Transaction* _t = dynamic_cast<KMyMoneyRegister::Transaction*>(list[0]); - if(_t) - t = _t->transaction(); - } - return t; -} - -bool TDESelectTransactionsDlg::eventFilter(TQObject* o, TQEvent* e) -{ - bool rc = false; - TQKeyEvent* k; - - if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) { - switch(e->type()) { - case TQEvent::KeyPress: - k = dynamic_cast<TQKeyEvent*>(e); - if((k->state() & TQt::KeyButtonMask) == 0) { - switch(k->key()) { - case TQt::Key_Return: - case TQt::Key_Enter: - if(buttonOk->isEnabled()) { - accept(); - rc = true; - } - // tricky fall through here - default: - break; - } - } - // tricky fall through here - default: - break; - } - } - return rc; -} - -#include "kselecttransactionsdlg.moc" -// vim:cin:si:ai:et:ts=2:sw=2: |