summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/transactioneditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/dialogs/transactioneditor.cpp')
-rw-r--r--kmymoney2/dialogs/transactioneditor.cpp400
1 files changed, 200 insertions, 200 deletions
diff --git a/kmymoney2/dialogs/transactioneditor.cpp b/kmymoney2/dialogs/transactioneditor.cpp
index c53d3c6..91f60b8 100644
--- a/kmymoney2/dialogs/transactioneditor.cpp
+++ b/kmymoney2/dialogs/transactioneditor.cpp
@@ -18,12 +18,12 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlabel.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qtooltip.h>
+#include <tqlabel.h>
+#include <tqapplication.h>
+#include <tqeventloop.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqtooltip.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -60,7 +60,7 @@
using namespace KMyMoneyRegister;
using namespace KMyMoneyTransactionForm;
-TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) :
+TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) :
m_transactions(list),
m_regForm(regForm),
m_item(item),
@@ -70,14 +70,14 @@ TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMon
m_openEditSplits(false)
{
m_item->startEditMode();
- connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotUpdateAccount()));
+ connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotUpdateAccount()));
}
TransactionEditor::~TransactionEditor()
{
// Make sure the widgets do not send out signals to the editor anymore
// After all, the editor is about to die
- QMap<QString, QWidget*>::iterator it_w;
+ TQMap<TQString, TQWidget*>::iterator it_w;
for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) {
(*it_w)->disconnect(this);
}
@@ -87,7 +87,7 @@ TransactionEditor::~TransactionEditor()
emit finishEdit(m_transactions);
}
-void TransactionEditor::slotUpdateAccount(const QString& id)
+void TransactionEditor::slotUpdateAccount(const TQString& id)
{
m_account = MyMoneyFile::instance()->account(id);
setupPrecision();
@@ -103,24 +103,24 @@ void TransactionEditor::slotUpdateAccount(void)
void TransactionEditor::setupPrecision(void)
{
const int prec = (m_account.id().isEmpty()) ? 2 : MyMoneyMoney::denomToPrec(m_account.fraction());
- QStringList widgets = QStringList::split(",", "amount,deposit,payment");
- QStringList::const_iterator it_w;
+ TQStringList widgets = TQStringList::split(",", "amount,deposit,payment");
+ TQStringList::const_iterator it_w;
for(it_w = widgets.begin(); it_w != widgets.end(); ++it_w) {
- QWidget * w;
+ TQWidget * w;
if((w = haveWidget(*it_w)) != 0) {
dynamic_cast<kMyMoneyEdit*>(w)->setPrecision(prec);
}
}
}
-void TransactionEditor::setup(QWidgetList& tabOrderWidgets, const MyMoneyAccount& account, KMyMoneyRegister::Action action)
+void TransactionEditor::setup(TQWidgetList& tabOrderWidgets, const MyMoneyAccount& account, KMyMoneyRegister::Action action)
{
m_account = account;
m_initialAction = action;
createEditWidgets();
m_regForm->arrangeEditWidgets(m_editWidgets, m_item);
m_regForm->tabOrder(tabOrderWidgets, m_item);
- QWidget* w = haveWidget("tabbar");
+ TQWidget* w = haveWidget("tabbar");
if(w)
tabOrderWidgets.append(w);
loadEditWidgets(action);
@@ -135,7 +135,7 @@ void TransactionEditor::clearFinalWidgets(void)
m_finalEditWidgets.clear();
}
-void TransactionEditor::addFinalWidget(const QWidget* w)
+void TransactionEditor::addFinalWidget(const TQWidget* w)
{
if(w) {
m_finalEditWidgets << w;
@@ -146,11 +146,11 @@ void TransactionEditor::slotReloadEditWidgets(void)
{
}
-bool TransactionEditor::eventFilter(QObject* o, QEvent* e)
+bool TransactionEditor::eventFilter(TQObject* o, TQEvent* e)
{
bool rc = false;
- if(o == haveWidget("number")) {
- if(e->type() == QEvent::MouseButtonDblClick) {
+ if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(haveWidget("number"))) {
+ if(e->type() == TQEvent::MouseButtonDblClick) {
emit assignNumber();
rc = true;
}
@@ -159,15 +159,15 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e)
// if the object is a widget, the event is a key press event and
// the object is one of our edit widgets, then ....
if(o->isWidgetType()
- && (e->type() == QEvent::KeyPress)
- && m_editWidgets.values().contains(dynamic_cast<QWidget*>(o))) {
- QKeyEvent* k = dynamic_cast<QKeyEvent*>(e);
- if((k->state() & Qt::KeyButtonMask) == 0) {
+ && (e->type() == TQEvent::KeyPress)
+ && m_editWidgets.values().tqcontains(dynamic_cast<TQWidget*>(o))) {
+ TQKeyEvent* k = dynamic_cast<TQKeyEvent*>(e);
+ if((k->state() & TQt::KeyButtonMask) == 0) {
bool isFinal = false;
- QValueList<const QWidget*>::const_iterator it_w;
+ TQValueList<const TQWidget*>::const_iterator it_w;
switch(k->key()) {
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
// we check, if the object is one of the m_finalEditWidgets and if it's
// a kMyMoneyEdit object that the value is not 0. If any of that is the
// case, it's the final object. In other cases, we convert the enter
@@ -176,7 +176,7 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e)
// we treat the return/enter key as such.
if(KMyMoneyGlobalSettings::enterMovesBetweenFields()) {
for(it_w = m_finalEditWidgets.begin(); !isFinal && it_w != m_finalEditWidgets.end(); ++it_w) {
- if(*it_w == o) {
+ if(TQT_BASE_OBJECT_CONST(*it_w) == TQT_BASE_OBJECT(o)) {
if(dynamic_cast<const kMyMoneyEdit*>(*it_w)) {
isFinal = !(dynamic_cast<const kMyMoneyEdit*>(*it_w)->value().isZero());
} else
@@ -188,25 +188,25 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e)
// for the non-final objects, we treat the return key as a TAB
if(!isFinal) {
- QKeyEvent evt(e->type(),
- Key_Tab, 0, k->state(), QString::null,
+ TQKeyEvent evt(e->type(),
+ Key_Tab, 0, k->state(), TQString(),
k->isAutoRepeat(), k->count());
- QApplication::sendEvent( o, &evt );
+ TQApplication::sendEvent( o, &evt );
// in case of a category item and the split button is visible
// send a second event so that we get passed the button.
if(dynamic_cast<KMyMoneyCategory*>(o) && dynamic_cast<KMyMoneyCategory*>(o)->splitButton())
- QApplication::sendEvent( o, &evt );
+ TQApplication::sendEvent( o, &evt );
} else {
- QTimer::singleShot(0, this, SIGNAL(returnPressed()));
+ TQTimer::singleShot(0, this, TQT_SIGNAL(returnPressed()));
}
// don't process any further
rc = true;
break;
- case Qt::Key_Escape:
- QTimer::singleShot(0, this, SIGNAL(escapePressed()));
+ case TQt::Key_Escape:
+ TQTimer::singleShot(0, this, TQT_SIGNAL(escapePressed()));
break;
}
}
@@ -214,13 +214,13 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e)
return rc;
}
-void TransactionEditor::slotNumberChanged(const QString& txt)
+void TransactionEditor::slotNumberChanged(const TQString& txt)
{
kMyMoneyLineEdit* number = dynamic_cast<kMyMoneyLineEdit*>(haveWidget("number"));
if(number) {
if(MyMoneyFile::instance()->checkNoUsed(m_account.id(), txt)) {
- if(KMessageBox::questionYesNo(m_regForm, QString("<qt>")+i18n("The number <b>%1</b> has already been used in account <b>%2</b>. Do you want to replace it with the next available number?").arg(txt).arg(m_account.name())+QString("</qt>"), i18n("Duplicate number")) == KMessageBox::Yes) {
+ if(KMessageBox::questionYesNo(m_regForm, TQString("<qt>")+i18n("The number <b>%1</b> has already been used in account <b>%2</b>. Do you want to replace it with the next available number?").tqarg(txt).tqarg(m_account.name())+TQString("</qt>"), i18n("Duplicate number")) == KMessageBox::Yes) {
number->loadText(KMyMoneyUtils::nextCheckNumber(m_account));
}
}
@@ -229,18 +229,18 @@ void TransactionEditor::slotNumberChanged(const QString& txt)
void TransactionEditor::slotUpdateButtonState(void)
{
- QString reason;
+ TQString reason;
emit transactionDataSufficient(isComplete(reason));
}
-QWidget* TransactionEditor::haveWidget(const QString& name) const
+TQWidget* TransactionEditor::haveWidget(const TQString& name) const
{
return m_editWidgets.haveWidget(name);
}
int TransactionEditor::slotEditSplits(void)
{
- return QDialog::Rejected;
+ return TQDialog::Rejected;
}
#if 0
@@ -301,12 +301,12 @@ int TransactionEditor::slotEditSplits(void)
}
acc = MyMoneyAccount();
}
- QString msg;
- msg = QString("<p>")+i18n("This transaction has more than two splits and is based on a different currency (%1). Using this account to modify the transaction is currently not very well supported by KMyMoney and may result in false results.").arg(sec.name())+QString(" ");
+ TQString msg;
+ msg = TQString("<p>")+i18n("This transaction has more than two splits and is based on a different currency (%1). Using this account to modify the transaction is currently not very well supported by KMyMoney and may result in false results.").tqarg(sec.name())+TQString(" ");
if(acc.id().isEmpty()) {
msg += i18n("KMyMoney was not able to find a more appropriate account to edit this transaction. Nevertheless, you are allowed to modify the transaction. If you don't want to edit this transaction, please cancel from editing next.");
} else {
- msg += i18n("Using e.g. <b>%1</b> to edit this transaction is a better choice. Nevertheless, you are allowed to modify the transaction. If you want to use the suggested account instead, please cancel from editing next and change the view to the suggested account.").arg(acc.name());
+ msg += i18n("Using e.g. <b>%1</b> to edit this transaction is a better choice. Nevertheless, you are allowed to modify the transaction. If you want to use the suggested account instead, please cancel from editing next and change the view to the suggested account.").tqarg(acc.name());
}
KMessageBox::information(0, msg);
}
@@ -405,16 +405,16 @@ bool TransactionEditor::fixTransactionCommodity(const MyMoneyAccount& account)
// this will happen and allow him to stop the processing (rc = false)
try {
- QString msg;
+ TQString msg;
if(firstTimeMultiCurrency) {
firstTimeMultiCurrency = false;
if(!isMultiSelection()) {
- msg = i18n("This transaction has more than two splits and is originally based on a different currency (%1). Using this account to modify the transaction may result in rounding errors. Do you want to continue?").arg(osec.name());
+ msg = i18n("This transaction has more than two splits and is originally based on a different currency (%1). Using this account to modify the transaction may result in rounding errors. Do you want to continue?").tqarg(osec.name());
} else {
- msg = i18n("At least one of the selected transactions has more than two splits and is originally based on a different currency (%1). Using this account to modify the transactions may result in rounding errors. Do you want to continue?").arg(osec.name());
+ msg = i18n("At least one of the selected transactions has more than two splits and is originally based on a different currency (%1). Using this account to modify the transactions may result in rounding errors. Do you want to continue?").tqarg(osec.name());
}
- if(KMessageBox::warningContinueCancel(0, QString("<qt>%1</qt>").arg(msg)) == KMessageBox::Cancel) {
+ if(KMessageBox::warningContinueCancel(0, TQString("<qt>%1</qt>").tqarg(msg)) == KMessageBox::Cancel) {
rc = false;
}
}
@@ -423,7 +423,7 @@ bool TransactionEditor::fixTransactionCommodity(const MyMoneyAccount& account)
MyMoneyMoney price;
if(!(*it_t).split().shares().isZero() && !(*it_t).split().value().isZero())
price = (*it_t).split().shares() / (*it_t).split().value();
- QValueList<MyMoneySplit>::iterator it_s;
+ TQValueList<MyMoneySplit>::iterator it_s;
MyMoneySplit& mySplit = (*it_t).split();
for(it_s = (*it_t).transaction().splits().begin(); it_s != (*it_t).transaction().splits().end(); ++it_s) {
MyMoneySplit s = (*it_s);
@@ -472,9 +472,9 @@ bool TransactionEditor::canAssignNumber(void) const
return (number != 0) && (number->text().isEmpty());
}
-void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QValueList<MyMoneySplit>& splits, QString& categoryId, const char* splitEditSlot, bool /* allowObjectCreation */)
+void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const TQValueList<MyMoneySplit>& splits, TQString& categoryId, const char* splitEditSlot, bool /* allowObjectCreation */)
{
- disconnect(category, SIGNAL(focusIn()), this, splitEditSlot);
+ disconnect(category, TQT_SIGNAL(focusIn()), this, splitEditSlot);
#if 0
// FIXME must deal with the logic that suppressObjectCreation is
// automatically turned off when the createItem() signal is connected
@@ -484,13 +484,13 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV
switch(splits.count()) {
case 0:
- categoryId = QString();
+ categoryId = TQString();
if(!category->currentText().isEmpty()) {
category->setCurrentText();
// make sure, we don't see the selector
category->completion()->hide();
}
- category->completion()->setSelected(QString());
+ category->completion()->setSelected(TQString());
break;
case 1:
@@ -500,9 +500,9 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV
break;
default:
- categoryId = QString();
+ categoryId = TQString();
category->setSplitTransaction();
- connect(category, SIGNAL(focusIn()), this, splitEditSlot);
+ connect(category, TQT_SIGNAL(focusIn()), this, splitEditSlot);
#if 0
// FIXME must deal with the logic that suppressObjectCreation is
// automatically turned off when the createItem() signal is connected
@@ -513,17 +513,17 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV
}
}
-bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, bool suppressBalanceWarnings)
+bool TransactionEditor::enterTransactions(TQString& newId, bool askForSchedule, bool suppressBalanceWarnings)
{
- newId = QString();
+ newId = TQString();
MyMoneyFile* file = MyMoneyFile::instance();
// make sure to run through all stuff that is tied to 'focusout events'.
- m_regForm->parentWidget()->setFocus();
- QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10);
+ m_regForm->tqparentWidget()->setFocus();
+ TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10);
// we don't need to update our widgets anymore, so we just disconnect the signal
- disconnect(file, SIGNAL(dataChanged()), this, SLOT(slotReloadEditWidgets()));
+ disconnect(file, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadEditWidgets()));
KMyMoneyRegister::SelectedTransactions::iterator it_t;
MyMoneyTransaction t;
@@ -538,7 +538,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
// collect the transactions to be stored in the engine in a local
// list first, so that the user has a chance to interrupt the storage
// process
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
bool storeTransactions = true;
// collect transactions
@@ -562,12 +562,12 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
MyMoneyFileTransaction ft;
try {
- QValueList<MyMoneyTransaction>::iterator it_ts;
- QMap<QString, bool> minBalanceEarly;
- QMap<QString, bool> minBalanceAbsolute;
- QMap<QString, bool> maxCreditEarly;
- QMap<QString, bool> maxCreditAbsolute;
- QMap<QString, bool> accountIds;
+ TQValueList<MyMoneyTransaction>::iterator it_ts;
+ TQMap<TQString, bool> minBalanceEarly;
+ TQMap<TQString, bool> minBalanceAbsolute;
+ TQMap<TQString, bool> maxCreditEarly;
+ TQMap<TQString, bool> maxCreditAbsolute;
+ TQMap<TQString, bool> accountIds;
for(it_ts = list.begin(); it_ts != list.end(); ++it_ts) {
// if we have a categorization, make sure we remove
@@ -576,7 +576,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
(*it_ts).setImported(false);
// create information about min and max balances
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = (*it_ts).splits().begin(); it_s != (*it_ts).splits().end(); ++it_s) {
MyMoneyAccount acc = file->account((*it_s).accountId());
accountIds[acc.id()] = true;
@@ -599,19 +599,19 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
if((*it_ts).id().isEmpty()) {
bool enter = true;
- if(askForSchedule && (*it_ts).postDate() > QDate::currentDate()) {
+ if(askForSchedule && (*it_ts).postDate() > TQDate::tqcurrentDate()) {
KGuiItem enterItem;
KIconLoader* il = KGlobal::iconLoader();
KGuiItem enterButton( i18n("&Enter" ),
- QIconSet(il->loadIcon("kontact_journal", KIcon::Small, KIcon::SizeSmall)),
+ TQIconSet(il->loadIcon("kontact_journal", KIcon::Small, KIcon::SizeSmall)),
i18n("Accepts the entered data and stores it"),
i18n("Use this to enter the transaction into the ledger."));
KGuiItem scheduleButton( i18n("&Schedule" ),
- QIconSet(il->loadIcon("kontact_date", KIcon::Small, KIcon::SizeSmall)),
+ TQIconSet(il->loadIcon("kontact_date", KIcon::Small, KIcon::SizeSmall)),
i18n("Accepts the entered data and stores it as schedule"),
i18n("Use this to schedule the transaction for later entry into the ledger."));
- enter = KMessageBox::questionYesNo(m_regForm, QString("<qt>%1</qt>").arg(i18n("The transaction you are about to enter has a post date in the future.<br/><br/>Do you want to enter it in the ledger or add it to the schedules?")), i18n("Dialog caption for 'Enter or schedule' dialog", "Enter or schedule?"), enterButton, scheduleButton, "EnterOrScheduleTransactionInFuture") == KMessageBox::Yes;
+ enter = KMessageBox::questionYesNo(m_regForm, TQString("<qt>%1</qt>").tqarg(i18n("The transaction you are about to enter has a post date in the future.<br/><br/>Do you want to enter it in the ledger or add it to the schedules?")), i18n("Dialog caption for 'Enter or schedule' dialog", "Enter or schedule?"), enterButton, scheduleButton, "EnterOrScheduleTransactionInFuture") == KMessageBox::Yes;
}
if(enter) {
// add new transaction
@@ -623,7 +623,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
t = (*it_ts);
// if a new transaction has a valid number, keep it with the account
- QString number = (*it_ts).splits()[0].number();
+ TQString number = (*it_ts).splits()[0].number();
if(!number.isEmpty()) {
m_account.setValue("lastNumberUsed", number);
file->modifyAccount(m_account);
@@ -667,37 +667,37 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
ft.commit();
// now analyse the balances and spit out warnings to the user
- QMap<QString, bool>::const_iterator it_a;
+ TQMap<TQString, bool>::const_iterator it_a;
if(!suppressBalanceWarnings) {
for(it_a = accountIds.begin(); it_a != accountIds.end(); ++it_a) {
- QString msg;
+ TQString msg;
MyMoneyAccount acc = file->account(it_a.key());
MyMoneyMoney balance = file->balance(acc.id());
const MyMoneySecurity& sec = file->security(acc.currencyId());
- QString key;
+ TQString key;
key = "minBalanceEarly";
if(!acc.value(key).isEmpty()) {
if(minBalanceEarly[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) {
- msg = QString("<qt>%1</qt>").arg(i18n("The balance of account <b>%1</b> dropped below the warning balance of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
+ msg = TQString("<qt>%1</qt>").tqarg(i18n("The balance of account <b>%1</b> dropped below the warning balance of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
}
}
key = "minBalanceAbsolute";
if(!acc.value(key).isEmpty()) {
if(minBalanceAbsolute[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) {
- msg = QString("<qt>%1</qt>").arg(i18n("The balance of account <b>%1</b> dropped below the minimum balance of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
+ msg = TQString("<qt>%1</qt>").tqarg(i18n("The balance of account <b>%1</b> dropped below the minimum balance of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
}
}
key = "maxCreditEarly";
if(!acc.value(key).isEmpty()) {
if(maxCreditEarly[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) {
- msg = QString("<qt>%1</qt>").arg(i18n("The balance of account <b>%1</b> dropped below the maximum credit warning limit of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
+ msg = TQString("<qt>%1</qt>").tqarg(i18n("The balance of account <b>%1</b> dropped below the maximum credit warning limit of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
}
}
key = "maxCreditAbsolute";
if(!acc.value(key).isEmpty()) {
if(maxCreditAbsolute[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) {
- msg = QString("<qt>%1</qt>").arg(i18n("The balance of account <b>%1</b> dropped below the maximum credit limit of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
+ msg = TQString("<qt>%1</qt>").tqarg(i18n("The balance of account <b>%1</b> dropped below the maximum credit limit of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec)));
}
}
@@ -713,7 +713,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b
}
emit statusProgress(-1, -1);
- emit statusMsg(QString());
+ emit statusMsg(TQString());
}
return storeTransactions;
@@ -724,7 +724,7 @@ StdTransactionEditor::StdTransactionEditor()
{
}
-StdTransactionEditor::StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) :
+StdTransactionEditor::StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) :
TransactionEditor(regForm, item, list, lastPostDate),
m_inUpdateVat(false)
{
@@ -738,15 +738,15 @@ StdTransactionEditor::~StdTransactionEditor()
}
}
-bool StdTransactionEditor::eventFilter(QObject* o, QEvent* e)
+bool StdTransactionEditor::eventFilter(TQObject* o, TQEvent* e)
{
bool rc = TransactionEditor::eventFilter(o, e);
#if 0
// this is sofar dead code here, as the focus out event for Comboboxes
// never comes along here. I don't know why (ipwizard - 2009-10-03)
- if((e->type() == QEvent::FocusOut)
- && (haveWidget("payee") == dynamic_cast<QWidget*>(o))) {
+ if((e->type() == TQEvent::FocusOut)
+ && (haveWidget("payee") == dynamic_cast<TQWidget*>(o))) {
// loosing the focus on the payee widget?
qDebug("Loosing focus on payee");
KMyMoneyPayeeCombo* p = dynamic_cast<KMyMoneyPayeeCombo*>(haveWidget("payee"));
@@ -762,25 +762,25 @@ void StdTransactionEditor::createEditWidgets(void)
KMyMoneyCategory* account = new KMyMoneyCategory;
account->setHint(i18n("Account"));
m_editWidgets["account"] = account;
- connect(account, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
- connect(account, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateAccount(const QString&)));
+ connect(account, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
+ connect(account, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateAccount(const TQString&)));
KMyMoneyPayeeCombo* payee = new KMyMoneyPayeeCombo;
payee->setHint(i18n("Payer/Receiver"));
m_editWidgets["payee"] = payee;
- connect(payee, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
- connect(payee, SIGNAL(createItem(const QString&, QString&)), this, SIGNAL(createPayee(const QString&, QString&)));
- connect(payee, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool)));
- connect(payee, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdatePayee(const QString&)));
+ connect(payee, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
+ connect(payee, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SIGNAL(createPayee(const TQString&, TQString&)));
+ connect(payee, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool)));
+ connect(payee, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdatePayee(const TQString&)));
KMyMoneyCategory* category = new KMyMoneyCategory(0, 0, true);
category->setHint(i18n("Category/Account"));
m_editWidgets["category"] = category;
- connect(category, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateCategory(const QString&)));
- connect(category, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
- connect(category, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateCategory(const QString&, QString&)));
- connect(category, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool)));
- connect(category->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditSplits()));
+ connect(category, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateCategory(const TQString&)));
+ connect(category, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
+ connect(category, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateCategory(const TQString&, TQString&)));
+ connect(category, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool)));
+ connect(category->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSplits()));
category->splitButton()->setDisabled(true);
KTextEdit* memo = new KTextEdit;
@@ -812,41 +812,41 @@ void StdTransactionEditor::createEditWidgets(void)
kMyMoneyLineEdit* number = new kMyMoneyLineEdit;
number->setHint(i18n("Number"));
m_editWidgets["number"] = number;
- connect(number, SIGNAL(lineChanged(const QString&)), this, SLOT(slotNumberChanged(const QString&)));
+ connect(number, TQT_SIGNAL(lineChanged(const TQString&)), this, TQT_SLOT(slotNumberChanged(const TQString&)));
// number->installEventFilter(this);
}
m_editWidgets["postdate"] = new kMyMoneyDateInput;
- connect(m_editWidgets["postdate"], SIGNAL(dateChanged(const QDate&)), this, SLOT(slotUpdateButtonState()));
+ connect(m_editWidgets["postdate"], TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotUpdateButtonState()));
kMyMoneyEdit* value = new kMyMoneyEdit;
m_editWidgets["amount"] = value;
value->setResetButtonVisible(false);
- connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateAmount(const QString&)));
- connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
+ connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateAmount(const TQString&)));
+ connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
value = new kMyMoneyEdit;
m_editWidgets["payment"] = value;
value->setResetButtonVisible(false);
- connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdatePayment(const QString&)));
- connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
+ connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdatePayment(const TQString&)));
+ connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
value = new kMyMoneyEdit;
m_editWidgets["deposit"] = value;
value->setResetButtonVisible(false);
- connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateDeposit(const QString&)));
- connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState()));
+ connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateDeposit(const TQString&)));
+ connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
KMyMoneyCashFlowCombo* cashflow = new KMyMoneyCashFlowCombo(0, 0, m_account.accountGroup());
m_editWidgets["cashflow"] = cashflow;
- connect(cashflow, SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, SLOT(slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection)));
- connect(cashflow, SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, SLOT(slotUpdateButtonState()));
+ connect(cashflow, TQT_SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, TQT_SLOT(slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection)));
+ connect(cashflow, TQT_SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, TQT_SLOT(slotUpdateButtonState()));
KMyMoneyReconcileCombo* reconcile = new KMyMoneyReconcileCombo;
m_editWidgets["status"] = reconcile;
- connect(reconcile, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateButtonState()));
+ connect(reconcile, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateButtonState()));
- KMyMoneyRegister::QWidgetContainer::iterator it_w;
+ KMyMoneyRegister::TQWidgetContainer::iterator it_w;
for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) {
(*it_w)->installEventFilter(this);
}
@@ -857,9 +857,9 @@ void StdTransactionEditor::createEditWidgets(void)
cashflow->removeDontCare();
}
- QLabel* label;
- m_editWidgets["category-label"] = label = new QLabel(i18n("Category"), 0);
- label->setAlignment(Qt::AlignVCenter | Qt::DontClip);
+ TQLabel* label;
+ m_editWidgets["category-label"] = label = new TQLabel(i18n("Category"), 0);
+ label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip);
// create a copy of tabbar above the form (if we are created for a form)
KMyMoneyTransactionForm::TransactionForm* form = dynamic_cast<KMyMoneyTransactionForm::TransactionForm*>(m_regForm);
@@ -868,29 +868,29 @@ void StdTransactionEditor::createEditWidgets(void)
KMyMoneyTransactionForm::TabBar* tabbar = new KMyMoneyTransactionForm::TabBar;
m_editWidgets["tabbar"] = tabbar;
tabbar->copyTabs(form->tabBar());
- connect(tabbar, SIGNAL(tabSelected(int)), this, SLOT(slotUpdateAction(int)));
+ connect(tabbar, TQT_SIGNAL(tabSelected(int)), this, TQT_SLOT(slotUpdateAction(int)));
}
- label = new QLabel(i18n("Date"), 0);
- label->setAlignment(Qt::AlignVCenter | Qt::DontClip);
+ label = new TQLabel(i18n("Date"), 0);
+ label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip);
m_editWidgets["date-label"] = label;
- label = new QLabel(i18n("Number"), 0);
- label->setAlignment(Qt::AlignVCenter | Qt::DontClip);
+ label = new TQLabel(i18n("Number"), 0);
+ label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip);
m_editWidgets["number-label"] = label;
setupPrecision();
}
-void StdTransactionEditor::setupCategoryWidget(QString& categoryId)
+void StdTransactionEditor::setupCategoryWidget(TQString& categoryId)
{
- TransactionEditor::setupCategoryWidget(dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]), m_splits, categoryId, SLOT(slotEditSplits()));
+ TransactionEditor::setupCategoryWidget(dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]), m_splits, categoryId, TQT_SLOT(slotEditSplits()));
if(m_splits.count() == 1)
m_shares = m_splits[0].shares();
}
-bool StdTransactionEditor::isTransfer(const QString& accId1, const QString& accId2) const
+bool StdTransactionEditor::isTransfer(const TQString& accId1, const TQString& accId2) const
{
if(accId1.isEmpty() || accId2.isEmpty())
return false;
@@ -903,8 +903,8 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
// don't kick off VAT processing from here
m_inUpdateVat = true;
- QMap<QString, QWidget*>::const_iterator it_w;
- QWidget* w;
+ TQMap<TQString, TQWidget*>::const_iterator it_w;
+ TQWidget* w;
AccountSet aSet;
// load the account widget
@@ -929,11 +929,11 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
// load the category widget
KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);
- disconnect(category, SIGNAL(focusIn()), this, SLOT(slotEditSplits()));
+ disconnect(category, TQT_SIGNAL(focusIn()), this, TQT_SLOT(slotEditSplits()));
// check if the current transaction has a reference to an equity account
bool haveEquityAccount = false;
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = m_transaction.splits().begin(); !haveEquityAccount && it_s != m_transaction.splits().end(); ++it_s) {
MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId());
if(acc.accountType() == MyMoneyAccount::Equity)
@@ -966,7 +966,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
else if(m_lastPostDate.isValid())
dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->setDate(m_lastPostDate);
else
- dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->setDate(QDate::currentDate());
+ dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->setDate(TQDate::tqcurrentDate());
if((w = haveWidget("number")) != 0) {
dynamic_cast<kMyMoneyLineEdit*>(w)->loadText(m_split.number());
@@ -979,23 +979,23 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
}
dynamic_cast<KMyMoneyReconcileCombo*>(m_editWidgets["status"])->setState(m_split.reconcileFlag());
- QString payeeId = m_split.payeeId();
+ TQString payeeId = m_split.payeeId();
if(!payeeId.isEmpty()) {
payee->setSelectedItem(payeeId);
}
m_splits.clear();
if(m_transaction.splitCount() < 2) {
- category->completion()->setSelected(QString());
+ category->completion()->setSelected(TQString());
} else {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = m_transaction.splits().begin(); it_s != m_transaction.splits().end(); ++it_s) {
if((*it_s) == m_split)
continue;
m_splits.append(*it_s);
}
}
- QString categoryId;
+ TQString categoryId;
setupCategoryWidget(categoryId);
if((w = haveWidget("cashflow")) != 0) {
@@ -1004,7 +1004,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
}
if((w = haveWidget("category-label")) != 0) {
- QLabel *categoryLabel = dynamic_cast<QLabel*>(w);
+ TQLabel *categoryLabel = dynamic_cast<TQLabel*>(w);
if(isTransfer(m_split.accountId(), categoryId)) {
if(m_split.value().isPositive())
categoryLabel->setText(i18n("Transfer from"));
@@ -1040,7 +1040,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
}
}
if(action != KMyMoneyRegister::ActionNone) {
- QLabel *categoryLabel = dynamic_cast<QLabel*>(w);
+ TQLabel *categoryLabel = dynamic_cast<TQLabel*>(w);
if(action == KMyMoneyRegister::ActionTransfer) {
if(m_split.value().isPositive())
categoryLabel->setText(i18n("Transfer from"));
@@ -1071,7 +1071,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
}
} else {
- dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->loadDate(QDate());
+ dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->loadDate(TQDate());
dynamic_cast<KMyMoneyReconcileCombo*>(m_editWidgets["status"])->setState(MyMoneySplit::Unknown);
if(haveWidget("deposit")) {
dynamic_cast<kMyMoneyEdit*>(m_editWidgets["deposit"])->loadText("");
@@ -1092,16 +1092,16 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action)
w->setEnabled(false);
}
- category->completion()->setSelected(QString());
+ category->completion()->setSelected(TQString());
}
// allow kick off VAT processing again
m_inUpdateVat = false;
}
-QWidget* StdTransactionEditor::firstWidget(void) const
+TQWidget* StdTransactionEditor::firstWidget(void) const
{
- QWidget* w = 0;
+ TQWidget* w = 0;
if(m_initialAction != KMyMoneyRegister::ActionNone)
w = haveWidget("payee");
return w;
@@ -1111,7 +1111,7 @@ void StdTransactionEditor::slotReloadEditWidgets(void)
{
// reload category widget
KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);
- QString categoryId = category->selectedItem();
+ TQString categoryId = category->selectedItem();
AccountSet aSet;
aSet.addAccountGroup(MyMoneyAccount::Asset);
@@ -1133,7 +1133,7 @@ void StdTransactionEditor::slotReloadEditWidgets(void)
// reload payee widget
KMyMoneyPayeeCombo* payee = dynamic_cast<KMyMoneyPayeeCombo*>(m_editWidgets["payee"]);
- QString payeeId = payee->selectedItem();
+ TQString payeeId = payee->selectedItem();
payee->loadPayees(MyMoneyFile::instance()->payeeList());
@@ -1142,12 +1142,12 @@ void StdTransactionEditor::slotReloadEditWidgets(void)
}
}
-void StdTransactionEditor::slotUpdatePayee(const QString& payeeId)
+void StdTransactionEditor::slotUpdatePayee(const TQString& payeeId)
{
// we have a new payee assigned to this transaction.
// retrieve some information about the state of the category widget
KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);
- QStringList list;
+ TQStringList list;
category->selectedItems(list);
// If payee has associated default account (category), set that now if
@@ -1173,9 +1173,9 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId)
// check if all value fields are empty
kMyMoneyEdit* amount;
- QStringList fields;
+ TQStringList fields;
fields << "amount" << "payment" << "deposit";
- QStringList::const_iterator it_f;
+ TQStringList::const_iterator it_f;
for(it_f = fields.begin(); it_f != fields.end(); ++it_f) {
amount = dynamic_cast<kMyMoneyEdit*>(haveWidget(*it_f));
if(amount && !amount->value().isZero())
@@ -1195,7 +1195,7 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId)
// check if date has been altered by user
kMyMoneyDateInput* postDate = dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"]);
if((m_lastPostDate.isValid() && (postDate->date() != m_lastPostDate))
- || (!m_lastPostDate.isValid() && (postDate->date() != QDate::currentDate())))
+ || (!m_lastPostDate.isValid() && (postDate->date() != TQDate::tqcurrentDate())))
return;
#endif
@@ -1207,7 +1207,7 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId)
MyMoneyMoney StdTransactionEditor::shares(const MyMoneyTransaction& t) const
{
MyMoneyMoney result;
- QValueList<MyMoneySplit>::const_iterator it_s;
+ 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()) {
result += (*it_s).shares();
@@ -1221,9 +1221,9 @@ struct uniqTransaction {
int cnt;
};
-void StdTransactionEditor::autoFill(const QString& payeeId)
+void StdTransactionEditor::autoFill(const TQString& payeeId)
{
- QValueList<QPair<MyMoneyTransaction, MyMoneySplit> > list;
+ TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> > list;
MyMoneyTransactionFilter filter(m_account.id());
filter.addPayee(payeeId);
MyMoneyFile::instance()->transactionList(list, filter);
@@ -1231,17 +1231,17 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
// ok, we found at least one previous transaction. now we clear out
// what we have collected so far and add those splits from
// the previous transaction.
- QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >::const_iterator it_t;
- QMap<QString, struct uniqTransaction> uniqList;
+ TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >::const_iterator it_t;
+ TQMap<TQString, struct uniqTransaction> uniqList;
// collect the transactions and see if we have any duplicates
for(it_t = list.begin(); it_t != list.end(); ++it_t) {
- QString key = (*it_t).first.accountSignature();
+ TQString key = (*it_t).first.accountSignature();
int cnt = 0;
- QMap<QString, struct uniqTransaction>::iterator it_u;
+ TQMap<TQString, struct uniqTransaction>::iterator it_u;
do {
- QString ukey = QString("%1-%2").arg(key).arg(cnt);
- it_u = uniqList.find(ukey);
+ TQString ukey = TQString("%1-%2").tqarg(key).tqarg(cnt);
+ it_u = uniqList.tqfind(ukey);
if(it_u == uniqList.end()) {
uniqList[ukey].t = &((*it_t).first);
uniqList[ukey].cnt = 1;
@@ -1289,7 +1289,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
KSelectTransactionsDlg dlg(m_account, m_regForm);
dlg.setCaption(i18n("Select autofill transaction"));
- QMap<QString, struct uniqTransaction>::const_iterator it_u;
+ TQMap<TQString, struct uniqTransaction>::const_iterator it_u;
for(it_u = uniqList.begin(); it_u != uniqList.end(); ++it_u) {
dlg.addTransaction(*(*it_u).t);
}
@@ -1303,7 +1303,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
if(dlg.m_register->lastItem())
dlg.m_register->selectItem(dlg.m_register->lastItem());
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
t = dlg.transaction();
}
#if 0
@@ -1311,7 +1311,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
#endif
} else {
int maxCnt = 0;
- QMap<QString, struct uniqTransaction>::const_iterator it_u;
+ TQMap<TQString, struct uniqTransaction>::const_iterator it_u;
for(it_u = uniqList.begin(); it_u != uniqList.end(); ++it_u) {
if((*it_u).cnt > maxCnt) {
t = *(*it_u).t;
@@ -1324,18 +1324,18 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
m_transaction.removeSplits();
m_split = MyMoneySplit();
MyMoneySplit otherSplit;
- QValueList<MyMoneySplit>::ConstIterator it;
+ TQValueList<MyMoneySplit>::ConstIterator it;
for(it = t.splits().begin(); it != t.splits().end(); ++it) {
MyMoneySplit s(*it);
s.setReconcileFlag(MyMoneySplit::NotReconciled);
- s.setReconcileDate(QDate());
+ s.setReconcileDate(TQDate());
s.clearId();
- s.setBankID(QString());
+ s.setBankID(TQString());
// older versions of KMyMoney used to set the action
// we don't need this anymore
if(s.action() != MyMoneySplit::ActionAmortization
&& s.action() != MyMoneySplit::ActionInterest) {
- s.setAction(QString());
+ s.setAction(TQString());
}
// FIXME update check number. The old comment contained
@@ -1360,7 +1360,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
// the autofilled memo text which will then also be used
// in this split. See createTransaction() for this logic.
if(s.accountId() != m_account.id() && t.splitCount() == 2)
- s.setMemo(QString());
+ s.setMemo(TQString());
m_transaction.addSplit(s);
if(s.accountId() == m_account.id() && m_split == MyMoneySplit()) {
@@ -1381,14 +1381,14 @@ void StdTransactionEditor::autoFill(const QString& payeeId)
}
// now setup the widgets with the new data but keep the date
- QDate date = dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->date();
+ TQDate date = dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->date();
loadEditWidgets(action);
dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"])->setDate(date);
}
}
// focus jumps into the category field
- QWidget* w;
+ TQWidget* w;
if((w = haveWidget("payee")) != 0) {
w->setFocus();
}
@@ -1398,7 +1398,7 @@ void StdTransactionEditor::slotUpdateAction(int action)
{
TabBar* tabbar = dynamic_cast<TabBar*>(haveWidget("tabbar"));
if(tabbar) {
- QLabel* categoryLabel = dynamic_cast<QLabel*>(haveWidget("category-label"));
+ TQLabel* categoryLabel = dynamic_cast<TQLabel*>(haveWidget("category-label"));
KMyMoneyCashFlowCombo* cashflow = dynamic_cast<KMyMoneyCashFlowCombo*>(m_editWidgets["cashflow"]);
switch(action) {
case KMyMoneyRegister::ActionDeposit:
@@ -1419,7 +1419,7 @@ void StdTransactionEditor::slotUpdateAction(int action)
void StdTransactionEditor::slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection dir)
{
- QLabel* categoryLabel = dynamic_cast<QLabel*>(haveWidget("category-label"));
+ TQLabel* categoryLabel = dynamic_cast<TQLabel*>(haveWidget("category-label"));
// qDebug("Update cashflow to %d", dir);
if(categoryLabel) {
@@ -1440,9 +1440,9 @@ void StdTransactionEditor::slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirectio
}
}
-void StdTransactionEditor::slotUpdateCategory(const QString& id)
+void StdTransactionEditor::slotUpdateCategory(const TQString& id)
{
- QLabel *categoryLabel = dynamic_cast<QLabel*>(haveWidget("category-label"));
+ TQLabel *categoryLabel = dynamic_cast<TQLabel*>(haveWidget("category-label"));
// qDebug("Update category to %s", id.data());
if(categoryLabel) {
@@ -1495,7 +1495,7 @@ void StdTransactionEditor::slotUpdateCategory(const QString& id)
updateVAT(false);
}
-void StdTransactionEditor::slotUpdatePayment(const QString& txt)
+void StdTransactionEditor::slotUpdatePayment(const TQString& txt)
{
MyMoneyMoney val(txt);
@@ -1508,7 +1508,7 @@ void StdTransactionEditor::slotUpdatePayment(const QString& txt)
updateVAT();
}
-void StdTransactionEditor::slotUpdateDeposit(const QString& txt)
+void StdTransactionEditor::slotUpdateDeposit(const TQString& txt)
{
MyMoneyMoney val(txt);
if(val.isNegative()) {
@@ -1520,7 +1520,7 @@ void StdTransactionEditor::slotUpdateDeposit(const QString& txt)
updateVAT();
}
-void StdTransactionEditor::slotUpdateAmount(const QString& txt)
+void StdTransactionEditor::slotUpdateAmount(const TQString& txt)
{
// qDebug("Update amount to %s", txt.data());
MyMoneyMoney val(txt);
@@ -1530,7 +1530,7 @@ void StdTransactionEditor::slotUpdateAmount(const QString& txt)
void StdTransactionEditor::updateAmount(const MyMoneyMoney& val)
{
- QLabel *categoryLabel = dynamic_cast<QLabel*>(haveWidget("category-label"));
+ TQLabel *categoryLabel = dynamic_cast<TQLabel*>(haveWidget("category-label"));
if(categoryLabel) {
KMyMoneyCashFlowCombo* cashflow = dynamic_cast<KMyMoneyCashFlowCombo*>(m_editWidgets["cashflow"]);
@@ -1615,8 +1615,8 @@ void StdTransactionEditor::updateVAT(bool amountChanged)
// if we made this a split transaction, then move the
// focus to the memo field
- if(qApp->focusWidget() == haveWidget("category")) {
- QWidget* w = haveWidget("memo");
+ if(tqApp->tqfocusWidget() == haveWidget("category")) {
+ TQWidget* w = haveWidget("memo");
if(w)
w->setFocus();
}
@@ -1658,7 +1658,7 @@ bool StdTransactionEditor::addVatSplit(MyMoneyTransaction& tr, const MyMoneyMone
tax.setAccountId(vatAcc.id());
// qDebug("vat amount is '%s'", category.value("VatAmount").latin1());
- if(category.value("VatAmount").lower() != QString("net")) {
+ if(category.value("VatAmount").lower() != TQString("net")) {
// split value is the gross value
gv = amount;
nv = gv / (MyMoneyMoney(1,1) + vatRate);
@@ -1698,7 +1698,7 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void)
MyMoneySplit t; // tax split
bool netValue = false;
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = m_splits.begin(); it_s != m_splits.end(); ++it_s) {
MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId());
if(!acc.value("VatAccount").isEmpty()) {
@@ -1729,7 +1729,7 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void)
// block the signals to avoid popping up the split editor dialog
// for nothing
m_editWidgets["category"]->blockSignals(true);
- QString id;
+ TQString id;
setupCategoryWidget(id);
m_editWidgets["category"]->blockSignals(false);
@@ -1737,20 +1737,20 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void)
return amount;
}
-bool StdTransactionEditor::isComplete(QString& reason) const
+bool StdTransactionEditor::isComplete(TQString& reason) const
{
- reason = QString();
- // reason.clear(); // for Qt4
+ reason = TQString();
+ // reason.clear(); // for TQt4
- QMap<QString, QWidget*>::const_iterator it_w;
+ TQMap<TQString, TQWidget*>::const_iterator it_w;
kMyMoneyDateInput* postDate = dynamic_cast<kMyMoneyDateInput*>(m_editWidgets["postdate"]);
if(postDate) {
postDate->markAsBadDate();
- QToolTip::remove(postDate);
+ TQToolTip::remove(postDate);
if(postDate->date().isValid() && (postDate->date() < m_account.openingDate())) {
postDate->markAsBadDate(true, KMyMoneyGlobalSettings::listNegativeValueColor());
reason = i18n("Cannot enter transaction with postdate prior to account's opening date.");
- QToolTip::add(postDate, reason);
+ TQToolTip::add(postDate, reason);
return false;
}
}
@@ -1783,35 +1783,35 @@ bool StdTransactionEditor::isComplete(QString& reason) const
return it_w != m_editWidgets.end();
}
-void StdTransactionEditor::slotCreateCategory(const QString& name, QString& id)
+void StdTransactionEditor::slotCreateCategory(const TQString& name, TQString& id)
{
- MyMoneyAccount acc, parent;
+ MyMoneyAccount acc, tqparent;
acc.setName(name);
KMyMoneyCashFlowCombo* cashflow = dynamic_cast<KMyMoneyCashFlowCombo*>(haveWidget("cashflow"));
if(cashflow) {
// form based input
if(cashflow->direction() == KMyMoneyRegister::Deposit)
- parent = MyMoneyFile::instance()->income();
+ tqparent = MyMoneyFile::instance()->income();
else
- parent = MyMoneyFile::instance()->expense();
+ tqparent = MyMoneyFile::instance()->expense();
} else if(haveWidget("deposit")) {
// register based input
kMyMoneyEdit* deposit = dynamic_cast<kMyMoneyEdit*>(m_editWidgets["deposit"]);
if(deposit->value().isPositive())
- parent = MyMoneyFile::instance()->income();
+ tqparent = MyMoneyFile::instance()->income();
else
- parent = MyMoneyFile::instance()->expense();
+ tqparent = MyMoneyFile::instance()->expense();
} else
- parent = MyMoneyFile::instance()->expense();
+ tqparent = MyMoneyFile::instance()->expense();
// TODO extract possible first part of a hierarchy and check if it is one
- // of our top categories. If so, remove it and select the parent
+ // of our top categories. If so, remove it and select the tqparent
// according to this information.
- emit createCategory(acc, parent);
+ emit createCategory(acc, tqparent);
// return id
id = acc.id();
@@ -1819,14 +1819,14 @@ void StdTransactionEditor::slotCreateCategory(const QString& name, QString& id)
int StdTransactionEditor::slotEditSplits(void)
{
- int rc = QDialog::Rejected;
+ int rc = TQDialog::Rejected;
if(!m_openEditSplits) {
// only get in here in a single instance
m_openEditSplits = true;
// force focus change to update all data
- QWidget* w = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"])->splitButton();
+ TQWidget* w = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"])->splitButton();
if(w)
w->setFocus();
@@ -1877,10 +1877,10 @@ int StdTransactionEditor::slotEditSplits(void)
0,
m_priceInfo,
m_regForm);
- connect(dlg, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool)));
- connect(dlg, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)));
+ connect(dlg, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool)));
+ connect(dlg, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)));
- if((rc = dlg->exec()) == QDialog::Accepted) {
+ if((rc = dlg->exec()) == TQDialog::Accepted) {
m_transaction = dlg->transaction();
m_split = m_transaction.splits()[0];
loadEditWidgets();
@@ -1900,7 +1900,7 @@ int StdTransactionEditor::slotEditSplits(void)
return rc;
}
-void StdTransactionEditor::checkPayeeInSplit(MyMoneySplit& s, const QString& payeeId)
+void StdTransactionEditor::checkPayeeInSplit(MyMoneySplit& s, const TQString& payeeId)
{
if(s.accountId().isEmpty())
return;
@@ -1957,7 +1957,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
{
// extract price info from original transaction
m_priceInfo.clear();
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
if(!torig.id().isEmpty()) {
for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) {
if((*it_s).id() != sorig.id()) {
@@ -2006,7 +2006,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
}
KMyMoneyPayeeCombo* payee = dynamic_cast<KMyMoneyPayeeCombo*>(m_editWidgets["payee"]);
- QString payeeId;
+ TQString payeeId;
if(!isMultiSelection() || (isMultiSelection() && !payee->currentText().isEmpty())) {
payeeId = payee->selectedItem();
s0.setPayeeId(payeeId);
@@ -2029,7 +2029,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
s0.setReconcileFlag(status->state());
if(s0.reconcileFlag() == MyMoneySplit::Reconciled && !s0.reconcileDate().isValid())
- s0.setReconcileDate(QDate::currentDate());
+ s0.setReconcileDate(TQDate::tqcurrentDate());
checkPayeeInSplit(s0, payeeId);
@@ -2040,7 +2040,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
// if we have none or only one other split, we reconstruct it here
// if we have more than one other split, we take them as they are
// make sure to perform all those changes on a local copy
- QValueList<MyMoneySplit> splits = m_splits;
+ TQValueList<MyMoneySplit> splits = m_splits;
MyMoneySplit s1;
if(splits.count() == 0) {
@@ -2056,7 +2056,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
// split or create it
if(isMultiSelection()) {
if(torig.splitCount() == 2) {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) {
if((*it_s).id() == sorig.id())
continue;
@@ -2109,7 +2109,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
return false;
} else {
MyMoneyAccount cat = MyMoneyFile::instance()->account(s1.accountId());
- if(m_priceInfo.find(cat.currencyId()) != m_priceInfo.end()) {
+ if(m_priceInfo.tqfind(cat.currencyId()) != m_priceInfo.end()) {
shares = (s1.value() * m_priceInfo[cat.currencyId()]).reduce().convert(cat.fraction());
}
else
@@ -2124,7 +2124,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone
t.addSplit(s1);
} else {
- QValueList<MyMoneySplit>::iterator it_s;
+ TQValueList<MyMoneySplit>::iterator it_s;
for(it_s = splits.begin(); it_s != splits.end(); ++it_s) {
s1 = *it_s;
s1.clearId();
@@ -2143,7 +2143,7 @@ void StdTransactionEditor::setupFinalWidgets(void)
addFinalWidget(haveWidget("status"));
}
-void StdTransactionEditor::slotUpdateAccount(const QString& id)
+void StdTransactionEditor::slotUpdateAccount(const TQString& id)
{
TransactionEditor::slotUpdateAccount(id);
KMyMoneyCategory* category = dynamic_cast<KMyMoneyCategory*>(m_editWidgets["category"]);