diff options
Diffstat (limited to 'kmymoney2/dialogs/knewaccountdlg.cpp')
-rw-r--r-- | kmymoney2/dialogs/knewaccountdlg.cpp | 288 |
1 files changed, 144 insertions, 144 deletions
diff --git a/kmymoney2/dialogs/knewaccountdlg.cpp b/kmymoney2/dialogs/knewaccountdlg.cpp index f941f2e..fb01aef 100644 --- a/kmymoney2/dialogs/knewaccountdlg.cpp +++ b/kmymoney2/dialogs/knewaccountdlg.cpp @@ -23,19 +23,19 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qlabel.h> -#include <qheader.h> -#include <qtooltip.h> -#include <qcheckbox.h> -#include <qtimer.h> -#include <qtabwidget.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qtextedit.h> -#include <qlayout.h> -#include <qtabwidget.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqheader.h> +#include <tqtooltip.h> +#include <tqcheckbox.h> +#include <tqtimer.h> +#include <tqtabwidget.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqtextedit.h> +#include <tqlayout.h> +#include <tqtabwidget.h> // ---------------------------------------------------------------------------- // KDE Headers @@ -88,24 +88,24 @@ #define KMM_KDCHART_PROPSET_NORMAL_DATA KDCHART_PROPSET_NORMAL_DATA #endif -KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, QWidget *parent, const char *name, const QString& title) - : KNewAccountDlgDecl(parent,name,true), +KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, TQWidget *tqparent, const char *name, const TQString& title) + : KNewAccountDlgDecl(tqparent,name,true), m_account(account), m_bSelectedParentAccount(false), m_categoryEditor(categoryEditor), m_isEditing(isEditing) { - QString columnName = ( (categoryEditor) ? i18n("Categories") : i18n("Accounts") ); + TQString columnName = ( (categoryEditor) ? i18n("Categories") : i18n("Accounts") ); m_qlistviewParentAccounts->setRootIsDecorated(true); m_qlistviewParentAccounts->setAllColumnsShowFocus(true); m_qlistviewParentAccounts->setSectionHeader(columnName); m_qlistviewParentAccounts->setMultiSelection(false); m_qlistviewParentAccounts->header()->setResizeEnabled(true); - m_qlistviewParentAccounts->setColumnWidthMode(0, QListView::Maximum); + m_qlistviewParentAccounts->setColumnWidthMode(0, TQListView::Maximum); m_qlistviewParentAccounts->setEnabled(false); // never show the horizontal scroll bar - m_qlistviewParentAccounts->setHScrollBarMode(QScrollView::AlwaysOff); + m_qlistviewParentAccounts->setHScrollBarMode(TQScrollView::AlwaysOff); m_subAccountLabel->setText(i18n("Is a sub account")); @@ -135,7 +135,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo if (categoryEditor) { // get rid of the tabs that are not used for categories - QWidget* tab = m_tab->page(m_tab->indexOf(m_institutionTab)); + TQWidget* tab = m_tab->page(m_tab->indexOf(m_institutionTab)); if(tab) m_tab->removePage(tab); tab = m_tab->page(m_tab->indexOf(m_limitsTab)); @@ -178,7 +178,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo else { // get rid of the tabs that are not used for accounts - QWidget* taxtab = m_tab->page(m_tab->indexOf(m_taxTab)); + TQWidget* taxtab = m_tab->page(m_tab->indexOf(m_taxTab)); if (taxtab) { if(m_account.isAssetLiability()) { m_vatCategory->setText(i18n( "VAT account")); @@ -206,7 +206,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo default: // no limit available, so we might get rid of the tab - QWidget* tab = m_tab->page(m_tab->indexOf(m_limitsTab)); + TQWidget* tab = m_tab->page(m_tab->indexOf(m_limitsTab)); if(tab) m_tab->removePage(tab); // don't try to hide the widgets we just wiped @@ -289,7 +289,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo } if(!m_account.openingDate().isValid()) - m_account.setOpeningDate(QDate::currentDate()); + m_account.setOpeningDate(TQDate::tqcurrentDate()); startDateEdit->setDate(m_account.openingDate()); accountNoEdit->setText(account.number()); @@ -334,14 +334,14 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo // Load the institutions // then the accounts - QString institutionName; + TQString institutionName; try { if (m_isEditing && !account.institutionId().isEmpty()) institutionName = file->institution(account.institutionId()).name(); else - institutionName = QString(); + institutionName = TQString(); } catch (MyMoneyException *e) { @@ -349,7 +349,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo delete e; } - initParentWidget(account.parentAccountId(), account.id()); + initParentWidget(account.tqparentAccountId(), account.id()); if(m_account.isInvest()) m_qlistviewParentAccounts->setEnabled(false); @@ -366,44 +366,44 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo cancelButton->setGuiItem(KStdGuiItem::cancel()); createButton->setGuiItem(KStdGuiItem::ok()); - connect(cancelButton, SIGNAL(clicked()), SLOT(reject())); - connect(createButton, SIGNAL(clicked()), this, SLOT(okClicked())); - connect(m_qlistviewParentAccounts, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(slotSelectionChanged(QListViewItem*))); - connect(m_qbuttonNew, SIGNAL(clicked()), this, SLOT(slotNewClicked())); - connect(typeCombo, SIGNAL(activated(const QString&)), - this, SLOT(slotAccountTypeChanged(const QString&))); + connect(cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); + connect(createButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(okClicked())); + connect(m_qlistviewParentAccounts, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(slotSelectionChanged(TQListViewItem*))); + connect(m_qbuttonNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewClicked())); + connect(typeCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(slotAccountTypeChanged(const TQString&))); - connect(accountNameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckFinished())); + connect(accountNameEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckFinished())); - connect(m_vatCategory, SIGNAL(toggled(bool)), this, SLOT(slotVatChanged(bool))); - connect(m_vatAssignment, SIGNAL(toggled(bool)), this, SLOT(slotVatAssignmentChanged(bool))); - connect(m_vatCategory, SIGNAL(toggled(bool)), this, SLOT(slotCheckFinished())); - connect(m_vatAssignment, SIGNAL(toggled(bool)), this, SLOT(slotCheckFinished())); - connect(m_vatRate, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckFinished())); - connect(m_vatAccount, SIGNAL(stateChanged()), this, SLOT(slotCheckFinished())); + connect(m_vatCategory, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotVatChanged(bool))); + connect(m_vatAssignment, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotVatAssignmentChanged(bool))); + connect(m_vatCategory, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatAssignment, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatRate, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatAccount, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotCheckFinished())); - connect(m_minBalanceEarlyEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMinBalanceAbsoluteEdit(const QString&))); - connect(m_minBalanceAbsoluteEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMinBalanceEarlyEdit(const QString&))); - connect(m_maxCreditEarlyEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMaxCreditAbsoluteEdit(const QString&))); - connect(m_maxCreditAbsoluteEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMaxCreditEarlyEdit(const QString&))); + connect(m_minBalanceEarlyEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMinBalanceAbsoluteEdit(const TQString&))); + connect(m_minBalanceAbsoluteEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMinBalanceEarlyEdit(const TQString&))); + connect(m_maxCreditEarlyEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMaxCreditAbsoluteEdit(const TQString&))); + connect(m_maxCreditAbsoluteEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMaxCreditEarlyEdit(const TQString&))); - connect(m_qcomboboxInstitutions, SIGNAL(activated(const QString&)), this, SLOT(slotLoadInstitutions(const QString&))); + connect(m_qcomboboxInstitutions, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotLoadInstitutions(const TQString&))); m_vatCategory->setChecked(false); m_vatAssignment->setChecked(false); - // make sure our account does not have an id and no parent assigned - // and certainly no children in case we create a new account + // make sure our account does not have an id and no tqparent assigned + // and certainly no tqchildren in case we create a new account if(!m_isEditing) { m_account.clearId(); - m_account.setParentAccountId(QString()); - QStringList::ConstIterator it; + m_account.setParentAccountId(TQString()); + TQStringList::ConstIterator it; while((it = m_account.accountList().begin()) != m_account.accountList().end()) m_account.removeAccountId(*it); if(m_parentItem == 0) { - // force loading of initial parent + // force loading of initial tqparent m_account.setAccountType(MyMoneyAccount::UnknownAccountType); MyMoneyAccount::_accountTypeE type = account.accountType(); if(type == MyMoneyAccount::UnknownAccountType) @@ -416,7 +416,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo m_vatRate->setValue(MyMoneyMoney(m_account.value("VatRate"))*MyMoneyMoney(100,1)); } else { if(!m_account.value("VatAccount").isEmpty()) { - QString accId = m_account.value("VatAccount").latin1(); + TQString accId = m_account.value("VatAccount").latin1(); try { // make sure account exists MyMoneyFile::instance()->account(accId); @@ -435,14 +435,14 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo slotVatAssignmentChanged(m_vatAssignment->isChecked()); slotCheckFinished(); - kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (this); + kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (TQT_TQOBJECT(this)); requiredFields->setOkButton(createButton); // button to be enabled when all fields present requiredFields->add(accountNameEdit); // using a timeout is the only way, I got the 'ensureItemVisible' // working when creating the dialog. I assume, this // has something to do with the delayed update of the display somehow. - QTimer::singleShot(50, this, SLOT(timerDone())); + TQTimer::singleShot(50, this, TQT_SLOT(timerDone())); } void KNewAccountDlg::timerDone(void) @@ -451,7 +451,7 @@ void KNewAccountDlg::timerDone(void) if(m_parentItem) m_qlistviewParentAccounts->ensureItemVisible(m_parentItem); // KNewAccountDlgDecl::resizeEvent(0); m_qlistviewParentAccounts->setColumnWidth(m_qlistviewParentAccounts->nameColumn(), m_qlistviewParentAccounts->visibleWidth()); - m_qlistviewParentAccounts->repaintContents(false); + m_qlistviewParentAccounts->tqrepaintContents(false); } void KNewAccountDlg::setOpeningBalance(const MyMoneyMoney& balance) @@ -468,7 +468,7 @@ void KNewAccountDlg::okClicked() { MyMoneyFile* file = MyMoneyFile::instance(); - QString accountNameText = accountNameEdit->text(); + TQString accountNameText = accountNameEdit->text(); if (accountNameText.isEmpty()) { KMessageBox::error(this, i18n("You have not specified a name.\nPlease fill in this field.")); @@ -476,24 +476,24 @@ void KNewAccountDlg::okClicked() return; } - MyMoneyAccount parent = parentAccount(); - if (parent.name().length() == 0) + MyMoneyAccount tqparent = tqparentAccount(); + if (tqparent.name().length() == 0) { - KMessageBox::error(this, i18n("Please select a parent account.")); + KMessageBox::error(this, i18n("Please select a tqparent account.")); return; } if (!m_categoryEditor) { - QString institutionNameText = m_qcomboboxInstitutions->currentText(); + TQString institutionNameText = m_qcomboboxInstitutions->currentText(); if (institutionNameText != i18n("<No Institution>")) { try { MyMoneyFile *file = MyMoneyFile::instance(); - QValueList<MyMoneyInstitution> list = file->institutionList(); - QValueList<MyMoneyInstitution>::ConstIterator institutionIterator; + TQValueList<MyMoneyInstitution> list = file->institutionList(); + TQValueList<MyMoneyInstitution>::ConstIterator institutionIterator; for (institutionIterator = list.begin(); institutionIterator != list.end(); ++institutionIterator) { if ((*institutionIterator).name() == institutionNameText) @@ -508,7 +508,7 @@ void KNewAccountDlg::okClicked() } else { - m_account.setInstitutionId(QString()); + m_account.setInstitutionId(TQString()); } } @@ -532,16 +532,16 @@ void KNewAccountDlg::okClicked() storeKVP("lastNumberUsed", m_lastCheckNumberUsed); // delete a previous version of the minimumbalance information - storeKVP("minimumBalance", QString(), QString()); + storeKVP("minimumBalance", TQString(), TQString()); MyMoneyAccount::accountTypeE acctype; if (!m_categoryEditor) { acctype = KMyMoneyUtils::stringToAccountType(typeCombo->currentText()); - // If it's a loan, check if the parent is asset or liability. In + // If it's a loan, check if the tqparent is asset or liability. In // case of asset, we change the account type to be AssetLoan if(acctype == MyMoneyAccount::Loan - && parent.accountGroup() == MyMoneyAccount::Asset) + && tqparent.accountGroup() == MyMoneyAccount::Asset) acctype = MyMoneyAccount::AssetLoan; #if 0 @@ -549,22 +549,22 @@ void KNewAccountDlg::okClicked() // we don't need this check anymore. if(!file->nameToAccount(accountNameText).isEmpty() && (file->nameToAccount(accountNameText) != m_account.id())) { - KMessageBox::error(this, QString("<qt>")+i18n("An account named <b>%1</b> already exists. You cannot create a second account with the same name.").arg(accountNameText)+QString("</qt>")); + KMessageBox::error(this, TQString("<qt>")+i18n("An account named <b>%1</b> already exists. You cannot create a second account with the same name.").tqarg(accountNameText)+TQString("</qt>")); return; } #endif } else { - acctype = parent.accountGroup(); - QString newName; - if(!MyMoneyFile::instance()->isStandardAccount(parent.id())) { - newName = MyMoneyFile::instance()->accountToCategory(parent.id()) + MyMoneyFile::AccountSeperator; + acctype = tqparent.accountGroup(); + TQString newName; + if(!MyMoneyFile::instance()->isStandardAccount(tqparent.id())) { + newName = MyMoneyFile::instance()->accountToCategory(tqparent.id()) + MyMoneyFile::AccountSeperator; } newName += accountNameText; if(!file->categoryToAccount(newName, acctype).isEmpty() && (file->categoryToAccount(newName, acctype) != m_account.id())) { - KMessageBox::error(this, QString("<qt>")+i18n("A category named <b>%1</b> already exists. You cannot create a second category with the same name.").arg(newName)+QString("</qt>")); + KMessageBox::error(this, TQString("<qt>")+i18n("A category named <b>%1</b> already exists. You cannot create a second category with the same name.").tqarg(newName)+TQString("</qt>")); return; } } @@ -619,7 +619,7 @@ void KNewAccountDlg::okClicked() accept(); } -void KNewAccountDlg::loadKVP(const QString& key, kMyMoneyEdit* widget) +void KNewAccountDlg::loadKVP(const TQString& key, kMyMoneyEdit* widget) { if(!widget) return; @@ -631,7 +631,7 @@ void KNewAccountDlg::loadKVP(const QString& key, kMyMoneyEdit* widget) } } -void KNewAccountDlg::loadKVP(const QString& key, KLineEdit* widget) +void KNewAccountDlg::loadKVP(const TQString& key, KLineEdit* widget) { if(!widget) return; @@ -639,7 +639,7 @@ void KNewAccountDlg::loadKVP(const QString& key, KLineEdit* widget) widget->setText(m_account.value(key)); } -void KNewAccountDlg::storeKVP(const QString& key, const QString& text, const QString& value) +void KNewAccountDlg::storeKVP(const TQString& key, const TQString& text, const TQString& value) { if(text.isEmpty()) m_account.deletePair(key); @@ -647,12 +647,12 @@ void KNewAccountDlg::storeKVP(const QString& key, const QString& text, const QSt m_account.setValue(key, value); } -void KNewAccountDlg::storeKVP(const QString& key, kMyMoneyEdit* widget) +void KNewAccountDlg::storeKVP(const TQString& key, kMyMoneyEdit* widget) { storeKVP(key, widget->lineedit()->text(), widget->text()); } -void KNewAccountDlg::storeKVP(const QString& key, KLineEdit* widget) +void KNewAccountDlg::storeKVP(const TQString& key, KLineEdit* widget) { storeKVP(key, widget->text(), widget->text()); } @@ -669,14 +669,14 @@ const MyMoneyAccount& KNewAccountDlg::account(void) break; case 1: case 2: - m_account.setValue("priceMode", QString("%1").arg(m_priceMode->currentItem())); + m_account.setValue("priceMode", TQString("%1").tqarg(m_priceMode->currentItem())); break; } return m_account; } -const MyMoneyAccount& KNewAccountDlg::parentAccount(void) +const MyMoneyAccount& KNewAccountDlg::tqparentAccount(void) { if (!m_bSelectedParentAccount) { @@ -710,7 +710,7 @@ const MyMoneyAccount& KNewAccountDlg::parentAccount(void) return m_parentAccount; } -void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId) +void KNewAccountDlg::initParentWidget(TQString tqparentId, const TQString& accountId) { MyMoneyFile *file = MyMoneyFile::instance(); @@ -723,18 +723,18 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_parentItem = 0; m_accountItem = 0; - // Determine the parent account + // Determine the tqparent account try { - m_parentAccount = file->account(parentId); + m_parentAccount = file->account(tqparentId); } catch (MyMoneyException *e) { m_bSelectedParentAccount = false; m_parentAccount = MyMoneyAccount(); if(m_account.accountType() != MyMoneyAccount::UnknownAccountType) { - parentAccount(); - parentId = m_parentAccount.id(); + tqparentAccount(); + tqparentId = m_parentAccount.id(); } delete e; } @@ -748,7 +748,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_qlistviewParentAccounts->clear(); - // Now scan all 4 account roots to load the list and mark the parent + // Now scan all 4 account roots to load the list and mark the tqparent try { if (!m_categoryEditor) @@ -759,15 +759,15 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = assetAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == assetAccount.id()) + if (tqparentId == assetAccount.id()) m_parentItem = assetTopLevelAccount; assetTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = assetAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = assetAccount.accountList().begin(); it != assetAccount.accountList().end(); ++it ) { @@ -777,7 +777,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(assetTopLevelAccount, acc); - if(parentId == acc.id()) { + if(tqparentId == acc.id()) { m_parentItem = accountItem; } else if(accountId == acc.id()) { if(m_isEditing) @@ -785,10 +785,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = acc.accountList(); + TQStringList subAccounts = acc.accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, acc.id()); + showSubAccounts(subAccounts, accountItem, tqparentId, acc.id()); } } } @@ -799,15 +799,15 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = liabilityAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == liabilityAccount.id()) + if (tqparentId == liabilityAccount.id()) m_parentItem = liabilityTopLevelAccount; liabilityTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = liabilityAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = liabilityAccount.accountList().begin(); it != liabilityAccount.accountList().end(); ++it ) { @@ -817,7 +817,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(liabilityTopLevelAccount, acc); - if(parentId == acc.id()) { + if(tqparentId == acc.id()) { m_parentItem = accountItem; } else if(accountId == acc.id()) { if(m_isEditing) @@ -825,10 +825,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = acc.accountList(); + TQStringList subAccounts = acc.accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, acc.id()); + showSubAccounts(subAccounts, accountItem, tqparentId, acc.id()); } } } @@ -842,23 +842,23 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = incomeAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == incomeAccount.id()) + if (tqparentId == incomeAccount.id()) m_parentItem = incomeTopLevelAccount; incomeTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = incomeAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = incomeAccount.accountList().begin(); it != incomeAccount.accountList().end(); ++it ) { KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(incomeTopLevelAccount, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -866,10 +866,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } @@ -881,23 +881,23 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = expenseAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == expenseAccount.id()) + if (tqparentId == expenseAccount.id()) m_parentItem = expenseTopLevelAccount; expenseTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = expenseAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = expenseAccount.accountList().begin(); it != expenseAccount.accountList().end(); ++it ) { KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(expenseTopLevelAccount, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -905,10 +905,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } @@ -924,7 +924,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if (m_parentItem) { - m_subAccountLabel->setText(i18n("Is a sub account of %1").arg(m_parentAccount.name())); + m_subAccountLabel->setText(i18n("Is a sub account of %1").tqarg(m_parentAccount.name())); m_parentItem->setOpen(true); m_qlistviewParentAccounts->setSelected(m_parentItem, true); } @@ -932,18 +932,18 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_qlistviewParentAccounts->setEnabled(true); } -void KNewAccountDlg::showSubAccounts(QStringList accounts, KMyMoneyAccountTreeBaseItem *parentItem, - const QString& parentId, const QString& accountId) +void KNewAccountDlg::showSubAccounts(TQStringList accounts, KMyMoneyAccountTreeBaseItem *tqparentItem, + const TQString& tqparentId, const TQString& accountId) { MyMoneyFile *file = MyMoneyFile::instance(); - for ( QStringList::ConstIterator it = accounts.begin(); it != accounts.end(); ++it ) + for ( TQStringList::ConstIterator it = accounts.begin(); it != accounts.end(); ++it ) { - KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(parentItem, + KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(tqparentItem, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -951,15 +951,15 @@ void KNewAccountDlg::showSubAccounts(QStringList accounts, KMyMoneyAccountTreeBa m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } -void KNewAccountDlg::resizeEvent(QResizeEvent* e) +void KNewAccountDlg::resizeEvent(TQResizeEvent* e) { m_qlistviewParentAccounts->setColumnWidth(0, m_qlistviewParentAccounts->width()); @@ -967,7 +967,7 @@ void KNewAccountDlg::resizeEvent(QResizeEvent* e) KNewAccountDlgDecl::resizeEvent(e); } -void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) +void KNewAccountDlg::slotSelectionChanged(TQListViewItem *item) { KMyMoneyAccountTreeBaseItem *accountItem = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(item); try @@ -976,7 +976,7 @@ void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) //qDebug("Selected account id: %s", accountItem->accountID().data()); m_parentAccount = file->account(accountItem->id()); - m_subAccountLabel->setText(i18n("Is a sub account of %1").arg(m_parentAccount.name())); + m_subAccountLabel->setText(i18n("Is a sub account of %1").tqarg(m_parentAccount.name())); if(m_qlistviewParentAccounts->isEnabled()) { m_bSelectedParentAccount = true; } @@ -990,13 +990,13 @@ void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) void KNewAccountDlg::loadVatAccounts(void) { - QValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount> list; MyMoneyFile::instance()->accountList(list); - QValueList<MyMoneyAccount>::Iterator it; - QStringList loadListExpense; - QStringList loadListIncome; - QStringList loadListAsset; - QStringList loadListLiability; + TQValueList<MyMoneyAccount>::Iterator it; + TQStringList loadListExpense; + TQStringList loadListIncome; + TQStringList loadListAsset; + TQStringList loadListLiability; for(it = list.begin(); it != list.end(); ++it) { if(!(*it).value("VatRate").isEmpty()) { if((*it).accountType() == MyMoneyAccount::Expense) @@ -1020,11 +1020,11 @@ void KNewAccountDlg::loadVatAccounts(void) vatSet.load(m_vatAccount, i18n("Expense"), loadListExpense, false); } -void KNewAccountDlg::slotLoadInstitutions(const QString& name) +void KNewAccountDlg::slotLoadInstitutions(const TQString& name) { int id=-1, counter=0; m_qcomboboxInstitutions->clear(); - QString bic; + TQString bic; // Are we forcing the user to use institutions? m_qcomboboxInstitutions->insertItem(i18n("<No Institution>")); m_bicValue->setText(" "); @@ -1034,8 +1034,8 @@ void KNewAccountDlg::slotLoadInstitutions(const QString& name) { MyMoneyFile *file = MyMoneyFile::instance(); - QValueList<MyMoneyInstitution> list = file->institutionList(); - QValueList<MyMoneyInstitution>::ConstIterator institutionIterator; + TQValueList<MyMoneyInstitution> list = file->institutionList(); + TQValueList<MyMoneyInstitution>::ConstIterator institutionIterator; for (institutionIterator = list.begin(), counter=1; institutionIterator != list.end(); ++institutionIterator, counter++) { if ((*institutionIterator).name() == name) { @@ -1084,7 +1084,7 @@ void KNewAccountDlg::slotNewClicked() } } -void KNewAccountDlg::slotAccountTypeChanged(const QString& typeStr) +void KNewAccountDlg::slotAccountTypeChanged(const TQString& typeStr) { MyMoneyAccount::accountTypeE type; MyMoneyAccount::accountTypeE oldType; @@ -1094,25 +1094,25 @@ void KNewAccountDlg::slotAccountTypeChanged(const QString& typeStr) try { oldType = m_account.accountType(); if(oldType != type) { - QString parentId; + TQString tqparentId; switch(MyMoneyAccount::accountGroup(type)) { case MyMoneyAccount::Asset: - parentId = file->asset().id(); + tqparentId = file->asset().id(); break; case MyMoneyAccount::Liability: - parentId = file->liability().id(); + tqparentId = file->liability().id(); break; case MyMoneyAccount::Expense: - parentId = file->expense().id(); + tqparentId = file->expense().id(); break; case MyMoneyAccount::Income: - parentId = file->income().id(); + tqparentId = file->income().id(); break; default: qWarning("Unknown account group in KNewAccountDlg::slotAccountTypeChanged()"); break; } - initParentWidget(parentId, QString()); + initParentWidget(tqparentId, TQString()); m_account.setAccountType(type); } } catch(MyMoneyException *e) { @@ -1176,30 +1176,30 @@ void KNewAccountDlg::adjustEditWidgets(kMyMoneyEdit* dst, kMyMoneyEdit* src, cha } } -void KNewAccountDlg::slotAdjustMinBalanceAbsoluteEdit(const QString&) +void KNewAccountDlg::slotAdjustMinBalanceAbsoluteEdit(const TQString&) { adjustEditWidgets(m_minBalanceAbsoluteEdit, m_minBalanceEarlyEdit, '<', -1); } -void KNewAccountDlg::slotAdjustMinBalanceEarlyEdit(const QString&) +void KNewAccountDlg::slotAdjustMinBalanceEarlyEdit(const TQString&) { adjustEditWidgets(m_minBalanceEarlyEdit, m_minBalanceAbsoluteEdit, '>', -1); } -void KNewAccountDlg::slotAdjustMaxCreditAbsoluteEdit(const QString&) +void KNewAccountDlg::slotAdjustMaxCreditAbsoluteEdit(const TQString&) { adjustEditWidgets(m_maxCreditAbsoluteEdit, m_maxCreditEarlyEdit, '>', 1); } -void KNewAccountDlg::slotAdjustMaxCreditEarlyEdit(const QString&) +void KNewAccountDlg::slotAdjustMaxCreditEarlyEdit(const TQString&) { adjustEditWidgets(m_maxCreditEarlyEdit, m_maxCreditAbsoluteEdit, '<', 1); } -void KNewAccountDlg::addTab(QWidget* w, const QString& name) +void KNewAccountDlg::addTab(TQWidget* w, const TQString& name) { if(w) { - w->reparent(m_tab, QPoint(0,0)); + w->reparent(m_tab, TQPoint(0,0)); m_tab->addTab(w, name); } } |