diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/dialogs/ksecuritylisteditor.cpp | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip |
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/ksecuritylisteditor.cpp')
-rw-r--r-- | kmymoney2/dialogs/ksecuritylisteditor.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kmymoney2/dialogs/ksecuritylisteditor.cpp b/kmymoney2/dialogs/ksecuritylisteditor.cpp index ee4c486..86e2e66 100644 --- a/kmymoney2/dialogs/ksecuritylisteditor.cpp +++ b/kmymoney2/dialogs/ksecuritylisteditor.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qcheckbox.h> +#include <tqcheckbox.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -51,49 +51,49 @@ #define ACCFRACT_COL 6 #define CASHFRACT_COL 7 -#define CURRENCY_MARKET QString("ISO 4217") +#define CURRENCY_MARKET TQString("ISO 4217") -KSecurityListEditor::KSecurityListEditor(QWidget *parent, const char *name) : - KSecurityListEditorDecl(parent, name) +KSecurityListEditor::KSecurityListEditor(TQWidget *tqparent, const char *name) : + KSecurityListEditorDecl(tqparent, name) { m_listView->setColumnWidth(ID_COL, 0); - m_listView->setColumnWidthMode(NAME_COL, QListView::Maximum); - m_listView->setColumnWidthMode(ID_COL, QListView::Manual); - m_listView->setColumnAlignment(CURR_COL, Qt::AlignHCenter); + m_listView->setColumnWidthMode(NAME_COL, TQListView::Maximum); + m_listView->setColumnWidthMode(ID_COL, TQListView::Manual); + m_listView->setColumnAlignment(CURR_COL, TQt::AlignHCenter); m_listView->setMultiSelection(false); m_listView->setAllColumnsShowFocus(true); KIconLoader *il = KGlobal::iconLoader(); KGuiItem removeButtenItem( i18n( "&Delete" ), - QIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete this entry"), i18n("Remove this security item from the file")); m_deleteButton->setGuiItem(removeButtenItem); KGuiItem addButtenItem( i18n( "&Add" ), - QIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), i18n("Add a new entry"), i18n("Create a new security entry.")); m_addButton->setGuiItem(addButtenItem); KGuiItem editButtenItem( i18n( "&Edit" ), - QIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), i18n("Modify the selected entry"), i18n("Change the security information of the selected entry.")); m_editButton->setGuiItem(editButtenItem); KGuiItem okButtenItem( i18n("&Close" ), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Close the dialog"), i18n("Use this to close the dialog and return to the application.")); m_closeButton->setGuiItem(okButtenItem); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_showCurrencyButton, SIGNAL(toggled(bool)), this, SLOT(slotLoadList())); - connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(slotUpdateButtons())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_showCurrencyButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotLoadList())); + connect(m_listView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotUpdateButtons())); - connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditSecurity())); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteSecurity())); + connect(m_editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSecurity())); + connect(m_deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteSecurity())); // FIXME for now, the only way to add a new security is to add a new investment m_addButton->hide(); @@ -109,22 +109,22 @@ void KSecurityListEditor::slotLoadList(void) { m_listView->clear(); - QValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList(); - QValueList<MyMoneySecurity>::ConstIterator it; + TQValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList(); + TQValueList<MyMoneySecurity>::ConstIterator it; if(m_showCurrencyButton->isChecked()) { list += MyMoneyFile::instance()->currencyList(); } for(it = list.begin(); it != list.end(); ++it) { - KListViewItem* newItem = new KListViewItem(m_listView, QString((*it).id())); + KListViewItem* newItem = new KListViewItem(m_listView, TQString((*it).id())); fillItem(newItem, *it); } slotUpdateButtons(); } -void KSecurityListEditor::fillItem(QListViewItem* item, const MyMoneySecurity& security) +void KSecurityListEditor::fillItem(TQListViewItem* item, const MyMoneySecurity& security) { - QString market = security.tradingMarket(); + TQString market = security.tradingMarket(); MyMoneySecurity tradingCurrency; if(security.isCurrency()) market = CURRENCY_MARKET; @@ -136,16 +136,16 @@ void KSecurityListEditor::fillItem(QListViewItem* item, const MyMoneySecurity& s item->setText(SYMBOL_COL, security.tradingSymbol()); item->setText(MARKET_COL, market); item->setText(CURR_COL, tradingCurrency.tradingSymbol()); - item->setText(ACCFRACT_COL, QString::number(security.smallestAccountFraction())); + item->setText(ACCFRACT_COL, TQString::number(security.smallestAccountFraction())); // smallestCashFraction is only applicable for currencies if(security.isCurrency()) - item->setText(CASHFRACT_COL, QString::number(security.smallestCashFraction())); + item->setText(CASHFRACT_COL, TQString::number(security.smallestCashFraction())); } void KSecurityListEditor::slotUpdateButtons(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); @@ -160,13 +160,13 @@ void KSecurityListEditor::slotUpdateButtons(void) void KSecurityListEditor::slotEditSecurity(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); KNewInvestmentWizard dlg(security, this, "KNewInvestmentWizard"); - if(dlg.exec() == QDialog::Accepted) { - dlg.createObjects(QString()); + if(dlg.exec() == TQDialog::Accepted) { + dlg.createObjects(TQString()); security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); fillItem(item, security); } @@ -175,16 +175,16 @@ void KSecurityListEditor::slotEditSecurity(void) void KSecurityListEditor::slotDeleteSecurity(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); - QString msg; - QString dontAsk; + TQString msg; + TQString dontAsk; if(security.isCurrency()) { - msg = QString("<p>") + i18n("Do you really want to remove the currency <b>%1</b> from the file?</p><i>Note: It is currently not supported to add currencies.</i>").arg(security.name()); + msg = TQString("<p>") + i18n("Do you really want to remove the currency <b>%1</b> from the file?</p><i>Note: It is currently not supported to add currencies.</i>").tqarg(security.name()); dontAsk = "DeleteCurrency"; } else { - msg = QString("<p>") + i18n("Do you really want to remove the %1 <b>%2</b> from the file?").arg(KMyMoneyUtils::securityTypeToString(security.securityType())).arg(security.name()); + msg = TQString("<p>") + i18n("Do you really want to remove the %1 <b>%2</b> from the file?").tqarg(KMyMoneyUtils::securityTypeToString(security.securityType())).tqarg(security.name()); dontAsk = "DeleteSecurity"; } if(KMessageBox::questionYesNo(this, msg, i18n("Delete security"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk) == KMessageBox::Yes) { |