summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views/kgloballedgerview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/views/kgloballedgerview.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/views/kgloballedgerview.cpp')
-rw-r--r--kmymoney2/views/kgloballedgerview.cpp336
1 files changed, 168 insertions, 168 deletions
diff --git a/kmymoney2/views/kgloballedgerview.cpp b/kmymoney2/views/kgloballedgerview.cpp
index bf95e50..981f5e1 100644
--- a/kmymoney2/views/kgloballedgerview.cpp
+++ b/kmymoney2/views/kgloballedgerview.cpp
@@ -20,9 +20,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qtimer.h>
+#include <tqframe.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -65,26 +65,26 @@ public:
MousePressFilter* m_mousePressFilter;
KMyMoneyRegister::RegisterSearchLineWidget* m_registerSearchLine;
- QPoint m_startPoint;
- QString m_reconciliationAccount;
- QDate m_reconciliationDate;
+ TQPoint m_startPoint;
+ TQString m_reconciliationAccount;
+ TQDate m_reconciliationDate;
MyMoneyMoney m_endingBalance;
int m_precision;
bool m_inLoading;
bool m_recursion;
bool m_showDetails;
KMyMoneyRegister::Action m_action;
- QTimer m_viewPosTimer;
+ TQTimer m_viewPosTimer;
};
-MousePressFilter::MousePressFilter(QWidget* parent, const char* name) :
- QObject(parent, name),
+MousePressFilter::MousePressFilter(TQWidget* tqparent, const char* name) :
+ TQObject(tqparent, name),
m_lastMousePressEvent(0),
m_filterActive(true)
{
}
-void MousePressFilter::addWidget(QWidget* w)
+void MousePressFilter::addWidget(TQWidget* w)
{
m_parents.append(w);
}
@@ -94,27 +94,27 @@ void MousePressFilter::setFilterActive(bool state)
m_filterActive = state;
}
-bool MousePressFilter::isChildOf( QWidget* child, QWidget *parent )
+bool MousePressFilter::isChildOf( TQWidget* child, TQWidget *tqparent )
{
while(child) {
- if(child == parent)
+ if(child == tqparent)
return true;
// If one of the ancestors is a KPassivePopup then it's as
// if it is a child of our own
if(dynamic_cast<KPassivePopup*>(child))
return true;
- child = child->parentWidget();
+ child = child->tqparentWidget();
}
return false;
}
-bool MousePressFilter::eventFilter(QObject* o, QEvent* e)
+bool MousePressFilter::eventFilter(TQObject* o, TQEvent* e)
{
if(m_filterActive) {
- if(e->type() == QEvent::MouseButtonPress && !m_lastMousePressEvent) {
- QValueList<QWidget*>::const_iterator it_w;
+ if(e->type() == TQEvent::MouseButtonPress && !m_lastMousePressEvent) {
+ TQValueList<TQWidget*>::const_iterator it_w;
for(it_w = m_parents.begin(); it_w != m_parents.end(); ++it_w) {
- if(isChildOf((QWidget*)o, (*it_w))) {
+ if(isChildOf((TQWidget*)o, (*it_w))) {
m_lastMousePressEvent = e;
break;
}
@@ -126,7 +126,7 @@ bool MousePressFilter::eventFilter(QObject* o, QEvent* e)
}
}
- if(e->type() != QEvent::MouseButtonPress) {
+ if(e->type() != TQEvent::MouseButtonPress) {
m_lastMousePressEvent = 0;
}
}
@@ -143,21 +143,21 @@ KGlobalLedgerView::Private::Private() :
{
}
-QDate KGlobalLedgerView::m_lastPostDate;
+TQDate KGlobalLedgerView::m_lastPostDate;
-KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name )
- : KMyMoneyViewBase(parent, name, i18n("Ledgers")),
+KGlobalLedgerView::KGlobalLedgerView(TQWidget *tqparent, const char *name )
+ : KMyMoneyViewBase(tqparent, name, i18n("Ledgers")),
d(new Private),
m_needReload(false),
m_newAccountLoaded(true),
m_inEditMode(false)
{
- d->m_mousePressFilter = new MousePressFilter((QWidget*)this);
+ d->m_mousePressFilter = new MousePressFilter((TQWidget*)this);
d->m_action = KMyMoneyRegister::ActionNone;;
// create the toolbar frame at the top of the view
- m_toolbarFrame = new QFrame(this);
- QVBoxLayout* toolbarLayout = new QVBoxLayout(m_toolbarFrame, 0, 0);
+ m_toolbarFrame = new TQFrame(this);
+ TQVBoxLayout* toolbarLayout = new TQVBoxLayout(m_toolbarFrame, 0, 0);
m_toolbar = new KToolBar(m_toolbarFrame, 0, true);
toolbarLayout->addWidget(m_toolbar);
@@ -176,21 +176,21 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name )
//m_toolbar->setMaximumSize(50,20);
m_toolbar->alignItemRight(1);
#endif
- m_toolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- layout()->addWidget(m_toolbarFrame);
+ m_toolbar->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed);
+ tqlayout()->addWidget(m_toolbarFrame);
// create the register frame
- m_registerFrame = new QFrame(this);
- QVBoxLayout* registerFrameLayout = new QVBoxLayout(m_registerFrame, 0, 0);
- layout()->addWidget(m_registerFrame);
- layout()->setStretchFactor(m_registerFrame, 2);
+ m_registerFrame = new TQFrame(this);
+ TQVBoxLayout* registerFrameLayout = new TQVBoxLayout(m_registerFrame, 0, 0);
+ tqlayout()->addWidget(m_registerFrame);
+ tqlayout()->setStretchFactor(m_registerFrame, 2);
m_register = new KMyMoneyRegister::Register(m_registerFrame);
registerFrameLayout->addWidget(m_register);
m_register->installEventFilter(this);
- connect(m_register, SIGNAL(openContextMenu()), this, SIGNAL(openContextMenu()));
- connect(m_register, SIGNAL(headerClicked()), this, SLOT(slotSortOptions()));
- connect(m_register, SIGNAL(reconcileStateColumnClicked(KMyMoneyRegister::Transaction*)), this, SLOT(slotToggleTransactionMark(KMyMoneyRegister::Transaction*)));
- connect(&d->m_viewPosTimer, SIGNAL(timeout()), this, SLOT(slotUpdateViewPos()));
+ connect(m_register, TQT_SIGNAL(openContextMenu()), this, TQT_SIGNAL(openContextMenu()));
+ connect(m_register, TQT_SIGNAL(headerClicked()), this, TQT_SLOT(slotSortOptions()));
+ connect(m_register, TQT_SIGNAL(reconcileStateColumnClicked(KMyMoneyRegister::Transaction*)), this, TQT_SLOT(slotToggleTransactionMark(KMyMoneyRegister::Transaction*)));
+ connect(&d->m_viewPosTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotUpdateViewPos()));
// insert search line widget
@@ -198,24 +198,24 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name )
m_toolbar->setStretchableWidget(d->m_registerSearchLine);
// create the summary frame
- m_summaryFrame = new QFrame(this);
- QHBoxLayout* summaryFrameLayout = new QHBoxLayout(m_summaryFrame, 0, 0);
- m_leftSummaryLabel = new QLabel(m_summaryFrame);
- m_centerSummaryLabel = new QLabel(m_summaryFrame);
- m_rightSummaryLabel = new QLabel(m_summaryFrame);
+ m_summaryFrame = new TQFrame(this);
+ TQHBoxLayout* summaryFrameLayout = new TQHBoxLayout(m_summaryFrame, 0, 0);
+ m_leftSummaryLabel = new TQLabel(m_summaryFrame);
+ m_centerSummaryLabel = new TQLabel(m_summaryFrame);
+ m_rightSummaryLabel = new TQLabel(m_summaryFrame);
summaryFrameLayout->addWidget(m_leftSummaryLabel);
- QSpacerItem* spacer = new QSpacerItem( 20, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
summaryFrameLayout->addItem(spacer);
summaryFrameLayout->addWidget(m_centerSummaryLabel);
- spacer = new QSpacerItem( 20, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ spacer = new TQSpacerItem( 20, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
summaryFrameLayout->addItem(spacer);
summaryFrameLayout->addWidget(m_rightSummaryLabel);
- layout()->addWidget(m_summaryFrame);
+ tqlayout()->addWidget(m_summaryFrame);
// create the button frame
- m_buttonFrame = new QFrame(this);
- QVBoxLayout* buttonLayout = new QVBoxLayout(m_buttonFrame, 0, 0);
- layout()->addWidget(m_buttonFrame);
+ m_buttonFrame = new TQFrame(this);
+ TQVBoxLayout* buttonLayout = new TQVBoxLayout(m_buttonFrame, 0, 0);
+ tqlayout()->addWidget(m_buttonFrame);
m_buttonbar = new KToolBar(m_buttonFrame, 0, true);
m_buttonbar->setIconText(KToolBar::IconTextRight);
buttonLayout->addWidget(m_buttonbar);
@@ -229,26 +229,26 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name )
kmymoney2->action("transaction_match")->plug(m_buttonbar);
// create the transaction form frame
- m_formFrame = new QFrame(this);
- QVBoxLayout* frameLayout = new QVBoxLayout(m_formFrame, 5, 0);
+ m_formFrame = new TQFrame(this);
+ TQVBoxLayout* frameLayout = new TQVBoxLayout(m_formFrame, 5, 0);
m_form = new KMyMoneyTransactionForm::TransactionForm(m_formFrame);
frameLayout->addWidget(m_form->tabBar(m_formFrame));
frameLayout->addWidget(m_form);
- m_formFrame->setFrameShape( QFrame::Panel );
- m_formFrame->setFrameShadow( QFrame::Raised );
- layout()->addWidget(m_formFrame);
-
- connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView()));
- connect(m_register, SIGNAL(focusChanged(KMyMoneyRegister::Transaction*)), m_form, SLOT(slotSetTransaction(KMyMoneyRegister::Transaction*)));
- connect(m_register, SIGNAL(focusChanged()), kmymoney2, SLOT(slotUpdateActions()));
- connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), this, SLOT(slotSelectAccount(const QString&)));
- connect(m_register, SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)));
- connect(m_register, SIGNAL(editTransaction()), this, SIGNAL(startEdit()));
- connect(m_register, SIGNAL(emptyItemSelected()), this, SLOT(slotNewTransaction()));
- connect(m_register, SIGNAL(aboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)), this, SLOT(slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)));
- connect(d->m_mousePressFilter, SIGNAL(mousePressedOnExternalWidget(bool&)), this, SIGNAL(cancelOrEndEdit(bool&)));
-
- connect(m_form, SIGNAL(newTransaction(KMyMoneyRegister::Action)), this, SLOT(slotNewTransaction(KMyMoneyRegister::Action)));
+ m_formFrame->setFrameShape( TQFrame::Panel );
+ m_formFrame->setFrameShadow( TQFrame::Raised );
+ tqlayout()->addWidget(m_formFrame);
+
+ connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView()));
+ connect(m_register, TQT_SIGNAL(focusChanged(KMyMoneyRegister::Transaction*)), m_form, TQT_SLOT(slotSetTransaction(KMyMoneyRegister::Transaction*)));
+ connect(m_register, TQT_SIGNAL(focusChanged()), kmymoney2, TQT_SLOT(slotUpdateActions()));
+ connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(slotSelectAccount(const TQString&)));
+ connect(m_register, TQT_SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)));
+ connect(m_register, TQT_SIGNAL(editTransaction()), this, TQT_SIGNAL(startEdit()));
+ connect(m_register, TQT_SIGNAL(emptyItemSelected()), this, TQT_SLOT(slotNewTransaction()));
+ connect(m_register, TQT_SIGNAL(aboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)), this, TQT_SLOT(slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)));
+ connect(d->m_mousePressFilter, TQT_SIGNAL(mousePressedOnExternalWidget(bool&)), this, TQT_SIGNAL(cancelOrEndEdit(bool&)));
+
+ connect(m_form, TQT_SIGNAL(newTransaction(KMyMoneyRegister::Action)), this, TQT_SLOT(slotNewTransaction(KMyMoneyRegister::Action)));
// setup mouse press filter
d->m_mousePressFilter->addWidget(m_formFrame);
@@ -287,8 +287,8 @@ void KGlobalLedgerView::clear(void)
m_register->clear();
// setup header font
- QFont font = KMyMoneyGlobalSettings::listHeaderFont();
- QFontMetrics fm( font );
+ TQFont font = KMyMoneyGlobalSettings::listHeaderFont();
+ TQFontMetrics fm( font );
int height = fm.lineSpacing()+6;
m_register->horizontalHeader()->setMinimumHeight(height);
m_register->horizontalHeader()->setMaximumHeight(height);
@@ -305,7 +305,7 @@ void KGlobalLedgerView::clear(void)
m_transactionList.clear();
// and the selected account in the combo box
- m_accountComboBox->setSelected(QString());
+ m_accountComboBox->setSelected(TQString());
// fraction defaults to two digits
d->m_precision = 2;
@@ -324,12 +324,12 @@ void KGlobalLedgerView::loadView(void)
KMyMoneyRegister::SelectedTransactions list;
emit transactionsSelected(list);
- QMap<QString, bool> isSelected;
- QString focusItemId;
- QString anchorItemId;
+ TQMap<TQString, bool> isSelected;
+ TQString focusItemId;
+ TQString anchorItemId;
if(!d->m_inLoading)
- d->m_startPoint = QPoint(-1, -1);
+ d->m_startPoint = TQPoint(-1, -1);
if(!m_newAccountLoaded) {
// remember the current selected transactions
@@ -348,11 +348,11 @@ void KGlobalLedgerView::loadView(void)
// remember the upper left corner of the viewport
if(!d->m_inLoading && d->m_showDetails == KMyMoneyGlobalSettings::showRegisterDetailed())
- d->m_startPoint = QPoint(m_register->contentsX(), m_register->contentsY());
+ d->m_startPoint = TQPoint(m_register->contentsX(), m_register->contentsY());
} else {
if(d->m_viewPosTimer.isActive())
d->m_viewPosTimer.stop();
- d->m_startPoint = QPoint(-1, -1);
+ d->m_startPoint = TQPoint(-1, -1);
d->m_inLoading = false;
d->m_registerSearchLine->searchLine()->reset();
}
@@ -381,14 +381,14 @@ void KGlobalLedgerView::loadView(void)
// ... and recreate it
KMyMoneyRegister::RegisterItem* focusItem = 0;
KMyMoneyRegister::RegisterItem* anchorItem = 0;
- QMap<QString, MyMoneyMoney> actBalance, clearedBalance, futureBalance;
- QMap<QString, MyMoneyMoney>::iterator it_b;
+ TQMap<TQString, MyMoneyMoney> actBalance, clearedBalance, futureBalance;
+ TQMap<TQString, MyMoneyMoney>::iterator it_b;
try {
// setup the filter to select the transactions we want to display
// and update the sort order
- QString sortOrder;
- QString key;
- QDate reconciliationDate = d->m_reconciliationDate;
+ TQString sortOrder;
+ TQString key;
+ TQDate reconciliationDate = d->m_reconciliationDate;
MyMoneyTransactionFilter filter(m_account.id());
// if it's an investment account, we also take care of
@@ -402,7 +402,7 @@ void KGlobalLedgerView::loadView(void)
filter.addState(MyMoneyTransactionFilter::notReconciled);
filter.addState(MyMoneyTransactionFilter::cleared);
} else {
- filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), QDate());
+ filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), TQDate());
key = "kmm-sort-std";
sortOrder = KMyMoneyGlobalSettings::sortNormalView();
if (KMyMoneyGlobalSettings::hideReconciledTransactions()
@@ -426,8 +426,8 @@ void KGlobalLedgerView::loadView(void)
kmymoney2->slotStatusProgressBar(0, m_transactionList.count());
// create the elements for the register
- QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >::const_iterator it;
- QMap<QString, int>uniqueMap;
+ TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >::const_iterator it;
+ TQMap<TQString, int>uniqueMap;
int i = 0;
for(it = m_transactionList.begin(); it != m_transactionList.end(); ++it) {
uniqueMap[(*it).first.id()]++;
@@ -448,10 +448,10 @@ void KGlobalLedgerView::loadView(void)
// show scheduled transactions which have a scheduled postdate
// within the next 'period' days. In reconciliation mode, the
// period starts on the statement date.
- QDate endDate = QDate::currentDate().addDays(period);
+ TQDate endDate = TQDate::tqcurrentDate().addDays(period);
if(isReconciliationAccount())
endDate = reconciliationDate.addDays(period);
- QValueList<MyMoneySchedule> scheduleList = MyMoneyFile::instance()->scheduleList(m_account.id());
+ TQValueList<MyMoneySchedule> scheduleList = MyMoneyFile::instance()->scheduleList(m_account.id());
while(scheduleList.count() > 0){
MyMoneySchedule& s = scheduleList.first();
for(;;) {
@@ -464,11 +464,11 @@ void KGlobalLedgerView::loadView(void)
// certainly be posted in the past. So we take todays date
// as the alternative
if(s.isOverdue())
- t.setPostDate(QDate::currentDate());
+ t.setPostDate(TQDate::tqcurrentDate());
else
t.setPostDate(s.adjustedNextDueDate());
- const QValueList<MyMoneySplit>& splits = t.splits();
- QValueList<MyMoneySplit>::const_iterator it_s;
+ const TQValueList<MyMoneySplit>& splits = t.splits();
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = splits.begin(); it_s != splits.end(); ++it_s) {
if((*it_s).accountId() == m_account.id()) {
new KMyMoneyRegister::StdTransactionScheduled(m_register, t, *it_s, uniqueMap[t.id()]);
@@ -476,7 +476,7 @@ void KGlobalLedgerView::loadView(void)
}
// keep track of this payment locally (not in the engine)
if(s.isOverdue())
- s.setLastPayment(QDate::currentDate());
+ s.setLastPayment(TQDate::tqcurrentDate());
else
s.setLastPayment(s.nextDueDate());
@@ -528,7 +528,7 @@ void KGlobalLedgerView::loadView(void)
actBalance[m_account.id()] = MyMoneyMoney();
if(m_account.accountType() == MyMoneyAccount::Investment) {
- QValueList<QString>::const_iterator it_a;
+ TQValueList<TQString>::const_iterator it_a;
for(it_a = m_account.accountList().begin(); it_a != m_account.accountList().end(); ++it_a) {
actBalance[*it_a] = MyMoneyMoney();
}
@@ -544,10 +544,10 @@ void KGlobalLedgerView::loadView(void)
|| m_account.accountGroup() == MyMoneyAccount::Equity)
factor = -factor;
- QMap<QString, int> deposits;
- QMap<QString, int> payments;
- QMap<QString, MyMoneyMoney> depositAmount;
- QMap<QString, MyMoneyMoney> paymentAmount;
+ TQMap<TQString, int> deposits;
+ TQMap<TQString, int> payments;
+ TQMap<TQString, MyMoneyMoney> depositAmount;
+ TQMap<TQString, MyMoneyMoney> paymentAmount;
for(it_b = actBalance.begin(); it_b != actBalance.end(); ++it_b) {
MyMoneyMoney balance = MyMoneyFile::instance()->balance(it_b.key());
balance = balance * factor;
@@ -590,7 +590,7 @@ void KGlobalLedgerView::loadView(void)
while(p) {
KMyMoneyRegister::Transaction* t = dynamic_cast<KMyMoneyRegister::Transaction*>(p);
if(t) {
- if(isSelected.contains(t->id()))
+ if(isSelected.tqcontains(t->id()))
t->setSelected(true);
if(t->id() == focusItemId)
@@ -629,7 +629,7 @@ void KGlobalLedgerView::loadView(void)
}
}
- if(t->transaction().postDate() > QDate::currentDate()) {
+ if(t->transaction().postDate() > TQDate::tqcurrentDate()) {
tracer.printf("Reducing actual balance by %s because %s/%s(%s) is in the future", (split.shares() * factor).formatMoney("", 2).data(), t->transaction().id().data(), split.id().data(), t->transaction().postDate().toString(Qt::ISODate).data());
actBalance[split.accountId()] -= split.shares() * factor;
}
@@ -652,11 +652,11 @@ void KGlobalLedgerView::loadView(void)
arg(paymentAmount[m_account.id()].abs().formatMoney(m_account.fraction())) );
}
if(pStatement) {
- pStatement->setText(i18n("%1 payments (%2)").arg(payments[m_account.id()]).
+ pStatement->setText(i18n("%1 payments (%2)").tqarg(payments[m_account.id()]).
arg(paymentAmount[m_account.id()].abs().formatMoney(m_account.fraction())) );
}
if(dStatement) {
- dStatement->setText(i18n("%1 deposits (%2)").arg(deposits[m_account.id()]).
+ dStatement->setText(i18n("%1 deposits (%2)").tqarg(deposits[m_account.id()]).
arg(depositAmount[m_account.id()].abs().formatMoney(m_account.fraction())) );
}
@@ -699,9 +699,9 @@ void KGlobalLedgerView::loadView(void)
// (re-)position viewport
if(m_newAccountLoaded) {
if(focusItem) {
- d->m_startPoint = QPoint(-1, -1);
+ d->m_startPoint = TQPoint(-1, -1);
} else {
- d->m_startPoint = QPoint(0, 0);
+ d->m_startPoint = TQPoint(0, 0);
}
}
if(!d->m_inLoading) {
@@ -715,7 +715,7 @@ void KGlobalLedgerView::loadView(void)
emit accountSelected(m_account);
}
-void KGlobalLedgerView::updateSummaryLine(const QMap<QString, MyMoneyMoney>& actBalance, const QMap<QString, MyMoneyMoney>& clearedBalance)
+void KGlobalLedgerView::updateSummaryLine(const TQMap<TQString, MyMoneyMoney>& actBalance, const TQMap<TQString, MyMoneyMoney>& clearedBalance)
{
MyMoneyFile* file = MyMoneyFile::instance();
m_leftSummaryLabel->show();
@@ -724,24 +724,24 @@ void KGlobalLedgerView::updateSummaryLine(const QMap<QString, MyMoneyMoney>& act
if(isReconciliationAccount()) {
if(m_account.accountType() != MyMoneyAccount::Investment) {
- m_leftSummaryLabel->setText(i18n("Statement: %1").arg(d->m_endingBalance.formatMoney("", d->m_precision)));
- m_centerSummaryLabel->setText(i18n("Cleared: %1").arg(clearedBalance[m_account.id()].formatMoney("", d->m_precision)));
- m_rightSummaryLabel->setText(i18n("Difference: %1").arg((clearedBalance[m_account.id()] - d->m_endingBalance).formatMoney("", d->m_precision)));
+ m_leftSummaryLabel->setText(i18n("Statement: %1").tqarg(d->m_endingBalance.formatMoney("", d->m_precision)));
+ m_centerSummaryLabel->setText(i18n("Cleared: %1").tqarg(clearedBalance[m_account.id()].formatMoney("", d->m_precision)));
+ m_rightSummaryLabel->setText(i18n("Difference: %1").tqarg((clearedBalance[m_account.id()] - d->m_endingBalance).formatMoney("", d->m_precision)));
}
} else {
// update summary line in normal mode
- QDate reconcileDate = m_account.lastReconciliationDate();
+ TQDate reconcileDate = m_account.lastReconciliationDate();
if(reconcileDate.isValid()) {
- m_leftSummaryLabel->setText(i18n("Last reconciled: %1").arg(KGlobal::locale()->formatDate(reconcileDate, true)));
+ m_leftSummaryLabel->setText(i18n("Last reconciled: %1").tqarg(KGlobal::locale()->formatDate(reconcileDate, true)));
} else {
m_leftSummaryLabel->setText(i18n("Never reconciled"));
}
m_rightSummaryLabel->setPaletteForegroundColor(m_leftSummaryLabel->paletteForegroundColor());
if(m_account.accountType() != MyMoneyAccount::Investment) {
- m_centerSummaryLabel->setText(i18n("Cleared: %1").arg(clearedBalance[m_account.id()].formatMoney("", d->m_precision)));
- m_rightSummaryLabel->setText(i18n("Balance: %1").arg(actBalance[m_account.id()].formatMoney("", d->m_precision)));
+ m_centerSummaryLabel->setText(i18n("Cleared: %1").tqarg(clearedBalance[m_account.id()].formatMoney("", d->m_precision)));
+ m_rightSummaryLabel->setText(i18n("Balance: %1").tqarg(actBalance[m_account.id()].formatMoney("", d->m_precision)));
bool showNegative = actBalance[m_account.id()].isNegative();
if(m_account.accountGroup() == MyMoneyAccount::Liability && !actBalance[m_account.id()].isZero())
showNegative = !showNegative;
@@ -752,11 +752,11 @@ void KGlobalLedgerView::updateSummaryLine(const QMap<QString, MyMoneyMoney>& act
m_centerSummaryLabel->hide();
MyMoneyMoney balance;
MyMoneySecurity base = file->baseCurrency();
- QMap<QString, MyMoneyMoney>::const_iterator it_b;
+ TQMap<TQString, MyMoneyMoney>::const_iterator it_b;
bool approx = false;
for(it_b = actBalance.begin(); it_b != actBalance.end(); ++it_b) {
MyMoneyAccount stock = file->account(it_b.key());
- QString currencyId = stock.currencyId();
+ TQString currencyId = stock.currencyId();
MyMoneySecurity sec = file->security(currencyId);
MyMoneyPrice priceInfo;
MyMoneyMoney rate(1,1);
@@ -775,7 +775,7 @@ void KGlobalLedgerView::updateSummaryLine(const QMap<QString, MyMoneyMoney>& act
}
balance += ((*it_b) * rate).convert(base.smallestAccountFraction());
}
- m_rightSummaryLabel->setText(i18n("Investment value: %1%2").arg(approx ? "~" : "").arg(balance.formatMoney(base.tradingSymbol(), d->m_precision)));
+ m_rightSummaryLabel->setText(i18n("Investment value: %1%2").tqarg(approx ? "~" : "").tqarg(balance.formatMoney(base.tradingSymbol(), d->m_precision)));
}
}
}
@@ -784,18 +784,18 @@ void KGlobalLedgerView::slotUpdateViewPos(void)
{
m_register->setUpdatesEnabled(true);
- if(d->m_startPoint == QPoint(-1, -1)) {
+ if(d->m_startPoint == TQPoint(-1, -1)) {
m_register->ensureItemVisible(m_register->focusItem());
m_register->updateContents();
} else {
m_register->setContentsPos(d->m_startPoint.x(), d->m_startPoint.y());
- m_register->repaintContents();
+ m_register->tqrepaintContents();
}
d->m_inLoading = false;
}
-void KGlobalLedgerView::resizeEvent(QResizeEvent* ev)
+void KGlobalLedgerView::resizeEvent(TQResizeEvent* ev)
{
m_register->resize(KMyMoneyRegister::DetailColumn);
m_form->resize(KMyMoneyTransactionForm::ValueColumn1);
@@ -820,9 +820,9 @@ void KGlobalLedgerView::loadAccounts(void)
m_accountComboBox->loadList((KMyMoneyUtils::categoryTypeE)(KMyMoneyUtils::asset | KMyMoneyUtils::liability));
if(m_account.id().isEmpty()) {
- QStringList list = m_accountComboBox->accountList();
+ TQStringList list = m_accountComboBox->accountList();
if(list.count()) {
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for(it = list.begin(); it != list.end(); ++it) {
MyMoneyAccount a = file->account(*it);
if(!a.isInvest()) {
@@ -849,7 +849,7 @@ void KGlobalLedgerView::loadAccounts(void)
}
}
-void KGlobalLedgerView::selectTransaction(const QString& id)
+void KGlobalLedgerView::selectTransaction(const TQString& id)
{
if(!id.isEmpty()) {
KMyMoneyRegister::RegisterItem* p = m_register->lastItem();
@@ -879,14 +879,14 @@ void KGlobalLedgerView::slotSelectAllTransactions(void)
}
p = p->nextItem();
}
- m_register->repaintItems();
+ m_register->tqrepaintItems();
// inform everyone else about the selected items
KMyMoneyRegister::SelectedTransactions list(m_register);
emit transactionsSelected(list);
}
-void KGlobalLedgerView::slotSetReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance)
+void KGlobalLedgerView::slotSetReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance)
{
if(d->m_reconciliationAccount != acc.id()) {
// make sure the account is selected
@@ -935,7 +935,7 @@ bool KGlobalLedgerView::slotSelectAccount(const MyMoneyObject& obj)
return rc;
}
-bool KGlobalLedgerView::slotSelectAccount(const QString& id, const QString& transactionId)
+bool KGlobalLedgerView::slotSelectAccount(const TQString& id, const TQString& transactionId)
{
bool rc = true;
@@ -944,9 +944,9 @@ bool KGlobalLedgerView::slotSelectAccount(const QString& id, const QString& tran
try {
m_account = MyMoneyFile::instance()->account(id);
// if a stock account is selected, we show the
- // the corresponding parent (investment) account
+ // the corresponding tqparent (investment) account
if(m_account.isInvest()) {
- m_account = MyMoneyFile::instance()->account(m_account.parentAccountId());
+ m_account = MyMoneyFile::instance()->account(m_account.tqparentAccountId());
}
m_newAccountLoaded = true;
slotLoadView();
@@ -1089,14 +1089,14 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected
}
// decide, if we edit in the register or in the form
- TransactionEditorContainer* parent;
+ TransactionEditorContainer* tqparent;
if(m_formFrame->isVisible())
- parent = m_form;
+ tqparent = m_form;
else {
- parent = m_register;
+ tqparent = m_register;
}
- editor = item->createEditor(parent, list, m_lastPostDate);
+ editor = item->createEditor(tqparent, list, m_lastPostDate);
// check that we use the same transaction commodity in all selected transactions
// if not, we need to update this in the editor's list. The user can also bail out
@@ -1111,27 +1111,27 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected
}
if(editor) {
- if(parent == m_register) {
+ if(tqparent == m_register) {
// make sure, the height of the table is correct
m_register->updateRegister(KMyMoneyGlobalSettings::ledgerLens() | !KMyMoneyGlobalSettings::transactionForm());
}
m_inEditMode = true;
- connect(editor, SIGNAL(transactionDataSufficient(bool)), kmymoney2->action("transaction_enter"), SLOT(setEnabled(bool)));
- connect(editor, SIGNAL(returnPressed()), kmymoney2->action("transaction_enter"), SLOT(activate()));
- connect(editor, SIGNAL(escapePressed()), kmymoney2->action("transaction_cancel"), SLOT(activate()));
+ connect(editor, TQT_SIGNAL(transactionDataSufficient(bool)), kmymoney2->action("transaction_enter"), TQT_SLOT(setEnabled(bool)));
+ connect(editor, TQT_SIGNAL(returnPressed()), kmymoney2->action("transaction_enter"), TQT_SLOT(activate()));
+ connect(editor, TQT_SIGNAL(escapePressed()), kmymoney2->action("transaction_cancel"), TQT_SLOT(activate()));
- connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets()));
- connect(editor, SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&)));
+ connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets()));
+ connect(editor, TQT_SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&)));
- connect(editor, SIGNAL(objectCreation(bool)), d->m_mousePressFilter, SLOT(setFilterDeactive(bool)));
- connect(editor, SIGNAL(createPayee(const QString&, QString&)), kmymoney2, SLOT(slotPayeeNew(const QString&, QString&)));
- connect(editor, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&)));
- connect(editor, SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&)));
- connect(editor, SIGNAL(assignNumber(void)), kmymoney2, SLOT(slotTransactionAssignNumber()));
- connect(editor, SIGNAL(lastPostDateUsed(const QDate&)), this, SLOT(slotKeepPostDate(const QDate&)));
+ connect(editor, TQT_SIGNAL(objectCreation(bool)), d->m_mousePressFilter, TQT_SLOT(setFilterDeactive(bool)));
+ connect(editor, TQT_SIGNAL(createPayee(const TQString&, TQString&)), kmymoney2, TQT_SLOT(slotPayeeNew(const TQString&, TQString&)));
+ connect(editor, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&)));
+ connect(editor, TQT_SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&)));
+ connect(editor, TQT_SIGNAL(assignNumber(void)), kmymoney2, TQT_SLOT(slotTransactionAssignNumber()));
+ connect(editor, TQT_SIGNAL(lastPostDateUsed(const TQDate&)), this, TQT_SLOT(slotKeepPostDate(const TQDate&)));
- // create the widgets, place them in the parent and load them with data
+ // create the widgets, place them in the tqparent and load them with data
// setup tab order
m_tabOrderWidgets.clear();
editor->setup(m_tabOrderWidgets, m_account, d->m_action);
@@ -1139,22 +1139,22 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected
Q_ASSERT(!m_tabOrderWidgets.isEmpty());
// install event filter in all taborder widgets
- for(QWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) {
+ for(TQWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) {
w->installEventFilter(this);
}
// Install a filter that checks if a mouse press happened outside
// of one of our own widgets.
- qApp->installEventFilter(d->m_mousePressFilter);
+ tqApp->installEventFilter(d->m_mousePressFilter);
// Check if the editor has some preference on where to set the focus
// If not, set the focus to the first widget in the tab order
- QWidget* focusWidget = editor->firstWidget();
- if(!focusWidget)
- focusWidget = m_tabOrderWidgets.first();
+ TQWidget* tqfocusWidget = editor->firstWidget();
+ if(!tqfocusWidget)
+ tqfocusWidget = m_tabOrderWidgets.first();
// for some reason, this only works reliably if delayed a bit
- QTimer::singleShot(10, focusWidget, SLOT(setFocus()));
+ TQTimer::singleShot(10, tqfocusWidget, TQT_SLOT(setFocus()));
// preset to 'I have no idea which type to create' for the next round.
d->m_action = KMyMoneyRegister::ActionNone;
@@ -1166,7 +1166,7 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected
void KGlobalLedgerView::slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions& list)
{
m_inEditMode = false;
- qApp->removeEventFilter(d->m_mousePressFilter);
+ tqApp->removeEventFilter(d->m_mousePressFilter);
// a possible focusOut event may have removed the focus, so we
// install it back again.
@@ -1204,13 +1204,13 @@ bool KGlobalLedgerView::focusNextPrevChild(bool next)
// qDebug("KGlobalLedgerView::focusNextPrevChild(editmode=%s)", m_inEditMode ? "true" : "false");
if(m_inEditMode) {
- QWidget *w = 0;
- QWidget *currentWidget;
+ TQWidget *w = 0;
+ TQWidget *currentWidget;
- w = qApp->focusWidget();
- while(w && m_tabOrderWidgets.find(w) == -1) {
- // qDebug("'%s' not in list, use parent", w->className());
- w = w->parentWidget();
+ w = tqApp->tqfocusWidget();
+ while(w && m_tabOrderWidgets.tqfind(w) == -1) {
+ // qDebug("'%s' not in list, use tqparent", w->className());
+ w = w->tqparentWidget();
}
// if(w) qDebug("tab order is at '%s'", w->className());
currentWidget = m_tabOrderWidgets.current();
@@ -1222,7 +1222,7 @@ bool KGlobalLedgerView::focusNextPrevChild(bool next)
}
if(w != currentWidget
- && ((w->focusPolicy() & TabFocus) == TabFocus)
+ && ((w->focusPolicy() & TQ_TabFocus) == TQ_TabFocus)
&& w->isVisible() && w->isEnabled()) {
// qDebug("Selecting '%s' as focus", w->className());
w->setFocus();
@@ -1258,26 +1258,26 @@ void KGlobalLedgerView::show(void)
KMyMoneyViewBase::show();
}
-bool KGlobalLedgerView::eventFilter(QObject* o, QEvent* e)
+bool KGlobalLedgerView::eventFilter(TQObject* o, TQEvent* e)
{
bool rc = false;
- if(e->type() == QEvent::KeyPress) {
- QKeyEvent *k = static_cast<QKeyEvent*>(e);
+ if(e->type() == TQEvent::KeyPress) {
+ TQKeyEvent *k = TQT_TQKEYEVENT(e);
if(m_inEditMode) {
// qDebug("object = %s, key = %d", o->className(), k->key());
- if(o == m_register) {
+ if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) {
// we hide all key press events from the register
// while editing a transaction
rc = true;
}
} else {
// qDebug("object = %s, key = %d", o->className(), k->key());
- if(o == m_register) {
- if((k->state() & Qt::KeyButtonMask) == 0) {
+ if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) {
+ if((k->state() & TQt::KeyButtonMask) == 0) {
switch(k->key()) {
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
kmymoney2->action("transaction_edit")->activate();
rc = true;
break;
@@ -1297,8 +1297,8 @@ void KGlobalLedgerView::slotSortOptions(void)
{
KSortOptionDlg* dlg = new KSortOptionDlg(this);
- QString key;
- QString sortOrder, def;
+ TQString key;
+ TQString sortOrder, def;
if(isReconciliationAccount()) {
key = "kmm-sort-reconcile";
def = KMyMoneyGlobalSettings::sortReconcileView();
@@ -1311,11 +1311,11 @@ void KGlobalLedgerView::slotSortOptions(void)
if(!m_account.value(key).isEmpty())
sortOrder = m_account.value(key);
- QString oldOrder = sortOrder;
+ TQString oldOrder = sortOrder;
dlg->setSortOption(sortOrder, def);
- if(dlg->exec() == QDialog::Accepted) {
+ if(dlg->exec() == TQDialog::Accepted) {
sortOrder = dlg->sortOption();
if(sortOrder != oldOrder) {
if(sortOrder.isEmpty()) {
@@ -1343,12 +1343,12 @@ void KGlobalLedgerView::slotToggleTransactionMark(KMyMoneyRegister::Transaction*
}
}
-void KGlobalLedgerView::slotKeepPostDate(const QDate& date)
+void KGlobalLedgerView::slotKeepPostDate(const TQDate& date)
{
m_lastPostDate = date;
}
-bool KGlobalLedgerView::canCreateTransactions(QString& tooltip) const
+bool KGlobalLedgerView::canCreateTransactions(TQString& tooltip) const
{
bool rc = true;
if(m_account.id().isEmpty()) {
@@ -1367,7 +1367,7 @@ bool KGlobalLedgerView::canCreateTransactions(QString& tooltip) const
return rc;
}
-bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const
+bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const
{
if(m_register->focusItem() == 0)
return false;
@@ -1379,17 +1379,17 @@ bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedT
return list.count() > 0;
}
-bool KGlobalLedgerView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const
+bool KGlobalLedgerView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const
{
return canProcessTransactions(list,tooltip) && list.canModify();
}
-bool KGlobalLedgerView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const
+bool KGlobalLedgerView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const
{
return canProcessTransactions(list,tooltip) && list.canDuplicate();
}
-bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const
+bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const
{
// check if we can edit the list of transactions. We can edit, if
//
@@ -1421,7 +1421,7 @@ bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTran
KMyMoneyRegister::SelectedTransactions::const_iterator it_t;
for(it_t = list.begin(); rc && it_t != list.end(); ++it_t) {
if((*it_t).transaction().id().isEmpty()) {
- tooltip = QString();
+ tooltip = TQString();
rc = false;
continue;
}