summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/kexportdlg.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/dialogs/kexportdlg.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/kexportdlg.cpp')
-rw-r--r--kmymoney2/dialogs/kexportdlg.cpp92
1 files changed, 44 insertions, 48 deletions
diff --git a/kmymoney2/dialogs/kexportdlg.cpp b/kmymoney2/dialogs/kexportdlg.cpp
index c00e3cf..701d138 100644
--- a/kmymoney2/dialogs/kexportdlg.cpp
+++ b/kmymoney2/dialogs/kexportdlg.cpp
@@ -20,20 +20,16 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qpixmap.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqpixmap.h>
// ----------------------------------------------------------------------------
// KDE Headers
#include <kglobal.h>
#include <klocale.h>
-#if QT_VERSION > 300
#include <kstandarddirs.h>
-#else
-#include <kstddirs.h>
-#endif
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <kpushbutton.h>
@@ -49,8 +45,8 @@
#include "../widgets/kmymoneyaccountcombo.h"
#include "../kmymoneyutils.h"
-KExportDlg::KExportDlg(QWidget *parent)
- : KExportDlgDecl(parent, 0, true)
+KExportDlg::KExportDlg(TQWidget *tqparent)
+ : KExportDlgDecl(tqparent, 0, true)
{
// Set (almost) all the last used options
readConfig();
@@ -63,40 +59,40 @@ KExportDlg::KExportDlg(QWidget *parent)
m_qbuttonCancel->setGuiItem(KStdGuiItem::cancel());
KGuiItem okButtenItem( i18n( "&Export" ),
- QIconSet(il->loadIcon("fileexport", KIcon::Small, KIcon::SizeSmall)),
+ TQIconSet(il->loadIcon("fileexport", KIcon::Small, KIcon::SizeSmall)),
i18n("Start operation"),
i18n("Use this to start the export operation"));
m_qbuttonOk->setGuiItem(okButtenItem);
KGuiItem browseButtenItem( i18n( "&Browse..." ),
- QIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)),
+ TQIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)),
i18n("Select filename"),
i18n("Use this to select a filename to export to"));
m_qbuttonBrowse->setGuiItem(browseButtenItem);
KGuiItem newButtenItem( i18n( "&New..." ),
- QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)),
+ TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)),
i18n("Create a new profile"),
i18n("Use this to open the profile editor"));
m_profileEditorButton->setGuiItem(newButtenItem);
// connect the buttons to their functionality
- connect(m_qbuttonBrowse, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) );
- connect(m_profileEditorButton, SIGNAL(clicked()), this, SLOT(slotNewProfile()));
- connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(slotOkClicked()));
- connect(m_qbuttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(m_qbuttonBrowse, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotBrowse() ) );
+ connect(m_profileEditorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewProfile()));
+ connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOkClicked()));
+ connect(m_qbuttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
// connect the change signals to the check slot and perform initial check
- connect(m_qlineeditFile, SIGNAL(textChanged(const QString&)), this, SLOT(checkData()));
- connect(m_qcheckboxAccount, SIGNAL(toggled(bool)), this, SLOT(checkData()));
- connect(m_qcheckboxCategories, SIGNAL(toggled(bool)), this, SLOT(checkData()));
- connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), this, SLOT(checkData(const QString&)));
- connect(m_profileComboBox, SIGNAL(highlighted(int)), this, SLOT(checkData()));
- connect(m_kmymoneydateStart, SIGNAL(dateChanged(const QDate&)), this, SLOT(checkData()));
- connect(m_kmymoneydateEnd, SIGNAL(dateChanged(const QDate&)), this, SLOT(checkData()));
-
- checkData(QString());
+ connect(m_qlineeditFile, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(checkData()));
+ connect(m_qcheckboxAccount, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkData()));
+ connect(m_qcheckboxCategories, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkData()));
+ connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(checkData(const TQString&)));
+ connect(m_profileComboBox, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(checkData()));
+ connect(m_kmymoneydateStart, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(checkData()));
+ connect(m_kmymoneydateEnd, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(checkData()));
+
+ checkData(TQString());
}
KExportDlg::~KExportDlg()
@@ -105,15 +101,15 @@ KExportDlg::~KExportDlg()
void KExportDlg::slotBrowse()
{
- QString newName(KFileDialog::getSaveFileName(QString::null,"*.QIF"));
- KMyMoneyUtils::appendCorrectFileExt(newName, QString("qif"));
+ TQString newName(KFileDialog::getSaveFileName(TQString(),"*.TQIF"));
+ KMyMoneyUtils::appendCorrectFileExt(newName, TQString("qif"));
if (!newName.isEmpty())
m_qlineeditFile->setText(newName);
}
void KExportDlg::slotNewProfile(void)
{
- MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "QIF Profile Editor");
+ MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "TQIF Profile Editor");
if(editor->exec()) {
m_profileComboBox->setCurrentText(editor->selectedProfile());
loadProfiles();
@@ -129,11 +125,11 @@ void KExportDlg::loadProfiles(const bool selectLast)
edit->slotOk();
delete edit;
- QString current = m_profileComboBox->currentText();
+ TQString current = m_profileComboBox->currentText();
m_profileComboBox->clear();
- QStringList list;
+ TQStringList list;
KConfig* config = KGlobal::config();
config->setGroup("Profiles");
@@ -147,7 +143,7 @@ void KExportDlg::loadProfiles(const bool selectLast)
}
m_profileComboBox->setCurrentItem(0);
- if(list.contains(current) > 0)
+ if(list.tqcontains(current) > 0)
m_profileComboBox->setCurrentText(current);
}
@@ -178,19 +174,19 @@ void KExportDlg::writeConfig(void)
kconfig->writeEntry("KExportDlg_LastFile", m_qlineeditFile->text());
kconfig->writeEntry("KExportDlg_AccountOpt", m_qcheckboxAccount->isChecked());
kconfig->writeEntry("KExportDlg_CatOpt", m_qcheckboxCategories->isChecked());
- kconfig->writeEntry("KExportDlg_StartDate", QDateTime(m_kmymoneydateStart->date()));
- kconfig->writeEntry("KExportDlg_EndDate", QDateTime(m_kmymoneydateEnd->date()));
+ kconfig->writeEntry("KExportDlg_StartDate", TQDateTime(m_kmymoneydateStart->date()));
+ kconfig->writeEntry("KExportDlg_EndDate", TQDateTime(m_kmymoneydateEnd->date()));
kconfig->writeEntry("KExportDlg_LastProfile", m_profileComboBox->currentText());
kconfig->sync();
}
-void KExportDlg::checkData(const QString& accountId)
+void KExportDlg::checkData(const TQString& accountId)
{
bool okEnabled = false;
if(!m_qlineeditFile->text().isEmpty()) {
- QString strFile(m_qlineeditFile->text());
- if(KMyMoneyUtils::appendCorrectFileExt(strFile, QString("qif")))
+ TQString strFile(m_qlineeditFile->text());
+ if(KMyMoneyUtils::appendCorrectFileExt(strFile, TQString("qif")))
m_qlineeditFile->setText(strFile);
}
@@ -200,8 +196,8 @@ void KExportDlg::checkData(const QString& accountId)
account = file->account(accountId);
if(m_lastAccount != accountId) {
MyMoneyTransactionFilter filter(accountId);
- QValueList<MyMoneyTransaction> list = file->transactionList(filter);
- QValueList<MyMoneyTransaction>::Iterator it;
+ TQValueList<MyMoneyTransaction> list = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction>::Iterator it;
if(!list.isEmpty()) {
it = list.begin();
@@ -228,14 +224,14 @@ void KExportDlg::checkData(const QString& accountId)
void KExportDlg::loadAccounts(void)
{
/*
- QStringList strList;
+ TQStringList strList;
try {
MyMoneyFile *file = MyMoneyFile::instance();
// read all account items from the MyMoneyFile objects and add them to the listbox
- addCategories(strList, file->liability().id(), QString());
- addCategories(strList, file->asset().id(), QString());
+ addCategories(strList, file->liability().id(), TQString());
+ addCategories(strList, file->asset().id(), TQString());
} catch (MyMoneyException *e) {
qDebug("Exception '%s' thrown in %s, line %ld caught in KExportDlg::loadAccounts:%d",
@@ -247,26 +243,26 @@ void KExportDlg::loadAccounts(void)
/*
m_accountComboBox->setCurrentItem(0);
- if(strList.contains(current) > 0)
+ if(strList.tqcontains(current) > 0)
m_accountComboBox->setCurrentText(current);
*/
}
-QString KExportDlg::accountId() const
+TQString KExportDlg::accountId() const
{
return m_lastAccount;
}
/*
-void KExportDlg::addCategories(QStringList& strList, const QString& id, const QString& leadIn) const
+void KExportDlg::addCategories(TQStringList& strList, const TQString& id, const TQString& leadIn) const
{
MyMoneyFile *file = MyMoneyFile::instance();
- QString name;
+ TQString name;
MyMoneyAccount account = file->account(id);
- QStringList accList = account.accountList();
- QStringList::ConstIterator it_a;
+ TQStringList accList = account.accountList();
+ TQStringList::ConstIterator it_a;
for(it_a = accList.begin(); it_a != accList.end(); ++it_a) {
account = file->account(*it_a);
@@ -275,7 +271,7 @@ void KExportDlg::addCategories(QStringList& strList, const QString& id, const QS
}
}
-QString KExportDlg::accountId(const QString& account) const
+TQString KExportDlg::accountId(const TQString& account) const
{
return MyMoneyFile::instance()->nameToAccount(account);
}