summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/kcsvprogressdlg.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/kcsvprogressdlg.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/kcsvprogressdlg.cpp')
-rw-r--r--kmymoney2/dialogs/kcsvprogressdlg.cpp78
1 files changed, 37 insertions, 41 deletions
diff --git a/kmymoney2/dialogs/kcsvprogressdlg.cpp b/kmymoney2/dialogs/kcsvprogressdlg.cpp
index d8f85ed..7b923e7 100644
--- a/kmymoney2/dialogs/kcsvprogressdlg.cpp
+++ b/kmymoney2/dialogs/kcsvprogressdlg.cpp
@@ -19,22 +19,18 @@
***************************************************************************/
#include <kglobal.h>
#include <klocale.h>
-#if QT_VERSION > 300
#include <kstandarddirs.h>
-#else
-#include <kstddirs.h>
-#endif
-#include <qpixmap.h>
+#include <tqpixmap.h>
// ----------------------------------------------------------------------------
// QT Includes
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qprogressbar.h>
-#include <qlineedit.h>
-#include <qgroupbox.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqprogressbar.h>
+#include <tqlineedit.h>
+#include <tqgroupbox.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -51,8 +47,8 @@
#include "../kmymoneyutils.h"
/** Simple constructor */
-KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, QWidget *parent, const char *name )
- : KCsvProgressDlgDecl(parent,name, true)
+KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, TQWidget *tqparent, const char *name )
+ : KCsvProgressDlgDecl(tqparent,name, true)
{
m_nType = type;
if (m_nType==0)
@@ -70,11 +66,11 @@ KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, QWidget *par
readConfig();
- connect(m_qbuttonBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseClicked()));
- connect(m_qbuttonRun, SIGNAL(clicked()), this, SLOT(slotRunClicked()));
- connect(m_qlineeditFile, SIGNAL(textChanged(const QString&)), this,
- SLOT(slotFileTextChanged(const QString&)));
- connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(m_qbuttonBrowse, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseClicked()));
+ connect(m_qbuttonRun, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRunClicked()));
+ connect(m_qlineeditFile, TQT_SIGNAL(textChanged(const TQString&)), this,
+ TQT_SLOT(slotFileTextChanged(const TQString&)));
+ connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()));
}
/** Simple destructor */
@@ -94,16 +90,16 @@ void KCsvProgressDlg::performExport(void)
return;
}
- QString strFile = m_qlineeditFile->text();
- if(KMyMoneyUtils::appendCorrectFileExt(strFile, QString("csv")))
+ TQString strFile = m_qlineeditFile->text();
+ if(KMyMoneyUtils::appendCorrectFileExt(strFile, TQString("csv")))
m_qlineeditFile->setText(strFile);
- if (m_kmymoneydateEnd->getQDate() < m_kmymoneydateStart->getQDate()) {
+ if (m_kmymoneydateEnd->getTQDate() < m_kmymoneydateStart->getTQDate()) {
KMessageBox::information(this, i18n("Please enter a start date lower than the end date."));
return;
}
- QFile qfile(m_qlineeditFile->text());
+ TQFile qfile(m_qlineeditFile->text());
if (!qfile.open(IO_WriteOnly)) {
KMessageBox::error(this, i18n("Unable to open export file for writing."));
return;
@@ -111,27 +107,27 @@ void KCsvProgressDlg::performExport(void)
qfile.close();
m_qlabelAccount->setText(m_mymoneyaccount->name());
- m_qlabelTransaction->setText(QString("0") + i18n(" of ") + QString::number(m_mymoneyaccount->transactionCount()));
+ m_qlabelTransaction->setText(TQString("0") + i18n(" of ") + TQString::number(m_mymoneyaccount->transactionCount()));
m_qprogressbar->setTotalSteps(m_mymoneyaccount->transactionCount());
// Make sure we have an account to operate on
if (m_mymoneyaccount) {
// Connect to the provided signals in MyMoneyAccount
// These signals will be emitted at appropriate times.
- connect(m_mymoneyaccount, SIGNAL(signalProgressCount(int)), m_qprogressbar, SLOT(setTotalSteps(int)));
- connect(m_mymoneyaccount, SIGNAL(signalProgress(int)), this, SLOT(slotSetProgress(int)));
+ connect(m_mymoneyaccount, TQT_SIGNAL(signalProgressCount(int)), m_qprogressbar, TQT_SLOT(setTotalSteps(int)));
+ connect(m_mymoneyaccount, TQT_SIGNAL(signalProgress(int)), this, TQT_SLOT(slotSetProgress(int)));
int nTransCount = 0;
// Do the actual write
- if (!m_mymoneyaccount->writeCSVFile(m_qlineeditFile->text(), m_kmymoneydateStart->getQDate(),
- m_kmymoneydateEnd->getQDate(), nTransCount)) {
+ if (!m_mymoneyaccount->writeCSVFile(m_qlineeditFile->text(), m_kmymoneydateStart->getTQDate(),
+ m_kmymoneydateEnd->getTQDate(), nTransCount)) {
KMessageBox::error(this, i18n("Error occurred whilst exporting to csv file."), i18n("Export CSV"));
}
else {
- QString qstringPrompt = i18n("Export finished successfully.\n\n");
+ TQString qstringPrompt = i18n("Export finished successfully.\n\n");
qstringPrompt += i18n("Number of transactions exported ");
- qstringPrompt += QString::number(nTransCount);
+ qstringPrompt += TQString::number(nTransCount);
qstringPrompt += ".";
KMessageBox::information(this, qstringPrompt, i18n("Export CSV"));
}
@@ -150,7 +146,7 @@ void KCsvProgressDlg::performImport(void)
return;
}
- QFile qfile(m_qlineeditFile->text());
+ TQFile qfile(m_qlineeditFile->text());
if (!qfile.open(IO_ReadOnly)) {
KMessageBox::error(this, i18n("Unable to open import file for reading."));
return;
@@ -163,8 +159,8 @@ void KCsvProgressDlg::performImport(void)
if (m_mymoneyaccount) {
// Connect to the provided signals in MyMoneyAccount
// These signals will be emitted at appropriate times.
- connect(m_mymoneyaccount, SIGNAL(signalProgressCount(int)), m_qprogressbar, SLOT(setTotalSteps(int)));
- connect(m_mymoneyaccount, SIGNAL(signalProgress(int)), this, SLOT(slotSetProgress(int)));
+ connect(m_mymoneyaccount, TQT_SIGNAL(signalProgressCount(int)), m_qprogressbar, TQT_SLOT(setTotalSteps(int)));
+ connect(m_mymoneyaccount, TQT_SIGNAL(signalProgress(int)), this, TQT_SLOT(slotSetProgress(int)));
int nTransCount = 0;
@@ -173,9 +169,9 @@ void KCsvProgressDlg::performImport(void)
KMessageBox::error(this, i18n("Error occurred whilst importing csv file."), i18n("Import CSV"));
}
else {
- QString qstringPrompt = i18n("Import finished successfully.\n\n");
+ TQString qstringPrompt = i18n("Import finished successfully.\n\n");
qstringPrompt += i18n("Number of transactions imported ");
- qstringPrompt += QString::number(nTransCount);
+ qstringPrompt += TQString::number(nTransCount);
qstringPrompt += ".";
KMessageBox::information(this, qstringPrompt, i18n("Import CSV"));
}
@@ -186,7 +182,7 @@ void KCsvProgressDlg::performImport(void)
/** Called when the user clicks on the Browser button */
void KCsvProgressDlg::slotBrowseClicked()
{
- QString newName = KFileDialog::getSaveFileName(QString::null,"*.CSV");
+ TQString newName = KFileDialog::getSaveFileName(TQString(),"*.CSV");
if (!newName.isEmpty())
{
m_qlineeditFile->setText(newName);
@@ -207,7 +203,7 @@ void KCsvProgressDlg::slotRunClicked()
}
/** Make sure the text input is ok */
-void KCsvProgressDlg::slotFileTextChanged(const QString& text)
+void KCsvProgressDlg::slotFileTextChanged(const TQString& text)
{
if (!text.isEmpty()) {
m_qlineeditFile->setText(text);
@@ -234,8 +230,8 @@ void KCsvProgressDlg::writeConfig(void)
KConfig *kconfig = KGlobal::config();
kconfig->setGroup("Last Use Settings");
kconfig->writeEntry("KCsvProgressDlg_LastFile", m_qlineeditFile->text());
- kconfig->writeEntry("KCsvProgressDlg_StartDate", QDateTime(m_kmymoneydateStart->date()));
- kconfig->writeEntry("KCsvProgressDlg_EndDate", QDateTime(m_kmymoneydateEnd->date()));
+ kconfig->writeEntry("KCsvProgressDlg_StartDate", TQDateTime(m_kmymoneydateStart->date()));
+ kconfig->writeEntry("KCsvProgressDlg_EndDate", TQDateTime(m_kmymoneydateEnd->date()));
kconfig->sync();
}
@@ -243,9 +239,9 @@ void KCsvProgressDlg::writeConfig(void)
void KCsvProgressDlg::slotSetProgress(int progress)
{
m_qprogressbar->setProgress(progress);
- QString qstring = QString::number(progress);
+ TQString qstring = TQString::number(progress);
qstring += i18n(" of ");
- qstring += QString::number(m_qprogressbar->totalSteps());
+ qstring += TQString::number(m_qprogressbar->totalSteps());
m_qlabelTransaction->setText(qstring);
}