From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: 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 --- kmymoney2/views/kaccountsview.cpp | 146 ++++---- kmymoney2/views/kaccountsview.h | 37 +- kmymoney2/views/kaccountsviewdecl.ui | 33 +- kmymoney2/views/kbudgetview.cpp | 222 ++++++------ kmymoney2/views/kbudgetview.h | 37 +- kmymoney2/views/kbudgetviewdecl.ui | 44 +-- kmymoney2/views/kcategoriesview.cpp | 84 ++--- kmymoney2/views/kcategoriesview.h | 23 +- kmymoney2/views/kcategoriesviewdecl.ui | 27 +- kmymoney2/views/kforecastview.cpp | 160 ++++----- kmymoney2/views/kforecastview.h | 11 +- kmymoney2/views/kforecastviewdecl.ui | 74 ++-- kmymoney2/views/kgloballedgerview.cpp | 336 +++++++++--------- kmymoney2/views/kgloballedgerview.h | 104 +++--- kmymoney2/views/khomeview.cpp | 558 +++++++++++++++--------------- kmymoney2/views/khomeview.h | 33 +- kmymoney2/views/kinstitutionsview.cpp | 94 +++--- kmymoney2/views/kinstitutionsview.h | 23 +- kmymoney2/views/kinstitutionsviewdecl.ui | 19 +- kmymoney2/views/kinvestmentlistitem.cpp | 66 ++-- kmymoney2/views/kinvestmentlistitem.h | 18 +- kmymoney2/views/kinvestmentview.cpp | 50 +-- kmymoney2/views/kinvestmentview.h | 11 +- kmymoney2/views/kinvestmentviewdecl.ui | 15 +- kmymoney2/views/kmymoneyfile.cpp | 2 +- kmymoney2/views/kmymoneyfile.h | 2 +- kmymoney2/views/kmymoneytransaction.cpp | 2 +- kmymoney2/views/kmymoneytransaction.h | 6 +- kmymoney2/views/kmymoneyview.cpp | 564 +++++++++++++++---------------- kmymoney2/views/kmymoneyview.h | 98 +++--- kmymoney2/views/kpayeesview.cpp | 288 ++++++++-------- kmymoney2/views/kpayeesview.h | 65 ++-- kmymoney2/views/kpayeesviewdecl.ui | 94 +++--- kmymoney2/views/kreportsview.cpp | 288 ++++++++-------- kmymoney2/views/kreportsview.h | 69 ++-- kmymoney2/views/kscheduledlistitem.cpp | 40 +-- kmymoney2/views/kscheduledlistitem.h | 20 +- kmymoney2/views/kscheduledview.cpp | 118 +++---- kmymoney2/views/kscheduledview.h | 31 +- kmymoney2/views/kscheduledviewdecl.ui | 16 +- 40 files changed, 1979 insertions(+), 1949 deletions(-) (limited to 'kmymoney2/views') diff --git a/kmymoney2/views/kaccountsview.cpp b/kmymoney2/views/kaccountsview.cpp index b0800cd..f84bf63 100644 --- a/kmymoney2/views/kaccountsview.cpp +++ b/kmymoney2/views/kaccountsview.cpp @@ -17,10 +17,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,8 +43,8 @@ #include "../kmymoney2.h" -KMyMoneyAccountIconItem::KMyMoneyAccountIconItem(QIconView *parent, const MyMoneyAccount& account) : - KIconViewItem(parent, account.name()), +KMyMoneyAccountIconItem::KMyMoneyAccountIconItem(TQIconView *tqparent, const MyMoneyAccount& account) : + KIconViewItem(tqparent, account.name()), m_account(account), m_reconcileFlag(false) { @@ -68,29 +68,29 @@ void KMyMoneyAccountIconItem::updateAccount(const MyMoneyAccount& account) setPixmap(account.accountPixmap(m_reconcileFlag)); } -KAccountsView::KAccountsView(QWidget *parent, const char *name) : - KAccountsViewDecl(parent,name), +KAccountsView::KAccountsView(TQWidget *tqparent, const char *name) : + KAccountsViewDecl(tqparent,name), m_assetItem(0), m_liabilityItem(0) { // create the searchline widget - // and insert it into the existing layout - m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->parentWidget()); - QVBoxLayout* layout = dynamic_cast(m_accountTree->parentWidget()->layout()); - if(layout) { - layout->insertWidget(0, m_searchWidget); + // and insert it into the existing tqlayout + m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->tqparentWidget()); + TQVBoxLayout* tqlayout = dynamic_cast(m_accountTree->tqparentWidget()->tqlayout()); + if(tqlayout) { + tqlayout->insertWidget(0, m_searchWidget); } // setup icons for collapse and expand button KIconLoader *ic = KGlobal::iconLoader(); KGuiItem collapseGuiItem("", - QIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); KGuiItem expandGuiItem("", - QIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); m_collapseButton->setGuiItem(collapseGuiItem); m_expandButton->setGuiItem(expandGuiItem); @@ -101,21 +101,21 @@ KAccountsView::KAccountsView(QWidget *parent, const char *name) : config->setGroup("Last Use Settings"); m_tab->setCurrentPage(config->readNumEntry("KAccountsView_LastType", 0)); - connect(m_tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotTabChanged(QWidget*))); + connect(m_tab, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(slotTabChanged(TQWidget*))); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateNetWorth(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateNetWorth(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(m_accountIcons, SIGNAL(selectionChanged(QIconViewItem*)), this, SLOT(slotSelectIcon(QIconViewItem*))); - connect(m_accountIcons, SIGNAL(rightButtonClicked(QIconViewItem*, const QPoint&)), this, SLOT(slotOpenContext(QIconViewItem*))); - connect(m_accountIcons, SIGNAL(executed(QIconViewItem*)), this, SLOT(slotOpenObject(QIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(selectionChanged(TQIconViewItem*)), this, TQT_SLOT(slotSelectIcon(TQIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(rightButtonClicked(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT(slotOpenContext(TQIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(executed(TQIconViewItem*)), this, TQT_SLOT(slotOpenObject(TQIconViewItem*))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); - connect(m_collapseButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); + connect(m_collapseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); + connect(m_expandButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); } KAccountsView::~KAccountsView() @@ -137,7 +137,7 @@ void KAccountsView::slotLoadAccounts(void) slotTabChanged(m_tab->currentPage()); } -void KAccountsView::slotTabChanged(QWidget* _tab) +void KAccountsView::slotTabChanged(TQWidget* _tab) { AccountsViewTab tab = static_cast(m_tab->indexOf(_tab)); @@ -196,7 +196,7 @@ void KAccountsView::polish(void) { // don't forget base class implementation KAccountsViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Account View Settings"); } @@ -222,7 +222,7 @@ void KAccountsView::loadIconView(void) ::timetrace("start load accounts icon view"); // remember the positions of the icons - QMap posMap; + TQMap posMap; KMyMoneyAccountIconItem* p = dynamic_cast(m_accountIcons->firstItem()); for(;p; p = dynamic_cast(p->nextItem())) posMap[p->itemObject().id()] = p->pos(); @@ -232,16 +232,16 @@ void KAccountsView::loadIconView(void) // clear the current contents and recreate it m_accountIcons->clear(); - QMap accountMap; + TQMap accountMap; MyMoneyFile* file = MyMoneyFile::instance(); // get account list and sort by name - QValueList alist; + TQValueList alist; file->accountList(alist); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = alist.begin(); it_a != alist.end(); ++it_a) { - accountMap[QString("%1-%2").arg((*it_a).name()).arg((*it_a).id())] = *it_a; + accountMap[TQString("%1-%2").tqarg((*it_a).name()).tqarg((*it_a).id())] = *it_a; } bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() @@ -249,12 +249,12 @@ void KAccountsView::loadIconView(void) bool existNewIcons = false; // parse list and add all asset and liability accounts - QMap::const_iterator it; + TQMap::const_iterator it; for(it = accountMap.begin(); it != accountMap.end(); ++it) { - QPoint loc; + TQPoint loc; if((*it).isClosed() && !showClosedAccounts) continue; - const QString& pos = (*it).value("kmm-iconpos"); + const TQString& pos = (*it).value("kmm-iconpos"); KMyMoneyAccountIconItem* item; switch((*it).accountGroup()) { case MyMoneyAccount::Equity: @@ -271,12 +271,12 @@ void KAccountsView::loadIconView(void) // if we have a position stored with the object and no other // idea of it's current position, then take the one // stored inside the object. Also, turn off auto arrangement - if(!pos.isEmpty() && posMap[(*it).id()] == QPoint()) { + if(!pos.isEmpty() && posMap[(*it).id()] == TQPoint()) { posMap[(*it).id()] = point(pos); } loc = posMap[(*it).id()]; - if(loc == QPoint()) { + if(loc == TQPoint()) { existNewIcons = true; } else { m_accountIcons->setAutoArrange(false); @@ -286,7 +286,7 @@ void KAccountsView::loadIconView(void) if((*it).id() == m_reconciliationAccount.id()) item->setReconciliation(true); - if(loc != QPoint()) { + if(loc != TQPoint()) { item->move(loc); } break; @@ -311,15 +311,15 @@ void KAccountsView::loadIconView(void) void KAccountsView::loadListView(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load accounts list view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -329,7 +329,7 @@ void KAccountsView::loadListView(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -344,9 +344,9 @@ void KAccountsView::loadListView(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -388,13 +388,13 @@ void KAccountsView::loadListView(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -403,11 +403,11 @@ void KAccountsView::loadListView(void) // reposition viewport m_accountTree->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); // and in case we need to show things expanded, we'll do so if(KMyMoneyGlobalSettings::showAccountsExpanded()) @@ -419,7 +419,7 @@ void KAccountsView::loadListView(void) ::timetrace("done load accounts list view"); } -bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList) +bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -427,10 +427,10 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() || !KMyMoneyGlobalSettings::hideClosedAccounts(); - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -452,7 +452,7 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); @@ -478,14 +478,14 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri return unused; } -void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { Q_UNUSED(reconciliationDate); Q_UNUSED(endingBalance); // scan through the list of accounts and mark all non // expanded and re-select the one that was probably selected before - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); KMyMoneyAccountTreeItem* item; while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); @@ -506,7 +506,7 @@ void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& if(!acc.id().isEmpty()) { // scan through the list of accounts and mark // the one that is currently reconciled - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->itemObject().id() == acc.id()) { @@ -534,19 +534,19 @@ void KAccountsView::slotUpdateNetWorth(void) MyMoneyMoney netWorth = m_assetItem->totalValue() - m_liabilityItem->totalValue(); - QString s(i18n("Net Worth: ")); + TQString s(i18n("Net Worth: ")); // FIXME figure out how to deal with the approximate // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(netWorth.formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(netWorth.formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } @@ -560,42 +560,42 @@ KMyMoneyAccountIconItem* KAccountsView::selectedIcon(void) const return dynamic_cast(m_accountIcons->currentItem()); } -void KAccountsView::slotSelectIcon(QIconViewItem* item) +void KAccountsView::slotSelectIcon(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit selectObject(p->itemObject()); } -void KAccountsView::slotOpenContext(QIconViewItem* item) +void KAccountsView::slotOpenContext(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit openContextMenu(p->itemObject()); } -void KAccountsView::slotOpenObject(QIconViewItem* item) +void KAccountsView::slotOpenObject(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit openObject(p->itemObject()); } -QString KAccountsView::point(const QPoint& val) const +TQString KAccountsView::point(const TQPoint& val) const { - return QString("%1;%2").arg(val.x()).arg(val.y()); + return TQString("%1;%2").tqarg(val.x()).tqarg(val.y()); } -QPoint KAccountsView::point(const QString& val) const +TQPoint KAccountsView::point(const TQString& val) const { - QRegExp exp("(\\d+);(\\d+)"); + TQRegExp exp("(\\d+);(\\d+)"); int x = 0; int y = 0; if(exp.search(val) != -1) { x = exp.cap(1).toInt(); y = exp.cap(2).toInt(); } - return QPoint(x, y); + return TQPoint(x, y); } void KAccountsView::slotUpdateIconPos(unsigned int action) diff --git a/kmymoney2/views/kaccountsview.h b/kmymoney2/views/kaccountsview.h index ed30ac5..33a787c 100644 --- a/kmymoney2/views/kaccountsview.h +++ b/kmymoney2/views/kaccountsview.h @@ -49,12 +49,12 @@ public: /** * Constructor to be used to construct an account icon object. * - * @param parent pointer to the KIconView object this entry should be + * @param tqparent pointer to the KIconView object this entry should be * added to. * @param account const reference to MyMoneyAccount for which * the KIconView entry is constructed */ - KMyMoneyAccountIconItem(QIconView *parent, const MyMoneyAccount& account); + KMyMoneyAccountIconItem(TQIconView *tqparent, const MyMoneyAccount& account); ~KMyMoneyAccountIconItem(); /** @@ -87,10 +87,11 @@ private: class KAccountsView : public KAccountsViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KAccountsView(QWidget *parent=0, const char *name=0); + KAccountsView(TQWidget *tqparent=0, const char *name=0); virtual ~KAccountsView(); public slots: @@ -103,8 +104,8 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); @@ -117,7 +118,7 @@ public slots: */ void slotUpdateIconPos(unsigned int action); - void slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); protected: typedef enum { @@ -136,7 +137,7 @@ protected: void loadListView(void); void loadIconView(void); - bool loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList); + bool loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList); /** * This method returns a pointer to the currently selected @@ -144,15 +145,15 @@ protected: */ KMyMoneyAccountIconItem* selectedIcon(void) const; - QPoint point(const QString& str) const; - QString point(const QPoint& val) const; + TQPoint point(const TQString& str) const; + TQString point(const TQPoint& val) const; protected slots: void slotUpdateNetWorth(void); - void slotTabChanged(QWidget*); - void slotSelectIcon(QIconViewItem* item); - void slotOpenContext(QIconViewItem* item); - void slotOpenObject(QIconViewItem* item); + void slotTabChanged(TQWidget*); + void slotSelectIcon(TQIconViewItem* item); + void slotOpenContext(TQIconViewItem* item); + void slotOpenObject(TQIconViewItem* item); void slotExpandCollapse(void); signals: @@ -181,17 +182,17 @@ signals: /** * This signal is emitted, when the user selected to reparent the - * account @p acc to be a subordinate account of @p parent. + * account @p acc to be a subordinate account of @p tqparent. * * @param acc const reference to account to be reparented - * @param parent const reference to new parent account + * @param tqparent const reference to new tqparent account */ - void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& parent); + void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent); private: MyMoneyAccount m_reconciliationAccount; - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; KMyMoneyAccountTreeItem* m_assetItem; KMyMoneyAccountTreeItem* m_liabilityItem; diff --git a/kmymoney2/views/kaccountsviewdecl.ui b/kmymoney2/views/kaccountsviewdecl.ui index c8bb5ac..922844f 100644 --- a/kmymoney2/views/kaccountsviewdecl.ui +++ b/kmymoney2/views/kaccountsviewdecl.ui @@ -1,6 +1,6 @@ KAccountsViewDecl - + KAccountsViewDecl @@ -19,11 +19,11 @@ 0 - + m_tab - + tab @@ -45,9 +45,9 @@ false - + - layout5 + tqlayout5 @@ -85,7 +85,7 @@ Expanding - + 515 20 @@ -96,7 +96,7 @@ - + tab @@ -127,7 +127,7 @@ - + m_hiddenCategories @@ -135,9 +135,9 @@ Note: Unused categories are not shown as selected by settings. - + - layout4 + tqlayout4 @@ -153,18 +153,18 @@ Expanding - + 367 20 - + m_totalProfitsLabel - + 150 0 @@ -176,7 +176,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -200,5 +200,8 @@ slotCollapseAll() - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kbudgetview.cpp b/kmymoney2/views/kbudgetview.cpp index a8d5bc1..c2bf5dc 100644 --- a/kmymoney2/views/kbudgetview.cpp +++ b/kmymoney2/views/kbudgetview.cpp @@ -19,17 +19,17 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,12 +61,12 @@ #include "../kmymoney2.h" // *** KBudgetListItem Implementation *** -KBudgetListItem::KBudgetListItem(KListView *parent, const MyMoneyBudget& budget) : - KListViewItem(parent), +KBudgetListItem::KBudgetListItem(KListView *tqparent, const MyMoneyBudget& budget) : + KListViewItem(tqparent), m_budget(budget) { setText(0, budget.name()); - setText(1, QString("%1").arg(budget.budgetStart().year())); + setText(1, TQString("%1").tqarg(budget.budgetStart().year())); // allow in column rename setRenameEnabled(0, true); @@ -76,18 +76,18 @@ KBudgetListItem::~KBudgetListItem() { } -void KBudgetListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void KBudgetListItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { p->setFont(KMyMoneyGlobalSettings::listCellFont()); - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if (isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } @@ -95,8 +95,8 @@ void KBudgetListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, const int KBudgetView::m_iBudgetYearsAhead = 5; const int KBudgetView::m_iBudgetYearsBack = 3; -KBudgetView::KBudgetView(QWidget *parent, const char *name ) : - KBudgetViewDecl(parent,name), +KBudgetView::KBudgetView(TQWidget *tqparent, const char *name ) : + KBudgetViewDecl(tqparent,name), m_needReload(false), m_inSelection(false) { @@ -104,73 +104,73 @@ KBudgetView::KBudgetView(QWidget *parent, const char *name ) : m_budgetList->setSorting(0); KIconLoader* il = KGlobal::iconLoader(); - KGuiItem newButtenItem( QString(""), - QIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), + KGuiItem newButtenItem( TQString(""), + TQIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), i18n("Creates a new budget"), i18n("Use this to create a new empty budget.")); m_newButton->setGuiItem(newButtenItem); - QToolTip::add(m_newButton, newButtenItem.toolTip()); + TQToolTip::add(m_newButton, newButtenItem.toolTip()); - KGuiItem renameButtenItem( QString(""), - QIconSet(il->loadIcon("editpaste", KIcon::Small, KIcon::SizeSmall)), + KGuiItem renameButtenItem( TQString(""), + TQIconSet(il->loadIcon("editpaste", KIcon::Small, KIcon::SizeSmall)), i18n("Rename the current selected budget"), i18n("Use this to start renaming the selected budget.")); m_renameButton->setGuiItem(renameButtenItem); - QToolTip::add(m_renameButton, renameButtenItem.toolTip()); + TQToolTip::add(m_renameButton, renameButtenItem.toolTip()); - KGuiItem deleteButtenItem( QString(""), - QIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), + KGuiItem deleteButtenItem( TQString(""), + TQIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete the current selected budget"), i18n("Use this to delete the selected budget.")); m_deleteButton->setGuiItem(deleteButtenItem); - QToolTip::add(m_deleteButton, deleteButtenItem.toolTip()); + TQToolTip::add(m_deleteButton, deleteButtenItem.toolTip()); - KGuiItem updateButtenItem( QString(""), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + KGuiItem updateButtenItem( TQString(""), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered values and stores the budget"), i18n("Use this to store the modified data.")); m_updateButton->setGuiItem(updateButtenItem); - QToolTip::add(m_updateButton, updateButtenItem.toolTip()); + TQToolTip::add(m_updateButton, updateButtenItem.toolTip()); - KGuiItem resetButtenItem( QString(""), - QIconSet(il->loadIcon("undo", KIcon::Small, KIcon::SizeSmall)), + KGuiItem resetButtenItem( TQString(""), + TQIconSet(il->loadIcon("undo", KIcon::Small, KIcon::SizeSmall)), i18n("Revert budget to last saved state"), i18n("Use this to discard the modified data.")); m_resetButton->setGuiItem(resetButtenItem); - QToolTip::add(m_resetButton, resetButtenItem.toolTip()); + TQToolTip::add(m_resetButton, resetButtenItem.toolTip()); - connect(m_budgetList, SIGNAL(contextMenu(KListView*, QListViewItem* , const QPoint&)), - this, SLOT(slotOpenContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(m_budgetList, SIGNAL(itemRenamed(QListViewItem*,int,const QString&)), this, SLOT(slotRenameBudget(QListViewItem*,int,const QString&))); - connect(m_budgetList, SIGNAL(selectionChanged()), this, SLOT(slotSelectBudget())); + connect(m_budgetList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem* , const TQPoint&)), + this, TQT_SLOT(slotOpenContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(m_budgetList, TQT_SIGNAL(itemRenamed(TQListViewItem*,int,const TQString&)), this, TQT_SLOT(slotRenameBudget(TQListViewItem*,int,const TQString&))); + connect(m_budgetList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectBudget())); - connect(m_cbBudgetSubaccounts, SIGNAL(clicked()), this, SLOT(cb_includesSubaccounts_clicked())); + connect(m_cbBudgetSubaccounts, TQT_SIGNAL(clicked()), this, TQT_SLOT(cb_includesSubaccounts_clicked())); - connect(m_accountTree, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectAccount(QListViewItem*))); - connect(m_accountTree, SIGNAL(valueChanged()), this, SLOT(slotRefreshHideUnusedButton())); + connect(m_accountTree, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectAccount(TQListViewItem*))); + connect(m_accountTree, TQT_SIGNAL(valueChanged()), this, TQT_SLOT(slotRefreshHideUnusedButton())); // connect the buttons to the actions. Make sure the enabled state // of the actions is reflected by the buttons - connect(kmymoney2->action("budget_new"), SIGNAL(enabled(bool)), m_newButton, SLOT(setEnabled(bool))); - connect(m_renameButton, SIGNAL(clicked()), kmymoney2->action("budget_rename"), SLOT(activate())); - connect(kmymoney2->action("budget_rename"), SIGNAL(enabled(bool)), m_renameButton, SLOT(setEnabled(bool))); - connect(m_deleteButton, SIGNAL(clicked()), kmymoney2->action("budget_delete"), SLOT(activate())); - connect(kmymoney2->action("budget_delete"), SIGNAL(enabled(bool)), m_deleteButton, SLOT(setEnabled(bool))); + connect(kmymoney2->action("budget_new"), TQT_SIGNAL(enabled(bool)), m_newButton, TQT_SLOT(setEnabled(bool))); + connect(m_renameButton, TQT_SIGNAL(clicked()), kmymoney2->action("budget_rename"), TQT_SLOT(activate())); + connect(kmymoney2->action("budget_rename"), TQT_SIGNAL(enabled(bool)), m_renameButton, TQT_SLOT(setEnabled(bool))); + connect(m_deleteButton, TQT_SIGNAL(clicked()), kmymoney2->action("budget_delete"), TQT_SLOT(activate())); + connect(kmymoney2->action("budget_delete"), TQT_SIGNAL(enabled(bool)), m_deleteButton, TQT_SLOT(setEnabled(bool))); - connect(m_budgetValue, SIGNAL(valuesChanged()), this, SLOT(slotBudgetedAmountChanged())); + connect(m_budgetValue, TQT_SIGNAL(valuesChanged()), this, TQT_SLOT(slotBudgetedAmountChanged())); - connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNewBudget())); - connect(m_updateButton, SIGNAL(pressed()), this, SLOT(slotUpdateBudget())); - connect(m_resetButton, SIGNAL(pressed()), this, SLOT(slotResetBudget())); + connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewBudget())); + connect(m_updateButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateBudget())); + connect(m_resetButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotResetBudget())); - connect(m_hideUnusedButton, SIGNAL(toggled(bool)), this, SLOT(slotHideUnused(bool))); + connect(m_hideUnusedButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotHideUnused(bool))); // setup initial state m_newButton->setEnabled(kmymoney2->action("budget_new")->isEnabled()); m_renameButton->setEnabled(kmymoney2->action("budget_rename")->isEnabled()); m_deleteButton->setEnabled(kmymoney2->action("budget_delete")->isEnabled()); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotRefreshView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotRefreshView())); } KBudgetView::~KBudgetView() @@ -179,8 +179,8 @@ KBudgetView::~KBudgetView() void KBudgetView::show() { - QTimer::singleShot(50, this, SLOT(slotRearrange())); - QWidget::show(); + TQTimer::singleShot(50, this, TQT_SLOT(slotRearrange())); + TQWidget::show(); if(m_needReload) { slotRefreshView(); } @@ -197,7 +197,7 @@ void KBudgetView::slotRearrange(void) resizeEvent(0); } -void KBudgetView::resizeEvent(QResizeEvent* ev) +void KBudgetView::resizeEvent(TQResizeEvent* ev) { // resize the register KBudgetViewDecl::resizeEvent(ev); @@ -212,7 +212,7 @@ void KBudgetView::slotReloadView(void) void KBudgetView::loadBudgets(void) { - QString id; + TQString id; ::timetrace("Start KBudgetView::loadBudgets"); @@ -220,7 +220,7 @@ void KBudgetView::loadBudgets(void) id = m_budget.id(); // remember the upper left corner of the viewport - QPoint startPoint = m_budgetList->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_budgetList->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_budgetList->setUpdatesEnabled(false); @@ -230,24 +230,24 @@ void KBudgetView::loadBudgets(void) m_budgetValue->clear(); // add the correct years to the drop down list - QDate date = QDate::currentDate(Qt::LocalTime); + TQDate date = TQDate::tqcurrentDate(Qt::LocalTime); int iStartYear = date.year() - m_iBudgetYearsBack; m_yearList.clear(); for (int i=0; i list = MyMoneyFile::instance()->budgetList(); - QValueList::ConstIterator it; + TQValueList list = MyMoneyFile::instance()->budgetList(); + TQValueList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { KBudgetListItem* item = new KBudgetListItem(m_budgetList, *it); // create a list of unique years - if (m_yearList.findIndex(QString::number((*it).budgetStart().year())) == -1) - m_yearList += QString::number((*it).budgetStart().year()); + if (m_yearList.tqfindIndex(TQString::number((*it).budgetStart().year())) == -1) + m_yearList += TQString::number((*it).budgetStart().year()); if(item->budget().id() == id) { m_budget = (*it); @@ -266,7 +266,7 @@ void KBudgetView::loadBudgets(void) // turn updates back on m_budgetList->setUpdatesEnabled(true); - m_budgetList->repaintContents(); + m_budgetList->tqrepaintContents(); // reset the status of the buttons m_updateButton->setEnabled(false); @@ -278,9 +278,9 @@ void KBudgetView::loadBudgets(void) ::timetrace("End KBudgetView::loadBudgets"); } -void KBudgetView::ensureBudgetVisible(const QString& id) +void KBudgetView::ensureBudgetVisible(const TQString& id) { - for (QListViewItem * item = m_budgetList->firstChild(); item; item = item->itemBelow()) { + for (TQListViewItem * item = m_budgetList->firstChild(); item; item = item->itemBelow()) { KBudgetListItem* p = dynamic_cast(item); if(p && p->budget().id() == id) { if(p->itemAbove()) @@ -300,7 +300,7 @@ void KBudgetView::slotRefreshView(void) { if(isVisible()) { if(m_inSelection) - QTimer::singleShot(0, this, SLOT(slotRefreshView())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRefreshView())); else { loadBudgets(); m_needReload = false; @@ -312,7 +312,7 @@ void KBudgetView::slotRefreshView(void) void KBudgetView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load budget account view"); @@ -329,10 +329,10 @@ void KBudgetView::loadAccounts(void) // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -342,7 +342,7 @@ void KBudgetView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -368,13 +368,13 @@ void KBudgetView::loadAccounts(void) m_accountTree->setBaseCurrency(security); const MyMoneyAccount& income = file->income(); - QStringList incSubAcctList = income.accountList(); + TQStringList incSubAcctList = income.accountList(); m_incomeItem = new KMyMoneyAccountTreeBudgetItem(m_accountTree, income, m_budget, security, i18n("Income")); haveUnusedBudgets |= loadSubAccounts(m_incomeItem, incSubAcctList, m_budget); m_incomeItem->setSelectable(false); const MyMoneyAccount& expense = file->expense(); - QStringList expSubAcctList = expense.accountList(); + TQStringList expSubAcctList = expense.accountList(); m_expenseItem = new KMyMoneyAccountTreeBudgetItem(m_accountTree, expense, m_budget, security, i18n("Expense")); haveUnusedBudgets |= loadSubAccounts(m_expenseItem, expSubAcctList, m_budget); m_expenseItem->setSelectable(false); @@ -386,13 +386,13 @@ void KBudgetView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -403,7 +403,7 @@ void KBudgetView::loadAccounts(void) // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); m_updateButton->setEnabled(!(selectedBudget() == m_budget)); m_resetButton->setEnabled(!(selectedBudget() == m_budget)); @@ -412,7 +412,7 @@ void KBudgetView::loadAccounts(void) } -bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QStringList& accountList, const MyMoneyBudget& budget) +bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* tqparent, TQStringList& accountList, const MyMoneyBudget& budget) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -421,24 +421,24 @@ bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QString //sort the subaccount list //FIXME this is just a hack to order the accounts if ( !accountList.isEmpty() ) { - QMap accountMap; - QValueList alist; + TQMap accountMap; + TQValueList alist; file->accountList ( alist, accountList ); accountList.clear(); - QValueList::const_iterator it_ac; + TQValueList::const_iterator it_ac; for ( it_ac = alist.begin(); it_ac != alist.end(); ++it_ac ) { accountMap[(*it_ac).name()] = *it_ac; } - QMap::const_iterator it_am; + TQMap::const_iterator it_am; for ( it_am = accountMap.begin(); it_am != accountMap.end(); ++it_am ) { accountList.prepend((*it_am).id()); //use prepend instead of append otherwise account show up in ascending order } } - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -460,12 +460,12 @@ bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QString delete e; } - QStringList subAcctList = acc.accountList(); - KMyMoneyAccountTreeBudgetItem *item = new KMyMoneyAccountTreeBudgetItem(parent, acc, budget, prices, security); + TQStringList subAcctList = acc.accountList(); + KMyMoneyAccountTreeBudgetItem *item = new KMyMoneyAccountTreeBudgetItem(tqparent, acc, budget, prices, security); unused |= loadSubAccounts(item, subAcctList, budget); // no child accounts and no value assigned to this account - bool thisUnused = (!item->firstChild()) && (!budget.contains(acc.id())); + bool thisUnused = (!item->firstChild()) && (!budget.tqcontains(acc.id())); // In case of a budget which is unused and we are requested to suppress // the display of those, @@ -485,8 +485,8 @@ void KBudgetView::askSave(void) // check if the content of a currently selected budget was modified // and ask to store the data if (m_updateButton->isEnabled()) { - if (KMessageBox::questionYesNo(this, QString("%1").arg( - i18n("Do you want to save the changes for %1").arg(m_budget.name())), + if (KMessageBox::questionYesNo(this, TQString("%1").tqarg( + i18n("Do you want to save the changes for %1").tqarg(m_budget.name())), i18n("Save changes")) == KMessageBox::Yes) { m_inSelection = true; slotUpdateBudget(); @@ -517,7 +517,7 @@ void KBudgetView::slotSelectBudget(void) m_assignmentBox->setEnabled(false); m_budget = MyMoneyBudget(); - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); item = dynamic_cast(it_l.current()); if(item) { m_budget = item->budget(); @@ -527,7 +527,7 @@ void KBudgetView::slotSelectBudget(void) slotRefreshHideUnusedButton(); loadAccounts(); - QValueList budgetList; + TQValueList budgetList; if(!m_budget.id().isEmpty()) budgetList << m_budget; emit selectObjects(budgetList); @@ -546,7 +546,7 @@ const MyMoneyBudget& KBudgetView::selectedBudget(void) const { static MyMoneyBudget nullBudget; - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); KBudgetListItem* item = dynamic_cast(it_l.current()); if(item) { return item->budget(); @@ -557,12 +557,12 @@ const MyMoneyBudget& KBudgetView::selectedBudget(void) const KMyMoneyAccountTreeBudgetItem* KBudgetView::selectedAccount(void) const { - QListViewItemIterator it_l(m_accountTree, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_accountTree, TQListViewItemIterator::Selected); KMyMoneyAccountTreeBudgetItem* item = dynamic_cast(it_l.current()); return item; } -void KBudgetView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p) +void KBudgetView::slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p) { Q_UNUSED(lv); Q_UNUSED(p); @@ -580,15 +580,15 @@ void KBudgetView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPo void KBudgetView::slotStartRename(void) { - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; if((it_v = it_l.current()) != 0) { it_v->startRename(0); } } // This variant is only called when a single budget is selected and renamed. -void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString& txt) +void KBudgetView::slotRenameBudget(TQListViewItem* p , int /*col*/, const TQString& txt) { KBudgetListItem *pBudget = dynamic_cast (p); if (!pBudget) @@ -596,7 +596,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString //kdDebug() << "[KPayeesView::slotRenamePayee]" << endl; // create a copy of the new name without appended whitespaces - QString new_name = txt.stripWhiteSpace(); + TQString new_name = txt.stripWhiteSpace(); if (pBudget->budget().name() != new_name) { MyMoneyFileTransaction ft; try { @@ -609,7 +609,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString if (KMessageBox::questionYesNo(this, i18n("A budget with the name '%1' already exists. It is not advisable to have " "multiple budgets with the same identification name. Are you sure you would like " - "to rename the budget?").arg(new_name)) != KMessageBox::Yes) + "to rename the budget?").tqarg(new_name)) != KMessageBox::Yes) { p->setText(0,pBudget->budget().name()); return; @@ -633,7 +633,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -642,7 +642,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString } } -void KBudgetView::slotSelectAccount(QListViewItem* item) +void KBudgetView::slotSelectAccount(TQListViewItem* item) { if(item->listView() == m_accountTree) { m_assignmentBox->setEnabled(false); @@ -653,7 +653,7 @@ void KBudgetView::slotSelectAccount(QListViewItem* item) if (m_budget.id().isEmpty() ) return; - QString id = account->id(); + TQString id = account->id(); m_leAccounts->setText(MyMoneyFile::instance()->accountToCategory(id)); m_cbBudgetSubaccounts->setChecked(m_budget.account(id).budgetSubaccounts()); m_accountTotal->setValue(m_budget.account(id).totalBalance()); @@ -709,7 +709,7 @@ void KBudgetView::cb_includesSubaccounts_clicked() return; if(selectedAccount() != 0) { - QString accountID = selectedAccount()->id(); + TQString accountID = selectedAccount()->id(); // now, we get a reference to the accountgroup, to mofify its atribute, // and then put the resulting account group instead of the original @@ -734,7 +734,7 @@ void KBudgetView::slotResetBudget(void) loadAccounts(); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to reset budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -748,7 +748,7 @@ void KBudgetView::slotUpdateBudget(void) slotRefreshHideUnusedButton(); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -757,11 +757,11 @@ void KBudgetView::languageChange(void) { KBudgetViewDecl::languageChange(); - m_newButton->setText(QString()); - m_renameButton->setText(QString()); - m_deleteButton->setText(QString()); - m_updateButton->setText(QString()); - m_resetButton->setText(QString()); + m_newButton->setText(TQString()); + m_renameButton->setText(TQString()); + m_deleteButton->setText(TQString()); + m_updateButton->setText(TQString()); + m_resetButton->setText(TQString()); } #include "kbudgetview.moc" diff --git a/kmymoney2/views/kbudgetview.h b/kmymoney2/views/kbudgetview.h index f857a15..14c7611 100644 --- a/kmymoney2/views/kbudgetview.h +++ b/kmymoney2/views/kbudgetview.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -50,20 +50,20 @@ public: /** * Constructor to be used to construct a budget entry object. * - * @param parent pointer to the KListView object this entry should be + * @param tqparent pointer to the KListView object this entry should be * added to. * @param budget const reference to MyMoneyBudget for which * the KListView entry is constructed */ - KBudgetListItem(KListView *parent, const MyMoneyBudget& budget); + KBudgetListItem(KListView *tqparent, const MyMoneyBudget& budget); ~KBudgetListItem(); /** - * This method is re-implemented from QListViewItem::paintCell(). - * Besides the standard implementation, the QPainter is set + * This method is re-implemented from TQListViewItem::paintCell(). + * Besides the standard implementation, the TQPainter is set * according to the applications settings. */ - void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); const MyMoneyBudget& budget(void) { return m_budget; }; void setBudget(const MyMoneyBudget& budget) { m_budget = budget; } @@ -79,14 +79,15 @@ private: class KBudgetView : public KBudgetViewDecl { Q_OBJECT + TQ_OBJECT public: - KBudgetView(QWidget *parent=0, const char *name=0); + KBudgetView(TQWidget *tqparent=0, const char *name=0); ~KBudgetView(); void show(); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); @@ -123,16 +124,16 @@ public slots: protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); void loadAccounts(void); - bool loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QStringList& accountList, const MyMoneyBudget& budget); + bool loadSubAccounts(KMyMoneyAccountTreeBudgetItem* tqparent, TQStringList& accountList, const MyMoneyBudget& budget); /** * This method loads all available budgets into the budget list widget. If a budget is * currently selected it remains selected if it is still present. */ void loadBudgets(void); - void ensureBudgetVisible(const QString& id); + void ensureBudgetVisible(const TQString& id); const MyMoneyBudget& selectedBudget(void) const; KMyMoneyAccountTreeBudgetItem* selectedAccount(void) const; void setTimeSpan(KMyMoneyAccountTreeBudgetItem *account, MyMoneyBudget::AccountGroup& accountGroup, int iTimeSpan); @@ -148,7 +149,7 @@ protected slots: * @param col The column where the name is located * @param txt The text of the new name */ - void slotRenameBudget(QListViewItem *p, int col, const QString& txt); + void slotRenameBudget(TQListViewItem *p, int col, const TQString& txt); /** * This slot is called when the amount of a budget is changed. It @@ -158,7 +159,7 @@ protected slots: /** */ - void slotSelectAccount(QListViewItem*); + void slotSelectAccount(TQListViewItem*); void AccountEnter(); @@ -181,14 +182,14 @@ private slots: * @param i the item on which the cursor resides * @param p position of the pointing device */ - void slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p); + void slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p); signals: /** * This signal serves as proxy for KMyMoneyBudgetList::selectObject() */ void openContextMenu(const MyMoneyObject& obj); - void selectObjects(const QValueList& budget); + void selectObjects(const TQValueList& budget); private: typedef enum { @@ -200,8 +201,8 @@ private: MyMoneyBudget m_budget; - QMap m_transactionCountMap; - QStringList m_yearList; + TQMap m_transactionCountMap; + TQStringList m_yearList; KMyMoneyAccountTreeBudgetItem* m_incomeItem; KMyMoneyAccountTreeBudgetItem* m_expenseItem; diff --git a/kmymoney2/views/kbudgetviewdecl.ui b/kmymoney2/views/kbudgetviewdecl.ui index f3fb5be..e03457d 100644 --- a/kmymoney2/views/kbudgetviewdecl.ui +++ b/kmymoney2/views/kbudgetviewdecl.ui @@ -1,6 +1,6 @@ KBudgetViewDecl - + KBudgetViewDecl @@ -30,15 +30,15 @@ 0 - + - layout7 + tqlayout7 unnamed - + groupBox1 @@ -57,9 +57,9 @@ unnamed - + - layout8 + tqlayout8 @@ -163,9 +163,9 @@ - + - layout6 + tqlayout6 @@ -184,7 +184,7 @@ - + m_hideUnusedButton @@ -192,7 +192,7 @@ Hide unused budget categories - + m_assignmentBox @@ -211,15 +211,15 @@ unnamed - + - layout7 + tqlayout7 unnamed - + textLabel3 @@ -227,7 +227,7 @@ Account - + m_leAccounts @@ -246,7 +246,7 @@ true - + textLabel1 @@ -273,7 +273,7 @@ - + m_cbBudgetSubaccounts @@ -281,9 +281,9 @@ Include subaccounts - + - layout9 + tqlayout9 @@ -304,7 +304,7 @@ Expanding - + 21 20 @@ -344,5 +344,9 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000032d49444154388db59531681c4714863f892dde8004b320c32e3870020b74458a6b0f5458e581c016a809a8496b42208454098604d2c4904a6954a410511ae752085b858c1208dc35221244b00119f60ac12ee860062c980719708a95a248f129459cd7cceeccf0edb76fff61a706830197d5ed765ff3166a30184c4d5d829fed3c7bdd5e6ce3bda71a5738ef301802e1d6d179477152303c1842bc822797a64fbf7b4a9a43be00ada817cb0e12011c2611205ccd73755f9c087c6b19bef0d7c100f5b8267d07caf10fe8ab9210156320fc01be16aa5a11043307f30b20a21041019985f48ef2f7fa0becc68e80475fd584e831b396f210f67795c3831a4940a3228925bb27f4d652ba4b01a199b73342f3981be0ca57745042ac30c632d853b6373d44b056c8ef0922508d94d14be59b2f4aeaf58cd5751069e06f3436890114332b9487d0bf80f61e64dc5f813c3790045453f67703fd4d4f7f6b4496b5597e689044af194f5f5e841800210478bee3d1a8f41e64acbe0f69ae6852e1cf0ccf7f74f4d652defbc042226c6f55e8f89f91bb6e9c387c9d521c9558db988a3416fe3c67e32b4779ec7167f0e8939ce19ea7fc5d298a80c875f03563930855ed2081bc05e91d5014ef53363eaf288e3d6285ee520a338e76c7a251a94e41e30470d3631004a262672e3eca59cec6978ef2b889979d11f2bb904af3be92081a416e28dfe831983920b1142345d5b0ff2234a6334276d7321ad53c795c511ca654a5a251996f19b83d158ef602b45a423d52f67703abeb29ee4ce9de4fc93378f218462f6b3efdb042cf3d59666977a0aa6fe9310888d25b13342afd4dcffeaee3d147399da540ab13f8f8b39c2cb3f8710d11ba2b96f9c57fcd7180287497a03ecde86f8dd8fe1a867b9ef6bb1612a84a871f6bd35b94e217a53832589970f2dcd85d9c7d4580d57521cbdaf4bfaf288e95e268d4ec8e60e72ccb0f2dbffea454e71e8d29f57882717152509482a48d8924b0bc12e82ee51445a03a6da079cbd0eec0fc22142b06620e89a3fc8d3783870743d814d2bc8994aa6ff286472e764902e5a96f72bbd3b4c37b280e95aa9e604c84e1cf978b37c74935797d7ae2ca7fac6968fe51ff0bf86dc30783c1d49f0baa9bb819e612310000000049454e44ae426082 - + + kmymoney/kmymoneyedit.h + kmymoney/kbudgetvalues.h + + diff --git a/kmymoney2/views/kcategoriesview.cpp b/kmymoney2/views/kcategoriesview.cpp index e01d62b..3c31f34 100644 --- a/kmymoney2/views/kcategoriesview.cpp +++ b/kmymoney2/views/kcategoriesview.cpp @@ -23,8 +23,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,44 +46,44 @@ #include "../kmymoney2.h" -KCategoriesView::KCategoriesView(QWidget *parent, const char *name ) : - KCategoriesViewDecl(parent, name), +KCategoriesView::KCategoriesView(TQWidget *tqparent, const char *name ) : + KCategoriesViewDecl(tqparent, name), m_incomeItem(0), m_expenseItem(0), m_needReload(false) { // create the searchline widget - // and insert it into the existing layout - m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->parentWidget()); - QVBoxLayout* layout = dynamic_cast(m_accountTree->parentWidget()->layout()); - if(layout) { - layout->insertWidget(0, m_searchWidget); + // and insert it into the existing tqlayout + m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->tqparentWidget()); + TQVBoxLayout* tqlayout = dynamic_cast(m_accountTree->tqparentWidget()->tqlayout()); + if(tqlayout) { + tqlayout->insertWidget(0, m_searchWidget); } // setup icons for collapse and expand button KIconLoader *ic = KGlobal::iconLoader(); KGuiItem collapseGuiItem("", - QIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); KGuiItem expandGuiItem("", - QIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); m_collapseButton->setGuiItem(collapseGuiItem); m_expandButton->setGuiItem(expandGuiItem); m_accountTree->setSectionHeader(i18n("Category")); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateProfit(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateProfit(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); - connect(m_collapseButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); + connect(m_collapseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); + connect(m_expandButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); } KCategoriesView::~KCategoriesView() @@ -118,7 +118,7 @@ void KCategoriesView::show(void) void KCategoriesView::polish(void) { KCategoriesViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Category View Settings"); } @@ -134,15 +134,15 @@ void KCategoriesView::slotLoadAccounts(void) void KCategoriesView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load categories view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -152,7 +152,7 @@ void KCategoriesView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -167,9 +167,9 @@ void KCategoriesView::loadAccounts(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -198,13 +198,13 @@ void KCategoriesView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -213,11 +213,11 @@ void KCategoriesView::loadAccounts(void) // reposition viewport m_accountTree->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); // and in case we need to show things expanded, we'll do so if(KMyMoneyGlobalSettings::showAccountsExpanded()) @@ -229,16 +229,16 @@ void KCategoriesView::loadAccounts(void) ::timetrace("done load categories view"); } -bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList) +bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList) { MyMoneyFile* file = MyMoneyFile::instance(); bool unused = false; - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -260,7 +260,7 @@ bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QSt delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); unused |= loadSubAccounts(item, acc.accountList()); // no child accounts and not transactions in this account means 'unused' @@ -286,7 +286,7 @@ void KCategoriesView::slotUpdateProfit(void) MyMoneyMoney profit = m_incomeItem->totalValue() - m_expenseItem->totalValue(); - QString s(i18n("Profit: ")); + TQString s(i18n("Profit: ")); if(profit.isNegative()) s = i18n("Loss: "); @@ -294,13 +294,13 @@ void KCategoriesView::slotUpdateProfit(void) // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(profit.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(profit.abs().formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(profit.abs().formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(profit.isNegative()) { s += ""; } diff --git a/kmymoney2/views/kcategoriesview.h b/kmymoney2/views/kcategoriesview.h index 4a6ad3c..d37e74d 100644 --- a/kmymoney2/views/kcategoriesview.h +++ b/kmymoney2/views/kcategoriesview.h @@ -45,7 +45,7 @@ class KListViewSearchLineWidget; * @author Michael Edwardes, Thomas Baumgart * * While named "categories view", this view actually displays all accounts - * that are children of the global "Income" and "Expense" accounts. Even though + * that are tqchildren of the global "Income" and "Expense" accounts. Even though * categories are internally just accounts as well, the distinction between * categories and accounts in the user interface is done for better * usability and clarity. @@ -63,8 +63,9 @@ class KListViewSearchLineWidget; class KCategoriesView : public KCategoriesViewDecl { Q_OBJECT + TQ_OBJECT public: - KCategoriesView(QWidget *parent=0, const char *name=0); + KCategoriesView(TQWidget *tqparent=0, const char *name=0); virtual ~KCategoriesView(); @@ -78,15 +79,15 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); protected: void loadAccounts(void); - bool loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList); + bool loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList); protected slots: void slotUpdateProfit(void); @@ -99,7 +100,7 @@ private: * * @param type account type as defined in MyMoneyAccount::accountTypeE */ - const QPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; + const TQPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; signals: /** @@ -121,16 +122,16 @@ signals: /** * This signal is emitted, when the user selected to reparent the - * account @p acc to be a subordinate account of @p parent. + * account @p acc to be a subordinate account of @p tqparent. * * @param acc const reference to account to be reparented - * @param parent const reference to new parent account + * @param tqparent const reference to new tqparent account */ - void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& parent); + void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent); private: - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; KMyMoneyAccountTreeItem* m_incomeItem; KMyMoneyAccountTreeItem* m_expenseItem; diff --git a/kmymoney2/views/kcategoriesviewdecl.ui b/kmymoney2/views/kcategoriesviewdecl.ui index 858cc54..7ede46b 100644 --- a/kmymoney2/views/kcategoriesviewdecl.ui +++ b/kmymoney2/views/kcategoriesviewdecl.ui @@ -1,6 +1,6 @@ KCategoriesViewDecl - + KCategoriesViewDecl @@ -27,9 +27,9 @@ false - + - layout5_2 + tqlayout5_2 @@ -67,7 +67,7 @@ Expanding - + 515 20 @@ -76,7 +76,7 @@ - + m_hiddenCategories @@ -84,9 +84,9 @@ Note: Unused categories are not shown as selected by settings. - + - layout5 + tqlayout5 @@ -102,18 +102,18 @@ Expanding - + 310 16 - + m_totalProfitsLabel - + 150 0 @@ -125,7 +125,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -149,5 +149,8 @@ slotCollapseAll() - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kforecastview.cpp b/kmymoney2/views/kforecastview.cpp index c7bcb0a..bf27e7f 100644 --- a/kmymoney2/views/kforecastview.cpp +++ b/kmymoney2/views/kforecastview.cpp @@ -17,12 +17,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,8 +46,8 @@ #include "../reports/pivottable.h" #include "../reports/pivotgrid.h" -KForecastView::KForecastView(QWidget *parent, const char *name) : - KForecastViewDecl(parent,name) +KForecastView::KForecastView(TQWidget *tqparent, const char *name) : + KForecastViewDecl(tqparent,name) { for(int i=0; i < MaxViewTabs; ++i) m_needReload[i] = false; @@ -56,11 +56,11 @@ KForecastView::KForecastView(QWidget *parent, const char *name) : config->setGroup("Last Use Settings"); m_tab->setCurrentPage(config->readNumEntry("KForecastView_LastType", 0)); - connect(m_tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotTabChanged(QWidget*))); + connect(m_tab, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(slotTabChanged(TQWidget*))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadForecast())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadForecast())); - connect(m_forecastButton, SIGNAL(clicked()), this, SLOT(slotManualForecast())); + connect(m_forecastButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotManualForecast())); m_forecastList->setAllColumnsShowFocus(true); m_summaryList->setAllColumnsShowFocus(true); @@ -68,7 +68,7 @@ KForecastView::KForecastView(QWidget *parent, const char *name) : m_advancedList->setAllColumnsShowFocus(true); m_forecastChart = new KReportChartView(m_tabChart, "forecastChart" ); - m_forecastChart->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_forecastChart->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); loadForecastSettings(); @@ -78,7 +78,7 @@ KForecastView::~KForecastView() { } -void KForecastView::slotTabChanged(QWidget* _tab) +void KForecastView::slotTabChanged(TQWidget* _tab) { ForecastViewTab tab = static_cast(m_tab->indexOf(_tab)); @@ -212,7 +212,7 @@ void KForecastView::loadListView(void) void KForecastView::loadSummaryView(void) { MyMoneyForecast forecast; - QValueList accList; + TQValueList accList; int dropMinimum; int dropZero; @@ -246,7 +246,7 @@ void KForecastView::loadSummaryView(void) //Get all accounts of the right type to calculate forecast m_nameIdx.clear(); accList = forecast.accountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; if(m_nameIdx[acc.id()] != acc.id()) { //Check if the account is there @@ -254,7 +254,7 @@ void KForecastView::loadSummaryView(void) } } - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc) { const MyMoneyAccount& acc = file->account(*it_nc); @@ -269,7 +269,7 @@ void KForecastView::loadSummaryView(void) } //Check if the account is going to be below zero or below the minimal balance in the forecast period - QString minimumBalance = acc.value("minimumBalance"); + TQString minimumBalance = acc.value("minimumBalance"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); //Check if the account is going to be below minimal balance @@ -279,7 +279,7 @@ void KForecastView::loadSummaryView(void) dropZero = forecast.daysToZeroBalance(acc); // spit out possible warnings - QString msg; + TQString msg; // if a minimum balance has been specified, an appropriate warning will // only be shown, if the drop below 0 is on a different day or not present @@ -292,14 +292,14 @@ void KForecastView::loadSummaryView(void) case -1: break; case 0: - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %2 is below the minimum balance %3 today.").arg(acc.name()).arg(minBalance.formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %2 is below the minimum balance %3 today.").tqarg(acc.name()).tqarg(minBalance.formatMoney(acc, currency)); + msg += TQString(""); break; default: - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").arg(acc.name()).arg(minBalance.formatMoney(acc, currency)).arg(dropMinimum-1); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").tqarg(acc.name()).tqarg(minBalance.formatMoney(acc, currency)).tqarg(dropMinimum-1); + msg += TQString(""); } if(!msg.isEmpty()) { @@ -308,31 +308,31 @@ void KForecastView::loadSummaryView(void) } // a drop below zero is always shown - msg = QString(); + msg = TQString(); switch(dropZero) { case -1: break; case 0: if(acc.accountGroup() == MyMoneyAccount::Asset) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 is below %2 today.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 is below %2 today.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)); + msg += TQString(""); break; } if(acc.accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 is above %2 today.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)); + msg = i18n("The balance of %1 is above %2 today.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)); break; } break; default: if(acc.accountGroup() == MyMoneyAccount::Asset) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 will drop below %2 in %3 days.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)).arg(dropZero); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 will drop below %2 in %3 days.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)).tqarg(dropZero); + msg += TQString(""); break; } if(acc.accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 will raise above %2 in %3 days.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)).arg(dropZero); + msg = i18n("The balance of %1 will raise above %2 in %3 days.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)).tqarg(dropZero); break; } } @@ -341,12 +341,12 @@ void KForecastView::loadSummaryView(void) } //advice about trends - msg = QString(); + msg = TQString(); MyMoneyMoney accCycleVariation = forecast.accountCycleVariation(acc); if (accCycleVariation < MyMoneyMoney(0, 1)) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The account %1 is decreasing %2 per cycle.").arg(acc.name()).arg(accCycleVariation.formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The account %1 is decreasing %2 per cycle.").tqarg(acc.name()).tqarg(accCycleVariation.formatMoney(acc, currency)); + msg += TQString(""); } if(!msg.isEmpty()) { @@ -360,7 +360,7 @@ void KForecastView::loadSummaryView(void) void KForecastView::loadAdvancedView(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; + TQValueList accList; MyMoneySecurity baseCurrency = file->baseCurrency(); MyMoneyForecast forecast; int daysToBeginDay; @@ -376,7 +376,7 @@ void KForecastView::loadAdvancedView(void) //Get all accounts of the right type to calculate forecast m_nameIdx.clear(); accList = forecast.accountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; if(m_nameIdx[acc.id()] != acc.id()) { //Check if the account is there @@ -393,32 +393,32 @@ void KForecastView::loadAdvancedView(void) int accountColumn = m_advancedList->addColumn(i18n("Account"), -1); //if beginning of forecast is today, set the begin day to next cycle to avoid repeating the first cycle - if(QDate::currentDate() < forecast.beginForecastDate()) { - daysToBeginDay = QDate::currentDate().daysTo(forecast.beginForecastDate()); + if(TQDate::tqcurrentDate() < forecast.beginForecastDate()) { + daysToBeginDay = TQDate::tqcurrentDate().daysTo(forecast.beginForecastDate()); } else { daysToBeginDay = forecast.accountsCycle(); } //add columns for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) { - int col = m_advancedList->addColumn(i18n("Min Bal %1").arg(i), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); - m_advancedList->addColumn(i18n("Min Date %1").arg(i), -1); + int col = m_advancedList->addColumn(i18n("Min Bal %1").tqarg(i), -1); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); + m_advancedList->addColumn(i18n("Min Date %1").tqarg(i), -1); } for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) { - int col = m_advancedList->addColumn(i18n("Max Bal %1").arg(i), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); - m_advancedList->addColumn(i18n("Max Date %1").arg(i), -1); + int col = m_advancedList->addColumn(i18n("Max Bal %1").tqarg(i), -1); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); + m_advancedList->addColumn(i18n("Max Date %1").tqarg(i), -1); } int col = m_advancedList->addColumn(i18n("Average"), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); m_advancedList->setSorting(-1); KMyMoneyForecastListViewItem *advancedItem = 0; - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc) { const MyMoneyAccount& acc = file->account(*it_nc); - QString amount; + TQString amount; MyMoneyMoney amountMM; MyMoneySecurity currency; @@ -436,35 +436,35 @@ void KForecastView::loadAdvancedView(void) int it_c = 1; // iterator for the columns of the listview //get minimum balance list - QValueList minBalanceList = forecast.accountMinimumBalanceDateList(acc); - QValueList::Iterator t_min; + TQValueList minBalanceList = forecast.accountMinimumBalanceDateList(acc); + TQValueList::Iterator t_min; for(t_min = minBalanceList.begin(); t_min != minBalanceList.end() ; ++t_min) { - QDate minDate = *t_min; + TQDate minDate = *t_min; amountMM = forecast.forecastBalance(acc, minDate); amount = amountMM.formatMoney(acc, currency); advancedItem->setText(it_c, amount, amountMM.isNegative()); it_c++; - QString dateString = KGlobal::locale()->formatDate(minDate, true); + TQString dateString = KGlobal::locale()->formatDate(minDate, true); advancedItem->setText(it_c, dateString, amountMM.isNegative()); it_c++; } //get maximum balance list - QValueList maxBalanceList = forecast.accountMaximumBalanceDateList(acc); - QValueList::Iterator t_max; + TQValueList maxBalanceList = forecast.accountMaximumBalanceDateList(acc); + TQValueList::Iterator t_max; for(t_max = maxBalanceList.begin(); t_max != maxBalanceList.end() ; ++t_max) { - QDate maxDate = *t_max; + TQDate maxDate = *t_max; amountMM = forecast.forecastBalance(acc, maxDate); amount = amountMM.formatMoney(acc, currency); advancedItem->setText(it_c, amount, amountMM.isNegative()); it_c++; - QString dateString = KGlobal::locale()->formatDate(maxDate, true); + TQString dateString = KGlobal::locale()->formatDate(maxDate, true); advancedItem->setText(it_c, dateString, amountMM.isNegative()); it_c++; } @@ -481,15 +481,15 @@ void KForecastView::loadBudgetView(void) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyForecast forecast; -// QValueList accList; +// TQValueList accList; m_budgetList->setBaseCurrency(file->baseCurrency()); //get the settings from current page and calculate this year based on last year - QDate historyEndDate = QDate(QDate::currentDate().year()-1, 12, 31); - QDate historyStartDate = historyEndDate.addDays(-m_accountsCycle->value() * m_forecastCycles->value()); - QDate forecastStartDate = QDate(QDate::currentDate().year(), 1, 1); - QDate forecastEndDate = QDate::currentDate().addDays(m_forecastDays->value()); + TQDate historyEndDate = TQDate(TQDate::tqcurrentDate().year()-1, 12, 31); + TQDate historyStartDate = historyEndDate.addDays(-m_accountsCycle->value() * m_forecastCycles->value()); + TQDate forecastStartDate = TQDate(TQDate::tqcurrentDate().year(), 1, 1); + TQDate forecastEndDate = TQDate::tqcurrentDate().addDays(m_forecastDays->value()); forecast.setHistoryMethod(m_historyMethod->selectedId()); MyMoneyBudget budget; @@ -513,10 +513,10 @@ void KForecastView::loadBudgetView(void) m_budgetList->show(); } -QValueList KForecastView::getAccountPrices(const MyMoneyAccount& acc) +TQValueList KForecastView::getAccountPrices(const MyMoneyAccount& acc) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -543,7 +543,7 @@ void KForecastView::addAssetLiabilityRows(const MyMoneyForecast& forecast) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList basePrices; + TQValueList basePrices; m_assetItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->asset(), forecast, basePrices, file->baseCurrency() ); m_assetItem->setOpen(true); m_liabilityItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->liability(), forecast, basePrices, file->baseCurrency()); @@ -554,7 +554,7 @@ void KForecastView::addIncomeExpenseRows(const MyMoneyForecast& forecast) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList basePrices; + TQValueList basePrices; m_incomeItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->income(), forecast, basePrices, file->baseCurrency() ); m_incomeItem->setOpen(true); m_expenseItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->expense(), forecast, basePrices, file->baseCurrency()); @@ -576,10 +576,10 @@ bool KForecastView::includeAccount(MyMoneyForecast& forecast, const MyMoneyAccou if( forecast.isForecastAccount(acc) ) return true; - QStringList accounts = acc.accountList(); + TQStringList accounts = acc.accountList(); if(accounts.size() > 0) { - QStringList::ConstIterator it_acc; + TQStringList::ConstIterator it_acc; for(it_acc = accounts.begin(); it_acc != accounts.end(); ++it_acc) { MyMoneyAccount account = file->account(*it_acc); if( includeAccount(forecast, account) ) @@ -589,10 +589,10 @@ bool KForecastView::includeAccount(MyMoneyForecast& forecast, const MyMoneyAccou return false; } -void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* parentItem, int forecastType ) +void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* tqparentItem, int forecastType ) { - QMap nameIdx; - QStringList accList; + TQMap nameIdx; + TQStringList accList; MyMoneyFile* file = MyMoneyFile::instance(); KMyMoneyAccountTreeForecastItem *forecastItem = 0; @@ -602,16 +602,16 @@ void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount if(accList.size() == 0) return; - QStringList::ConstIterator accList_t; + TQStringList::ConstIterator accList_t; for(accList_t = accList.begin(); accList_t != accList.end(); ++accList_t ) { MyMoneyAccount subAccount = file->account(*accList_t); - //only add the account if it is a forecast account or the parent of a forecast account + //only add the account if it is a forecast account or the tqparent of a forecast account if(includeAccount(forecast, subAccount)) { nameIdx[subAccount.id()] = subAccount.id(); } } - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = nameIdx.begin(); it_nc != nameIdx.end(); ++it_nc) { const MyMoneyAccount subAccount = file->account(*it_nc); @@ -623,14 +623,14 @@ void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount currency = file->security(subAccount.currencyId()); } - QString amount; - QString vAmount; + TQString amount; + TQString vAmount; MyMoneyMoney vAmountMM; //get prices - QValueList prices = getAccountPrices(subAccount); + TQValueList prices = getAccountPrices(subAccount); - forecastItem = new KMyMoneyAccountTreeForecastItem( parentItem, subAccount, forecast, prices, currency, static_cast(forecastType) ); + forecastItem = new KMyMoneyAccountTreeForecastItem( tqparentItem, subAccount, forecast, prices, currency, static_cast(forecastType) ); forecastItem->setOpen(true); loadAccounts(forecast, subAccount, forecastItem, forecastType); @@ -658,7 +658,7 @@ void KForecastView::loadChartView(void) reportCfg.setColumnsAreDays( true ); reportCfg.setConvertCurrency( true ); reportCfg.setIncludingForecast( true ); - reportCfg.setDateFilter(QDate::currentDate(),QDate::currentDate().addDays(m_forecastDays->value())); + reportCfg.setDateFilter(TQDate::tqcurrentDate(),TQDate::tqcurrentDate().addDays(m_forecastDays->value())); reports::PivotTable table(reportCfg); diff --git a/kmymoney2/views/kforecastview.h b/kmymoney2/views/kforecastview.h index 8beb24a..36de0e5 100644 --- a/kmymoney2/views/kforecastview.h +++ b/kmymoney2/views/kforecastview.h @@ -46,10 +46,11 @@ using namespace reports; class KForecastView : public KForecastViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KForecastView(QWidget *parent=0, const char *name=0); + KForecastView(TQWidget *tqparent=0, const char *name=0); virtual ~KForecastView(); void show(void); @@ -69,7 +70,7 @@ protected: MaxViewTabs } ForecastViewTab; - QMap m_nameIdx; + TQMap m_nameIdx; /** @@ -108,21 +109,21 @@ protected: void loadForecastSettings(void); protected slots: - void slotTabChanged(QWidget*); + void slotTabChanged(TQWidget*); /** * Get the list of prices for an account * This is used later to create an instance of KMyMoneyAccountTreeForecastItem * */ - QValueList getAccountPrices(const MyMoneyAccount& acc); + TQValueList getAccountPrices(const MyMoneyAccount& acc); private: void addAssetLiabilityRows(const MyMoneyForecast& forecast); void addIncomeExpenseRows(const MyMoneyForecast& forecast); void addTotalRow(KMyMoneyAccountTreeForecast* forecastList, const MyMoneyForecast& forecast); bool includeAccount(MyMoneyForecast& forecast, const MyMoneyAccount& acc); - void loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* parentItem, int forecastType); + void loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* tqparentItem, int forecastType); bool m_needReload[MaxViewTabs]; KMyMoneyAccountTreeForecastItem* m_totalItem; diff --git a/kmymoney2/views/kforecastviewdecl.ui b/kmymoney2/views/kforecastviewdecl.ui index 6d2bf3b..3110bbf 100644 --- a/kmymoney2/views/kforecastviewdecl.ui +++ b/kmymoney2/views/kforecastviewdecl.ui @@ -1,6 +1,6 @@ KForecastViewDecl - + KForecastViewDecl @@ -19,7 +19,7 @@ 0 - + groupBox3 @@ -30,15 +30,15 @@ unnamed - + - layout16 + tqlayout16 unnamed - + textLabel1 @@ -54,7 +54,7 @@ Days to Forecast: - + m_forecastDays @@ -65,7 +65,7 @@ 1 - + textLabel3 @@ -81,7 +81,7 @@ Days of Accounts Cycle: - + m_accountsCycle @@ -100,7 +100,7 @@ 1 - + textLabel5 @@ -108,7 +108,7 @@ Day of Month to start Forecast: - + m_beginDay @@ -119,7 +119,7 @@ 0 - + textLabel4 @@ -127,7 +127,7 @@ Historic Cycles: - + m_forecastCycles @@ -138,7 +138,7 @@ 1 - + textLabel6 @@ -146,7 +146,7 @@ Chart Detail: - + All @@ -189,24 +189,24 @@ Expanding - + 16 31 - + - layout76 + tqlayout76 unnamed - + - layout17 + tqlayout17 @@ -216,7 +216,7 @@ unnamed - + textLabel2 @@ -232,7 +232,7 @@ Current Forecast Method: - + m_forecastMethod @@ -254,7 +254,7 @@ - + m_historyMethod @@ -265,7 +265,7 @@ unnamed - + radioButton11 @@ -276,7 +276,7 @@ 0 - + radioButton12 @@ -287,7 +287,7 @@ 1 - + radioButton12 @@ -312,16 +312,16 @@ Expanding - + 21 6 - + - layout75 + tqlayout75 @@ -345,7 +345,7 @@ Expanding - + 31 21 @@ -369,7 +369,7 @@ - + m_tab @@ -381,7 +381,7 @@ 1 - + summary @@ -470,7 +470,7 @@ AutoOneFit - + New Item @@ -502,7 +502,7 @@ - + detail @@ -526,7 +526,7 @@ - + advanced @@ -550,7 +550,7 @@ - + budget @@ -574,7 +574,7 @@ - + m_tabChart @@ -610,5 +610,5 @@ - + 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 -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // 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(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::const_iterator it_w; + if(e->type() == TQEvent::MouseButtonPress && !m_lastMousePressEvent) { + TQValueList::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 isSelected; - QString focusItemId; - QString anchorItemId; + TQMap 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 actBalance, clearedBalance, futureBalance; - QMap::iterator it_b; + TQMap actBalance, clearedBalance, futureBalance; + TQMap::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 >::const_iterator it; - QMapuniqueMap; + TQValueList >::const_iterator it; + TQMapuniqueMap; 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 scheduleList = MyMoneyFile::instance()->scheduleList(m_account.id()); + TQValueList 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& splits = t.splits(); - QValueList::const_iterator it_s; + const TQValueList& splits = t.splits(); + TQValueList::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::const_iterator it_a; + TQValueList::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 deposits; - QMap payments; - QMap depositAmount; - QMap paymentAmount; + TQMap deposits; + TQMap payments; + TQMap depositAmount; + TQMap 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(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& actBalance, const QMap& clearedBalance) +void KGlobalLedgerView::updateSummaryLine(const TQMap& actBalance, const TQMap& clearedBalance) { MyMoneyFile* file = MyMoneyFile::instance(); m_leftSummaryLabel->show(); @@ -724,24 +724,24 @@ void KGlobalLedgerView::updateSummaryLine(const QMap& 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& act m_centerSummaryLabel->hide(); MyMoneyMoney balance; MyMoneySecurity base = file->baseCurrency(); - QMap::const_iterator it_b; + TQMap::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& 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(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; } diff --git a/kmymoney2/views/kgloballedgerview.h b/kmymoney2/views/kgloballedgerview.h index 861bd0e..0d782ab 100644 --- a/kmymoney2/views/kgloballedgerview.h +++ b/kmymoney2/views/kgloballedgerview.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,12 +45,12 @@ #include #include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QPopupMenu; -class QFrame; -class QLabel; +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQPopupMenu; +class TQFrame; +class TQLabel; class KMyMoneyAccountCombo; class KToolBar; @@ -63,17 +63,18 @@ class TransactionEditor; * events on widgets outside a given set of widgets. This is used internally * to detect when to leave the edit mode. */ -class MousePressFilter : public QObject +class MousePressFilter : public TQObject { Q_OBJECT + TQ_OBJECT public: - MousePressFilter(QWidget* parent = 0, const char* name = 0); + MousePressFilter(TQWidget* tqparent = 0, const char* name = 0); /** - * Add widget @p w to the list of possible parent objects. See eventFilter() how + * Add widget @p w to the list of possible tqparent objects. See eventFilter() how * they will be used. */ - void addWidget(QWidget* w); + void addWidget(TQWidget* w); public slots: /** @@ -95,32 +96,32 @@ public slots: protected: /** * This method checks if the widget @p child is a child of - * the widget @p parent and returns either @a true or @a false. + * the widget @p tqparent and returns either @a true or @a false. * * @param child pointer to child widget - * @param parent pointer to parent widget - * @retval true @p child points to widget which has @p parent as parent or grand-parent - * @retval false @p child points to a widget which is not related to @p parent + * @param tqparent pointer to tqparent widget + * @retval true @p child points to widget which has @p tqparent as tqparent or grand-tqparent + * @retval false @p child points to a widget which is not related to @p tqparent */ - bool isChildOf(QWidget* child, QWidget* parent); + bool isChildOf(TQWidget* child, TQWidget* tqparent); /** * Reimplemented from base class. Sends out the mousePressedOnExternalWidget() signal * if object @p o points to an object which is not a child widget of any added previously * using the addWidget() method. The signal is sent out only once for each event @p e. * - * @param o pointer to QObject - * @param e pointer to QEvent + * @param o pointer to TQObject + * @param e pointer to TQEvent * @return always returns @a false */ - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); signals: void mousePressedOnExternalWidget(bool&); private: - QValueList m_parents; - QEvent* m_lastMousePressEvent; + TQValueList m_parents; + TQEvent* m_lastMousePressEvent; bool m_filterActive; }; @@ -130,15 +131,16 @@ private: class KGlobalLedgerView : public KMyMoneyViewBase { Q_OBJECT + TQ_OBJECT public: - KGlobalLedgerView(QWidget *parent=0, const char *name=0); + KGlobalLedgerView(TQWidget *tqparent=0, const char *name=0); ~KGlobalLedgerView(); /** * This method returns the id of the currently selected account - * or QString() if none is selected. + * or TQString() if none is selected. */ - const QString accountId(void) const { return m_account.id(); } + const TQString accountId(void) const { return m_account.id(); } /** * Checks if new transactions can be created in the current context @@ -150,7 +152,7 @@ public: * @retval true Yes, view allows to create transactions (tooltip is not changed) * @retval false No, view does not support creation of transactions (tooltip is updated with message) */ - bool canCreateTransactions(QString& tooltip) const; + bool canCreateTransactions(TQString& tooltip) const; /** * Checks if a list of transactions can be modified (edit/delete) in the current context @@ -163,9 +165,9 @@ public: * @retval true Yes, view allows to edit/delete transactions (tooltip is not changed) * @retval false No, view cannot edit/delete transactions (tooltip is updated with message) */ - bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; - bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * Checks if the list of transactions can be edited in the current context @@ -177,7 +179,7 @@ public: * * @return @c true if edit operation is possible, @c false if not */ - bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; TransactionEditor* startEdit(const KMyMoneyRegister::SelectedTransactions& list); @@ -204,13 +206,13 @@ public slots: * * @param accountId Internal id used for the account to show * @param transactionId Internal id used for the transaction to select. - * Default is QString() which will select the last + * Default is TQString() which will select the last * transaction in the ledger if not the same account * * @retval true selection of account referenced by @p id succeeded * @retval false selection of account failed */ - bool slotSelectAccount(const QString& accountId, const QString& transactionId = QString()); + bool slotSelectAccount(const TQString& accountId, const TQString& transactionId = TQString()); /** * This method is provided for convenience and acts as the method above. @@ -228,7 +230,7 @@ public slots: * @param endingBalance The calculated ending balance for the statement * Default ist 0. */ - void slotSetReconcileAccount(const MyMoneyAccount& account = MyMoneyAccount(), const QDate& reconciliationDate = QDate(), const MyMoneyMoney& endingBalance = MyMoneyMoney()); + void slotSetReconcileAccount(const MyMoneyAccount& account = MyMoneyAccount(), const TQDate& reconciliationDate = TQDate(), const MyMoneyMoney& endingBalance = MyMoneyMoney()); /** * Select all transactions in the ledger that are not hidden. @@ -253,9 +255,9 @@ protected: void loadView(void); - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); - void selectTransaction(const QString& id); + void selectTransaction(const TQString& id); /** * This method handles the focus of the keyboard. When in edit mode @@ -268,7 +270,7 @@ protected: */ bool focusNextPrevChild(bool next); - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); /** * Returns @a true if setReconciliationAccount() has been called for @@ -287,7 +289,7 @@ protected: * @param actBalance map of account indexed values to be used as actual balance * @param clearedBalance map of account indexed values to be used as cleared balance */ - void updateSummaryLine(const QMap& actBalance, const QMap& clearedBalance); + void updateSummaryLine(const TQMap& actBalance, const TQMap& clearedBalance); /** * setup the default action according to the current account type @@ -301,13 +303,13 @@ protected slots: /** * Sets the contentsPos of the register to d->m_startPoint or makes - * the focus item visible if d->m_startPoint equals QPoint(-1, -1). + * the focus item visible if d->m_startPoint equals TQPoint(-1, -1). */ void slotUpdateViewPos(void); void slotSortOptions(void); void slotToggleTransactionMark(KMyMoneyRegister::Transaction* t); - void slotKeepPostDate(const QDate&); + void slotKeepPostDate(const TQDate&); void slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&); @@ -318,7 +320,7 @@ protected: * and is used to preset the posting date when new transactions are created. * This member is initialised to the current date when the program is started. */ - static QDate m_lastPostDate; + static TQDate m_lastPostDate; private: /// \internal d-pointer class. @@ -327,11 +329,11 @@ private: Private* const d; // frames - QFrame* m_toolbarFrame; - QFrame* m_registerFrame; - QFrame* m_buttonFrame; - QFrame* m_formFrame; - QFrame* m_summaryFrame; + TQFrame* m_toolbarFrame; + TQFrame* m_registerFrame; + TQFrame* m_buttonFrame; + TQFrame* m_formFrame; + TQFrame* m_summaryFrame; // widgets KMyMoneyAccountCombo* m_accountComboBox; @@ -347,11 +349,11 @@ private: /** * This member holds the transaction list */ - QValueList > m_transactionList; + TQValueList > m_transactionList; - QLabel* m_leftSummaryLabel; - QLabel* m_centerSummaryLabel; - QLabel* m_rightSummaryLabel; + TQLabel* m_leftSummaryLabel; + TQLabel* m_centerSummaryLabel; + TQLabel* m_rightSummaryLabel; KMyMoneyTransactionForm::TransactionForm* m_form; @@ -359,7 +361,7 @@ private: bool m_newAccountLoaded; bool m_inEditMode; - QWidgetList m_tabOrderWidgets; + TQWidgetList m_tabOrderWidgets; signals: void accountSelected(const MyMoneyObject&); @@ -396,7 +398,7 @@ signals: void toggleReconciliationFlag(void); private: - bool canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; }; #endif diff --git a/kmymoney2/views/khomeview.cpp b/kmymoney2/views/khomeview.cpp index 95b7323..51e9c65 100644 --- a/kmymoney2/views/khomeview.cpp +++ b/kmymoney2/views/khomeview.cpp @@ -23,16 +23,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -88,12 +88,12 @@ class KHomeView::Private { public: Private() {} - void addNameIndex(QMap &idx, const MyMoneyAccount& account); + void addNameIndex(TQMap &idx, const MyMoneyAccount& account); }; -void KHomeView::Private::addNameIndex(QMap &idx, const MyMoneyAccount& account) +void KHomeView::Private::addNameIndex(TQMap &idx, const MyMoneyAccount& account) { - QString key = account.name(); + TQString key = account.name(); if(idx[key].id().isEmpty()) { idx[key] = account; @@ -101,15 +101,15 @@ void KHomeView::Private::addNameIndex(QMap &idx, const } else if(idx[key].id() != account.id()) { key = account.name() + "[%1]"; int dup = 2; - while(!idx[key.arg(dup)].id().isEmpty() - && idx[key.arg(dup)].id() != account.id()) + while(!idx[key.tqarg(dup)].id().isEmpty() + && idx[key.tqarg(dup)].id() != account.id()) ++dup; - idx[key.arg(dup)] = account; + idx[key.tqarg(dup)] = account; } } -KHomeView::KHomeView(QWidget *parent, const char *name ) : - KMyMoneyViewBase(parent, name, i18n("Home")), +KHomeView::KHomeView(TQWidget *tqparent, const char *name ) : + KMyMoneyViewBase(tqparent, name, i18n("Home")), d(new Private), m_showAllSchedules(false), m_needReload(true) @@ -117,13 +117,13 @@ KHomeView::KHomeView(QWidget *parent, const char *name ) : m_part = new KHTMLPart(this, "htmlpart_km2"); addWidget(m_part->view()); - m_filename = KMyMoneyUtils::findResource("appdata", QString("html/home%1.html")); + m_filename = KMyMoneyUtils::findResource("appdata", TQString("html/home%1.html")); // m_part->openURL(m_filename); - connect(m_part->browserExtension(), SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)), - this, SLOT(slotOpenURL(const KURL&, const KParts::URLArgs&))); + connect(m_part->browserExtension(), TQT_SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)), + this, TQT_SLOT(slotOpenURL(const KURL&, const KParts::URLArgs&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView())); } KHomeView::~KHomeView() @@ -153,7 +153,7 @@ void KHomeView::show(void) loadView(); m_needReload = false; } - QWidget::show(); + TQWidget::show(); } void KHomeView::slotPrintView(void) @@ -167,7 +167,7 @@ void KHomeView::loadView(void) m_part->setZoomFactor( KMyMoneyGlobalSettings::fontSizePercentage() ); //kdDebug() << "Setting font size: " << m_part->zoomFactor() << endl; - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); if(list.count() == 0) { @@ -186,7 +186,7 @@ void KHomeView::loadView(void) else { qDebug("Element id=test found!"); - QString tagname = e.tagName().string(); + TQString tagname = e.tagName().string(); qDebug("%s",tagname.latin1()); qDebug("%s id=%s",e.tagName().string().latin1(),e.getAttribute("id").string().latin1()); @@ -214,23 +214,23 @@ void KHomeView::loadView(void) //clear the forecast flag so it will be reloaded m_forecast.setForecastDone(false); - QString filename = KGlobal::dirs()->findResource("appdata", "html/kmymoney2.css"); - QString header = QString("\n\n").arg(filename); + TQString filename = KGlobal::dirs()->findResource("appdata", "html/kmymoney2.css"); + TQString header = TQString("\n\n").tqarg(filename); header += KMyMoneyUtils::variableCSS(); header += "\n"; - QString footer = "\n"; + TQString footer = "\n"; m_part->begin(); m_part->write(header); - m_part->write(QString("
%1
").arg(i18n("Your Financial Summary"))); + m_part->write(TQString("
%1
").tqarg(i18n("Your Financial Summary"))); - QStringList settings = KMyMoneyGlobalSettings::itemList(); + TQStringList settings = KMyMoneyGlobalSettings::itemList(); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it = settings.begin(); it != settings.end(); ++it) { int option = (*it).toInt(); @@ -246,7 +246,7 @@ void KHomeView::loadView(void) case 3: // payment accounts // Check if preferred accounts are shown separately - if(settings.find("2") == settings.end()) { + if(settings.tqfind("2") == settings.end()) { showAccounts(static_cast (Payment | Preferred), i18n("Payment Accounts")); } else { @@ -279,7 +279,7 @@ void KHomeView::loadView(void) } m_part->write("
"); - m_part->write(link(VIEW_WELCOME, QString()) + i18n("Show KMyMoney welcome page") + linkend()); + m_part->write(link(VIEW_WELCOME, TQString()) + i18n("Show KMyMoney welcome page") + linkend()); m_part->write("
"); m_part->write("
"); m_part->write(footer); @@ -291,7 +291,7 @@ void KHomeView::loadView(void) void KHomeView::showNetWorthGraph(void) { #ifdef HAVE_KDCHART - m_part->write(QString("
%1
\n
 
\n").arg(i18n("Networth Forecast"))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("Networth Forecast"))); MyMoneyReport reportCfg = MyMoneyReport( MyMoneyReport::eAssetLiability, @@ -311,7 +311,7 @@ void KHomeView::showNetWorthGraph(void) reportCfg.setColumnsAreDays( true ); reportCfg.setConvertCurrency( true ); reportCfg.setIncludingForecast( true ); - reportCfg.setDateFilter(QDate::currentDate(),QDate::currentDate().addDays(+90)); + reportCfg.setDateFilter(TQDate::tqcurrentDate(),TQDate::tqcurrentDate().addDays(+90)); reports::PivotTable table(reportCfg); @@ -330,7 +330,7 @@ void KHomeView::showNetWorthGraph(void) const int idPropFutureValue = chartWidget->params()->registerProperties(propSetFutureValue); //KDChartPropertySet propSetLastValue("last value", idPropFutureValue); - //propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignBottom); + //propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, TQt::AlignLeft | TQt::AlignBottom); //propSetLastValue.setExtraLinesWidth(KDChartPropertySet::OwnID, -4); //propSetLastValue.setExtraLinesColor(KDChartPropertySet::OwnID, KMyMoneyGlobalSettings::listGridColor()); // propSetLastValue.setShowMarker(KDChartPropertySet::OwnID, true); @@ -349,19 +349,19 @@ void KHomeView::showNetWorthGraph(void) chartWidget->resize(width()-80, nh); } - QPixmap pm(chartWidget->width(), chartWidget->height()); + TQPixmap pm(chartWidget->width(), chartWidget->height()); pm.fill(KGlobalSettings::baseColor()); - QPainter p(&pm); + TQPainter p(&pm); chartWidget->paintTo(p); - QByteArray ba; - QBuffer buffer( ba ); + TQByteArray ba; + TQBuffer buffer( ba ); buffer.open( IO_WriteOnly ); pm.save( &buffer, "PNG" ); // writes pixmap into ba in PNG format m_part->write(""); m_part->write(""); - m_part->write(QString("").arg(KCodecs::base64Encode(ba))); + m_part->write(TQString("").tqarg(TQString(KCodecs::base64Encode(ba)))); m_part->write(""); m_part->write("
\"Networth\"
\"Networth\"
"); @@ -372,8 +372,8 @@ void KHomeView::showNetWorthGraph(void) void KHomeView::showPayments(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList overdues; - QValueList schedule; + TQValueList overdues; + TQValueList schedule; int i = 0; //if forecast has not been executed yet, do it. @@ -383,12 +383,12 @@ void KHomeView::showPayments(void) schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate::currentDate(), - QDate::currentDate().addMonths(1)); + TQDate::tqcurrentDate(), + TQDate::tqcurrentDate().addMonths(1)); overdues = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), QDate(), true); + TQDate(), TQDate(), true); if(schedule.empty() && overdues.empty()) return; @@ -396,11 +396,11 @@ void KHomeView::showPayments(void) // HACK // Remove the finished schedules - QValueList::Iterator d_it; + TQValueList::Iterator d_it; for (d_it=schedule.begin(); d_it!=schedule.end();) { // FIXME cleanup old code - // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == QDate()) + // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == TQDate()) if ((*d_it).isFinished()) { d_it = schedule.remove(d_it); @@ -412,7 +412,7 @@ void KHomeView::showPayments(void) for (d_it=overdues.begin(); d_it!=overdues.end();) { // FIXME cleanup old code - // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == QDate()) + // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == TQDate()) if ((*d_it).isFinished()) { d_it = overdues.remove(d_it); @@ -422,17 +422,17 @@ void KHomeView::showPayments(void) } m_part->write("
"); - m_part->write(QString("
%1
\n").arg(i18n("Payments"))); + m_part->write(TQString("
%1
\n").tqarg(i18n("Payments"))); if(overdues.count() > 0) { m_part->write("
 
\n"); qBubbleSort(overdues); - QValueList::Iterator it; - QValueList::Iterator it_f; + TQValueList::Iterator it; + TQValueList::Iterator it_f; m_part->write(""); - m_part->write(QString("\n").arg(showColoredAmount(i18n("Overdue payments"), true))); + m_part->write(TQString("\n").tqarg(showColoredAmount(i18n("Overdue payments"), true))); m_part->write(""); m_part->write("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*it, cnt); m_part->write(""); // make sure to not repeat overdues later again @@ -483,15 +483,15 @@ void KHomeView::showPayments(void) qBubbleSort(schedule); // Extract todays payments if any - QValueList todays; - QValueList::Iterator t_it; + TQValueList todays; + TQValueList::Iterator t_it; for (t_it=schedule.begin(); t_it!=schedule.end();) { - if ((*t_it).nextDueDate() == QDate::currentDate()) { + if ((*t_it).nextDueDate() == TQDate::tqcurrentDate()) { todays.append(*t_it); (*t_it).setNextDueDate((*t_it).nextPayment((*t_it).nextDueDate())); - //if nextDueDate is still currentDate then remove it from scheduled payments - if ((*t_it).nextDueDate() == QDate::currentDate()) { + //if nextDueDate is still tqcurrentDate then remove it from scheduled payments + if ((*t_it).nextDueDate() == TQDate::tqcurrentDate()) { t_it = schedule.remove(t_it); continue; } @@ -502,7 +502,7 @@ void KHomeView::showPayments(void) if (todays.count() > 0) { m_part->write("
 
\n"); m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -453,9 +453,9 @@ void KHomeView::showPayments(void) for(it = overdues.begin(); it != overdues.end(); ++it) { // determine number of overdue payments - QDate nextDate = (*it).adjustedNextDueDate(); + TQDate nextDate = (*it).adjustedNextDueDate(); int cnt = 0; - while(nextDate.isValid() && nextDate < QDate::currentDate()) { + while(nextDate.isValid() && nextDate < TQDate::tqcurrentDate()) { ++cnt; nextDate = (*it).nextPayment(nextDate); // for single occurence nextDate will not change, so we @@ -464,7 +464,7 @@ void KHomeView::showPayments(void) break; } - m_part->write(QString("
"); - m_part->write(QString("\n").arg(i18n("Today's payments"))); + m_part->write(TQString("\n").tqarg(i18n("Today's payments"))); m_part->write(""); m_part->write(""); for(t_it = todays.begin(); t_it != todays.end(); ++t_it) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*t_it); m_part->write(""); } @@ -533,10 +533,10 @@ void KHomeView::showPayments(void) { m_part->write("
 
\n"); - QValueList::Iterator it; + TQValueList::Iterator it; m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -522,7 +522,7 @@ void KHomeView::showPayments(void) m_part->write("
"); - m_part->write(QString("\n").arg(i18n("Future payments"))); + m_part->write(TQString("\n").tqarg(i18n("Future payments"))); m_part->write(""); m_part->write("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*it); m_part->write(""); @@ -602,12 +602,12 @@ void KHomeView::showPayments(void) while(1); if (needMoreLess) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); m_part->write(""); m_part->write(""); @@ -620,7 +620,7 @@ void KHomeView::showPayments(void) void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) { - QString tmp; + TQString tmp; MyMoneyFile* file = MyMoneyFile::instance(); try { @@ -629,49 +629,49 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) MyMoneyTransaction t = sched.transaction(); // only show the entry, if it is still active // FIXME clean old code - // if(!sched.isFinished() && sched.nextPayment(sched.lastPayment()) != QDate()) { + // if(!sched.isFinished() && sched.nextPayment(sched.lastPayment()) != TQDate()) { if(!sched.isFinished()) { MyMoneySplit sp = t.splitByAccount(acc.id(), true); - QString pathEnter, pathSkip; + TQString pathEnter, pathSkip; KGlobal::iconLoader()->loadIcon("key_enter", KIcon::Small, KIcon::SizeSmall, KIcon::DefaultState, &pathEnter); KGlobal::iconLoader()->loadIcon("player_fwd", KIcon::Small, KIcon::SizeSmall, KIcon::DefaultState, &pathSkip); //show payment date - tmp = QString(""; //show balance after payments tmp += ""; @@ -685,13 +685,13 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) } } -void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header) +void KHomeView::showAccounts(KHomeView::paymentTypeE type, const TQString& header) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; - QValueList::Iterator it; - QValueList::Iterator prevIt; - QMap nameIdx; + TQValueList accounts; + TQValueList::Iterator it; + TQValueList::Iterator prevIt; + TQMap nameIdx; bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); @@ -767,7 +767,7 @@ void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header } if(accounts.count() > 0) { - QString tmp; + TQString tmp; int i = 0; tmp = "
" + header + "
\n
 
\n"; m_part->write(tmp); @@ -786,9 +786,9 @@ void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header m_part->write("
"); - QMap::const_iterator it_m; + TQMap::const_iterator it_m; for(it_m = nameIdx.begin(); it_m != nameIdx.end(); ++it_m) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showAccountEntry(*it_m); m_part->write(""); } @@ -812,17 +812,17 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc) showAccountEntry(acc, value, MyMoneyMoney(), showLimit); } else { //get balance for normal accounts - value = file->balance(acc.id(), QDate::currentDate()); + value = file->balance(acc.id(), TQDate::tqcurrentDate()); //if credit card or checkings account, show maximum credit if( acc.accountType() == MyMoneyAccount::CreditCard || acc.accountType() == MyMoneyAccount::Checkings ) { - QString maximumCredit = acc.value("maxCreditAbsolute"); + TQString maximumCredit = acc.value("maxCreditAbsolute"); MyMoneyMoney maxCredit = MyMoneyMoney(maximumCredit); showAccountEntry(acc, value, value - maxCredit, showLimit); } else { //otherwise use minimum balance - QString minimumBalance = acc.value("minBalanceAbsolute"); + TQString minimumBalance = acc.value("minBalanceAbsolute"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); showAccountEntry(acc, value, value - minBalance, showLimit); } @@ -832,33 +832,33 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc) void KHomeView::showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney& value, const MyMoneyMoney& valueToMinBal, const bool showMinBal) { MyMoneyFile* file = MyMoneyFile::instance(); - QString tmp; + TQString tmp; MyMoneySecurity currency = file->currency(acc.currencyId()); - QString amount; - QString amountToMinBal; + TQString amount; + TQString amountToMinBal; //format amounts amount = value.formatMoney(acc, currency); - amount.replace(" "," "); + amount.tqreplace(" "," "); if(showMinBal) { amountToMinBal = valueToMinBal.formatMoney(acc, currency); - amountToMinBal.replace(" "," "); + amountToMinBal.tqreplace(" "," "); } - tmp = QString(""; + tmp = TQString(""; //show account balance - tmp += QString("").arg(showColoredAmount(amount, value.isNegative())); + tmp += TQString("").tqarg(showColoredAmount(amount, value.isNegative())); //show minimum balance column if requested if(showMinBal) { //if it is an investment, show minimum balance empty if(acc.accountType() == MyMoneyAccount::Investment) { - tmp += QString(""); + tmp += TQString(""); } else { //show minimum balance entry - tmp += QString("").arg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative())); + tmp += TQString("").tqarg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative())); } } // qDebug("accountEntry = '%s'", tmp.latin1()); @@ -871,7 +871,7 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) MyMoneyMoney value; value = file->balance(acc.id()); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount stock = file->account(*it_a); try { @@ -886,7 +886,7 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) val = val.convert(acc.fraction()); value += val; } catch(MyMoneyException* e) { - qWarning("%s", (QString("cannot convert stock balance of %1 to base currency: %2").arg(stock.name(), e->what())).data()); + qWarning("%s", (TQString("cannot convert stock balance of %1 to base currency: %2").tqarg(stock.name(), e->what())).data()); delete e; } } @@ -895,18 +895,18 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) void KHomeView::showFavoriteReports(void) { - QValueList reports = MyMoneyFile::instance()->reportList(); + TQValueList reports = MyMoneyFile::instance()->reportList(); if ( reports.count() > 0 ) { bool firstTime = 1; int row = 0; - QValueList::const_iterator it_report = reports.begin(); + TQValueList::const_iterator it_report = reports.begin(); while( it_report != reports.end() ) { if ( (*it_report).isFavorite() ) { if(firstTime) { - m_part->write(QString("
%1
\n
 
\n").arg(i18n("Favorite Reports"))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("Favorite Reports"))); m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -560,7 +560,7 @@ void KHomeView::showPayments(void) cnt = (m_showAllSchedules) ? -1 : 6; bool needMoreLess = m_showAllSchedules; - QDate lastDate = QDate::currentDate().addMonths(1); + TQDate lastDate = TQDate::tqcurrentDate().addMonths(1); qBubbleSort(schedule); do { it = schedule.begin(); @@ -569,7 +569,7 @@ void KHomeView::showPayments(void) // if the next due date is invalid (schedule is finished) // we remove it from the list - QDate nextDate = (*it).nextDueDate(); + TQDate nextDate = (*it).nextDueDate(); if(!nextDate.isValid()) { schedule.remove(it); continue; @@ -585,7 +585,7 @@ void KHomeView::showPayments(void) if(cnt > 0) --cnt; - m_part->write(QString("
"); if(m_showAllSchedules) { - m_part->write(link(VIEW_SCHEDULE, QString("?mode=%1").arg("reduced")) + i18n("Less...") + linkend()); + m_part->write(link(VIEW_SCHEDULE, TQString("?mode=%1").tqarg("reduced")) + i18n("Less...") + linkend()); } else { - m_part->write(link(VIEW_SCHEDULE, QString("?mode=%1").arg("full")) + i18n("More...") + linkend()); + m_part->write(link(VIEW_SCHEDULE, TQString("?mode=%1").tqarg("full")) + i18n("More...") + linkend()); } m_part->write("
") + + tmp = TQString("") + KGlobal::locale()->formatDate(sched.adjustedNextDueDate(), true) + ""; if(pathEnter.length() > 0) - tmp += link(VIEW_SCHEDULE, QString("?id=%1&mode=enter").arg(sched.id()), i18n("Enter schedule")) + QString("").arg(pathEnter) + linkend(); + tmp += link(VIEW_SCHEDULE, TQString("?id=%1&mode=enter").tqarg(sched.id()), i18n("Enter schedule")) + TQString("").tqarg(pathEnter) + linkend(); if(pathSkip.length() > 0) - tmp += " " + link(VIEW_SCHEDULE, QString("?id=%1&mode=skip").arg(sched.id()), i18n("Skip schedule")) + QString("").arg(pathSkip) + linkend(); + tmp += " " + link(VIEW_SCHEDULE, TQString("?id=%1&mode=skip").tqarg(sched.id()), i18n("Skip schedule")) + TQString("").tqarg(pathSkip) + linkend(); - tmp += QString(" "); - tmp += link(VIEW_SCHEDULE, QString("?id=%1&mode=edit").arg(sched.id()), i18n("Edit schedule")) + sched.name() + linkend(); + tmp += TQString(" "); + tmp += link(VIEW_SCHEDULE, TQString("?id=%1&mode=edit").tqarg(sched.id()), i18n("Edit schedule")) + sched.name() + linkend(); //show quantity of payments overdue if any if(cnt > 1) - tmp += i18n(" (%1 payments)").arg(cnt); + tmp += i18n(" (%1 payments)").tqarg(cnt); //show account of the main split tmp += ""; - tmp += QString(file->account(acc.id()).name()); + tmp += TQString(file->account(acc.id()).name()); //show amount of the schedule tmp += ""; const MyMoneySecurity& currency = MyMoneyFile::instance()->currency(acc.currencyId()); - QString amount = (sp.value()*cnt).formatMoney(acc, currency); - amount.replace(" "," "); + TQString amount = (sp.value()*cnt).formatMoney(acc, currency); + amount.tqreplace(" "," "); tmp += showColoredAmount(amount, (sp.value()*cnt).isNegative()) ; tmp += ""; MyMoneyMoney payment = MyMoneyMoney((sp.value()*cnt)); - QDate paymentDate = QDate(sched.nextDueDate()); + TQDate paymentDate = TQDate(sched.nextDueDate()); MyMoneyMoney balanceAfter = forecastPaymentBalance(acc, payment, paymentDate); - QString balance = balanceAfter.formatMoney(acc, currency); - balance.replace(" "," "); + TQString balance = balanceAfter.formatMoney(acc, currency); + balance.tqreplace(" "," "); tmp += showColoredAmount(balance, balanceAfter.isNegative()); tmp += "
") + - link(VIEW_LEDGER, QString("?id=%1").arg(acc.id())) + acc.name() + linkend() + "") + + link(VIEW_LEDGER, TQString("?id=%1").tqarg(acc.id())) + acc.name() + linkend() + "%1%1  %1%1
"); m_part->write("") - .arg(row++ & 0x01 ? "even" : "odd") - .arg(link(VIEW_REPORTS, QString("?id=%1").arg((*it_report).id()))) - .arg((*it_report).name()) - .arg(linkend()) - .arg((*it_report).comment()) + m_part->write(TQString("") + .tqarg(row++ & 0x01 ? "even" : "odd") + .tqarg(link(VIEW_REPORTS, TQString("?id=%1").tqarg((*it_report).id()))) + .tqarg((*it_report).name()) + .tqarg(linkend()) + .tqarg((*it_report).comment()) ); } @@ -934,9 +934,9 @@ void KHomeView::showFavoriteReports(void) void KHomeView::showForecast(void) { - QMap nameIdx; + TQMap nameIdx; MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; + TQValueList accList; // if forecast has not been executed yet, do it. if(!m_forecast.isForecastDone()) @@ -945,7 +945,7 @@ void KHomeView::showForecast(void) accList = m_forecast.accountList(); // add it to a map to have it ordered by name - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for ( ; accList_t != accList.end(); ++accList_t ) { d->addNameIndex(nameIdx, *accList_t); } @@ -955,22 +955,22 @@ void KHomeView::showForecast(void) int colspan = 1; // get begin day - int beginDay = QDate::currentDate().daysTo(m_forecast.beginForecastDate()); + int beginDay = TQDate::tqcurrentDate().daysTo(m_forecast.beginForecastDate()); // if begin day is today skip to next cycle if(beginDay == 0) beginDay = m_forecast.accountsCycle(); // Now output header - m_part->write(QString("
%1
\n
 
\n").arg(i18n("%1 Day Forecast").arg(m_forecast.forecastDays()))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("%1 Day Forecast").tqarg(m_forecast.forecastDays()))); m_part->write("
"); m_part->write(i18n("Report")); @@ -916,12 +916,12 @@ void KHomeView::showFavoriteReports(void) firstTime = false; } - m_part->write(QString("
%2%3%4%5
%2%3%4%5
"); m_part->write(""); int colWidth = 55/ (m_forecast.forecastDays() / m_forecast.accountsCycle()); for(i = 0; (i*m_forecast.accountsCycle() + beginDay) <= m_forecast.forecastDays(); ++i) { - m_part->write(QString(""); colspan++; } @@ -979,17 +979,17 @@ void KHomeView::showForecast(void) // Now output entries i = 0; - QMap::ConstIterator it_account; + TQMap::ConstIterator it_account; for(it_account = nameIdx.begin(); it_account != nameIdx.end(); ++it_account) { //MyMoneyAccount acc = (*it_n); - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); - m_part->write(QString(""); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString(""); int dropZero = -1; //account dropped below zero int dropMinimum = -1; //account dropped below minimum balance - QString minimumBalance = (*it_account).value("minimumBalance"); + TQString minimumBalance = (*it_account).value("minimumBalance"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); MyMoneySecurity currency; MyMoneyMoney forecastBalance; @@ -1003,12 +1003,12 @@ void KHomeView::showForecast(void) } for (int f = beginDay; f <= m_forecast.forecastDays(); f += m_forecast.accountsCycle()) { - forecastBalance = m_forecast.forecastBalance(*it_account, QDate::currentDate().addDays(f)); - QString amount; + forecastBalance = m_forecast.forecastBalance(*it_account, TQDate::tqcurrentDate().addDays(f)); + TQString amount; amount = forecastBalance.formatMoney( *it_account, currency); - amount.replace(" "," "); - m_part->write(QString("").arg(showColoredAmount(amount, forecastBalance.isNegative()))); + amount.tqreplace(" "," "); + m_part->write(TQString("").tqarg(showColoredAmount(amount, forecastBalance.isNegative()))); } m_part->write(""); @@ -1023,7 +1023,7 @@ void KHomeView::showForecast(void) // spit out possible warnings - QString msg; + TQString msg; // if a minimum balance has been specified, an appropriate warning will // only be shown, if the drop below 0 is on a different day or not present @@ -1036,48 +1036,48 @@ void KHomeView::showForecast(void) case -1: break; case 0: - msg = i18n("The balance of %1 is below the minimum balance %2 today.").arg((*it_account).name()).arg(minBalance.formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is below the minimum balance %2 today.").tqarg((*it_account).name()).tqarg(minBalance.formatMoney(*it_account, currency)); msg = showColoredAmount(msg, true); break; default: - msg = i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").arg((*it_account).name()).arg(minBalance.formatMoney(*it_account, currency)).arg(dropMinimum-1); + msg = i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").tqarg((*it_account).name()).tqarg(minBalance.formatMoney(*it_account, currency)).tqarg(dropMinimum-1); msg = showColoredAmount(msg, true); break; } if(!msg.isEmpty()) { - m_part->write(QString("").arg(msg).arg(colspan)); + m_part->write(TQString("").tqarg(msg).tqarg(colspan)); } } // a drop below zero is always shown - msg = QString(); + msg = TQString(); switch(dropZero) { case -1: break; case 0: if((*it_account).accountGroup() == MyMoneyAccount::Asset) { - msg = i18n("The balance of %1 is below %2 today.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is below %2 today.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)); msg = showColoredAmount(msg, true); break; } if((*it_account).accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 is above %2 today.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is above %2 today.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)); break; } break; default: if((*it_account).accountGroup() == MyMoneyAccount::Asset) { - msg = i18n("The balance of %1 will drop below %2 in %3 days.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)).arg(dropZero); + msg = i18n("The balance of %1 will drop below %2 in %3 days.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)).tqarg(dropZero); msg = showColoredAmount(msg, true); break; } if((*it_account).accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 will raise above %2 in %3 days.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)).arg(dropZero); + msg = i18n("The balance of %1 will raise above %2 in %3 days.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)).tqarg(dropZero); break; } } if(!msg.isEmpty()) { - m_part->write(QString("").arg(msg).arg(colspan)); + m_part->write(TQString("").tqarg(msg).tqarg(colspan)); } } m_part->write("
"); m_part->write(i18n("Account")); m_part->write("").arg(colWidth)); + m_part->write(TQString("").tqarg(colWidth)); - m_part->write(i18n("%1 days").arg(i*m_forecast.accountsCycle() + beginDay)); + m_part->write(i18n("%1 days").tqarg(i*m_forecast.accountsCycle() + beginDay)); m_part->write("
") + - link(VIEW_LEDGER, QString("?id=%1").arg((*it_account).id())) + (*it_account).name() + linkend() + "
") + + link(VIEW_LEDGER, TQString("?id=%1").tqarg((*it_account).id())) + (*it_account).name() + linkend() + "").arg(colWidth)); - m_part->write(QString("%1").tqarg(colWidth)); + m_part->write(TQString("%1
%1
%1
%1
%1
"); @@ -1085,27 +1085,27 @@ void KHomeView::showForecast(void) } } -const QString KHomeView::link(const QString& view, const QString& query, const QString& _title) const +const TQString KHomeView::link(const TQString& view, const TQString& query, const TQString& _title) const { - QString titlePart; - QString title(_title); + TQString titlePart; + TQString title(_title); if(!title.isEmpty()) - titlePart = QString(" title=\"%1\"").arg(title.replace(" ", " ")); + titlePart = TQString(" title=\"%1\"").tqarg(title.tqreplace(" ", " ")); - return QString("").arg(view, query, titlePart); + return TQString("").tqarg(view, query, titlePart); } -const QString KHomeView::linkend(void) const +const TQString KHomeView::linkend(void) const { return ""; } void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) { - QString protocol = url.protocol(); - QString view = url.fileName(false); - QString id = url.queryItem("id").data(); - QString mode = url.queryItem("mode").data(); + TQString protocol = url.protocol(); + TQString view = url.fileName(false); + TQString id = url.queryItem("id"); + TQString mode = url.queryItem("mode"); if ( protocol == "http" ) { @@ -1118,26 +1118,26 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) else { if(view == VIEW_LEDGER) { - emit ledgerSelected(id, QString()); + emit ledgerSelected(id, TQString()); } else if(view == VIEW_SCHEDULE) { if(mode == "enter") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_enter"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_enter"), TQT_SLOT(activate())); } else if(mode == "edit") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_edit"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_edit"), TQT_SLOT(activate())); } else if(mode == "skip") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_skip"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_skip"), TQT_SLOT(activate())); } else if(mode == "full") { m_showAllSchedules = true; @@ -1152,11 +1152,11 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) emit reportSelected(id); } else if(view == VIEW_WELCOME) { - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); if ( mode == "whatsnew" ) { - QString fname = KMyMoneyUtils::findResource("appdata",QString("html/whats_new%1.html")); + TQString fname = KMyMoneyUtils::findResource("appdata",TQString("html/whats_new%1.html")); if(!fname.isEmpty()) m_part->openURL(fname); } @@ -1164,12 +1164,12 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) m_part->openURL(m_filename); } else if(view == "action") { - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action( id ), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action( id ), TQT_SLOT(activate())); } else if(view == VIEW_HOME) { - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); if(list.count() == 0) { KMessageBox::information(this, i18n("Before KMyMoney can give you detailed information about your financial status, you need to create at least one account. Until then, KMyMoney shows the welcome page instead.")); @@ -1184,13 +1184,13 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) void KHomeView::showAssetsLiabilities(void) { - QValueList accounts; - QValueList::Iterator it; - QMap nameAssetsIdx; - QMap nameLiabilitiesIdx; + TQValueList accounts; + TQValueList::Iterator it; + TQMap nameAssetsIdx; + TQMap nameLiabilitiesIdx; MyMoneyMoney netAssets; MyMoneyMoney netLiabilities; - QString fontStart, fontEnd; + TQString fontStart, fontEnd; MyMoneyFile* file = MyMoneyFile::instance(); int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction()); @@ -1257,10 +1257,10 @@ void KHomeView::showAssetsLiabilities(void) m_part->write(""); //get asset and liability accounts - QMap::const_iterator asset_it = nameAssetsIdx.begin(); - QMap::const_iterator liabilities_it = nameLiabilitiesIdx.begin(); + TQMap::const_iterator asset_it = nameAssetsIdx.begin(); + TQMap::const_iterator liabilities_it = nameLiabilitiesIdx.begin(); for(; asset_it != nameAssetsIdx.end() || liabilities_it != nameLiabilitiesIdx.end();) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //write an asset account if we still have any if(asset_it != nameAssetsIdx.end()) { MyMoneyMoney value; @@ -1268,12 +1268,12 @@ void KHomeView::showAssetsLiabilities(void) if( (*asset_it).accountType() == MyMoneyAccount::Investment) { value = investmentBalance(*asset_it); } else { - value = MyMoneyFile::instance()->balance((*asset_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*asset_it).id(), TQDate::tqcurrentDate()); } //calculate balance for foreign currency accounts if((*asset_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*asset_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; baseValue = baseValue.convert(10000); netAssets += baseValue; @@ -1294,11 +1294,11 @@ void KHomeView::showAssetsLiabilities(void) //write a liability account if(liabilities_it != nameLiabilitiesIdx.end()) { MyMoneyMoney value; - value = MyMoneyFile::instance()->balance((*liabilities_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*liabilities_it).id(), TQDate::tqcurrentDate()); //calculate balance if foreign currency if((*liabilities_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*liabilities_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; baseValue = baseValue.convert(10000); netLiabilities += baseValue; @@ -1318,30 +1318,30 @@ void KHomeView::showAssetsLiabilities(void) MyMoneyMoney netWorth = netAssets+netLiabilities; //format assets, liabilities and net worth - QString amountAssets = netAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiabilities = netLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountNetWorth = netWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountAssets.replace(" "," "); - amountLiabilities.replace(" "," "); - amountNetWorth.replace(" "," "); + TQString amountAssets = netAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiabilities = netLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountNetWorth = netWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountAssets.tqreplace(" "," "); + amountLiabilities.tqreplace(" "," "); + amountNetWorth.tqreplace(" "," "); - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //print total for assets - m_part->write(QString("%1%2").arg(i18n("Total Assets")).arg(showColoredAmount(amountAssets, netAssets.isNegative()))); + m_part->write(TQString("%1%2").tqarg(i18n("Total Assets")).tqarg(showColoredAmount(amountAssets, netAssets.isNegative()))); //leave the intermediate column empty m_part->write(""); //print total liabilities - m_part->write(QString("%1%2").arg(i18n("Total Liabilities")).arg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()))); + m_part->write(TQString("%1%2").tqarg(i18n("Total Liabilities")).tqarg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()))); m_part->write(""); //print net worth - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); m_part->write(""); - m_part->write(QString("%1%2").arg(i18n("Net Worth")).arg(showColoredAmount(amountNetWorth, netWorth.isNegative() ))); + m_part->write(TQString("%1%2").tqarg(i18n("Net Worth")).tqarg(showColoredAmount(amountNetWorth, netWorth.isNegative() ))); m_part->write(""); m_part->write(""); @@ -1392,19 +1392,19 @@ void KHomeView::showBudget(void) m_part->write(i18n("Difference")); m_part->write(""); - m_part->write(QString("")); + m_part->write(TQString("")); MyMoneyMoney totalBudgetValue = grid.m_total[eBudget].m_total; MyMoneyMoney totalActualValue = grid.m_total[eActual].m_total; MyMoneyMoney totalBudgetDiffValue = grid.m_total[eBudgetDiff].m_total; - QString totalBudgetAmount = totalBudgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString totalActualAmount = totalActualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString totalBudgetDiffAmount = totalBudgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalBudgetAmount = totalBudgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalActualAmount = totalActualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalBudgetDiffAmount = totalBudgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - m_part->write(QString("%1").arg(showColoredAmount(totalBudgetAmount, totalBudgetValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(totalActualAmount, totalActualValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(totalBudgetDiffAmount, totalBudgetDiffValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalBudgetAmount, totalBudgetValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalActualAmount, totalActualValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalBudgetDiffAmount, totalBudgetDiffValue.isNegative()))); m_part->write(""); m_part->write(""); @@ -1448,10 +1448,10 @@ void KHomeView::showBudget(void) //write the outergroup if it is the first row of outergroup being shown if(i == 0) { m_part->write(""); - m_part->write(QString("%1").arg(KMyMoneyUtils::accountTypeToString( rowname.accountType()))); + m_part->write(TQString("%1").tqarg(KMyMoneyUtils::accountTypeToString( rowname.accountType()))); m_part->write(""); } - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //get values from grid MyMoneyMoney actualValue = it_row.data()[eActual][1]; @@ -1459,17 +1459,17 @@ void KHomeView::showBudget(void) MyMoneyMoney budgetDiffValue = it_row.data()[eBudgetDiff][1]; //format amounts - QString actualAmount = actualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString budgetAmount = budgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString budgetDiffAmount = budgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString actualAmount = actualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString budgetAmount = budgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString budgetDiffAmount = budgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); //account name - m_part->write(QString("") + link(VIEW_LEDGER, QString("?id=%1").arg(rowname.id())) + rowname.name() + linkend() + ""); + m_part->write(TQString("") + link(VIEW_LEDGER, TQString("?id=%1").tqarg(rowname.id())) + rowname.name() + linkend() + ""); //show amounts - m_part->write(QString("%1").arg(showColoredAmount(budgetAmount, budgetValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(actualAmount, actualValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(budgetDiffAmount, budgetDiffValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(budgetAmount, budgetValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(actualAmount, actualValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(budgetDiffAmount, budgetDiffValue.isNegative()))); m_part->write(""); } ++it_row; @@ -1481,19 +1481,19 @@ void KHomeView::showBudget(void) //if no negative differences are found, then inform that if(i == 0) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); - m_part->write(QString("%1").arg(i18n("No Budget Categories have been overrun"))); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("%1").tqarg(i18n("No Budget Categories have been overrun"))); m_part->write(""); } m_part->write("
"); } } -QString KHomeView::showColoredAmount(const QString& amount, bool isNegative) +TQString KHomeView::showColoredAmount(const TQString& amount, bool isNegative) { if(isNegative) { //if negative, get the settings for negative numbers - return QString("%2").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name(), amount); + return TQString("%2").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name(), amount); } //if positive, return the same string @@ -1516,18 +1516,18 @@ void KHomeView::doForecast(void) m_forecast.doForecast(); } -MyMoneyMoney KHomeView::forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, QDate& paymentDate) +MyMoneyMoney KHomeView::forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, TQDate& paymentDate) { - //if paymentDate before or equal to currentDate set it to current date plus 1 + //if paymentDate before or equal to tqcurrentDate set it to current date plus 1 //so we get to accumulate forecast balance correctly - if(paymentDate <= QDate::currentDate()) - paymentDate = QDate::currentDate().addDays(1); + if(paymentDate <= TQDate::tqcurrentDate()) + paymentDate = TQDate::tqcurrentDate().addDays(1); //check if the account is already there - if(m_accountList.find(acc.id()) == m_accountList.end() - || m_accountList[acc.id()].find(paymentDate) == m_accountList[acc.id()].end()) + if(m_accountList.tqfind(acc.id()) == m_accountList.end() + || m_accountList[acc.id()].tqfind(paymentDate) == m_accountList[acc.id()].end()) { - if(paymentDate == QDate::currentDate()) { + if(paymentDate == TQDate::tqcurrentDate()) { m_accountList[acc.id()][paymentDate] = m_forecast.forecastBalance(acc, paymentDate); } else { m_accountList[acc.id()][paymentDate] = m_forecast.forecastBalance(acc, paymentDate.addDays(-1)); @@ -1547,25 +1547,25 @@ void KHomeView::showCashFlowSummary() int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction()); //set start and end of month dates - QDate startOfMonth = QDate(QDate::currentDate().year(), QDate::currentDate().month(), 1); - QDate endOfMonth = QDate(QDate::currentDate().year(), QDate::currentDate().month(), QDate::currentDate().daysInMonth()); + TQDate startOfMonth = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), 1); + TQDate endOfMonth = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), TQDate::tqcurrentDate().daysInMonth()); //Add total income and expenses for this month //get transactions for current month filter.setDateFilter(startOfMonth, endOfMonth); filter.setReportAllSplits(false); - QValueList transactions = file->transactionList(filter); + TQValueList transactions = file->transactionList(filter); //if no transaction then skip and print total in zero if(transactions.size() > 0) { - QValueList::const_iterator it_transaction; + TQValueList::const_iterator it_transaction; //get all transactions for this month for(it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction ) { //get the splits for each transaction - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator it_split; for(it_split = splits.begin(); it_split != splits.end(); ++it_split) { if(!(*it_split).shares().isZero()) { ReportAccount repSplitAcc = ReportAccount((*it_split).accountId()); @@ -1596,10 +1596,10 @@ void KHomeView::showCashFlowSummary() } //format income and expenses - QString amountIncome = incomeValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountExpense = expenseValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountIncome.replace(" "," "); - amountExpense.replace(" "," "); + TQString amountIncome = incomeValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountExpense = expenseValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountIncome.tqreplace(" "," "); + amountExpense.tqreplace(" "," "); //calculate schedules @@ -1610,14 +1610,14 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney scheduledOtherTransfer; //get overdues and schedules until the end of this month - QValueList schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, + TQValueList schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), endOfMonth); //Remove the finished schedules - QValueList::Iterator finished_it; + TQValueList::Iterator finished_it; for (finished_it=schedule.begin(); finished_it!=schedule.end();) { if ((*finished_it).isFinished()) { finished_it = schedule.remove(finished_it); @@ -1627,9 +1627,9 @@ void KHomeView::showCashFlowSummary() } //add income and expenses - QValueList::Iterator sched_it; + TQValueList::Iterator sched_it; for (sched_it=schedule.begin(); sched_it!=schedule.end();) { - QDate nextDate = (*sched_it).nextDueDate(); + TQDate nextDate = (*sched_it).nextDueDate(); int cnt = 0; while(nextDate.isValid() && nextDate <= endOfMonth) { @@ -1650,18 +1650,18 @@ void KHomeView::showCashFlowSummary() // take care of the autoCalc stuff if((*sched_it).type() == MyMoneySchedule::TYPE_LOANPAYMENT) { - QDate nextDate = (*sched_it).nextPayment((*sched_it).lastPayment()); + TQDate nextDate = (*sched_it).nextPayment((*sched_it).lastPayment()); //make sure we have all 'starting balances' so that the autocalc works - QValueList::const_iterator it_s; - QMap balanceMap; + TQValueList::const_iterator it_s; + TQMap balanceMap; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s ) { MyMoneyAccount acc = file->account((*it_s).accountId()); // collect all overdues on the first day - QDate schedDate = nextDate; - if(QDate::currentDate() >= nextDate) - schedDate = QDate::currentDate().addDays(1); + TQDate schedDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + schedDate = TQDate::tqcurrentDate().addDays(1); balanceMap[acc.id()] += file->balance(acc.id()); } @@ -1669,8 +1669,8 @@ void KHomeView::showCashFlowSummary() } //go through the splits and assign to liquid or other transfers - const QValueList splits = transaction.splits(); - QValueList::const_iterator split_it; + const TQValueList splits = transaction.splits(); + TQValueList::const_iterator split_it; for (split_it = splits.begin(); split_it != splits.end(); ++split_it) { if( (*split_it).accountId() != acc.id() ) { ReportAccount repSplitAcc = ReportAccount((*split_it).accountId()); @@ -1680,7 +1680,7 @@ void KHomeView::showCashFlowSummary() //convert to foreign currency if needed if(repSplitAcc.currencyId() != file->baseCurrency().id()) { - MyMoneyMoney curPrice = repSplitAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repSplitAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); value = value * curPrice; value = value.convert(10000); } @@ -1707,19 +1707,19 @@ void KHomeView::showCashFlowSummary() } //format the currency strings - QString amountScheduledIncome = scheduledIncome.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledExpense = scheduledExpense.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledLiquidTransfer = scheduledLiquidTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledOtherTransfer = scheduledOtherTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledIncome = scheduledIncome.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledExpense = scheduledExpense.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledLiquidTransfer = scheduledLiquidTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledOtherTransfer = scheduledOtherTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountScheduledIncome.replace(" "," "); - amountScheduledExpense.replace(" "," "); - amountScheduledLiquidTransfer.replace(" "," "); - amountScheduledOtherTransfer.replace(" "," "); + amountScheduledIncome.tqreplace(" "," "); + amountScheduledExpense.tqreplace(" "," "); + amountScheduledLiquidTransfer.tqreplace(" "," "); + amountScheduledOtherTransfer.tqreplace(" "," "); //get liquid assets and liabilities - QValueList accounts; - QValueList::const_iterator account_it; + TQValueList accounts; + TQValueList::const_iterator account_it; MyMoneyMoney liquidAssets; MyMoneyMoney liquidLiabilities; @@ -1733,11 +1733,11 @@ void KHomeView::showCashFlowSummary() case MyMoneyAccount::Savings: case MyMoneyAccount::Cash: { - MyMoneyMoney value = MyMoneyFile::instance()->balance((*account_it).id(), QDate::currentDate()); + MyMoneyMoney value = MyMoneyFile::instance()->balance((*account_it).id(), TQDate::tqcurrentDate()); //calculate balance for foreign currency accounts if((*account_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*account_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; liquidAssets += baseValue; liquidAssets = liquidAssets.convert(10000); @@ -1750,11 +1750,11 @@ void KHomeView::showCashFlowSummary() case MyMoneyAccount::CreditCard: { MyMoneyMoney value; - value = MyMoneyFile::instance()->balance((*account_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*account_it).id(), TQDate::tqcurrentDate()); //calculate balance if foreign currency if((*account_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*account_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; liquidLiabilities += baseValue; liquidLiabilities = liquidLiabilities.convert(10000); @@ -1773,12 +1773,12 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney liquidWorth = liquidAssets+liquidLiabilities; //format assets, liabilities and net worth - QString amountLiquidAssets = liquidAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiquidLiabilities = liquidLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiquidWorth = liquidWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountLiquidAssets.replace(" "," "); - amountLiquidLiabilities.replace(" "," "); - amountLiquidWorth.replace(" "," "); + TQString amountLiquidAssets = liquidAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiquidLiabilities = liquidLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiquidWorth = liquidWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountLiquidAssets.tqreplace(" "," "); + amountLiquidLiabilities.tqreplace(" "," "); + amountLiquidWorth.tqreplace(" "," "); //show the summary m_part->write("
" + i18n("Cash Flow Summary") + "
\n
 
\n"); @@ -1807,19 +1807,19 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); //print current income - m_part->write(QString("%2").arg(showColoredAmount(amountIncome, incomeValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountIncome, incomeValue.isNegative()))); //print the scheduled income - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledIncome, scheduledIncome.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledIncome, scheduledIncome.isNegative()))); //print current expenses - m_part->write(QString("%2").arg(showColoredAmount(amountExpense, expenseValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpense, expenseValue.isNegative()))); //print the scheduled expenses - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledExpense, scheduledExpense.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledExpense, scheduledExpense.isNegative()))); m_part->write(""); m_part->write(""); @@ -1849,19 +1849,19 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); //print current liquid assets - m_part->write(QString("%2").arg(showColoredAmount(amountLiquidAssets, liquidAssets.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountLiquidAssets, liquidAssets.isNegative()))); //print the scheduled transfers - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledLiquidTransfer, scheduledLiquidTransfer.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledLiquidTransfer, scheduledLiquidTransfer.isNegative()))); //print current liabilities - m_part->write(QString("%2").arg(showColoredAmount(amountLiquidLiabilities, liquidLiabilities.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountLiquidLiabilities, liquidLiabilities.isNegative()))); //print the scheduled transfers - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledOtherTransfer, scheduledOtherTransfer.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledOtherTransfer, scheduledOtherTransfer.isNegative()))); m_part->write(""); @@ -1873,12 +1873,12 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney expectedAsset = liquidAssets + scheduledIncome + scheduledExpense + scheduledLiquidTransfer + scheduledOtherTransfer; MyMoneyMoney expectedLiabilities = liquidLiabilities + scheduledLiquidTransfer; - QString amountExpectedAsset = expectedAsset.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountExpectedLiabilities = expectedLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountProfit = profitValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountProfit.replace(" "," "); - amountExpectedAsset.replace(" "," "); - amountExpectedLiabilities.replace(" "," "); + TQString amountExpectedAsset = expectedAsset.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountExpectedLiabilities = expectedLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountProfit = profitValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountProfit.tqreplace(" "," "); + amountExpectedAsset.tqreplace(" "," "); + amountExpectedLiabilities.tqreplace(" "," "); @@ -1888,7 +1888,7 @@ void KHomeView::showCashFlowSummary() //income and expense title m_part->write(""); m_part->write(""); - m_part->write(i18n("Cash Flow Status")); + m_part->write(i18n("Cash Flow tqStatus")); m_part->write(""); //column titles m_part->write(""); @@ -1905,17 +1905,17 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); m_part->write(" "); //print expected assets - m_part->write(QString("%2").arg(showColoredAmount(amountExpectedAsset, expectedAsset.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpectedAsset, expectedAsset.isNegative()))); //print expected liabilities - m_part->write(QString("%2").arg(showColoredAmount(amountExpectedLiabilities, expectedLiabilities.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpectedLiabilities, expectedLiabilities.isNegative()))); //print expected profit - m_part->write(QString("%2").arg(showColoredAmount(amountProfit, profitValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountProfit, profitValue.isNegative()))); m_part->write(""); diff --git a/kmymoney2/views/khomeview.h b/kmymoney2/views/khomeview.h index 213fd91..f580ed4 100644 --- a/kmymoney2/views/khomeview.h +++ b/kmymoney2/views/khomeview.h @@ -24,9 +24,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QVBoxLayout; -class QFrame; +#include +class TQVBoxLayout; +class TQFrame; // ---------------------------------------------------------------------------- // KDE Includes @@ -51,6 +51,7 @@ class QFrame; class KHomeView : public KMyMoneyViewBase { Q_OBJECT + TQ_OBJECT public: /** * Definition of bitmap used as argument for showAccounts(). @@ -60,13 +61,13 @@ public: Payment = 2 ///< show payment accounts }; - KHomeView(QWidget *parent=0, const char *name=0); + KHomeView(TQWidget *tqparent=0, const char *name=0); ~KHomeView(); protected: void showPayments(void); void showPaymentEntry(const MyMoneySchedule&, int cnt = 1); - void showAccounts(paymentTypeE type, const QString& hdr); + void showAccounts(paymentTypeE type, const TQString& hdr); void showAccountEntry(const MyMoneyAccount&); void showFavoriteReports(void); void showForecast(void); @@ -78,8 +79,8 @@ protected: void showBudget(void); void showCashFlowSummary(void); - const QString link(const QString& view, const QString& query, const QString& title = QString()) const; - const QString linkend(void) const; + const TQString link(const TQString& view, const TQString& query, const TQString& title = TQString()) const; + const TQString linkend(void) const; void loadView(void); public slots: @@ -99,9 +100,9 @@ public slots: void slotPrintView(void); signals: - void ledgerSelected(const QString& id, const QString& transaction); - void scheduleSelected(const QString& id); - void reportSelected(const QString& id); + void ledgerSelected(const TQString& id, const TQString& transaction); + void scheduleSelected(const TQString& id); + void reportSelected(const TQString& id); private: /// \internal d-pointer class. @@ -112,7 +113,7 @@ private: /** * daily balances of an account */ - typedef QMap dailyBalances; + typedef TQMap dailyBalances; /** * Print an account and its balance and limit @@ -129,7 +130,7 @@ private: * Print text in the color set for negative numbers, if @p amount is negative * abd @p isNegative is true */ - QString showColoredAmount(const QString& amount, bool isNegative); + TQString showColoredAmount(const TQString& amount, bool isNegative); /** * Run the forecast @@ -139,11 +140,11 @@ private: /** * Calculate the forecast balance after a payment has been made */ - MyMoneyMoney forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, QDate& paymentDate); + MyMoneyMoney forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, TQDate& paymentDate); KHTMLPart* m_part; - QVBoxLayout* m_qvboxlayoutPage; - QString m_filename; + TQVBoxLayout* m_qvboxtqlayoutPage; + TQString m_filename; bool m_showAllSchedules; bool m_needReload; MyMoneyForecast m_forecast; @@ -151,7 +152,7 @@ private: /** * daily forecast balance of accounts */ - QMap m_accountList; + TQMap m_accountList; }; diff --git a/kmymoney2/views/kinstitutionsview.cpp b/kmymoney2/views/kinstitutionsview.cpp index 2c3ac5d..5fd9999 100644 --- a/kmymoney2/views/kinstitutionsview.cpp +++ b/kmymoney2/views/kinstitutionsview.cpp @@ -17,9 +17,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,19 +36,19 @@ #include "../kmymoneyglobalsettings.h" #include "../kmymoney2.h" -KInstitutionsView::KInstitutionsView(QWidget *parent, const char *name) : - KInstitutionsViewDecl(parent,name), +KInstitutionsView::KInstitutionsView(TQWidget *tqparent, const char *name) : + KInstitutionsViewDecl(tqparent,name), m_needReload(false) { m_accountTree->header()->setLabel(0, i18n("Institution/Account")); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateNetWorth(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateNetWorth(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); } KInstitutionsView::~KInstitutionsView() @@ -75,7 +75,7 @@ void KInstitutionsView::show(void) void KInstitutionsView::polish(void) { KInstitutionsViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Institution View Settings"); } @@ -90,15 +90,15 @@ void KInstitutionsView::slotLoadAccounts(void) void KInstitutionsView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load institutions view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -108,7 +108,7 @@ void KInstitutionsView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -121,25 +121,25 @@ void KInstitutionsView::loadAccounts(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList alist; + TQValueList alist; file->accountList(alist); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = alist.begin(); it_a != alist.end(); ++it_a) { m_accountMap[(*it_a).id()] = *it_a; } // we need to make sure we show stock accounts - // under the right institution (the one of the parent account) - QMap::iterator it_am; + // under the right institution (the one of the tqparent account) + TQMap::iterator it_am; for(it_am = m_accountMap.begin(); it_am != m_accountMap.end(); ++it_am) { if((*it_am).isInvest()) { - (*it_am).setInstitutionId(m_accountMap[(*it_am).parentAccountId()].institutionId()); + (*it_am).setInstitutionId(m_accountMap[(*it_am).tqparentAccountId()].institutionId()); } } - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -157,13 +157,13 @@ void KInstitutionsView::loadAccounts(void) none.setName(i18n("Accounts with no institution assigned")); KMyMoneyAccountTreeItem* noInstitutionItem = new KMyMoneyAccountTreeItem(m_accountTree, none); noInstitutionItem->setPixmap(0,none.pixmap()); - loadSubAccounts(noInstitutionItem, QString()); + loadSubAccounts(noInstitutionItem, TQString()); // hide it, if unused noInstitutionItem->setVisible(noInstitutionItem->childCount() != 0); - QValueList list = file->institutionList(); - QValueList::const_iterator it_i; + TQValueList list = file->institutionList(); + TQValueList::const_iterator it_i; for(it_i = list.begin(); it_i != list.end(); ++it_i) { KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(m_accountTree, *it_i); item->setPixmap(0, none.pixmap()); @@ -177,13 +177,13 @@ void KInstitutionsView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -194,16 +194,16 @@ void KInstitutionsView::loadAccounts(void) // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); ::timetrace("done load institutions view"); } -void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent) +void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent) { bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); - const MyMoneyAccount& account = dynamic_cast(parent->itemObject()); - QValueList::const_iterator it_a; + const MyMoneyAccount& account = dynamic_cast(tqparent->itemObject()); + TQValueList::const_iterator it_a; MyMoneyFile* file = MyMoneyFile::instance(); for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { MyMoneyAccount acc = m_accountMap[(*it_a)]; @@ -212,23 +212,23 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent) if(acc.isClosed() && !showClosedAccounts) continue; const MyMoneySecurity& security = m_securityMap[acc.currencyId()]; - QValueList prices; + TQValueList prices; prices += file->price(acc.currencyId(), security.tradingCurrency()); if(security.tradingCurrency() != file->baseCurrency().id()) { MyMoneySecurity sec = m_securityMap[security.tradingCurrency()]; prices += file->price(sec.id(), file->baseCurrency().id()); } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); } } -void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QString& institutionId) +void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQString& institutionId) { MyMoneyFile* file = MyMoneyFile::instance(); - QMap::const_iterator it_a; + TQMap::const_iterator it_a; MyMoneyMoney value; bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); @@ -244,7 +244,7 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q if(acc.institutionId() == institutionId && !acc.isInvest() && (!acc.isClosed() || showClosedAccounts)) { - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.currencyId() != file->baseCurrency().id()) { @@ -257,7 +257,7 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); @@ -276,8 +276,8 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q // it does not take the negative sign for liability accounts // into account. So we correct this here with the value we // have calculated while filling the list - parent->adjustTotalValue(-parent->totalValue()); // load a 0 - parent->adjustTotalValue(value); // now store the new value + tqparent->adjustTotalValue(-tqparent->totalValue()); // load a 0 + tqparent->adjustTotalValue(value); // now store the new value // we need to call slotUpdateNetWorth() here manually, because // KMyMoneyAccountTreeItem::adjustTotalValue() does not send out @@ -297,19 +297,19 @@ void KInstitutionsView::slotUpdateNetWorth(void) item = dynamic_cast(item->nextSibling()); } - QString s(i18n("Net Worth: ")); + TQString s(i18n("Net Worth: ")); // FIXME figure out how to deal with the approximate // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(netWorth.formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(netWorth.formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } @@ -318,14 +318,14 @@ void KInstitutionsView::slotUpdateNetWorth(void) m_totalProfitsLabel->setText(s); } -void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { Q_UNUSED(reconciliationDate); Q_UNUSED(endingBalance); // scan through the list of accounts and mark all non // expanded and re-select the one that was probably selected before - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); KMyMoneyAccountTreeItem* item; while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); @@ -337,7 +337,7 @@ void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const QD m_reconciliationAccount = acc; if(!acc.id().isEmpty()) { - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->itemObject().id() == acc.id()) { diff --git a/kmymoney2/views/kinstitutionsview.h b/kmymoney2/views/kinstitutionsview.h index 3a35713..9c1ab96 100644 --- a/kmymoney2/views/kinstitutionsview.h +++ b/kmymoney2/views/kinstitutionsview.h @@ -42,10 +42,11 @@ class KInstitutionsView : public KInstitutionsViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KInstitutionsView(QWidget *parent=0, const char *name=0); + KInstitutionsView(TQWidget *tqparent=0, const char *name=0); virtual ~KInstitutionsView(); public slots: @@ -58,22 +59,22 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); - void slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); protected: void loadAccounts(void); // load accounts that are kept at a specific institution - void loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QString& institutionId); + void loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQString& institutionId); - // load stock accounts under the investment account (parent) - void loadSubAccounts(KMyMoneyAccountTreeItem* parent); + // load stock accounts under the investment account (tqparent) + void loadSubAccounts(KMyMoneyAccountTreeItem* tqparent); protected slots: void slotUpdateNetWorth(void); @@ -85,7 +86,7 @@ private: * * @param type account type as defined in MyMoneyAccount::accountTypeE */ - const QPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; + const TQPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; signals: /** @@ -117,9 +118,9 @@ signals: private: MyMoneyAccount m_reconciliationAccount; - QMap m_accountMap; - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_accountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; /// set if a view needs to be reloaded during show() bool m_needReload; diff --git a/kmymoney2/views/kinstitutionsviewdecl.ui b/kmymoney2/views/kinstitutionsviewdecl.ui index 3a0a740..678ec08 100644 --- a/kmymoney2/views/kinstitutionsviewdecl.ui +++ b/kmymoney2/views/kinstitutionsviewdecl.ui @@ -1,6 +1,6 @@ KInstitutionsViewDecl - + KInstitutionsViewDecl @@ -27,9 +27,9 @@ false - + - layout2 + tqlayout2 @@ -45,18 +45,18 @@ Expanding - + 20 20 - + m_totalProfitsLabel - + 150 0 @@ -68,7 +68,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -78,5 +78,8 @@ - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kinvestmentlistitem.cpp b/kmymoney2/views/kinvestmentlistitem.cpp index c2c41d9..f3cf29b 100644 --- a/kmymoney2/views/kinvestmentlistitem.cpp +++ b/kmymoney2/views/kinvestmentlistitem.cpp @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,8 +40,8 @@ #include #include -KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount& account) - : KListViewItem(parent) +KInvestmentListItem::KInvestmentListItem(KListView* tqparent, const MyMoneyAccount& account) + : KListViewItem(tqparent) { bColumn5Negative = false; bColumn6Negative = false; @@ -50,7 +50,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount bColumn9Negative = false; m_account = account; - m_listView = parent; + m_listView = tqparent; MyMoneySecurity security; MyMoneyFile* file = MyMoneyFile::instance(); @@ -60,7 +60,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount int prec = MyMoneyMoney::denomToPrec(m_tradingCurrency.smallestAccountFraction()); - QValueList transactionList; + TQValueList transactionList; // FIXME PRICE // equity_price_history history = equity.priceHistory(); @@ -100,37 +100,37 @@ KInvestmentListItem::~KInvestmentListItem() // FIXME PRICE #if 0 -const QString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history) { return calculateGain(history, -7, 0, false, bColumn6Negative); } -const QString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history) { return calculateGain(history, -28, 0, false, bColumn7Negative); } -const QString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history) { return calculateGain(history, 0, -3, false, bColumn8Negative); } -const QString KInvestmentListItem::calculateYTDGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculateYTDGain(const equity_price_history& history) { return calculateGain(history, 0, 0, true, bColumn9Negative); } -const QString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative) +const TQString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative) { bNegative = false; if(history.isEmpty()) { - return QString("0.0%"); + return TQString("0.0%"); } else { bool bFoundCurrent = false, bFoundComparison = false; - QDate tempDate, comparisonDate = QDate::currentDate(); + TQDate tempDate, comparisonDate = TQDate::tqcurrentDate(); if(YTD) { @@ -147,9 +147,9 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his //find the current value, or closest to the current value. equity_price_history::ConstIterator itToday = history.end(); - for(tempDate = QDate::currentDate(); tempDate >= comparisonDate; ) + for(tempDate = TQDate::tqcurrentDate(); tempDate >= comparisonDate; ) { - itToday = history.find(tempDate); + itToday = history.tqfind(tempDate); if(itToday != history.end()) { currentValue = itToday.data(); @@ -162,14 +162,14 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his if(!bFoundCurrent) { - return QString("0.0%"); + return TQString("0.0%"); } - //find a date that is closest to a week old, not older, and not today's date. Because its a QMap, this map + //find a date that is closest to a week old, not older, and not today's date. Because its a TQMap, this map //should already be sorted earliest to latest. for(equity_price_history::ConstIterator it = history.begin(); it != history.end(); ++it) { - if(it.key() >= comparisonDate && it.key() < QDate::currentDate()) + if(it.key() >= comparisonDate && it.key() < TQDate::tqcurrentDate()) { comparisonDate = it.key(); comparisonValue = it.data(); @@ -180,7 +180,7 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his if(!bFoundComparison) { - return QString("0.0%"); + return TQString("0.0%"); } //qDebug("Current date/value to use is %s/%s, Previous is %s/%s", tempDate.toString().data(), currentValue.toString().data(), comparisonDate.toString().data(), comparisonValue.toString().data()); @@ -195,21 +195,21 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his bNegative = true; } - QString ds = QString("%1%").arg(result, 0, 'f', 3); + TQString ds = TQString("%1%").tqarg(result, 0, 'f', 3); return ds; /*MyMoneyMoney result = (currentValue / comparisonValue); result = result * 100; result = result - 100; qDebug("final result = %s", result.toString().data()); - return QString(result.formatMoney("", 3) + "%");*/ + return TQString(result.formatMoney("", 3) + "%");*/ } } - return QString(""); + return TQString(""); } #endif -int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) const +int KInvestmentListItem::compare(TQListViewItem* i, int col, bool ascending) const { KInvestmentListItem* item = dynamic_cast(i); // do special sorting only for numeric columns @@ -247,7 +247,7 @@ int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) cons return KListViewItem::compare(i, col, ascending); } -void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align) +void KInvestmentListItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align) { bool bPaintRed = false; if((column == COLUMN_RAWGAIN_INDEX && bColumn5Negative) || @@ -261,15 +261,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co p->save(); - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if(isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); #ifndef KMM_DESIGNER - QFont font = KMyMoneyGlobalSettings::listCellFont(); + TQFont font = KMyMoneyGlobalSettings::listCellFont(); // strike out closed accounts if(m_account.isClosed()) font.setStrikeOut(true); @@ -279,15 +279,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co if(bPaintRed) { - QColorGroup _cg( cg2); - QColor c = _cg.text(); - _cg.setColor(QColorGroup::Text, Qt::red); - QListViewItem::paintCell(p, _cg, column, width, align); - _cg.setColor(QColorGroup::Text, c); + TQColorGroup _cg( cg2); + TQColor c = _cg.text(); + _cg.setColor(TQColorGroup::Text, TQt::red); + TQListViewItem::paintCell(p, _cg, column, width, align); + _cg.setColor(TQColorGroup::Text, c); } else { - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } p->restore(); diff --git a/kmymoney2/views/kinvestmentlistitem.h b/kmymoney2/views/kinvestmentlistitem.h index d0ad62b..cb0d944 100644 --- a/kmymoney2/views/kinvestmentlistitem.h +++ b/kmymoney2/views/kinvestmentlistitem.h @@ -59,30 +59,30 @@ class KInvestmentListItem : public KListViewItem { public: - KInvestmentListItem(KListView* parent, const MyMoneyAccount& security); + KInvestmentListItem(KListView* tqparent, const MyMoneyAccount& security); ~KInvestmentListItem(); - QString securityId() const { return m_account.currencyId(); }; + TQString securityId() const { return m_account.currencyId(); }; const MyMoneyAccount& account(void) const { return m_account; }; const MyMoneySecurity tradingCurrency(void) const { return m_tradingCurrency; }; /** * Helper method to show the right order */ - int compare(QListViewItem* i, int col, bool ascending) const; + int compare(TQListViewItem* i, int col, bool ascending) const; protected: - void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align); private: // FIXME PRICE #if 0 - const QString calculate1WeekGain(const equity_price_history& history); - const QString calculate4WeekGain(const equity_price_history& history); - const QString calculate3MonthGain(const equity_price_history& history); - const QString calculateYTDGain(const equity_price_history& history); - const QString calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative); + const TQString calculate1WeekGain(const equity_price_history& history); + const TQString calculate4WeekGain(const equity_price_history& history); + const TQString calculate3MonthGain(const equity_price_history& history); + const TQString calculateYTDGain(const equity_price_history& history); + const TQString calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative); #endif private: diff --git a/kmymoney2/views/kinvestmentview.cpp b/kmymoney2/views/kinvestmentview.cpp index ae8cc11..d6ebb1a 100644 --- a/kmymoney2/views/kinvestmentview.cpp +++ b/kmymoney2/views/kinvestmentview.cpp @@ -62,8 +62,8 @@ public: -KInvestmentView::KInvestmentView(QWidget *parent, const char *name) : - KInvestmentViewDecl(parent,name), +KInvestmentView::KInvestmentView(TQWidget *tqparent, const char *name) : + KInvestmentViewDecl(tqparent,name), d(new Private) { m_table->setRootIsDecorated(false); @@ -72,31 +72,31 @@ KInvestmentView::KInvestmentView(QWidget *parent, const char *name) : m_table->addColumn(i18n("Symbol")); int col = m_table->addColumn(i18n("Value")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); col = m_table->addColumn(i18n("Quantity")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); col = m_table->addColumn(i18n("Price")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); m_table->setMultiSelection(false); - m_table->setColumnWidthMode(0, QListView::Maximum); + m_table->setColumnWidthMode(0, TQListView::Maximum); m_table->header()->setResizeEnabled(true); m_table->setAllColumnsShowFocus(true); m_table->setShowSortIndicator(true); m_table->restoreLayout(KGlobal::config(), "Investment Settings"); - connect(m_table, SIGNAL(contextMenu(KListView*, QListViewItem* , const QPoint&)), - this, SLOT(slotListContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(m_table, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(slotSelectionChanged(QListViewItem *))); + connect(m_table, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem* , const TQPoint&)), + this, TQT_SLOT(slotListContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(m_table, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem *))); - connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), - this, SLOT(slotSelectAccount(const QString&))); + connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), + this, TQT_SLOT(slotSelectAccount(const TQString&))); - connect(m_table, SIGNAL(doubleClicked(QListViewItem*,const QPoint&, int)), kmymoney2->action("investment_edit"), SLOT(activate())); + connect(m_table, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&, int)), kmymoney2->action("investment_edit"), TQT_SLOT(activate())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView())); } KInvestmentView::~KInvestmentView() @@ -105,7 +105,7 @@ KInvestmentView::~KInvestmentView() delete d; } -void KInvestmentView::slotSelectionChanged(QListViewItem *item) +void KInvestmentView::slotSelectionChanged(TQListViewItem *item) { kmymoney2->slotSelectInvestment(); @@ -121,7 +121,7 @@ void KInvestmentView::slotSelectionChanged(QListViewItem *item) } } -void KInvestmentView::slotListContextMenu(KListView* /* lv */, QListViewItem* /*item*/, const QPoint& /*point*/) +void KInvestmentView::slotListContextMenu(KListView* /* lv */, TQListViewItem* /*item*/, const TQPoint& /*point*/) { kmymoney2->slotSelectInvestment(); KInvestmentListItem *pItem = dynamic_cast(m_table->selectedItem()); @@ -160,9 +160,9 @@ void KInvestmentView::loadAccounts(void) m_accountComboBox->loadList(MyMoneyAccount::Investment); if(d->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.accountType() == MyMoneyAccount::Investment) { @@ -205,7 +205,7 @@ bool KInvestmentView::slotSelectAccount(const MyMoneyObject& obj) return rc; } -bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transactionId, const bool /* reconciliation*/) +bool KInvestmentView::slotSelectAccount(const TQString& id, const TQString& transactionId, const bool /* reconciliation*/) { bool rc = true; @@ -215,9 +215,9 @@ bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transa try { d->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(d->m_account.isInvest()) { - d->m_account = MyMoneyFile::instance()->account(d->m_account.parentAccountId()); + d->m_account = MyMoneyFile::instance()->account(d->m_account.tqparentAccountId()); } // TODO if we don't have an investment account, then we should switch to the ledger view d->m_newAccountLoaded = true; @@ -246,8 +246,8 @@ bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transa void KInvestmentView::clear(void) { // setup header font - QFont font = KMyMoneyGlobalSettings::listHeaderFont(); - QFontMetrics fm( font ); + TQFont font = KMyMoneyGlobalSettings::listHeaderFont(); + TQFontMetrics fm( font ); int height = fm.lineSpacing()+6; m_table->header()->setMinimumHeight(height); m_table->header()->setMaximumHeight(height); @@ -261,7 +261,7 @@ void KInvestmentView::clear(void) m_table->clear(); // and the selected account in the combo box - m_accountComboBox->setSelected(QString()); + m_accountComboBox->setSelected(TQString()); } void KInvestmentView::loadView(void) @@ -287,9 +287,9 @@ void KInvestmentView::loadView(void) || !KMyMoneyGlobalSettings::hideClosedAccounts(); try { d->m_account = file->account(d->m_account.id()); - QStringList securities = d->m_account.accountList(); + TQStringList securities = d->m_account.accountList(); - for(QStringList::ConstIterator it = securities.begin(); it != securities.end(); ++it) { + for(TQStringList::ConstIterator it = securities.begin(); it != securities.end(); ++it) { MyMoneyAccount acc = file->account(*it); if(!acc.isClosed() || showClosedAccounts) new KInvestmentListItem(m_table, acc); diff --git a/kmymoney2/views/kinvestmentview.h b/kmymoney2/views/kinvestmentview.h index ba0aecc..98e2b9a 100644 --- a/kmymoney2/views/kinvestmentview.h +++ b/kmymoney2/views/kinvestmentview.h @@ -47,9 +47,10 @@ class MyMoneyInvestTransaction; class KInvestmentView : public KInvestmentViewDecl { Q_OBJECT + TQ_OBJECT public: - KInvestmentView(QWidget *parent=0, const char *name=0); + KInvestmentView(TQWidget *tqparent=0, const char *name=0); ~KInvestmentView(); /** @@ -79,7 +80,7 @@ public slots: * @retval true selection of account referenced by @p id succeeded * @retval false selection of account failed */ - bool slotSelectAccount(const QString& accountId, const QString& transactionId = QString(), const bool reconciliation = false); + bool slotSelectAccount(const TQString& accountId, const TQString& transactionId = TQString(), const bool reconciliation = false); /** * This method is provided for convenience and acts as the method above. @@ -110,9 +111,9 @@ protected slots: * This slot receives the signal from the listview @c lv control that the context menu * was requested for @c item at @c point. */ - void slotListContextMenu(KListView* lv, QListViewItem* item, const QPoint& point); + void slotListContextMenu(KListView* lv, TQListViewItem* item, const TQPoint& point); - void slotSelectionChanged(QListViewItem *item); + void slotSelectionChanged(TQListViewItem *item); signals: @@ -120,7 +121,7 @@ signals: * This signal is emitted, if an account has been selected * which cannot handled by this view. */ - void accountSelected(const QString& accountId, const QString& transactionId); + void accountSelected(const TQString& accountId, const TQString& transactionId); void accountSelected(const MyMoneyObject&); diff --git a/kmymoney2/views/kinvestmentviewdecl.ui b/kmymoney2/views/kinvestmentviewdecl.ui index 1c74d50..d339bbf 100644 --- a/kmymoney2/views/kinvestmentviewdecl.ui +++ b/kmymoney2/views/kinvestmentviewdecl.ui @@ -1,6 +1,6 @@ KInvestmentViewDecl - + KInvestmentViewDecl @@ -22,15 +22,15 @@ 0 - + - layout2 + tqlayout2 unnamed - + textLabel1 @@ -53,7 +53,7 @@ Expanding - + 280 20 @@ -79,5 +79,8 @@ - + + kmymoney/kmymoneyaccountcombo.h + + diff --git a/kmymoney2/views/kmymoneyfile.cpp b/kmymoney2/views/kmymoneyfile.cpp index 4046cc0..76d3ea1 100644 --- a/kmymoney2/views/kmymoneyfile.cpp +++ b/kmymoney2/views/kmymoneyfile.cpp @@ -39,7 +39,7 @@ KMyMoneyFile::KMyMoneyFile() } /* -KMyMoneyFile::KMyMoneyFile(const QString&) +KMyMoneyFile::KMyMoneyFile(const TQString&) { } */ diff --git a/kmymoney2/views/kmymoneyfile.h b/kmymoney2/views/kmymoneyfile.h index ccda128..d7675c0 100644 --- a/kmymoney2/views/kmymoneyfile.h +++ b/kmymoney2/views/kmymoneyfile.h @@ -42,7 +42,7 @@ private: bool m_open; protected: - // KMyMoneyFile(const QString&); + // KMyMoneyFile(const TQString&); public: KMyMoneyFile(); diff --git a/kmymoney2/views/kmymoneytransaction.cpp b/kmymoney2/views/kmymoneytransaction.cpp index ee16a6a..373c55e 100644 --- a/kmymoney2/views/kmymoneytransaction.cpp +++ b/kmymoney2/views/kmymoneytransaction.cpp @@ -45,7 +45,7 @@ KMyMoneyTransaction::~KMyMoneyTransaction() { } -void KMyMoneyTransaction::setSplitId(const QString& id) +void KMyMoneyTransaction::setSplitId(const TQString& id) { m_splitId = id; } diff --git a/kmymoney2/views/kmymoneytransaction.h b/kmymoney2/views/kmymoneytransaction.h index 4deb184..f15f204 100644 --- a/kmymoney2/views/kmymoneytransaction.h +++ b/kmymoney2/views/kmymoneytransaction.h @@ -50,11 +50,11 @@ public: KMyMoneyTransaction(const MyMoneyTransaction& t); ~KMyMoneyTransaction(); - void setSplitId(const QString& id); - const QString& splitId(void) const { return m_splitId; }; + void setSplitId(const TQString& id); + const TQString& splitId(void) const { return m_splitId; }; private: - QString m_splitId; + TQString m_splitId; }; diff --git a/kmymoney2/views/kmymoneyview.cpp b/kmymoney2/views/kmymoneyview.cpp index 8719d79..bf1b5cc 100644 --- a/kmymoney2/views/kmymoneyview.cpp +++ b/kmymoney2/views/kmymoneyview.cpp @@ -25,17 +25,17 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -120,15 +120,15 @@ #define RECOVER_KEY_ID "0xD2B08440" -KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) - : KJanusWidget(parent, name, KJanusWidget::IconList), +KMyMoneyView::KMyMoneyView(TQWidget *tqparent, const char *name) + : KJanusWidget(tqparent, name, KJanusWidget::IconList), // m_bankRightClick(false), m_inConstructor(true), m_fileOpen(false), m_fmode(0600) { // the global variable kmymoney2 is not yet assigned. So we construct it here - QObject* kmymoney2 = parent->parent(); + TQObject* kmymoney2 = tqparent->tqparent(); const int iconSize = (KMyMoneyGlobalSettings::iconSize()+1)*16; newStorage(); @@ -137,100 +137,100 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) DesktopIcon("home", iconSize)); m_homeView = new KHomeView(m_homeViewFrame, "HomeView"); - connect(m_homeView, SIGNAL(ledgerSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); - connect(m_homeView, SIGNAL(scheduleSelected(const QString&)), - this, SLOT(slotScheduleSelected(const QString&))); - connect(m_homeView, SIGNAL(reportSelected(const QString&)), - this, SLOT(slotShowReport(const QString&))); + connect(m_homeView, TQT_SIGNAL(ledgerSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); + connect(m_homeView, TQT_SIGNAL(scheduleSelected(const TQString&)), + this, TQT_SLOT(slotScheduleSelected(const TQString&))); + connect(m_homeView, TQT_SIGNAL(reportSelected(const TQString&)), + this, TQT_SLOT(slotShowReport(const TQString&))); // Page 1 m_institutionsViewFrame = addVBoxPage( i18n("Institutions"), i18n("Institutions"), DesktopIcon("institutions", iconSize)); addTitleBar(m_institutionsViewFrame, i18n("Institutions")); m_institutionsView = new KInstitutionsView(m_institutionsViewFrame, "InstitutionsView"); - connect(m_institutionsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowInstitutionContextMenu(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotInstitutionEdit(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyInstitution&))); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_institutionsView, SLOT(slotReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); + connect(m_institutionsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowInstitutionContextMenu(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotInstitutionEdit(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyInstitution&))); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_institutionsView, TQT_SLOT(slotReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); // Page 2 m_accountsViewFrame = addVBoxPage( i18n("Accounts"), i18n("Accounts"), DesktopIcon("accounts", iconSize)); addTitleBar(m_accountsViewFrame, i18n("Accounts")); m_accountsView = new KAccountsView(m_accountsViewFrame, "AccountsView"); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInvestment(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(this, SIGNAL(kmmFilePlugin(unsigned int)), m_accountsView, SLOT(slotUpdateIconPos(unsigned int))); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_accountsView, SLOT(slotReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInvestment(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(this, TQT_SIGNAL(kmmFilePlugin(unsigned int)), m_accountsView, TQT_SLOT(slotUpdateIconPos(unsigned int))); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_accountsView, TQT_SLOT(slotReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); // Page 3 m_scheduleViewFrame = addVBoxPage( i18n("Scheduled\ntransactions"), i18n("Bills & Reminders"), DesktopIcon("schedule", iconSize)); addTitleBar(m_scheduleViewFrame, i18n("Scheduled transactions")); m_scheduledView = new KScheduledView(m_scheduleViewFrame, "ScheduledView"); - connect(kmymoney2, SIGNAL(fileLoaded(const KURL&)), m_scheduledView, SLOT(slotReloadView())); - connect(m_scheduledView, SIGNAL(scheduleSelected(const MyMoneySchedule&)), kmymoney2, SLOT(slotSelectSchedule(const MyMoneySchedule&))); - connect(m_scheduledView, SIGNAL(openContextMenu()), kmymoney2, SLOT(slotShowScheduleContextMenu())); - connect(m_scheduledView, SIGNAL(enterSchedule()), kmymoney2, SLOT(slotScheduleEnter())); - connect(m_scheduledView, SIGNAL(skipSchedule()), kmymoney2, SLOT(slotScheduleSkip())); - connect(m_scheduledView, SIGNAL(editSchedule()), kmymoney2, SLOT(slotScheduleEdit())); + connect(kmymoney2, TQT_SIGNAL(fileLoaded(const KURL&)), m_scheduledView, TQT_SLOT(slotReloadView())); + connect(m_scheduledView, TQT_SIGNAL(scheduleSelected(const MyMoneySchedule&)), kmymoney2, TQT_SLOT(slotSelectSchedule(const MyMoneySchedule&))); + connect(m_scheduledView, TQT_SIGNAL(openContextMenu()), kmymoney2, TQT_SLOT(slotShowScheduleContextMenu())); + connect(m_scheduledView, TQT_SIGNAL(enterSchedule()), kmymoney2, TQT_SLOT(slotScheduleEnter())); + connect(m_scheduledView, TQT_SIGNAL(skipSchedule()), kmymoney2, TQT_SLOT(slotScheduleSkip())); + connect(m_scheduledView, TQT_SIGNAL(editSchedule()), kmymoney2, TQT_SLOT(slotScheduleEdit())); // Page 4 m_categoriesViewFrame = addVBoxPage( i18n("Categories"), i18n("Categories"), DesktopIcon("categories", iconSize)); addTitleBar(m_categoriesViewFrame, i18n("Categories")); m_categoriesView = new KCategoriesView(m_categoriesViewFrame, "CategoriesView"); - connect(m_categoriesView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_categoriesView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); // Page 5 m_payeesViewFrame = addVBoxPage( i18n("Payees"), i18n("Payees"), DesktopIcon("payee", iconSize)); addTitleBar(m_payeesViewFrame, i18n("Payees")); m_payeesView = new KPayeesView(m_payeesViewFrame, "PayeesView"); - connect(kmymoney2, SIGNAL(payeeCreated(const QString&)), m_payeesView, SLOT(slotSelectPayeeAndTransaction(const QString&))); - connect(kmymoney2, SIGNAL(payeeRename()), m_payeesView, SLOT(slotStartRename())); - connect(m_payeesView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowPayeeContextMenu())); - connect(m_payeesView, SIGNAL(selectObjects(const QValueList&)), kmymoney2, SLOT(slotSelectPayees(const QValueList&))); - connect(m_payeesView, SIGNAL(transactionSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); + connect(kmymoney2, TQT_SIGNAL(payeeCreated(const TQString&)), m_payeesView, TQT_SLOT(slotSelectPayeeAndTransaction(const TQString&))); + connect(kmymoney2, TQT_SIGNAL(payeeRename()), m_payeesView, TQT_SLOT(slotStartRename())); + connect(m_payeesView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowPayeeContextMenu())); + connect(m_payeesView, TQT_SIGNAL(selectObjects(const TQValueList&)), kmymoney2, TQT_SLOT(slotSelectPayees(const TQValueList&))); + connect(m_payeesView, TQT_SIGNAL(transactionSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); // Page 6 m_ledgerViewFrame = addVBoxPage( i18n("Ledgers"), i18n("Ledgers"), DesktopIcon("ledger", iconSize)); m_ledgerView = new KGlobalLedgerView(m_ledgerViewFrame, "GlobalLedgerView"); - connect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_ledgerView, SIGNAL(openContextMenu()), kmymoney2, SLOT(slotShowTransactionContextMenu())); - connect(m_ledgerView, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), kmymoney2, SLOT(slotSelectTransactions(const KMyMoneyRegister::SelectedTransactions&))); - connect(m_ledgerView, SIGNAL(newTransaction()), kmymoney2, SLOT(slotTransactionsNew())); - connect(m_ledgerView, SIGNAL(cancelOrEndEdit(bool&)), kmymoney2, SLOT(slotTransactionsCancelOrEnter(bool&))); - connect(m_ledgerView, SIGNAL(startEdit()), kmymoney2, SLOT(slotTransactionsEdit())); - connect(m_ledgerView, SIGNAL(endEdit()), kmymoney2, SLOT(slotTransactionsEnter())); - connect(m_ledgerView, SIGNAL(toggleReconciliationFlag()), kmymoney2, SLOT(slotToggleReconciliationFlag())); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_ledgerView, SLOT(slotSetReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); - connect(kmymoney2, SIGNAL(selectAllTransactions()), m_ledgerView, SLOT(slotSelectAllTransactions())); + connect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_ledgerView, TQT_SIGNAL(openContextMenu()), kmymoney2, TQT_SLOT(slotShowTransactionContextMenu())); + connect(m_ledgerView, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), kmymoney2, TQT_SLOT(slotSelectTransactions(const KMyMoneyRegister::SelectedTransactions&))); + connect(m_ledgerView, TQT_SIGNAL(newTransaction()), kmymoney2, TQT_SLOT(slotTransactionsNew())); + connect(m_ledgerView, TQT_SIGNAL(cancelOrEndEdit(bool&)), kmymoney2, TQT_SLOT(slotTransactionsCancelOrEnter(bool&))); + connect(m_ledgerView, TQT_SIGNAL(startEdit()), kmymoney2, TQT_SLOT(slotTransactionsEdit())); + connect(m_ledgerView, TQT_SIGNAL(endEdit()), kmymoney2, TQT_SLOT(slotTransactionsEnter())); + connect(m_ledgerView, TQT_SIGNAL(toggleReconciliationFlag()), kmymoney2, TQT_SLOT(slotToggleReconciliationFlag())); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_ledgerView, TQT_SLOT(slotSetReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); + connect(kmymoney2, TQT_SIGNAL(selectAllTransactions()), m_ledgerView, TQT_SLOT(slotSelectAllTransactions())); // Page 7 m_investmentViewFrame = addVBoxPage( i18n("Investments"), i18n("Investments"), DesktopIcon("investments", iconSize)); addTitleBar(m_investmentViewFrame, i18n("Investments")); m_investmentView = new KInvestmentView(m_investmentViewFrame, "InvestmentView"); - connect(m_investmentView, SIGNAL(accountSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); - connect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_investmentView, SIGNAL(investmentRightMouseClick()), kmymoney2, SLOT(slotShowInvestmentContextMenu())); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_investmentView, TQT_SIGNAL(investmentRightMouseClick()), kmymoney2, TQT_SLOT(slotShowInvestmentContextMenu())); // Page 8 m_reportsViewFrame = addVBoxPage(i18n("Reports"), i18n("Reports"), @@ -242,10 +242,10 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) DesktopIcon("budget", iconSize)); addTitleBar(m_budgetViewFrame, i18n("Budgets")); m_budgetView = new KBudgetView(m_budgetViewFrame, "BudgetView"); - connect(kmymoney2, SIGNAL(fileLoaded(const KURL&)), m_budgetView, SLOT(slotRefreshView())); - connect(m_budgetView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowBudgetContextMenu())); - connect(m_budgetView, SIGNAL(selectObjects(const QValueList&)), kmymoney2, SLOT(slotSelectBudget(const QValueList&))); - connect(kmymoney2, SIGNAL(budgetRename()), m_budgetView, SLOT(slotStartRename())); + connect(kmymoney2, TQT_SIGNAL(fileLoaded(const KURL&)), m_budgetView, TQT_SLOT(slotRefreshView())); + connect(m_budgetView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowBudgetContextMenu())); + connect(m_budgetView, TQT_SIGNAL(selectObjects(const TQValueList&)), kmymoney2, TQT_SLOT(slotSelectBudget(const TQValueList&))); + connect(kmymoney2, TQT_SIGNAL(budgetRename()), m_budgetView, TQT_SLOT(slotStartRename())); // Page 10 m_forecastViewFrame = addVBoxPage( i18n("Forecast"), i18n("Forecast"), @@ -254,19 +254,19 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) m_forecastView = new KForecastView(m_forecastViewFrame, "ForecastView"); // get rid of the title text - QWidget* widget = dynamic_cast(child("KJanusWidgetTitleLabel", "QLabel")); + TQWidget* widget = dynamic_cast(child("KJanusWidgetTitleLabel", TQLABEL_OBJECT_NAME_STRING)); if(widget) widget->hide(); // and the separator below it - widget = dynamic_cast(child(0, "KSeparator")); + widget = dynamic_cast(child(0, "KSeparator")); if(widget) widget->hide(); // select the page first, before connecting the aboutToShow signal // because we don't want to override the information stored in the config file showPage(0); - connect(this, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT(slotRememberPage(QWidget*))); + connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), this, TQT_SLOT(slotRememberPage(TQWidget*))); m_inConstructor = false; } @@ -276,24 +276,24 @@ KMyMoneyView::~KMyMoneyView() removeStorage(); } -void KMyMoneyView::addTitleBar(QWidget* parent, const QString& title) +void KMyMoneyView::addTitleBar(TQWidget* tqparent, const TQString& title) { - KMyMoneyTitleLabel* label = new KMyMoneyTitleLabel( parent, "titleLabel" ); - label->setMinimumSize( QSize( 100, 30 ) ); + KMyMoneyTitleLabel* label = new KMyMoneyTitleLabel( tqparent, "titleLabel" ); + label->setMinimumSize( TQSize( 100, 30 ) ); label->setRightImageFile("pics/titlelabel_background.png" ); label->setText(title); } void KMyMoneyView::showTitleBar(bool show) { - QObjectList *l = queryList( 0, "titleLabel" ); - QObjectListIterator it( *l ); // iterate over the labels - QObject *obj; + TQObjectList *l = queryList( 0, "titleLabel" ); + TQObjectListIterator it( *l ); // iterate over the labels + TQObject *obj; while ( (obj = it.current()) != 0 ) { // for each found object... ++it; - ((QWidget*)obj)->setShown( show ); + ((TQWidget*)obj)->setShown( show ); } delete l; // delete the list, not the objects } @@ -337,7 +337,7 @@ bool KMyMoneyView::canPrint(void) return rc; } -bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& /* list */, QString& tooltip) const +bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& /* list */, TQString& tooltip) const { // we can only create transactions in the ledger view so // we check that this is the active page @@ -350,7 +350,7 @@ bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransac return rc; } -bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { // we can only modify transactions in the ledger view so // we check that this is the active page @@ -365,7 +365,7 @@ bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransac return rc; } -bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { // we can only duplicate transactions in the ledger view so // we check that this is the active page @@ -380,7 +380,7 @@ bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTran return rc; } -bool KMyMoneyView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { bool rc; // we can only edit transactions in the ledger view so @@ -397,7 +397,7 @@ bool KMyMoneyView::createNewTransaction(void) { bool rc = false; KMyMoneyRegister::SelectedTransactions list; - QString txt; + TQString txt; if(canCreateTransactions(list, txt)) { rc = m_ledgerView->selectEmptyTransaction(); } @@ -407,7 +407,7 @@ bool KMyMoneyView::createNewTransaction(void) TransactionEditor* KMyMoneyView::startEdit(const KMyMoneyRegister::SelectedTransactions& list) { TransactionEditor* editor = 0; - QString txt; + TQString txt; if(canEditTransactions(list, txt) || canCreateTransactions(list, txt)) { editor = m_ledgerView->startEdit(list); } @@ -451,16 +451,16 @@ void KMyMoneyView::enableViews(int state) emit viewStateChanged(state != 0); } -void KMyMoneyView::slotLedgerSelected(const QString& _accId, const QString& transaction) +void KMyMoneyView::slotLedgerSelected(const TQString& _accId, const TQString& transaction) { MyMoneyAccount acc = MyMoneyFile::instance()->account(_accId); - QString accId(_accId); + TQString accId(_accId); switch(acc.accountType()) { case MyMoneyAccount::Stock: // if a stock account is selected, we show the - // the corresponding parent (investment) account - acc = MyMoneyFile::instance()->account(acc.parentAccountId()); + // the corresponding tqparent (investment) account + acc = MyMoneyFile::instance()->account(acc.tqparentAccountId()); accId = acc.id(); // tricky fall through here @@ -492,19 +492,19 @@ void KMyMoneyView::slotLedgerSelected(const QString& _accId, const QString& tran } } -void KMyMoneyView::slotPayeeSelected(const QString& payee, const QString& account, const QString& transaction) +void KMyMoneyView::slotPayeeSelected(const TQString& payee, const TQString& account, const TQString& transaction) { showPage(pageIndex(m_payeesViewFrame)); m_payeesView->slotSelectPayeeAndTransaction(payee, account, transaction); } -void KMyMoneyView::slotScheduleSelected(const QString& scheduleId) +void KMyMoneyView::slotScheduleSelected(const TQString& scheduleId) { MyMoneySchedule sched = MyMoneyFile::instance()->schedule(scheduleId); kmymoney2->slotSelectSchedule(sched); } -void KMyMoneyView::slotShowReport(const QString& reportid) +void KMyMoneyView::slotShowReport(const TQString& reportid) { showPage(pageIndex(m_reportsViewFrame)); m_reportsView->slotOpenReport(reportid); @@ -536,7 +536,7 @@ void KMyMoneyView::closeFile(void) m_fileOpen = false; } -void KMyMoneyView::ungetString(QIODevice *qfile, char *buf, int len) +void KMyMoneyView::ungetString(TQIODevice *qfile, char *buf, int len) { buf = &buf[len-1]; while(len--) { @@ -546,7 +546,7 @@ void KMyMoneyView::ungetString(QIODevice *qfile, char *buf, int len) bool KMyMoneyView::readFile(const KURL& url) { - QString filename; + TQString filename; // newStorage(); m_fileOpen = false; @@ -583,7 +583,7 @@ bool KMyMoneyView::readFile(const KURL& url) } else { if(!KIO::NetAccess::download(url, filename, NULL)) { KMessageBox::detailedError(this, - i18n("Error while loading file '%1'!").arg(url.url()), + i18n("Error while loading file '%1'!").tqarg(url.url()), KIO::NetAccess::lastErrorString(), i18n("File access error")); return false; @@ -592,26 +592,26 @@ bool KMyMoneyView::readFile(const KURL& url) // let's glimps into the file to figure out, if it's one // of the old (uncompressed) or new (compressed) files. - QFile file(filename); - QFileInfo info(file); + TQFile file(filename); + TQFileInfo info(file); if(!info.isFile()) { - QString msg=i18n("%1 is not a KMyMoney file.").arg(filename); - KMessageBox::error(this, QString("

")+msg, i18n("Filetype Error")); + TQString msg=i18n("%1 is not a KMyMoney file.").tqarg(filename); + KMessageBox::error(this, TQString("

")+msg, i18n("Filetype Error")); return false; } m_fmode = 0600; - m_fmode |= info.permission(QFileInfo::ReadGroup) ? 040 : 0; - m_fmode |= info.permission(QFileInfo::WriteGroup) ? 020 : 0; - m_fmode |= info.permission(QFileInfo::ReadOther) ? 004 : 0; - m_fmode |= info.permission(QFileInfo::WriteOther) ? 002 : 0; + m_fmode |= info.permission(TQFileInfo::ReadGroup) ? 040 : 0; + m_fmode |= info.permission(TQFileInfo::WriteGroup) ? 020 : 0; + m_fmode |= info.permission(TQFileInfo::ReadOther) ? 004 : 0; + m_fmode |= info.permission(TQFileInfo::WriteOther) ? 002 : 0; - QIODevice *qfile = 0; + TQIODevice *qfile = 0; bool rc = true; // There's a problem with the KFilterDev and KGPGFile classes: // One supports the at(n) member but not ungetch() together with // readBlock() and the other does not provide an at(n) method but - // supports readBlock() that considers the ungetch() buffer. QFile + // supports readBlock() that considers the ungetch() buffer. TQFile // supports everything so this is not a problem. We solve the problem // for now by keeping track of which method can be used. bool haveAt = true; @@ -619,29 +619,29 @@ bool KMyMoneyView::readFile(const KURL& url) emit kmmFilePlugin (preOpen); ::timetrace("start reading file"); if(file.open(IO_ReadOnly)) { - QByteArray hdr(2); + TQByteArray hdr(2); int cnt; cnt = file.readBlock(hdr.data(), 2); file.close(); if(cnt == 2) { - if(QString(hdr) == QString("\037\213")) { // gzipped? + if(TQString(hdr) == TQString("\037\213")) { // gzipped? ::timetrace("detected GZIP"); qfile = KFilterDev::deviceForFile(filename, COMPRESSION_MIME_TYPE); - } else if(QString(hdr) == QString("--")){ // PGP ASCII armored? + } else if(TQString(hdr) == TQString("--")){ // PGP ASCII armored? ::timetrace("detected GPG"); if(KGPGFile::GPGAvailable()) { ::timetrace("have GPG"); - qfile = new KGPGFile(filename); + qfile = TQT_TQIODEVICE(new KGPGFile(filename)); haveAt = false; isEncrypted = true; } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("GPG is not available for decryption of file %1").arg(filename))); - qfile = new QFile(file.name()); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("GPG is not available for decryption of file %1").tqarg(filename))); + qfile = TQT_TQIODEVICE(new TQFile(file.name())); } } else { // we can't use file directly, as we delete qfile later on - qfile = new QFile(file.name()); + qfile = TQT_TQIODEVICE(new TQFile(file.name())); } ::timetrace("open file"); @@ -656,9 +656,9 @@ bool KMyMoneyView::readFile(const KURL& url) // Ok, we got the first block of 8 bytes. Read in the two // unsigned long int's by preserving endianess. This is - // achieved by reading them through a QDataStream object - Q_INT32 magic0, magic1; - QDataStream s(hdr, IO_ReadOnly); + // achieved by reading them through a TQDataStream object + TQ_INT32 magic0, magic1; + TQDataStream s(hdr, IO_ReadOnly); s >> magic0; s >> magic1; @@ -689,9 +689,9 @@ bool KMyMoneyView::readFile(const KURL& url) qfile->at(0); else ungetString(qfile, hdr.data(), 70); - QRegExp kmyexp(""); - QRegExp gncexp(""); + TQRegExp gncexp("%1"). arg(i18n("File %1 contains the old binary format used by KMyMoney. Please use an older version of KMyMoney (0.8.x) that still supports this format to convert it to the new XML based format.").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 contains the old binary format used by KMyMoney. Please use an older version of KMyMoney (0.8.x) that still supports this format to convert it to the new XML based format.").tqarg(filename))); } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 contains an unknown file format!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 contains an unknown file format!").tqarg(filename))); } rc = false; } } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("Cannot read from file %1!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("Cannot read from file %1!").tqarg(filename))); rc = false; } } catch (MyMoneyException *e) { - KMessageBox::sorry(this, QString("%1"). arg(i18n("Cannot load file %1. Reason: %2").arg(filename, e->what()))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("Cannot load file %1. Reason: %2").tqarg(filename, e->what()))); delete e; rc = false; } @@ -735,13 +735,13 @@ bool KMyMoneyView::readFile(const KURL& url) } qfile->close(); } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 not found!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 not found!").tqarg(filename))); rc = false; } delete qfile; } } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 not found!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 not found!").tqarg(filename))); rc = false; } @@ -775,7 +775,7 @@ bool KMyMoneyView::readFile(const KURL& url) return initializeStorage(); } -void KMyMoneyView::checkAccountName(const MyMoneyAccount& _acc, const QString& name) const +void KMyMoneyView::checkAccountName(const MyMoneyAccount& _acc, const TQString& name) const { MyMoneyFile* file = MyMoneyFile::instance(); if(_acc.name() != name) { @@ -805,7 +805,7 @@ bool KMyMoneyView::openDatabase (const KURL& url) { retry = false; break; case 1: // permanent error - KMessageBox::detailedError (this, i18n("Can't open database %1\n").arg(dbURL.prettyURL()), reader->lastError()); + KMessageBox::detailedError (this, i18n("Can't open database %1\n").tqarg(dbURL.prettyURL()), reader->lastError()); if (pDBMgr) { removeStorage(); delete pDBMgr; @@ -819,7 +819,7 @@ bool KMyMoneyView::openDatabase (const KURL& url) { } return false; } else { - QString options = dbURL.queryItem("options") + ",override"; + TQString options = dbURL.queryItem("options") + ",override"; dbURL.removeQueryItem("mode"); // now redundant dbURL.removeQueryItem("options"); dbURL.addQueryItem("options", options); @@ -911,7 +911,7 @@ bool KMyMoneyView::initializeStorage() // Check if we have to modify the file before we allow to work with it IMyMoneyStorage* s = MyMoneyFile::instance()->storage(); while (s->fileFixVersion() < s->currentFixVersion()) { - qDebug("%s", (QString("testing fileFixVersion %1 < %2").arg(s->fileFixVersion()).arg(s->currentFixVersion())).data()); + qDebug("%s", (TQString("testing fileFixVersion %1 < %2").tqarg(s->fileFixVersion()).tqarg(s->currentFixVersion())).data()); switch (s->fileFixVersion()) { case 0: fixFile_0(); @@ -967,11 +967,11 @@ bool KMyMoneyView::initializeStorage() return true; } -void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const QString& keyList) +void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const TQString& keyList) { - QIODevice *dev = qfile; + TQIODevice *dev = TQT_TQIODEVICE(qfile); KFilterBase *base = 0; - QIODevice *statusDevice = dev; + TQIODevice *statusDevice = dev; bool encryptedOk = true; bool encryptRecover = false; @@ -983,23 +983,23 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, if(KMyMoneyGlobalSettings::encryptRecover()) { encryptRecover = true; - if(!KGPGFile::keyAvailable(QString(RECOVER_KEY_ID))) { - KMessageBox::sorry(this, QString("

")+i18n("You have selected to encrypt your data also with the KMyMoney recover key, but the key with id

%1

has not been found in your keyring at this time. Please make sure to import this key into your keyring. You can find it on the KMyMoney web-site. This time your data will not be encrypted with the KMyMoney recover key.").arg(RECOVER_KEY_ID), i18n("GPG-Key not found")); + if(!KGPGFile::keyAvailable(TQString(RECOVER_KEY_ID))) { + KMessageBox::sorry(this, TQString("

")+i18n("You have selected to encrypt your data also with the KMyMoney recover key, but the key with id

%1

has not been found in your keyring at this time. Please make sure to import this key into your keyring. You can find it on the KMyMoney web-site. This time your data will not be encrypted with the KMyMoney recover key.").tqarg(RECOVER_KEY_ID), i18n("GPG-Key not found")); encryptRecover = false; } } - QStringList keys = QStringList::split(",", keyList); - QStringList::const_iterator it_s; + TQStringList keys = TQStringList::split(",", keyList); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); it_s != keys.begin(); ++it_s) { if(!KGPGFile::keyAvailable(*it_s)) { - KMessageBox::sorry(this, QString("

")+i18n("You have specified to encrypt your data for the user-id

%1.

Unfortunately, a valid key for this user-id was not found in your keyring. Please make sure to import a valid key for this user-id. This time, encryption is disabled.").arg(*it_s), i18n("GPG-Key not found")); + KMessageBox::sorry(this, TQString("

")+i18n("You have specified to encrypt your data for the user-id

%1.

Unfortunately, a valid key for this user-id was not found in your keyring. Please make sure to import a valid key for this user-id. This time, encryption is disabled.").tqarg(*it_s), i18n("GPG-Key not found")); encryptedOk = false; } } if(encryptedOk == true) { - QString msg = QString("

") + i18n("You have configured to save your data in encrypted form using GPG. Please be aware, that this is a brand new feature which is yet untested. Make sure, you have the necessary understanding that you might loose all your data if you store it encrypted and cannot decrypt it later on! If unsure, answer No."); + TQString msg = TQString("

") + i18n("You have configured to save your data in encrypted form using GPG. Please be aware, that this is a brand new feature which is yet untested. Make sure, you have the necessary understanding that you might loose all your data if you store it encrypted and cannot decrypt it later on! If unsure, answer No."); if(KMessageBox::questionYesNo(this, msg, i18n("Store GPG encrypted"), KStdGuiItem::yes(), KStdGuiItem::no(), "StoreEncrypted") == KMessageBox::No) { encryptedOk = false; @@ -1007,7 +1007,7 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, } } - int mask = umask((~m_fmode) & 0777); + int tqmask = umask((~m_fmode) & 0777); bool blocked = MyMoneyFile::instance()->signalsBlocked(); MyMoneyFile::instance()->blockSignals(true); MyMoneyFileTransaction ft; @@ -1017,8 +1017,8 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, base++; KGPGFile *kgpg = new KGPGFile(qfile->name()); if(kgpg) { - QStringList keys = QStringList::split(",", keyList); - QStringList::const_iterator it_s; + TQStringList keys = TQStringList::split(",", keyList); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); it_s != keys.end(); ++it_s) { kgpg->addRecipient((*it_s).latin1()); } @@ -1027,11 +1027,11 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, } MyMoneyFile::instance()->setValue("kmm-encryption-key", keyList); } - statusDevice = dev = kgpg; + statusDevice = dev = TQT_TQIODEVICE(kgpg); if(!dev || !dev->open(IO_WriteOnly)) { MyMoneyFile::instance()->blockSignals(blocked); delete dev; - throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").tqarg(qfile->name())); } } else if(!plaintext) { @@ -1039,26 +1039,26 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, base = KFilterBase::findFilterByMimeType( COMPRESSION_MIME_TYPE ); if(base) { qfile->close(); - base->setDevice(qfile, false); + base->setDevice(TQT_TQIODEVICE(qfile), false); // we need to reopen the file to set the mode inside the filter stuff dev = new KFilterDev(base, true); if(!dev || !dev->open(IO_WriteOnly)) { MyMoneyFile::instance()->blockSignals(blocked); delete dev; - throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").tqarg(qfile->name())); } statusDevice = base->device(); } } - umask(mask); + umask(tqmask); ft.commit(); pWriter->setProgressCallback(&KMyMoneyView::progressCallback); - dev->resetStatus(); + dev->resetqStatus(); pWriter->writeFile(dev, dynamic_cast (MyMoneyFile::instance()->storage())); MyMoneyFile::instance()->blockSignals(blocked); if(statusDevice->status() != IO_Ok) { - throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").tqarg(qfile->name())); } pWriter->setProgressCallback(0); @@ -1067,16 +1067,16 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, dev->close(); if(statusDevice->status() != IO_Ok) { delete dev; - throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").tqarg(qfile->name())); } delete dev; } else qfile->close(); } -bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) +bool KMyMoneyView::saveFile(const KURL& url, const TQString& keyList) { - QString filename = url.path(); + TQString filename = url.path(); if (!fileOpen()) { KMessageBox::error(this, i18n("Tried to access a file when it's not open")); @@ -1090,7 +1090,7 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) "If you still want to use older versions of KMyMoney with your data files, " "please make sure you keep a backup-file of your finance data. " "If you want to abort this operation, please press Cancel now"), - QString::null, KStdGuiItem::cont(), "WarningNewFileVersion0.5") == KMessageBox::Cancel) + TQString(), KStdGuiItem::cont(), "WarningNewFileVersion0.5") == KMessageBox::Cancel) return false; #endif @@ -1115,19 +1115,19 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) bool rc = true; try { if(! url.isValid()) { - throw new MYMONEYEXCEPTION(i18n("Malformed URL '%1'").arg(url.url())); + throw new MYMONEYEXCEPTION(i18n("Malformed URL '%1'").tqarg(url.url())); } if(url.isLocalFile()) { filename = url.path(); int fmode = 0600; gid_t gid = static_cast(-1); // don't change the group id (see "man 2 chown") - QFileInfo fi(filename); + TQFileInfo fi(filename); if(fi.exists()) { - fmode |= fi.permission(QFileInfo::ReadGroup) ? 040 : 0; - fmode |= fi.permission(QFileInfo::WriteGroup) ? 020 : 0; - fmode |= fi.permission(QFileInfo::ReadOther) ? 004 : 0; - fmode |= fi.permission(QFileInfo::WriteOther) ? 002 : 0; + fmode |= fi.permission(TQFileInfo::ReadGroup) ? 040 : 0; + fmode |= fi.permission(TQFileInfo::WriteGroup) ? 020 : 0; + fmode |= fi.permission(TQFileInfo::ReadOther) ? 004 : 0; + fmode |= fi.permission(TQFileInfo::WriteOther) ? 002 : 0; if(fi.groupId() != static_cast(-2)) gid = fi.groupId(); } @@ -1135,19 +1135,19 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) // create a new basic block here, so that the object qfile gets // deleted, before we reach the chown() call { - int mask = umask((~fmode) & 0777); + int tqmask = umask((~fmode) & 0777); KSaveFile qfile(filename, fmode); - umask(mask); + umask(tqmask); if(qfile.status() == 0) { try { saveToLocalFile(qfile.file(), pWriter, plaintext, keyList); } catch (MyMoneyException* e) { qfile.abort(); delete e; - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } else { - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } chown(filename, static_cast(-1), gid); @@ -1155,7 +1155,7 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) KTempFile tmpfile; saveToLocalFile(tmpfile.file(), pWriter, plaintext, keyList); if(!KIO::NetAccess::upload(tmpfile.name(), url, NULL)) - throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").arg(url.url())); + throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").tqarg(url.url())); tmpfile.unlink(); } m_fileType = KmmXML; @@ -1210,7 +1210,7 @@ bool KMyMoneyView::saveAsDatabase(const KURL& url) KMessageBox::detailedError (this, i18n("Can't open or create database %1\n" "Retry SaveAsDatabase and click Help" - " for further info").arg(url.prettyURL()), writer->lastError()); + " for further info").tqarg(url.prettyURL()), writer->lastError()); } delete writer; return (rc); @@ -1224,7 +1224,7 @@ bool KMyMoneyView::dirty(void) return MyMoneyFile::instance()->dirty(); } -bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { bool ok = true; @@ -1249,7 +1249,7 @@ bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const QDat void KMyMoneyView::finishReconciliation(const MyMoneyAccount& /* account */) { - emit reconciliationStarts(MyMoneyAccount(), QDate(), MyMoneyMoney()); + emit reconciliationStarts(MyMoneyAccount(), TQDate(), MyMoneyMoney()); } void KMyMoneyView::newFile(void) @@ -1268,7 +1268,7 @@ void KMyMoneyView::slotSetBaseCurrency(const MyMoneySecurity& baseCurrency) MyMoneyFile::instance()->setBaseCurrency(baseCurrency); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").arg(baseCurrency.name()).arg(e->what()), i18n("Set base currency")); + KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").tqarg(baseCurrency.name()).tqarg(e->what()), i18n("Set base currency")); delete e; } } @@ -1282,15 +1282,15 @@ void KMyMoneyView::selectBaseCurrency(void) // check if we have a base currency. If not, we need to select one if(file->baseCurrency().id().isEmpty()) { KCurrencyEditDlg dlg(this, "CurrencyEditDlg"); - connect(&dlg, SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), this, SLOT(slotSetBaseCurrency(const MyMoneySecurity&))); + connect(&dlg, TQT_SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), this, TQT_SLOT(slotSetBaseCurrency(const MyMoneySecurity&))); dlg.exec(); } if(!file->baseCurrency().id().isEmpty()) { // check that all accounts have a currency - QValueList list; + TQValueList list; file->accountList(list); - QValueList::Iterator it; + TQValueList::Iterator it; // don't forget those standard accounts list << file->asset(); @@ -1370,7 +1370,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("BAM", i18n("Bosnian Convertible Mark")), create); loadDefaultCurrency(MyMoneySecurity("BWP", i18n("Botswana Pula")), create); loadDefaultCurrency(MyMoneySecurity("BRL", i18n("Brazilian Real"), "R$"), create); - loadDefaultCurrency(MyMoneySecurity("GBP", i18n("British Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("GBP", i18n("British Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("BND", i18n("Brunei Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("BGL", i18n("Bulgarian Lev")), create); loadDefaultCurrency(MyMoneySecurity("BIF", i18n("Burundi Franc")), create); @@ -1385,7 +1385,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("CNY", i18n("Chinese Yuan Renminbi")), create); loadDefaultCurrency(MyMoneySecurity("COP", i18n("Colombian Peso")), create); loadDefaultCurrency(MyMoneySecurity("KMF", i18n("Comoros Franc")), create); - loadDefaultCurrency(MyMoneySecurity("CRC", i18n("Costa Rican Colon"), QChar(0x20A1)), create); + loadDefaultCurrency(MyMoneySecurity("CRC", i18n("Costa Rican Colon"), TQChar(0x20A1)), create); loadDefaultCurrency(MyMoneySecurity("HRK", i18n("Croatian Kuna")), create); loadDefaultCurrency(MyMoneySecurity("CUP", i18n("Cuban Peso")), create); loadDefaultCurrency(MyMoneySecurity("CZK", i18n("Czech Koruna")), create); @@ -1393,18 +1393,18 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("DJF", i18n("Djibouti Franc")), create); loadDefaultCurrency(MyMoneySecurity("DOP", i18n("Dominican Peso")), create); loadDefaultCurrency(MyMoneySecurity("XCD", i18n("East Caribbean Dollar"), "$"), create); - loadDefaultCurrency(MyMoneySecurity("EGP", i18n("Egyptian Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("EGP", i18n("Egyptian Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("SVC", i18n("El Salvador Colon")), create); loadDefaultCurrency(MyMoneySecurity("ERN", i18n("Eritrean Nakfa")), create); loadDefaultCurrency(MyMoneySecurity("EEK", i18n("Estonian Kroon")), create); loadDefaultCurrency(MyMoneySecurity("ETB", i18n("Ethiopian Birr")), create); - loadDefaultCurrency(MyMoneySecurity("EUR", i18n("Euro"), QChar(0x20ac)), true); - loadDefaultCurrency(MyMoneySecurity("FKP", i18n("Falkland Islands Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("EUR", i18n("Euro"), TQChar(0x20ac)), true); + loadDefaultCurrency(MyMoneySecurity("FKP", i18n("Falkland Islands Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("FJD", i18n("Fiji Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("GMD", i18n("Gambian Dalasi")), create); loadDefaultCurrency(MyMoneySecurity("GEL", i18n("Georgian Lari")), create); loadDefaultCurrency(MyMoneySecurity("GHC", i18n("Ghanaian Cedi")), create); - loadDefaultCurrency(MyMoneySecurity("GIP", i18n("Gibraltar Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("GIP", i18n("Gibraltar Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("GTQ", i18n("Guatemalan Quetzal")), create); loadDefaultCurrency(MyMoneySecurity("GWP", i18n("Guinea-Bissau Peso")), create); loadDefaultCurrency(MyMoneySecurity("GYD", i18n("Guyanan Dollar"), "$"), create); @@ -1413,21 +1413,21 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("HKD", i18n("Hong Kong Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("HUF", i18n("Hungarian Forint"), "HUF", 1, 1, 100), create); loadDefaultCurrency(MyMoneySecurity("ISK", i18n("Iceland Krona")), create); - loadDefaultCurrency(MyMoneySecurity("INR", i18n("Indian Rupee"), QChar(0x20A8)), create); + loadDefaultCurrency(MyMoneySecurity("INR", i18n("Indian Rupee"), TQChar(0x20A8)), create); loadDefaultCurrency(MyMoneySecurity("IDR", i18n("Indonesian Rupiah"), "IDR", 100, 1), create); loadDefaultCurrency(MyMoneySecurity("IRR", i18n("Iranian Rial"), "IRR", 1, 1), create); loadDefaultCurrency(MyMoneySecurity("IQD", i18n("Iraqi Dinar"), "IQD", 1000, 1000), create); - loadDefaultCurrency(MyMoneySecurity("ILS", i18n("Israeli New Shekel"), QChar(0x20AA)), create); + loadDefaultCurrency(MyMoneySecurity("ILS", i18n("Israeli New Shekel"), TQChar(0x20AA)), create); loadDefaultCurrency(MyMoneySecurity("JMD", i18n("Jamaican Dollar"), "$"), create); - loadDefaultCurrency(MyMoneySecurity("JPY", i18n("Japanese Yen"), QChar(0x00A5), 100, 1), create); + loadDefaultCurrency(MyMoneySecurity("JPY", i18n("Japanese Yen"), TQChar(0x00A5), 100, 1), create); loadDefaultCurrency(MyMoneySecurity("JOD", i18n("Jordanian Dinar"), "JOD", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("KZT", i18n("Kazakhstan Tenge")), create); loadDefaultCurrency(MyMoneySecurity("KES", i18n("Kenyan Shilling")), create); loadDefaultCurrency(MyMoneySecurity("KWD", i18n("Kuwaiti Dinar"), "KWD", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("KGS", i18n("Kyrgyzstan Som")), create); - loadDefaultCurrency(MyMoneySecurity("LAK", i18n("Laos Kip"), QChar(0x20AD)), create); + loadDefaultCurrency(MyMoneySecurity("LAK", i18n("Laos Kip"), TQChar(0x20AD)), create); loadDefaultCurrency(MyMoneySecurity("LVL", i18n("Latvian Lats")), create); - loadDefaultCurrency(MyMoneySecurity("LBP", i18n("Lebanese Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("LBP", i18n("Lebanese Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("LSL", i18n("Lesotho Loti")), create); loadDefaultCurrency(MyMoneySecurity("LRD", i18n("Liberian Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("LYD", i18n("Libyan Dinar"), "LYD", 1000, 1000), create); @@ -1443,7 +1443,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("MUR", i18n("Mauritius Rupee")), create); loadDefaultCurrency(MyMoneySecurity("MXN", i18n("Mexican Peso"), "$"), create); loadDefaultCurrency(MyMoneySecurity("MDL", i18n("Moldavian Leu")), create); - loadDefaultCurrency(MyMoneySecurity("MNT", i18n("Mongolian Tugrik"), QChar(0x20AE)), create); + loadDefaultCurrency(MyMoneySecurity("MNT", i18n("Mongolian Tugrik"), TQChar(0x20AE)), create); loadDefaultCurrency(MyMoneySecurity("MAD", i18n("Moroccan Dirham")), create); loadDefaultCurrency(MyMoneySecurity("MZM", i18n("Mozambique Metical")), create); loadDefaultCurrency(MyMoneySecurity("MMK", i18n("Myanmar Kyat")), create); @@ -1451,8 +1451,8 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("NPR", i18n("Nepalese Rupee")), create); loadDefaultCurrency(MyMoneySecurity("NZD", i18n("New Zealand Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("NIC", i18n("Nicaraguan Cordoba Oro")), create); - loadDefaultCurrency(MyMoneySecurity("NGN", i18n("Nigerian Naira"), QChar(0x20A6)), create); - loadDefaultCurrency(MyMoneySecurity("KPW", i18n("North Korean Won"), QChar(0x20A9)), create); + loadDefaultCurrency(MyMoneySecurity("NGN", i18n("Nigerian Naira"), TQChar(0x20A6)), create); + loadDefaultCurrency(MyMoneySecurity("KPW", i18n("North Korean Won"), TQChar(0x20A9)), create); loadDefaultCurrency(MyMoneySecurity("NOK", i18n("Norwegian Kroner"), "kr"), create); loadDefaultCurrency(MyMoneySecurity("OMR", i18n("Omani Rial"), "OMR", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("PKR", i18n("Pakistan Rupee")), create); @@ -1460,9 +1460,9 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("PGK", i18n("Papua New Guinea Kina")), create); loadDefaultCurrency(MyMoneySecurity("PYG", i18n("Paraguay Guarani")), create); loadDefaultCurrency(MyMoneySecurity("PEN", i18n("Peruvian Nuevo Sol")), create); - loadDefaultCurrency(MyMoneySecurity("PHP", i18n("Philippine Peso"), QChar(0x20B1)), create); + loadDefaultCurrency(MyMoneySecurity("PHP", i18n("Philippine Peso"), TQChar(0x20B1)), create); loadDefaultCurrency(MyMoneySecurity("PLN", i18n("Polish Zloty")), create); - loadDefaultCurrency(MyMoneySecurity("QAR", i18n("Qatari Rial")), create); + loadDefaultCurrency(MyMoneySecurity("TQAR", i18n("Qatari Rial")), create); loadDefaultCurrency(MyMoneySecurity("RON", i18n("Romanian Leu (new)")), true); loadDefaultCurrency(MyMoneySecurity("RUB", i18n("Russian Ruble")), true); loadDefaultCurrency(MyMoneySecurity("RWF", i18n("Rwanda Franc")), create); @@ -1477,19 +1477,19 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("SBD", i18n("Solomon Islands Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("SOS", i18n("Somali Shilling")), create); loadDefaultCurrency(MyMoneySecurity("ZAR", i18n("South African Rand")), create); - loadDefaultCurrency(MyMoneySecurity("KRW", i18n("South Korean Won"), QChar(0x20A9)), create); + loadDefaultCurrency(MyMoneySecurity("KRW", i18n("South Korean Won"), TQChar(0x20A9)), create); loadDefaultCurrency(MyMoneySecurity("LKR", i18n("Sri Lanka Rupee")), create); - loadDefaultCurrency(MyMoneySecurity("SHP", i18n("St. Helena Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("SHP", i18n("St. Helena Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("SDD", i18n("Sudanese Dinar")), create); loadDefaultCurrency(MyMoneySecurity("SRG", i18n("Suriname Guilder")), create); loadDefaultCurrency(MyMoneySecurity("SZL", i18n("Swaziland Lilangeni")), create); loadDefaultCurrency(MyMoneySecurity("SEK", i18n("Swedish Krona")), create); loadDefaultCurrency(MyMoneySecurity("CHF", i18n("Swiss Franc"), "SFr"), create); - loadDefaultCurrency(MyMoneySecurity("SYP", i18n("Syrian Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("SYP", i18n("Syrian Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("TWD", i18n("Taiwan Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("TJS", i18n("Tajikistan Somani")), create); loadDefaultCurrency(MyMoneySecurity("TZS", i18n("Tanzanian Shilling")), create); - loadDefaultCurrency(MyMoneySecurity("THB", i18n("Thai Baht"), QChar(0x0E3F)), create); + loadDefaultCurrency(MyMoneySecurity("THB", i18n("Thai Baht"), TQChar(0x0E3F)), create); loadDefaultCurrency(MyMoneySecurity("TOP", i18n("Tongan Pa'anga")), create); loadDefaultCurrency(MyMoneySecurity("TTD", i18n("Trinidad and Tobago Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("TND", i18n("Tunisian Dinar"), "TND", 1000, 1000), create); @@ -1503,7 +1503,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("UZS", i18n("Uzbekistani Sum")), create); loadDefaultCurrency(MyMoneySecurity("VUV", i18n("Vanuatu Vatu")), create); loadDefaultCurrency(MyMoneySecurity("VEB", i18n("Venezuelan Bolivar")), create); - loadDefaultCurrency(MyMoneySecurity("VND", i18n("Vietnamese Dong"), QChar(0x20AB)), create); + loadDefaultCurrency(MyMoneySecurity("VND", i18n("Vietnamese Dong"), TQChar(0x20AB)), create); loadDefaultCurrency(MyMoneySecurity("YUM", i18n("Yugoslav Dinar")), create); loadDefaultCurrency(MyMoneySecurity("ZMK", i18n("Zambian Kwacha")), create); loadDefaultCurrency(MyMoneySecurity("ZWD", i18n("Zimbabwe Dollar"), "$"), create); @@ -1514,7 +1514,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("XAG", i18n("Silver"), "XAG", 1, 1000000), create); } -void KMyMoneyView::loadAncientCurrency(const QString& id, const QString& name, const QString& sym, const QDate& date, const MyMoneyMoney& rate, const QString& newId, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) +void KMyMoneyView::loadAncientCurrency(const TQString& id, const TQString& name, const TQString& sym, const TQDate& date, const MyMoneyMoney& rate, const TQString& newId, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyPrice price(id, newId, date, rate, "KMyMoney"); @@ -1544,34 +1544,34 @@ void KMyMoneyView::loadAncientCurrency(const QString& id, const QString& name, c void KMyMoneyView::loadAncientCurrencies(void) { - loadAncientCurrency("ATS", i18n("Austrian Schilling"), "ÖS", QDate(1998,12,31), MyMoneyMoney(10000, 137603), "EUR"); - loadAncientCurrency("DEM", i18n("German Mark"), "DM", QDate(1998,12,31), MyMoneyMoney(100000, 195583), "EUR"); - loadAncientCurrency("FRF", i18n("French Franc"), "FF", QDate(1998,12,31), MyMoneyMoney(100000, 655957), "EUR"); - loadAncientCurrency("ITL", i18n("Italian Lira"), QChar(0x20A4), QDate(1998,12,31), MyMoneyMoney(100, 193627), "EUR"); - loadAncientCurrency("ESP", i18n("Spanish Peseta"), QString(), QDate(1998,12,31), MyMoneyMoney(1000, 166386), "EUR"); - loadAncientCurrency("NLG", i18n("Dutch Guilder"), QString(), QDate(1998,12,31), MyMoneyMoney(100000, 220371), "EUR"); - loadAncientCurrency("BEF", i18n("Belgian Franc"), "Fr", QDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); - loadAncientCurrency("LUF", i18n("Luxembourg Franc"), "Fr", QDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); - loadAncientCurrency("PTE", i18n("Portuguese Escudo"), QString(), QDate(1998,12,31), MyMoneyMoney(1000, 200482), "EUR"); - loadAncientCurrency("IEP", i18n("Irish Pound"), QChar(0x00A3), QDate(1998,12,31), MyMoneyMoney(1000000, 787564), "EUR"); - loadAncientCurrency("FIM", i18n("Finnish Markka"), QString(), QDate(1998,12,31), MyMoneyMoney(100000, 594573), "EUR"); - loadAncientCurrency("GRD", i18n("Greek Drachma"), QChar(0x20AF), QDate(1998,12,31), MyMoneyMoney(100, 34075), "EUR"); + loadAncientCurrency("ATS", i18n("Austrian Schilling"), "ÖS", TQDate(1998,12,31), MyMoneyMoney(10000, 137603), "EUR"); + loadAncientCurrency("DEM", i18n("German Mark"), "DM", TQDate(1998,12,31), MyMoneyMoney(100000, 195583), "EUR"); + loadAncientCurrency("FRF", i18n("French Franc"), "FF", TQDate(1998,12,31), MyMoneyMoney(100000, 655957), "EUR"); + loadAncientCurrency("ITL", i18n("Italian Lira"), TQChar(0x20A4), TQDate(1998,12,31), MyMoneyMoney(100, 193627), "EUR"); + loadAncientCurrency("ESP", i18n("Spanish Peseta"), TQString(), TQDate(1998,12,31), MyMoneyMoney(1000, 166386), "EUR"); + loadAncientCurrency("NLG", i18n("Dutch Guilder"), TQString(), TQDate(1998,12,31), MyMoneyMoney(100000, 220371), "EUR"); + loadAncientCurrency("BEF", i18n("Belgian Franc"), "Fr", TQDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); + loadAncientCurrency("LUF", i18n("Luxembourg Franc"), "Fr", TQDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); + loadAncientCurrency("PTE", i18n("Portuguese Escudo"), TQString(), TQDate(1998,12,31), MyMoneyMoney(1000, 200482), "EUR"); + loadAncientCurrency("IEP", i18n("Irish Pound"), TQChar(0x00A3), TQDate(1998,12,31), MyMoneyMoney(1000000, 787564), "EUR"); + loadAncientCurrency("FIM", i18n("Finnish Markka"), TQString(), TQDate(1998,12,31), MyMoneyMoney(100000, 594573), "EUR"); + loadAncientCurrency("GRD", i18n("Greek Drachma"), TQChar(0x20AF), TQDate(1998,12,31), MyMoneyMoney(100, 34075), "EUR"); - loadAncientCurrency("ROL", i18n("Romanian Leu"), "ROL", QDate(2005,6,30), MyMoneyMoney(1, 10000), "RON"); + loadAncientCurrency("ROL", i18n("Romanian Leu"), "ROL", TQDate(2005,6,30), MyMoneyMoney(1, 10000), "RON"); - loadAncientCurrency("RUR", i18n("Russian Ruble (old)"), "RUR", QDate(1998, 1, 1), MyMoneyMoney(1, 1000), "RUB"); + loadAncientCurrency("RUR", i18n("Russian Ruble (old)"), "RUR", TQDate(1998, 1, 1), MyMoneyMoney(1, 1000), "RUB"); - loadAncientCurrency("SIT", i18n("Slovenian Tolar"), "SIT", QDate(2006,12,31), MyMoneyMoney(100, 23964), "EUR"); + loadAncientCurrency("SIT", i18n("Slovenian Tolar"), "SIT", TQDate(2006,12,31), MyMoneyMoney(100, 23964), "EUR"); // Source: http://www.tf-portfoliosolutions.net/products/turkishlira.aspx - loadAncientCurrency("TRL", i18n("Turkish Lira"), "TL", QDate(2004,12,31), MyMoneyMoney(1,1000000), "TRY"); + loadAncientCurrency("TRL", i18n("Turkish Lira"), "TL", TQDate(2004,12,31), MyMoneyMoney(1,1000000), "TRY"); // Source: http://www.focus.de/finanzen/news/malta-und-zypern_aid_66058.html - loadAncientCurrency("MTL", i18n("Maltese Lira"), "MTL", QDate(2008,1,1), MyMoneyMoney(429300,1000000), "EUR"); - loadAncientCurrency("CYP", i18n("Cyprus Pound"), QString("C%1").arg(QChar(0x00A3)), QDate(2008,1,1), MyMoneyMoney(585274,1000000), "EUR"); + loadAncientCurrency("MTL", i18n("Maltese Lira"), "MTL", TQDate(2008,1,1), MyMoneyMoney(429300,1000000), "EUR"); + loadAncientCurrency("CYP", i18n("Cyprus Pound"), TQString("C%1").tqarg(TQChar(0x00A3)), TQDate(2008,1,1), MyMoneyMoney(585274,1000000), "EUR"); // Source: http://www.focus.de/finanzen/news/waehrungszone-slowakei-ist-neuer-euro-staat_aid_359025.html - loadAncientCurrency("SKK", i18n("Slovak Koruna"), "SKK", QDate(2008,12,31), MyMoneyMoney(1000,30126), "EUR"); + loadAncientCurrency("SKK", i18n("Slovak Koruna"), "SKK", TQDate(2008,12,31), MyMoneyMoney(1000,30126), "EUR"); } void KMyMoneyView::viewUp(void) @@ -1580,7 +1580,7 @@ void KMyMoneyView::viewUp(void) return; } -void KMyMoneyView::viewAccountList(const QString& /*selectAccount*/) +void KMyMoneyView::viewAccountList(const TQString& /*selectAccount*/) { if(pageIndex(m_accountsViewFrame) != activePageIndex()) showPage(1); @@ -1591,13 +1591,13 @@ void KMyMoneyView::viewAccountList(const QString& /*selectAccount*/) void KMyMoneyView::slotRefreshViews() { // turn off sync between ledger and investment view - disconnect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, SLOT(slotSelectAccount(const MyMoneyObject&))); - disconnect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, SLOT(slotSelectAccount(const MyMoneyObject&))); + disconnect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + disconnect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); // TODO turn sync between ledger and investment view if selected by user if(KMyMoneyGlobalSettings::syncLedgerInvestment()) { - connect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); } showTitleBar(KMyMoneyGlobalSettings::showTitleBar()); @@ -1623,12 +1623,12 @@ void KMyMoneyView::slotShowTransactionDetail(bool detailed) } -void KMyMoneyView::progressCallback(int current, int total, const QString& msg) +void KMyMoneyView::progressCallback(int current, int total, const TQString& msg) { kmymoney2->progressCallback(current, total, msg); } -void KMyMoneyView::slotRememberPage(QWidget* w) +void KMyMoneyView::slotRememberPage(TQWidget* w) { KConfig *config = KGlobal::config(); config->setGroup("Last Use Settings"); @@ -1645,22 +1645,22 @@ void KMyMoneyView::fixFile_2(void) MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyTransactionFilter filter; filter.setReportAllSplits( false ); - QValueList transactionList; + TQValueList transactionList; file->transactionList(transactionList, filter); // scan the transactions and modify transactions with two splits // which reference an account and a category to have the memo text // of the account. - QValueList::Iterator it_t; + TQValueList::Iterator it_t; int count = 0; for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { if((*it_t).splitCount() == 2) { - QString accountId; - QString categoryId; - QString accountMemo; - QString categoryMemo; - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s; + TQString accountId; + TQString categoryId; + TQString accountMemo; + TQString categoryMemo; + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneyAccount acc = file->account((*it_s).accountId()); if(acc.isIncomeExpense()) { @@ -1688,23 +1688,23 @@ void KMyMoneyView::fixFile_2(void) void KMyMoneyView::fixFile_1(void) { - // we need to fix reports. If the account filter list contains + // we need to fix reports. If the account filter list tqcontains // investment accounts, we need to add the stock accounts to the list // as well if we don't have the expert mode enabled if(!KMyMoneyGlobalSettings::expertMode()) { try { - QValueList reports = MyMoneyFile::instance()->reportList(); - QValueList::iterator it_r; + TQValueList reports = MyMoneyFile::instance()->reportList(); + TQValueList::iterator it_r; for(it_r = reports.begin(); it_r != reports.end(); ++it_r) { - QStringList list; + TQStringList list; (*it_r).accounts(list); - QStringList missing; - QStringList::const_iterator it_a, it_b; + TQStringList missing; + TQStringList::const_iterator it_a, it_b; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!list.contains(*it_b)) { + if(!list.tqcontains(*it_b)) { missing.append(*it_b); } } @@ -1724,20 +1724,20 @@ void KMyMoneyView::fixFile_1(void) #if 0 if(!m_accountsView->allItemsSelected()) { // retrieve a list of selected accounts - QStringList list; + TQStringList list; m_accountsView->selectedItems(list); // if we're not in expert mode, we need to make sure // that all stock accounts for the selected investment // account are also selected if(!KMyMoneyGlobalSettings::expertMode()) { - QStringList missing; - QStringList::const_iterator it_a, it_b; + TQStringList missing; + TQStringList::const_iterator it_a, it_b; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!list.contains(*it_b)) { + if(!list.tqcontains(*it_b)) { missing.append(*it_b); } } @@ -1764,13 +1764,13 @@ void KMyMoneyView::fixFile_0(void) */ MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accountList; + TQValueList accountList; file->accountList(accountList); ::timetrace("Have account list"); - QValueList::Iterator it_a; - QValueList scheduleList = file->scheduleList(); + TQValueList::Iterator it_a; + TQValueList scheduleList = file->scheduleList(); ::timetrace("Have schedule list"); - QValueList::Iterator it_s; + TQValueList::Iterator it_s; MyMoneyAccount equity = file->equity(); MyMoneyAccount asset = file->asset(); @@ -1784,15 +1784,15 @@ void KMyMoneyView::fixFile_0(void) } // until early before 0.8 release, the equity account was not saved to // the file. If we have an equity account with no sub-accounts but - // find and equity account that has equity() as it's parent, we reparent + // find and equity account that has equity() as it's tqparent, we reparent // this account. Need to move it to asset() first, because otherwise // MyMoneyFile::reparent would act as NOP. if(equityListEmpty && (*it_a).accountType() == MyMoneyAccount::Equity) { - if((*it_a).parentAccountId() == equity.id()) { + if((*it_a).tqparentAccountId() == equity.id()) { MyMoneyAccount acc = *it_a; - // tricky, force parent account to be empty so that we really - // can re-parent it - acc.setParentAccountId(QString()); + // tricky, force tqparent account to be empty so that we really + // can re-tqparent it + acc.setParentAccountId(TQString()); file->reparentAccount(acc, equity); kdDebug(2) << __func__ << " fixed account " << acc.id() << " reparented to " << equity.id() << endl; } @@ -1812,8 +1812,8 @@ void KMyMoneyView::fixFile_0(void) void KMyMoneyView::fixSchedule_0(MyMoneySchedule sched) { MyMoneyTransaction t = sched.transaction(); - QValueList splitList = t.splits(); - QValueList::ConstIterator it_s; + TQValueList splitList = t.splits(); + TQValueList::ConstIterator it_s; bool updated = false; try { @@ -1844,7 +1844,7 @@ void KMyMoneyView::fixSchedule_0(MyMoneySchedule sched) if((*it_s).reconcileFlag() != MyMoneySplit::NotReconciled) { kdDebug(2) << __func__ << " " << sched.id() << " " << (*it_s).id() << " should be 'not reconciled'" << endl; MyMoneySplit split = *it_s; - split.setReconcileDate(QDate()); + split.setReconcileDate(TQDate()); split.setReconcileFlag(MyMoneySplit::NotReconciled); t.modifySplit(split); updated = true; @@ -1884,7 +1884,7 @@ void KMyMoneyView::fixLoanAccount_0(MyMoneyAccount acc) i18n("The account \"%1\" was previously created as loan account but some information " "is missing. The new loan wizard will be started to collect all relevant " "information. Please use a KMyMoney version >= 0.8.7 and < 0.9 to correct the problem." - ).arg(acc.name()), + ).tqarg(acc.name()), i18n("Account problem")); throw new MYMONEYEXCEPTION("Fix LoanAccount0 not supported anymore"); @@ -1911,7 +1911,7 @@ void KMyMoneyView::createSchedule(MyMoneySchedule newSchedule, MyMoneyAccount& n // to the account pool. Note: the schedule code used to leave // this always the first split, but the loan code leaves it as // the second one. So I thought, searching is a good alternative .... - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId().isEmpty()) { MyMoneySplit s = (*it_s); @@ -1952,16 +1952,16 @@ void KMyMoneyView::fixTransactions_0(void) #endif ::timetrace("fixTransactions: get schedule list"); - QValueList scheduleList = file->scheduleList(); + TQValueList scheduleList = file->scheduleList(); ::timetrace("fixTransactions: get transaction list"); MyMoneyTransactionFilter filter; filter.setReportAllSplits( false ); - QValueList transactionList; + TQValueList transactionList; file->transactionList(transactionList, filter); ::timetrace("fixTransactions: have list"); - QValueList::Iterator it_x; - QStringList interestAccounts; + TQValueList::Iterator it_x; + TQStringList interestAccounts; KMSTATUS(i18n("Fix transactions")); kmymoney2->slotStatusProgressBar(0, scheduleList.count() + transactionList.count()); @@ -1970,12 +1970,12 @@ void KMyMoneyView::fixTransactions_0(void) // scan the schedules to find interest accounts for(it_x = scheduleList.begin(); it_x != scheduleList.end(); ++it_x) { MyMoneyTransaction t = (*it_x).transaction(); - QValueList::ConstIterator it_s; - QStringList accounts; + TQValueList::ConstIterator it_s; + TQStringList accounts; bool hasDuplicateAccounts = false; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { - if(accounts.contains((*it_s).accountId())) { + if(accounts.tqcontains((*it_s).accountId())) { hasDuplicateAccounts = true; kdDebug(2) << __func__ << " " << t.id() << " has multiple splits with account " << (*it_s).accountId() << endl; } else { @@ -1983,7 +1983,7 @@ void KMyMoneyView::fixTransactions_0(void) } if((*it_s).action() == MyMoneySplit::ActionInterest) { - if(interestAccounts.contains((*it_s).accountId()) == 0) { + if(interestAccounts.tqcontains((*it_s).accountId()) == 0) { interestAccounts << (*it_s).accountId(); } } @@ -1998,12 +1998,12 @@ void KMyMoneyView::fixTransactions_0(void) ::timetrace("fixTransactions: start loop"); // scan the transactions and modify loan transactions - QValueList::Iterator it_t; + TQValueList::Iterator it_t; for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { const char *defaultAction = 0; - QValueList splits = (*it_t).splits(); - QValueList::Iterator it_s; - QStringList accounts; + TQValueList splits = (*it_t).splits(); + TQValueList::Iterator it_s; + TQStringList accounts; // check if base commodity is set. if not, set baseCurrency if((*it_t).commodity().isEmpty()) { @@ -2091,14 +2091,14 @@ void KMyMoneyView::fixTransactions_0(void) // and check if there are any duplicates in this transactions for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneyAccount splitAccount = file->account((*it_s).accountId()); - if(accounts.contains((*it_s).accountId())) { + if(accounts.tqcontains((*it_s).accountId())) { hasDuplicateAccounts = true; } else { accounts << (*it_s).accountId(); } // if this split references an interest account, the action // must be of type ActionInterest - if(interestAccounts.contains((*it_s).accountId())) { + if(interestAccounts.tqcontains((*it_s).accountId())) { if((*it_s).action() != MyMoneySplit::ActionInterest) { kdDebug(2) << __func__ << " " << (*it_t).id() << " contains an interest account (" << (*it_s).accountId() << ") but does not have ActionInterest" << endl; (*it_s).setAction(MyMoneySplit::ActionInterest); @@ -2175,10 +2175,10 @@ void KMyMoneyView::slotPrintView(void) m_homeView->slotPrintView(); } -KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& icon) +KMyMoneyViewBase* KMyMoneyView::addPage(const TQString& title, const TQString& icon) { const int iconSize = (KMyMoneyGlobalSettings::iconSize()+1)*16; - QFrame* frm = KJanusWidget::addVBoxPage(title, title, DesktopIcon(icon, iconSize)); + TQFrame* frm = KJanusWidget::addVBoxPage(title, title, DesktopIcon(icon, iconSize)); return new KMyMoneyViewBase(frm, title.latin1(), title); } @@ -2189,8 +2189,8 @@ KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& ico // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -2202,30 +2202,30 @@ KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& ico class KMyMoneyViewBase::Private { public: - QFrame* m_titleLine; + TQFrame* m_titleLine; KMyMoneyTitleLabel* m_titleLabel; - QVBoxLayout* m_viewLayout; + TQVBoxLayout* m_viewLayout; }; -KMyMoneyViewBase::KMyMoneyViewBase(QWidget* parent, const char* name, const QString& title) : - QWidget(parent, name), +KMyMoneyViewBase::KMyMoneyViewBase(TQWidget* tqparent, const char* name, const TQString& title) : + TQWidget(tqparent, name), d(new Private) { - d->m_viewLayout = new QVBoxLayout(this); + d->m_viewLayout = new TQVBoxLayout(this); d->m_viewLayout->setSpacing( 6 ); d->m_viewLayout->setMargin( 0 ); d->m_titleLabel = new KMyMoneyTitleLabel( this, "titleLabel" ); - d->m_titleLabel->setMinimumSize( QSize( 100, 30 ) ); + d->m_titleLabel->setMinimumSize( TQSize( 100, 30 ) ); d->m_titleLabel->setRightImageFile("pics/titlelabel_background.png" ); d->m_titleLabel->setText(title); d->m_viewLayout->addWidget( d->m_titleLabel ); #if 0 - d->m_titleLine = new QFrame( this, "titleLine" ); - d->m_titleLine->setFrameShape( QFrame::HLine ); - d->m_titleLine->setFrameShadow( QFrame::Sunken ); - d->m_titleLine->setFrameShape( QFrame::HLine ); + d->m_titleLine = new TQFrame( this, "titleLine" ); + d->m_titleLine->setFrameShape( TQFrame::HLine ); + d->m_titleLine->setFrameShadow( TQFrame::Sunken ); + d->m_titleLine->setFrameShape( TQFrame::HLine ); d->m_viewLayout->addWidget( d->m_titleLine ); #endif } @@ -2235,12 +2235,12 @@ KMyMoneyViewBase::~KMyMoneyViewBase() delete d; } -void KMyMoneyViewBase::addWidget(QWidget* w) +void KMyMoneyViewBase::addWidget(TQWidget* w) { d->m_viewLayout->addWidget(w); } -QVBoxLayout* KMyMoneyViewBase::layout(void) const +TQVBoxLayout* KMyMoneyViewBase::tqlayout(void) const { return d->m_viewLayout; } diff --git a/kmymoney2/views/kmymoneyview.h b/kmymoney2/views/kmymoneyview.h index 13e3d76..e1c1266 100644 --- a/kmymoney2/views/kmymoneyview.h +++ b/kmymoney2/views/kmymoneyview.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QVBox; -class QFile; -class QVBoxLayout; +#include +class TQVBox; +class TQFile; +class TQVBoxLayout; // ---------------------------------------------------------------------------- // KDE Includes @@ -65,7 +65,7 @@ class TransactionEditor; class KForecastView; /** - * This class represents the view of the MyMoneyFile which contains + * This class represents the view of the MyMoneyFile which tqcontains * Banks/Accounts/Transactions, Recurring transactions (or Bills & Deposits) * and scripts (yet to be implemented). Each different aspect of the file * is represented by a tab within the view. @@ -77,6 +77,7 @@ class KForecastView; class KMyMoneyView : public KJanusWidget { Q_OBJECT + TQ_OBJECT public: enum viewID { @@ -127,17 +128,17 @@ private: KReportsView* m_reportsView; KForecastView* m_forecastView; - QVBox* m_homeViewFrame; - QVBox* m_accountsViewFrame; - QVBox* m_institutionsViewFrame; - QVBox* m_categoriesViewFrame; - QVBox* m_payeesViewFrame; - QVBox* m_budgetViewFrame; - QVBox* m_scheduleViewFrame; - QVBox* m_ledgerViewFrame; - QVBox* m_investmentViewFrame; - QVBox* m_reportsViewFrame; - QVBox* m_forecastViewFrame; + TQVBox* m_homeViewFrame; + TQVBox* m_accountsViewFrame; + TQVBox* m_institutionsViewFrame; + TQVBox* m_categoriesViewFrame; + TQVBox* m_payeesViewFrame; + TQVBox* m_budgetViewFrame; + TQVBox* m_scheduleViewFrame; + TQVBox* m_ledgerViewFrame; + TQVBox* m_investmentViewFrame; + TQVBox* m_reportsViewFrame; + TQVBox* m_forecastViewFrame; bool m_inConstructor; @@ -161,9 +162,9 @@ private: fileTypeE m_fileType; private: - void addTitleBar(QWidget* parent, const QString& title); + void addTitleBar(TQWidget* tqparent, const TQString& title); - void ungetString(QIODevice *qfile, char * buf, int len); + void ungetString(TQIODevice *qfile, char * buf, int len); /** * This method creates the currency @p curr if it does not exist and @@ -180,7 +181,7 @@ private: /** * */ - void loadAncientCurrency(const QString& id, const QString& name, const QString& sym, const QDate& date, const MyMoneyMoney& rate, const QString& newId, const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); + void loadAncientCurrency(const TQString& id, const TQString& name, const TQString& sym, const TQDate& date, const MyMoneyMoney& rate, const TQString& newId, const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); /** * if no base currency is defined, start the dialog and force it to be set @@ -200,9 +201,9 @@ private: */ void removeStorage(void); - void viewAccountList(const QString& selectAccount); // Show the accounts view + void viewAccountList(const TQString& selectAccount); // Show the accounts view - static void progressCallback(int current, int total, const QString&); + static void progressCallback(int current, int total, const TQString&); /** */ @@ -222,14 +223,14 @@ private: void createSchedule(MyMoneySchedule s, MyMoneyAccount& a); - void checkAccountName(const MyMoneyAccount& acc, const QString& name) const; + void checkAccountName(const MyMoneyAccount& acc, const TQString& name) const; public: /** * The constructor for KMyMoneyView. Just creates all the tabs for the * different aspects of the MyMoneyFile. */ - KMyMoneyView(QWidget *parent=0, const char *name=0); + KMyMoneyView(TQWidget *tqparent=0, const char *name=0); /** * Destructor @@ -266,14 +267,14 @@ public: * * @param url The URL to save into. * If no protocol is specified, file:// is assumed. - * @param keyList QString containing a comma separated list of keys + * @param keyList TQString containing a comma separated list of keys * to be used for encryption. If @p keyList is empty, * the file will be saved unencrypted (the default) * * @retval false save operation failed * @retval true save operation was successful */ - bool saveFile(const KURL& url, const QString& keyList = QString()); + bool saveFile(const KURL& url, const TQString& keyList = TQString()); /** * Saves the data into permanent storage on a new or empty SQL database. * @@ -340,9 +341,9 @@ public: */ void enableViews(int state = -1); - KMyMoneyViewBase* addPage(const QString& title, const QString& icon = QString()); + KMyMoneyViewBase* addPage(const TQString& title, const TQString& icon = TQString()); - void addWidget(QWidget* w); + void addWidget(TQWidget* w); virtual bool showPage(int index); @@ -357,7 +358,7 @@ public: * @retval true Yes, view allows to create a transaction (tooltip is not changed) * @retval false No, view cannot to create a transaction (tooltip is updated with message) */ - bool canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to modify (edit/delete) the selected transactions @@ -370,9 +371,9 @@ public: * @retval true Yes, view allows to edit/delete transactions (tooltip is not changed) * @retval false No, view cannot edit/delete transactions (tooltip is updated with message) */ - bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; - bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to edit the selected transactions @@ -385,7 +386,7 @@ public: * @retval true Yes, view allows to enter/edit transactions * @retval false No, view cannot enter/edit transactions */ - bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to print something @@ -410,7 +411,7 @@ public: * @retval true Reconciliation started * @retval false Account cannot be reconciled */ - bool startReconciliation(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + bool startReconciliation(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); /** * Used to finish reconciliation of account @a account. It switches the @@ -437,7 +438,7 @@ public slots: * * @param widget pointer to page widget */ - void slotRememberPage(QWidget* widget); + void slotRememberPage(TQWidget* widget); /** * Brings up a dialog to change the list(s) settings and saves them into the @@ -445,7 +446,7 @@ public slots: * * @see KListSettingsDlg * Refreshs all views. Used e.g. after settings have been changed or - * data has been loaded from external sources (QIF import). + * data has been loaded from external sources (TQIF import). **/ void slotRefreshViews(); @@ -457,7 +458,7 @@ public slots: * @param acc The ID of the account to be shown * @param transaction The ID of the transaction to be selected */ - void slotLedgerSelected(const QString& acc, const QString& transaction = QString()); + void slotLedgerSelected(const TQString& acc, const TQString& transaction = TQString()); /** * Called, whenever the payees view should pop up and a specific @@ -467,7 +468,7 @@ public slots: * @param accountId The ID of the account to be shown * @param transactionId The ID of the transaction to be selected */ - void slotPayeeSelected(const QString& payeeId, const QString& accountId, const QString& transactionId); + void slotPayeeSelected(const TQString& payeeId, const TQString& accountId, const TQString& transactionId); /** * Called, whenever the schedule view should pop up and a specific @@ -475,7 +476,7 @@ public slots: * * @param schedule The ID of the schedule to be shown */ - void slotScheduleSelected(const QString& schedule); + void slotScheduleSelected(const TQString& schedule); /** * Called, whenever the report view should pop up and a specific @@ -483,7 +484,7 @@ public slots: * * @param reportid The ID of the report to be shown */ - void slotShowReport(const QString& reportid); + void slotShowReport(const TQString& reportid); /** * Same as the above, but the caller passes in an actual report @@ -546,15 +547,15 @@ private: * the final destination is reached over a network * protocol (e.g. FTP) * - * @param qf pointer to QFile representing the opened file + * @param qf pointer to TQFile representing the opened file * @param writer pointer to the formatter * @param plaintext whether to override any compression & encryption settings - * @param keyList QString containing a comma separated list of keys to be used for encryption + * @param keyList TQString containing a comma separated list of keys to be used for encryption * If @p keyList is empty, the file will be saved unencrypted * * @note This method will close the file when it is written. */ - void saveToLocalFile(QFile* qf, IMyMoneyStorageFormat* writer, bool plaintext=false, const QString& keyList = QString()); + void saveToLocalFile(TQFile* qf, IMyMoneyStorageFormat* writer, bool plaintext=false, const TQString& keyList = TQString()); /** * Internal method used by slotAccountNew() and slotAccountCategory(). @@ -587,7 +588,7 @@ signals: * @param endingBalance collected ending balance when reconciliation starts * 0 otherwise */ - void reconciliationStarts(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void reconciliationStarts(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); }; @@ -595,16 +596,17 @@ signals: * This class is an abstract base class that all specific views * should be based on. */ -class KMyMoneyViewBase : public QWidget +class KMyMoneyViewBase : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KMyMoneyViewBase(QWidget* parent, const char *name, const QString& title); + KMyMoneyViewBase(TQWidget* tqparent, const char *name, const TQString& title); virtual ~KMyMoneyViewBase(); - void setTitle(const QString& title); - QVBoxLayout* layout(void) const; - void addWidget(QWidget* w); + void setTitle(const TQString& title); + TQVBoxLayout* tqlayout(void) const; + void addWidget(TQWidget* w); /** * This method is used to edit the currently selected transactions @@ -614,7 +616,7 @@ public: * @retval false view was not capable to edit transactions * @retval true view was capable to edit the transactions and did so */ - bool editTransactions(const QValueList& transactions) const { Q_UNUSED(transactions) return false; } + bool editTransactions(const TQValueList& transactions) const { Q_UNUSED(transactions) return false; } private: /// \internal d-pointer class. class Private; diff --git a/kmymoney2/views/kpayeesview.cpp b/kmymoney2/views/kpayeesview.cpp index ad17ff4..83c7e8f 100644 --- a/kmymoney2/views/kpayeesview.cpp +++ b/kmymoney2/views/kpayeesview.cpp @@ -25,22 +25,22 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -70,7 +70,7 @@ /* KTransactionPtrVector */ /* -------------------------------------------------------------------------------*/ -int KTransactionPtrVector::compareItems(const QString& s1, const QString& s2) const +int KTransactionPtrVector::compareItems(const TQString& s1, const TQString& s2) const { if(s1 == s2) return 0; @@ -99,7 +99,7 @@ int KTransactionPtrVector::compareItems(KTransactionPtrVector::Item d1, KTransac s2 = t2->splitByPayee(m_id); break; } - QString p1, p2; + TQString p1, p2; switch(m_sortType) { case SortValue: @@ -245,13 +245,13 @@ void KTransactionPtrVector::setSortType(const TransactionSortE type) sort(); } -void KTransactionPtrVector::setAccountId(const QString& id) +void KTransactionPtrVector::setAccountId(const TQString& id) { m_id = id; m_idMode = AccountMode; } -void KTransactionPtrVector::setPayeeId(const QString& id) +void KTransactionPtrVector::setPayeeId(const TQString& id) { m_id = id; m_idMode = PayeeMode; @@ -260,8 +260,8 @@ void KTransactionPtrVector::setPayeeId(const QString& id) // *** KPayeeListItem Implementation *** -KPayeeListItem::KPayeeListItem(KListView *parent, const MyMoneyPayee& payee) : - KListViewItem(parent), +KPayeeListItem::KPayeeListItem(KListView *tqparent, const MyMoneyPayee& payee) : + KListViewItem(tqparent), m_payee(payee) { setText(0, payee.name()); @@ -273,22 +273,22 @@ KPayeeListItem::~KPayeeListItem() { } -void KPayeeListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void KPayeeListItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if(isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); p->setFont(KMyMoneyGlobalSettings::listCellFont()); - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } -KTransactionListItem::KTransactionListItem(KListView* view, KTransactionListItem* parent, const QString& accountId, const QString& transactionId) : - KListViewItem(view, parent) +KTransactionListItem::KTransactionListItem(KListView* view, KTransactionListItem* tqparent, const TQString& accountId, const TQString& transactionId) : + KListViewItem(view, tqparent) { m_accountId = accountId; m_transactionId = transactionId; @@ -298,14 +298,14 @@ KTransactionListItem::~KTransactionListItem() { } -void KTransactionListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +void KTransactionListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment) { - QColorGroup _cg = cg; - _cg.setColor(QColorGroup::Base, backgroundColor()); - QListViewItem::paintCell(p, _cg, column, width, alignment); + TQColorGroup _cg = cg; + _cg.setColor(TQColorGroup::Base, backgroundColor()); + TQListViewItem::paintCell(p, _cg, column, width, tqalignment); } -const QColor KTransactionListItem::backgroundColor(void) +const TQColor KTransactionListItem::backgroundColor(void) { return isAlternate() ? KMyMoneyGlobalSettings::listBGColor() : KMyMoneyGlobalSettings::listColor(); } @@ -315,30 +315,30 @@ const QColor KTransactionListItem::backgroundColor(void) // *** KPayeesView Implementation *** -KPayeesView::KPayeesView(QWidget *parent, const char *name ) : - KPayeesViewDecl(parent,name), +KPayeesView::KPayeesView(TQWidget *tqparent, const char *name ) : + KPayeesViewDecl(tqparent,name), m_needReload(false), m_needConnection(true), m_updatesQueued(0), m_inSelection(false) { // create the searchline widget - // and insert it into the existing layout + // and insert it into the existing tqlayout m_searchWidget = new KListViewSearchLineWidget(m_payeesList, this); - m_searchWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed)); + m_searchWidget->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed)); KPayeesViewDeclLayout->insertWidget(0, m_searchWidget); - m_splitter = new QSplitter(this); - m_payeesList->reparent(m_splitter, QPoint(0,0), true); - m_tabWidget->reparent(m_splitter, QPoint(0, 0), true); - m_splitter->setResizeMode(m_tabWidget, QSplitter::Stretch); + m_splitter = new TQSplitter(this); + m_payeesList->reparent(m_splitter, TQPoint(0,0), true); + m_tabWidget->reparent(m_splitter, TQPoint(0, 0), true); + m_splitter->setResizeMode(m_tabWidget, TQSplitter::Stretch); m_splitter->setOpaqueResize(); - layout10->addWidget(m_splitter); + tqlayout10->addWidget(m_splitter); // use the size settings of the last run (if any) KConfig *config = KGlobal::config(); config->setGroup("Last Use Settings"); - QValueList sizes = config->readIntListEntry("KPayeesViewSplitterSize"); + TQValueList sizes = config->readIntListEntry("KPayeesViewSplitterSize"); if(sizes.size() == 2) { if(!sizes[0] || !sizes[1]) { sizes[0] = 1; @@ -348,10 +348,10 @@ KPayeesView::KPayeesView(QWidget *parent, const char *name ) : } m_transactionView->setSorting(-1); - m_transactionView->setColumnWidthMode(2, QListView::Manual); - m_transactionView->setColumnAlignment(3, Qt::AlignRight); + m_transactionView->setColumnWidthMode(2, TQListView::Manual); + m_transactionView->setColumnAlignment(3, TQt::AlignRight); // never show horizontal scroll bars - m_transactionView->setHScrollBarMode(QScrollView::AlwaysOff); + m_transactionView->setHScrollBarMode(TQScrollView::AlwaysOff); m_payeesList->addColumn(i18n("Name")); @@ -366,44 +366,44 @@ KPayeesView::KPayeesView(QWidget *parent, const char *name ) : KIconLoader* il = KGlobal::iconLoader(); KGuiItem updateButtenItem( i18n("Update"), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered data and stores it"), i18n("Use this to accept the modified data.")); m_updateButton->setGuiItem(updateButtenItem); - connect(m_payeesList, SIGNAL(selectionChanged()), this, SLOT(slotSelectPayee())); - connect(m_payeesList, SIGNAL(itemRenamed(QListViewItem*,int,const QString&)), this, SLOT(slotRenamePayee(QListViewItem*,int,const QString&))); + connect(m_payeesList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectPayee())); + connect(m_payeesList, TQT_SIGNAL(itemRenamed(TQListViewItem*,int,const TQString&)), this, TQT_SLOT(slotRenamePayee(TQListViewItem*,int,const TQString&))); - connect(addressEdit, SIGNAL(textChanged()), this, SLOT(slotPayeeDataChanged())); - connect(postcodeEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(telephoneEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(emailEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(notesEdit, SIGNAL(textChanged()), this, SLOT(slotPayeeDataChanged())); - connect(matchKeyEditList, SIGNAL(changed()), this, SLOT(slotKeyListChanged())); + connect(addressEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotPayeeDataChanged())); + connect(postcodeEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(telephoneEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(emailEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(notesEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotPayeeDataChanged())); + connect(matchKeyEditList, TQT_SIGNAL(changed()), this, TQT_SLOT(slotKeyListChanged())); - connect(radioNoMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(radioNameMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(radioKeyMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(checkMatchIgnoreCase, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); + connect(radioNoMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(radioNameMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(radioKeyMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(checkMatchIgnoreCase, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); - connect(checkEnableDefaultAccount, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(comboDefaultAccount, SIGNAL(accountSelected(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(buttonSelectMyAccount, SIGNAL(clicked()), this, SLOT(slotChooseDefaultAccount())); + connect(checkEnableDefaultAccount, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(comboDefaultAccount, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(buttonSelectMyAccount, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotChooseDefaultAccount())); - connect(m_updateButton, SIGNAL(clicked()), this, SLOT(slotUpdatePayee())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect(m_updateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdatePayee())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); - connect(m_payeesList, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotOpenContextMenu(KListView*, QListViewItem*, const QPoint&))); + connect(m_payeesList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), this, TQT_SLOT(slotOpenContextMenu(KListView*, TQListViewItem*, const TQPoint&))); -// connect(m_payeesList, SIGNAL(rightButtonClicked(QListViewItem* , const QPoint&, int)), -// this, SLOT(slotOpenContextMenu(QListViewItem*))); +// connect(m_payeesList, TQT_SIGNAL(rightButtonClicked(TQListViewItem* , const TQPoint&, int)), +// this, TQT_SLOT(slotOpenContextMenu(TQListViewItem*))); - connect(m_transactionView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(slotTransactionDoubleClicked(QListViewItem*))); + connect(m_transactionView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), + this, TQT_SLOT(slotTransactionDoubleClicked(TQListViewItem*))); - connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(rearrange(void))); + connect(m_tabWidget, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(rearrange(void))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadPayees())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadPayees())); } KPayeesView::~KPayeesView() @@ -419,7 +419,7 @@ void KPayeesView::slotQueueUpdate(void) m_updatesQueued++; // The KListViewSearchLineWidget has an internal timer for update purposes // of 200 ms, so we should be safe with 250 ms here - QTimer::singleShot(250, this, SLOT(slotActivateUpdate())); + TQTimer::singleShot(250, this, TQT_SLOT(slotActivateUpdate())); } void KPayeesView::slotActivateUpdate(void) @@ -432,20 +432,20 @@ void KPayeesView::slotActivateUpdate(void) void KPayeesView::slotChooseDefaultAccount(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QMap account_count; + TQMap account_count; for (int i = 0; i < m_transactionPtrVector.size(); ++i) { KMyMoneyTransaction* t = m_transactionPtrVector[i]; MyMoneySplit s = t->splitById(t->splitId()); const MyMoneyAccount& acc = file->account(s.accountId()); - QString txt; + TQString txt; if (s.action() != MyMoneySplit::ActionAmortization && acc.accountType() != MyMoneyAccount::AssetLoan && !file->isTransfer(*t) && t->splitCount() == 2) { MyMoneySplit s0 = t->splitByAccount(s.accountId(), false); - if (account_count.contains(s0.accountId())) { + if (account_count.tqcontains(s0.accountId())) { account_count[s0.accountId()]++; } else { @@ -454,7 +454,7 @@ void KPayeesView::slotChooseDefaultAccount(void) } } - QMapIterator most_frequent, iter; + TQMapIterator most_frequent, iter; most_frequent = account_count.end(); for (iter = account_count.begin(); iter != account_count.end(); iter++) { if (iter.data() > most_frequent.data()) { @@ -470,19 +470,19 @@ void KPayeesView::slotChooseDefaultAccount(void) void KPayeesView::slotStartRename(void) { - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; if((it_v = it_l.current()) != 0) { it_v->startRename(0); } } // This variant is only called when a single payee is selected and renamed. -void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QString& txt) +void KPayeesView::slotRenamePayee(TQListViewItem* p , int /* col */, const TQString& txt) { //kdDebug() << "[KPayeesView::slotRenamePayee]" << endl; // create a copy of the new name without appended whitespaces - QString new_name = txt.stripWhiteSpace(); + TQString new_name = txt.stripWhiteSpace(); if (m_payee.name() != new_name) { MyMoneyFileTransaction ft; try { @@ -495,7 +495,7 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin if (KMessageBox::questionYesNo(this, i18n("A payee with the name '%1' already exists. It is not advisable to have " "multiple payees with the same identification name. Are you sure you would like " - "to rename the payee?").arg(new_name)) != KMessageBox::Yes) + "to rename the payee?").tqarg(new_name)) != KMessageBox::Yes) { p->setText(0,m_payee.name()); return; @@ -521,7 +521,7 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify payee"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -530,9 +530,9 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin } } -void KPayeesView::ensurePayeeVisible(const QString& id) +void KPayeesView::ensurePayeeVisible(const TQString& id) { - for (QListViewItem * item = m_payeesList->firstChild(); item; item = item->itemBelow()) { + for (TQListViewItem * item = m_payeesList->firstChild(); item; item = item->itemBelow()) { KPayeeListItem* p = dynamic_cast(item); if(p && p->payee().id() == id) { if(p->itemAbove()) @@ -548,10 +548,10 @@ void KPayeesView::ensurePayeeVisible(const QString& id) } } -void KPayeesView::selectedPayees(QValueList& payeesList) const +void KPayeesView::selectedPayees(TQValueList& payeesList) const { - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected | QListViewItemIterator::Visible); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected | TQListViewItemIterator::Visible); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -565,8 +565,8 @@ void KPayeesView::slotSelectPayee(void) // check if the content of a currently selected payee was modified // and ask to store the data if (m_updateButton->isEnabled()) { - if (KMessageBox::questionYesNo(this, QString("%1").arg( - i18n("Do you want to save the changes for %1?").arg(m_newName)), + if (KMessageBox::questionYesNo(this, TQString("%1").tqarg( + i18n("Do you want to save the changes for %1?").tqarg(m_newName)), i18n("Save changes")) == KMessageBox::Yes) { m_inSelection = true; slotUpdatePayee(); @@ -576,7 +576,7 @@ void KPayeesView::slotSelectPayee(void) // loop over all payees and count the number of payees, also // optain last selected payee - QValueList payeesList; + TQValueList payeesList; selectedPayees(payeesList); emit selectObjects(payeesList); @@ -593,18 +593,18 @@ void KPayeesView::slotSelectPayee(void) m_tabWidget->setEnabled(false); // disable tab widget clearItemData(); // disable renaming in all listviewitem - for (QListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) + for (TQListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) i->setRenameEnabled(0, false); return; } // otherwise we have just one selected, enable payee information widget m_tabWidget->setEnabled(true); // enable renaming in all listviewitem - for (QListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) + for (TQListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) i->setRenameEnabled(0, true); // as of now we are updating only the last selected payee, and until - // selection mode of the QListView has been changed to Extended, this + // selection mode of the TQListView has been changed to Extended, this // will also be the only selection and behave exactly as before - Andreas try { m_payee = payeesList[0]; @@ -620,7 +620,7 @@ void KPayeesView::slotSelectPayee(void) emailEdit->setText(m_payee.email()); notesEdit->setText(m_payee.notes()); - QStringList keys; + TQStringList keys; bool ignorecase = false; MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); @@ -646,11 +646,11 @@ void KPayeesView::slotSelectPayee(void) void KPayeesView::clearItemData(void) { - addressEdit->setText(QString()); - postcodeEdit->setText(QString()); - telephoneEdit->setText(QString()); - emailEdit->setText(QString()); - notesEdit->setText(QString()); + addressEdit->setText(TQString()); + postcodeEdit->setText(TQString()); + telephoneEdit->setText(TQString()); + emailEdit->setText(TQString()); + notesEdit->setText(TQString()); showTransactions(); } @@ -664,16 +664,16 @@ void KPayeesView::showTransactions(void) m_transactionView->clear(); if(m_payee.id().isEmpty() || !m_tabWidget->isEnabled()) { - m_balanceLabel->setText(i18n("Balance: %1").arg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); + m_balanceLabel->setText(i18n("Balance: %1").tqarg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); return; } // setup the list and the pointer vector MyMoneyTransactionFilter filter; filter.addPayee(m_payee.id()); - filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), QDate()); + filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), TQDate()); - QValueList list = file->transactionList(filter); + TQValueList list = file->transactionList(filter); m_transactionList.clear(); m_transactionPtrVector.clear(); @@ -681,8 +681,8 @@ void KPayeesView::showTransactions(void) m_transactionPtrVector.setPayeeId(m_payee.id()); m_transactionPtrVector.setSortType(KTransactionPtrVector::SortPostDate); - QValueList::ConstIterator it_t; - QString lastId; + TQValueList::ConstIterator it_t; + TQString lastId; int ofs = 0; for(i = 0, it_t = list.begin(); it_t != list.end(); ++it_t) { @@ -699,7 +699,7 @@ void KPayeesView::showTransactions(void) MyMoneyAccount acc = MyMoneyFile::instance()->account(filter.matchingSplits()[ofs].accountId()); if(acc.accountGroup() == MyMoneyAccount::Asset || acc.accountGroup() == MyMoneyAccount::Liability) { - QValueList::ConstIterator it_k; + TQValueList::ConstIterator it_k; it_k = m_transactionList.append(k); balance += k.splitById(k.splitId()).value(); m_transactionPtrVector.insert(i, &(*it_k)); @@ -723,28 +723,28 @@ void KPayeesView::showTransactions(void) item->setText(0, s.number()); item->setText(1, KGlobal::locale()->formatDate(t->postDate(), true)); - QString txt; + TQString txt; if(s.action() == MyMoneySplit::ActionAmortization) { if(acc.accountType() == MyMoneyAccount::Loan) { if(s.value().isPositive()) { - txt = i18n("Amortization of %1").arg(acc.name()); + txt = i18n("Amortization of %1").tqarg(acc.name()); } else { - txt = i18n("Payment to %1").arg(acc.name()); + txt = i18n("Payment to %1").tqarg(acc.name()); } } else if(acc.accountType() == MyMoneyAccount::AssetLoan) { if(s.value().isNegative()) { - txt = i18n("Amortization of %1").arg(acc.name()); + txt = i18n("Amortization of %1").tqarg(acc.name()); } else { - txt = i18n("Payment to %1").arg(acc.name()); + txt = i18n("Payment to %1").tqarg(acc.name()); } } else { - txt = i18n("Loan payment from %1").arg(acc.name()); + txt = i18n("Loan payment from %1").tqarg(acc.name()); } } else if (file->isTransfer(*t)) { if(!s.value().isNegative()) { - txt = i18n("Transfer to %1").arg(acc.name()); + txt = i18n("Transfer to %1").tqarg(acc.name()); } else { - txt = i18n("Transfer from %1").arg(acc.name()); + txt = i18n("Transfer from %1").tqarg(acc.name()); } } else if(t->splitCount() > 2) { txt = i18n("Split transaction (category replacement)", "Split transaction"); @@ -755,7 +755,7 @@ void KPayeesView::showTransactions(void) item->setText(2, txt); item->setText(3, s.value().formatMoney(acc.fraction())); } - m_balanceLabel->setText(i18n("Balance: %1").arg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); + m_balanceLabel->setText(i18n("Balance: %1").tqarg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); // Trick: it seems, that the initial sizing of the view does // not work correctly. At least, the columns do not get displayed @@ -763,14 +763,14 @@ void KPayeesView::showTransactions(void) // is incorrect. If the widget is visible, resizing works correctly. // So, we let the dialog show up and resize it then. It's not really // clean, but the only way I got the damned thing working. - QTimer::singleShot(50, this, SLOT(rearrange())); + TQTimer::singleShot(50, this, TQT_SLOT(rearrange())); } void KPayeesView::slotKeyListChanged(void) { bool rc = false; bool ignorecase = false; - QStringList keys; + TQStringList keys; // J.Rodehueser: delete unused variable 'type' // orig: MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); m_payee.matchData(ignorecase, keys); @@ -801,7 +801,7 @@ void KPayeesView::slotPayeeDataChanged(void) || (!notesEdit->text().isEmpty() && m_payee.notes() != notesEdit->text())); bool ignorecase = false; - QStringList keys; + TQStringList keys; MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); rc |= (static_cast(type) != m_matchType->selectedId()); @@ -831,7 +831,7 @@ void KPayeesView::slotPayeeDataChanged(void) rc |= !m_payee.defaultAccountId().isEmpty(); } else { - QString temp = comboDefaultAccount->selectedAccounts().front(); + TQString temp = comboDefaultAccount->selectedAccounts().front(); rc |= ( temp.isEmpty() != m_payee.defaultAccountId().isEmpty()) || (!m_payee.defaultAccountId().isEmpty() && temp != m_payee.defaultAccountId()); } @@ -860,7 +860,7 @@ void KPayeesView::slotUpdatePayee(void) m_payee.setDefaultAccountId(); if (checkEnableDefaultAccount->isChecked()) { - QString temp; + TQString temp; if (!comboDefaultAccount->selectedAccounts().empty()) { temp = comboDefaultAccount->selectedAccounts().front(); m_payee.setDefaultAccountId(temp); @@ -872,7 +872,7 @@ void KPayeesView::slotUpdatePayee(void) } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify payee"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -882,7 +882,7 @@ void KPayeesView::readConfig(void) { m_transactionView->setFont(KMyMoneyGlobalSettings::listCellFont()); - QFontMetrics fm( KMyMoneyGlobalSettings::listHeaderFont() ); + TQFontMetrics fm( KMyMoneyGlobalSettings::listHeaderFont() ); int height = fm.lineSpacing()+6; m_transactionView->header()->setMinimumHeight(height); @@ -890,7 +890,7 @@ void KPayeesView::readConfig(void) m_transactionView->header()->setFont(KMyMoneyGlobalSettings::listHeaderFont()); m_payeesList->setDefaultRenameAction( - KMyMoneyGlobalSettings::focusChangeIsEnter() ? QListView::Accept : QListView::Reject); + KMyMoneyGlobalSettings::focusChangeIsEnter() ? TQListView::Accept : TQListView::Reject); //initialize the account list? comboDefaultAccount->loadList((KMyMoneyUtils::categoryTypeE)(KMyMoneyUtils::asset | KMyMoneyUtils::liability | MyMoneyAccount::Income | MyMoneyAccount::Expense)); @@ -904,7 +904,7 @@ void KPayeesView::show(void) // If you want to learn about the details, see the source of KListViewSearchLineWidget's // constructor if(m_needConnection) { - connect(m_searchWidget->searchLine(), SIGNAL(textChanged(const QString&)), this, SLOT(slotQueueUpdate(void))); + connect(m_searchWidget->searchLine(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotQueueUpdate(void))); m_needConnection = false; } @@ -913,13 +913,13 @@ void KPayeesView::show(void) m_needReload = false; } - // fixup the layout - QTimer::singleShot(0, this, SLOT(rearrange())); + // fixup the tqlayout + TQTimer::singleShot(0, this, TQT_SLOT(rearrange())); // don't forget base class implementation KPayeesViewDecl::show(); - QValueList list; + TQValueList list; selectedPayees(list); emit selectObjects(list); } @@ -928,7 +928,7 @@ void KPayeesView::slotLoadPayees(void) { if(isVisible()) { if(m_inSelection) - QTimer::singleShot(0, this, SLOT(slotLoadPayees())); + TQTimer::singleShot(0, this, TQT_SLOT(slotLoadPayees())); else loadPayees(); } else { @@ -941,15 +941,15 @@ void KPayeesView::loadPayees(void) if(m_inSelection) return; - QMap isSelected; - QString id; + TQMap isSelected; + TQString id; ::timetrace("Start KPayeesView::loadPayees"); readConfig(); // remember which items are selected in the list - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -963,7 +963,7 @@ void KPayeesView::loadPayees(void) id = currentItem->payee().id(); // remember the upper left corner of the viewport - QPoint startPoint = m_payeesList->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_payeesList->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_payeesList->setUpdatesEnabled(false); @@ -973,8 +973,8 @@ void KPayeesView::loadPayees(void) m_transactionView->clear(); currentItem = 0; - QValueListlist = MyMoneyFile::instance()->payeeList(); - QValueList::ConstIterator it; + TQValueListlist = MyMoneyFile::instance()->payeeList(); + TQValueList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { KPayeeListItem* item = new KPayeeListItem(m_payeesList, *it); @@ -991,11 +991,11 @@ void KPayeesView::loadPayees(void) // reposition viewport m_payeesList->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_payeesList->setUpdatesEnabled(true); - m_payeesList->repaintContents(); + m_payeesList->tqrepaintContents(); slotSelectPayee(); @@ -1007,7 +1007,7 @@ void KPayeesView::rearrange(void) resizeEvent(0); } -void KPayeesView::resizeEvent(QResizeEvent* ev) +void KPayeesView::resizeEvent(TQResizeEvent* ev) { // resize the register int w = m_transactionView->visibleWidth(); @@ -1023,14 +1023,14 @@ void KPayeesView::resizeEvent(QResizeEvent* ev) KPayeesViewDecl::resizeEvent(ev); } -void KPayeesView::slotTransactionDoubleClicked(QListViewItem* i) +void KPayeesView::slotTransactionDoubleClicked(TQListViewItem* i) { KTransactionListItem* item = static_cast(i); if (item) emit transactionSelected(item->accountId(), item->transactionId()); } -void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QString& accountId, const QString& transactionId) +void KPayeesView::slotSelectPayeeAndTransaction(const TQString& payeeId, const TQString& accountId, const TQString& transactionId) { if(!isVisible()) return; @@ -1041,8 +1041,8 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS m_searchWidget->searchLine()->updateSearch(); // deselect all other selected items - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -1051,7 +1051,7 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS } // find the payee in the list - QListViewItem* it; + TQListViewItem* it; for(it = m_payeesList->firstChild(); it; it = it->itemBelow()) { KPayeeListItem* item = dynamic_cast(it); if(item && item->payee().id() == payeeId) { @@ -1088,7 +1088,7 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS } } -void KPayeesView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p) +void KPayeesView::slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p) { Q_UNUSED(p); if(lv == m_payeesList) { diff --git a/kmymoney2/views/kpayeesview.h b/kmymoney2/views/kpayeesview.h index 92f98fd..f4a481e 100644 --- a/kmymoney2/views/kpayeesview.h +++ b/kmymoney2/views/kpayeesview.h @@ -29,8 +29,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QSplitter; +#include +class TQSplitter; // ---------------------------------------------------------------------------- // KDE Includes @@ -57,7 +57,7 @@ class KListViewSearchLineWidget; * vector is created, the sort method is set to SortPostDate. * The sort type can be changed using the method setSortType(). */ -class KTransactionPtrVector : public QPtrVector { +class KTransactionPtrVector : public TQPtrVector { public: /** * This enumerator defines the possible sort methods. @@ -111,20 +111,20 @@ public: * get information about the split referencing the current account * during the sort phase. */ - void setAccountId(const QString& id); + void setAccountId(const TQString& id); /** * This method is used to set the payee id to have a chance to * get information about the split referencing the current payee * during the sort phase. */ - void setPayeeId(const QString& id); + void setPayeeId(const TQString& id); protected: int compareItems(KTransactionPtrVector::Item d1, KTransactionPtrVector::Item d2); private: - int compareItems(const QString& s1, const QString& s2) const; + int compareItems(const TQString& s1, const TQString& s2) const; private: enum { @@ -132,7 +132,7 @@ private: PayeeMode }; short m_idMode; - QString m_id; + TQString m_id; TransactionSortE m_sortType; }; @@ -147,20 +147,20 @@ public: /** * Constructor to be used to construct a payee entry object. * - * @param parent pointer to the KListView object this entry should be + * @param tqparent pointer to the KListView object this entry should be * added to. * @param payee const reference to MyMoneyPayee for which * the KListView entry is constructed */ - KPayeeListItem(KListView *parent, const MyMoneyPayee& payee); + KPayeeListItem(KListView *tqparent, const MyMoneyPayee& payee); ~KPayeeListItem(); /** - * This method is re-implemented from QListViewItem::paintCell(). - * Besides the standard implementation, the QPainter is set + * This method is re-implemented from TQListViewItem::paintCell(). + * Besides the standard implementation, the TQPainter is set * according to the applications settings. */ - void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); const MyMoneyPayee& payee(void) const { return m_payee; }; @@ -175,48 +175,49 @@ private: class KTransactionListItem : public KListViewItem { public: - KTransactionListItem(KListView* view, KTransactionListItem* parent, const QString& accountId, const QString& transaction); + KTransactionListItem(KListView* view, KTransactionListItem* tqparent, const TQString& accountId, const TQString& transaction); ~KTransactionListItem(); - const QString& transactionId(void) const { return m_transactionId; }; + const TQString& transactionId(void) const { return m_transactionId; }; - const QString& accountId(void) const { return m_accountId; }; + const TQString& accountId(void) const { return m_accountId; }; /** * use my own paint method */ - void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment); + void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment); /** * use my own backgroundColor method */ - const QColor backgroundColor(); + const TQColor backgroundColor(); private: - QString m_transactionId; - QString m_accountId; + TQString m_transactionId; + TQString m_accountId; }; class KPayeesView : public KPayeesViewDecl { Q_OBJECT + TQ_OBJECT public: - KPayeesView(QWidget *parent=0, const char *name=0); + KPayeesView(TQWidget *tqparent=0, const char *name=0); ~KPayeesView(); void show(void); public slots: - void slotSelectPayeeAndTransaction(const QString& payeeId, const QString& accountId = QString(), const QString& transactionId = QString()); + void slotSelectPayeeAndTransaction(const TQString& payeeId, const TQString& accountId = TQString(), const TQString& transactionId = TQString()); void slotLoadPayees(void); void slotStartRename(void); void slotHelp(void); protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); void loadPayees(void); - void selectedPayees(QValueList& payeesList) const; - void ensurePayeeVisible(const QString& id); + void selectedPayees(TQValueList& payeesList) const; + void ensurePayeeVisible(const TQString& id); void clearItemData(void); protected slots: @@ -244,7 +245,7 @@ protected slots: * This slot is called when the name of a payee is changed inside * the payee list view and only a single payee is selected. */ - void slotRenamePayee(QListViewItem *p, int col, const QString& txt); + void slotRenamePayee(TQListViewItem *p, int col, const TQString& txt); /** * Updates the payee data in m_payee from the information in the @@ -252,7 +253,7 @@ protected slots: */ void slotUpdatePayee(void); - void slotTransactionDoubleClicked(QListViewItem *); + void slotTransactionDoubleClicked(TQListViewItem *); private slots: void rearrange(void); @@ -265,7 +266,7 @@ private slots: * @param item the item on which the cursor resides * @param p position of the pointer device */ - void slotOpenContextMenu(KListView* lv, QListViewItem* item, const QPoint& p); + void slotOpenContextMenu(KListView* lv, TQListViewItem* item, const TQPoint& p); void slotQueueUpdate(void); @@ -277,20 +278,20 @@ private: void readConfig(void); signals: - void transactionSelected(const QString& accountId, const QString& transactionId); + void transactionSelected(const TQString& accountId, const TQString& transactionId); void openContextMenu(const MyMoneyObject& obj); - void selectObjects(const QValueList& payees); + void selectObjects(const TQValueList& payees); private: MyMoneyPayee m_payee; - QString m_newName; + TQString m_newName; - QSplitter* m_splitter; + TQSplitter* m_splitter; /** * This member holds a list of all transactions */ - QValueList m_transactionList; + TQValueList m_transactionList; /** * This member keeps a vector of pointers to all visible (filtered) diff --git a/kmymoney2/views/kpayeesviewdecl.ui b/kmymoney2/views/kpayeesviewdecl.ui index 3584e6f..0c2705e 100644 --- a/kmymoney2/views/kpayeesviewdecl.ui +++ b/kmymoney2/views/kpayeesviewdecl.ui @@ -1,6 +1,6 @@ KPayeesViewDecl - + KPayeesViewDecl @@ -19,9 +19,9 @@ 0 - + - layout10 + tqlayout10 @@ -52,7 +52,7 @@ false - + m_tabWidget @@ -64,7 +64,7 @@ 1 - + tab @@ -75,7 +75,7 @@ unnamed - + transactionGroup @@ -92,7 +92,7 @@ 6 - + Layout11 @@ -161,14 +161,14 @@ false - + m_balanceLabel Balance: - + AlignVCenter|AlignRight @@ -178,7 +178,7 @@ - + tab @@ -189,7 +189,7 @@ unnamed - + detailsGroup @@ -206,7 +206,7 @@ 6 - + TextLabel7 @@ -218,7 +218,7 @@ 0 - + 90 0 @@ -228,7 +228,7 @@ E-Mail: - + TextLabel5 @@ -240,7 +240,7 @@ 0 - + 90 0 @@ -250,7 +250,7 @@ Postal Code: - + TextLabel6 @@ -262,7 +262,7 @@ 0 - + 90 0 @@ -272,7 +272,7 @@ Telephone/Fax: - + TextLabel4_2 @@ -284,7 +284,7 @@ 0 - + 90 0 @@ -293,26 +293,26 @@ Notes - + AlignTop|AlignLeft - + postcodeEdit - + telephoneEdit - + emailEdit - + addressEdit @@ -325,7 +325,7 @@ - + notesEdit @@ -338,7 +338,7 @@ - + TextLabel4 @@ -350,7 +350,7 @@ 0 - + 90 0 @@ -359,7 +359,7 @@ Address: - + AlignTop|AlignLeft @@ -375,7 +375,7 @@ Expanding - + 21 20 @@ -384,7 +384,7 @@ - + TabPage @@ -395,14 +395,14 @@ unnamed - + buttonGroup1 Transaction Matching - + m_matchType @@ -426,7 +426,7 @@ true - + radioNoMatch @@ -445,7 +445,7 @@ true - + radioNameMatch @@ -461,7 +461,7 @@ Match on Payee name - + radioKeyMatch @@ -498,7 +498,7 @@ This list contains the names that will match this payee if a transaction is imported from an external source. Keep in mind, that you can specify regular expressions here. - + checkMatchIgnoreCase @@ -516,7 +516,7 @@ Expanding - + 20 20 @@ -525,7 +525,7 @@ - + TabPage2 @@ -536,7 +536,7 @@ unnamed - + checkEnableDefaultAccount @@ -545,15 +545,15 @@ new transactions with this payee - + - layout5 + tqlayout5 unnamed - + labelDefaultAccount @@ -586,7 +586,7 @@ new transactions with this payee Expanding - + 20 31 @@ -598,9 +598,9 @@ new transactions with this payee - + - layout10 + tqlayout10 @@ -632,7 +632,7 @@ new transactions with this payee Expanding - + 260 21 @@ -662,5 +662,5 @@ new transactions with this payee ../widgets/kmymoneyaccountcombo.h - + diff --git a/kmymoney2/views/kreportsview.cpp b/kmymoney2/views/kreportsview.cpp index 6c7da52..36de4c9 100755 --- a/kmymoney2/views/kreportsview.cpp +++ b/kmymoney2/views/kreportsview.cpp @@ -30,22 +30,22 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -86,12 +86,12 @@ using namespace reports; * KReportsView::KReportTab Implementation */ -KReportsView::KReportTab::KReportTab(KTabWidget* parent, const MyMoneyReport& report ): - QWidget( parent, "reporttab" ), +KReportsView::KReportTab::KReportTab(KTabWidget* tqparent, const MyMoneyReport& report ): + TQWidget( tqparent, "reporttab" ), m_part( new KHTMLPart( this, "reporttabpart" ) ), m_chartView( new KReportChartView( this, "reportchart" ) ), m_control( new kMyMoneyReportControlDecl( this, "reportcontrol" ) ), - m_layout( new QVBoxLayout( this, 11, 6, "reporttablayout" ) ), + m_layout( new TQVBoxLayout( this, 11, 6, "reporttabtqlayout" ) ), m_report( report ), m_deleteMe( false ), m_showingChart( false ), @@ -105,20 +105,20 @@ KReportsView::KReportTab::KReportTab(KTabWidget* parent, const MyMoneyReport& re m_control->buttonChart->hide(); } - m_chartView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_chartView->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); m_chartView->hide(); - m_layout->addWidget( m_control ); //, 0, Qt::AlignTop ); + m_layout->addWidget( m_control ); //, 0, TQt::AlignTop ); m_layout->addWidget( m_part->view() ); m_layout->addWidget( m_chartView ); // I like this icon... - QString icon = KGlobal::dirs()->findResource("icon", "default.kde/16x16/mimetypes/spreadsheet.png"); + TQString icon = KGlobal::dirs()->findResource("icon", "default.kde/16x16/mimetypes/spreadsheet.png"); // but if it's not there, we'll use ye ol' standard icon - if ( icon == QString::null ) + if ( icon == TQString() ) icon = KGlobal::dirs()->findResource("icon", "hicolor/16x16/apps/kmymoney2.png"); - parent->insertTab( this, QIconSet(QPixmap(icon)), report.name() ); - parent->setTabEnabled( this, true ); + tqparent->insertTab( this, TQIconSet(TQPixmap(icon)), report.name() ); + tqparent->setTabEnabled( this, true ); #ifdef HAVE_KDCHART if ( m_report.isChartByDefault() ) @@ -139,29 +139,29 @@ void KReportsView::KReportTab::print(void) void KReportsView::KReportTab::copyToClipboard(void) { - QTextDrag* pdrag = new QTextDrag( createTable() ); + TQTextDrag* pdrag = new TQTextDrag( createTable() ); pdrag->setSubtype("html"); - QApplication::clipboard()->setData(pdrag); + TQApplication::tqclipboard()->setData(pdrag); } -void KReportsView::KReportTab::saveAs( const QString& filename, bool includeCSS ) +void KReportsView::KReportTab::saveAs( const TQString& filename, bool includeCSS ) { - QFile file( filename ); + TQFile file( filename ); if ( file.open( IO_WriteOnly ) ) { - if ( QFileInfo(filename).extension(false).lower() == "csv") + if ( TQFileInfo(filename).extension(false).lower() == "csv") { - QTextStream(&file) << m_table->renderCSV(); + TQTextStream(&file) << m_table->renderCSV(); } else { - QTextStream stream(&file); + TQTextStream stream(&file); - QRegExp exp(QString("(.*)(()(.*)").arg(KGlobal::locale()->encoding())); - QString table = createTable(); + TQRegExp exp(TQString("(.*)(()(.*)").tqarg(KGlobal::locale()->encoding())); + TQString table = createTable(); if(exp.search(table) != -1 && includeCSS) { - QFile cssFile(exp.cap(3)); + TQFile cssFile(exp.cap(3)); if(cssFile.open(IO_ReadOnly)) { - QTextStream cssStream(&cssFile); + TQTextStream cssStream(&cssFile); stream << exp.cap(1); stream << exp.cap(4); stream << endl << "