summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/dialogs/mymoneyqifprofileeditor.cpp')
-rw-r--r--kmymoney2/dialogs/mymoneyqifprofileeditor.cpp160
1 files changed, 80 insertions, 80 deletions
diff --git a/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp b/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp
index cc43ced..cdb7a34 100644
--- a/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp
+++ b/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp
@@ -18,11 +18,11 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qpushbutton.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qcheckbox.h>
-#include <qtabwidget.h>
+#include <tqpushbutton.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqcheckbox.h>
+#include <tqtabwidget.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -48,8 +48,8 @@
#include "mymoneyqifprofileeditor.h"
-MyMoneyQifProfileNameValidator::MyMoneyQifProfileNameValidator(QObject *o, const char *name)
- : QValidator(o, name)
+MyMoneyQifProfileNameValidator::MyMoneyQifProfileNameValidator(TQObject *o, const char *name)
+ : TQValidator(o, name)
{
}
@@ -57,26 +57,26 @@ MyMoneyQifProfileNameValidator::~MyMoneyQifProfileNameValidator()
{
}
-QValidator::State MyMoneyQifProfileNameValidator::validate(QString& name, int&) const
+TQValidator::State MyMoneyQifProfileNameValidator::validate(TQString& name, int&) const
{
KConfig* config = KGlobal::config();
config->setGroup("Profiles");
- QStringList list = config->readListEntry("profiles");
+ TQStringList list = config->readListEntry("profiles");
// invalid character?
- if(name.contains(",") != 0)
- return QValidator::Invalid;
+ if(name.tqcontains(",") != 0)
+ return TQValidator::Invalid;
// would not work in this form (empty or existing name)
- if(name.isEmpty() || list.contains(name))
- return QValidator::Intermediate;
+ if(name.isEmpty() || list.tqcontains(name))
+ return TQValidator::Intermediate;
// is OK
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
}
-MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, QWidget *parent, const char *name )
- : MyMoneyQifProfileEditorDecl(parent,name),
+MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, TQWidget *tqparent, const char *name )
+ : MyMoneyQifProfileEditorDecl(tqparent,name),
m_inEdit(edit),
m_isDirty(false),
m_isAccepted(false),
@@ -92,42 +92,42 @@ MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, QWidget *paren
// load button icons
KIconLoader* il = KGlobal::iconLoader();
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 create a new QIF import/export profile"));
+ i18n("Use this to create a new TQIF import/export profile"));
m_newButton->setGuiItem(newButtenItem);
- connect(m_profileListBox, SIGNAL(highlighted(const QString&)), this, SLOT(slotLoadProfileFromConfig(const QString&)));
- connect(m_resetButton, SIGNAL(clicked()), this, SLOT(slotReset()));
- connect(m_okButton, SIGNAL(clicked()), this, SLOT(slotOk()));
- connect(m_renameButton, SIGNAL(clicked()), this, SLOT(slotRename()));
- connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotDelete()));
- connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNew()));
- connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
- connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
+ connect(m_profileListBox, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(slotLoadProfileFromConfig(const TQString&)));
+ connect(m_resetButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReset()));
+ connect(m_okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOk()));
+ connect(m_renameButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRename()));
+ connect(m_deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelete()));
+ connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNew()));
+ connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
+ connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp()));
- connect(m_editDescription, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setProfileDescription(const QString&)));
- connect(m_editType, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setProfileType(const QString&)));
- connect(m_editOpeningBalance, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setOpeningBalanceText(const QString&)));
- connect(m_editAccountDelimiter, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setAccountDelimiter(const QString&)));
- connect(m_editVoidMark, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setVoidMark(const QString&)));
+ connect(m_editDescription, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setProfileDescription(const TQString&)));
+ connect(m_editType, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setProfileType(const TQString&)));
+ connect(m_editOpeningBalance, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setOpeningBalanceText(const TQString&)));
+ connect(m_editAccountDelimiter, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setAccountDelimiter(const TQString&)));
+ connect(m_editVoidMark, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setVoidMark(const TQString&)));
- //connect(m_editDateFormat, SIGNAL(highlighted(const QString&)), &m_profile, SLOT(setDateFormat(const QString&)));
- connect(m_editApostrophe, SIGNAL(highlighted(const QString&)), &m_profile, SLOT(setApostropheFormat(const QString&)));
+ //connect(m_editDateFormat, TQT_SIGNAL(highlighted(const TQString&)), &m_profile, TQT_SLOT(setDateFormat(const TQString&)));
+ connect(m_editApostrophe, TQT_SIGNAL(highlighted(const TQString&)), &m_profile, TQT_SLOT(setApostropheFormat(const TQString&)));
- connect(m_editAmounts, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotAmountTypeSelected(QListViewItem*)));
- connect(m_decimalBox, SIGNAL(activated(const QString&)), this, SLOT(slotDecimalChanged(const QString&)));
- connect(m_thousandsBox, SIGNAL(activated(const QString&)), this, SLOT(slotThousandsChanged(const QString&)));
+ connect(m_editAmounts, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotAmountTypeSelected(TQListViewItem*)));
+ connect(m_decimalBox, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotDecimalChanged(const TQString&)));
+ connect(m_thousandsBox, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotThousandsChanged(const TQString&)));
- connect(m_editInputFilterLocation, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterScriptImport(const QString&)));
- connect(m_editInputFilterLocation, SIGNAL(urlSelected(const QString&)), m_editInputFilterLocation, SLOT(setURL(const QString&)));
+ connect(m_editInputFilterLocation, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterScriptImport(const TQString&)));
+ connect(m_editInputFilterLocation, TQT_SIGNAL(urlSelected(const TQString&)), m_editInputFilterLocation, TQT_SLOT(setURL(const TQString&)));
- connect(m_editInputFilterFileType, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterFileType(const QString&)));
+ connect(m_editInputFilterFileType, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterFileType(const TQString&)));
- connect(m_editOutputFilterLocation, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterScriptExport(const QString&)));
- connect(m_editOutputFilterLocation, SIGNAL(urlSelected(const QString&)), m_editOutputFilterLocation, SLOT(setURL(const QString&)));
+ connect(m_editOutputFilterLocation, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterScriptExport(const TQString&)));
+ connect(m_editOutputFilterLocation, TQT_SIGNAL(urlSelected(const TQString&)), m_editOutputFilterLocation, TQT_SLOT(setURL(const TQString&)));
- connect(m_attemptMatch, SIGNAL(toggled(bool)), &m_profile, SLOT(setAttemptMatchDuplicates(bool)));
+ connect(m_attemptMatch, TQT_SIGNAL(toggled(bool)), &m_profile, TQT_SLOT(setAttemptMatchDuplicates(bool)));
}
MyMoneyQifProfileEditor::~MyMoneyQifProfileEditor()
@@ -145,9 +145,9 @@ MyMoneyQifProfileEditor::~MyMoneyQifProfileEditor()
void MyMoneyQifProfileEditor::loadWidgets(void)
{
if(m_inEdit)
- setCaption(i18n("QIF Profile Editor"));
+ setCaption(i18n("TQIF Profile Editor"));
else
- setCaption(i18n("QIF Profile Selector"));
+ setCaption(i18n("TQIF Profile Selector"));
m_editDateFormat->clear();
m_editDateFormat->insertItem( "%d/%m/%yy" );
@@ -175,12 +175,12 @@ void MyMoneyQifProfileEditor::loadWidgets(void)
m_editApostrophe->insertItem( "1900-1999" );
m_editApostrophe->insertItem( "2000-2099" );
- m_editAmounts->setColumnAlignment(1, Qt::AlignCenter);
- m_editAmounts->setColumnAlignment(2, Qt::AlignCenter);
- m_editAmounts->setColumnAlignment(3, Qt::AlignCenter);
+ m_editAmounts->setColumnAlignment(1, TQt::AlignCenter);
+ m_editAmounts->setColumnAlignment(2, TQt::AlignCenter);
+ m_editAmounts->setColumnAlignment(3, TQt::AlignCenter);
m_editAmounts->setColumnWidth(4, 0);
- m_editAmounts->setColumnWidthMode(4, QListView::Manual);
+ m_editAmounts->setColumnWidthMode(4, TQListView::Manual);
m_editAmounts->setSorting(4);
m_editAmounts->sort();
@@ -216,7 +216,7 @@ void MyMoneyQifProfileEditor::loadWidgets(void)
void MyMoneyQifProfileEditor::loadProfileListFromConfig(void)
{
- QFontMetrics fontMetrics(m_profileListBox->font());
+ TQFontMetrics fontMetrics(m_profileListBox->font());
int w = 100; // minimum is 100 pixels width for the list box
if(m_profile.isDirty()) {
@@ -226,14 +226,14 @@ void MyMoneyQifProfileEditor::loadProfileListFromConfig(void)
m_profileListBox->clear();
- QStringList list;
+ TQStringList list;
KConfig* config = KGlobal::config();
config->setGroup("Profiles");
list = config->readListEntry("profiles");
if(list.count() == 0) {
m_profile.clear();
- m_profile.setProfileDescription(i18n("The default QIF profile"));
+ m_profile.setProfileDescription(i18n("The default TQIF profile"));
addProfile("Default");
config->setGroup("Profiles");
@@ -249,28 +249,28 @@ void MyMoneyQifProfileEditor::loadProfileListFromConfig(void)
}
for(unsigned int i = 0; i < list.count(); ++i) {
int nw = fontMetrics.width(list[i]) + 10;
- w = QMAX( w, nw );
+ w = TQMAX( w, nw );
}
- w = QMIN(w, 200);
+ w = TQMIN(w, 200);
m_profileListBox->setMinimumWidth(w);
}
-void MyMoneyQifProfileEditor::slotLoadProfileFromConfig(const QString& profile)
+void MyMoneyQifProfileEditor::slotLoadProfileFromConfig(const TQString& profile)
{
- QString profileName = profile;
+ TQString profileName = profile;
if(m_profile.isDirty()) {
m_profile.saveProfile();
m_isDirty = true;
}
- if(m_profileListBox->findItem(profileName, Qt::ExactMatch | Qt::CaseSensitive) == NULL) {
+ if(m_profileListBox->tqfindItem(profileName, TQt::ExactMatch | TQt::CaseSensitive) == NULL) {
profileName = m_profileListBox->text(0);
}
m_profile.loadProfile("Profile-" + profileName);
- QListBoxItem *lbi = m_profileListBox->findItem(profileName, Qt::ExactMatch | Qt::CaseSensitive);
+ TQListBoxItem *lbi = m_profileListBox->tqfindItem(profileName, TQt::ExactMatch | TQt::CaseSensitive);
int idx = m_profileListBox->index(lbi);
showProfile();
if(idx >= 0) {
@@ -294,11 +294,11 @@ void MyMoneyQifProfileEditor::showProfile(void)
m_attemptMatch->setChecked(m_profile.attemptMatchDuplicates());
- QListViewItem* item;
- QListViewItemIterator it(m_editAmounts);
+ TQListViewItem* item;
+ TQListViewItemIterator it(m_editAmounts);
while((item = it.current()) != 0) {
- QChar key = item->text(1)[0];
+ TQChar key = item->text(1)[0];
item->setText(2, m_profile.amountDecimal(key));
item->setText(3, m_profile.amountThousands(key));
if(m_selectedAmountType == 0 && key == 'T' && m_inEdit) {
@@ -311,25 +311,25 @@ void MyMoneyQifProfileEditor::showProfile(void)
}
}
-void MyMoneyQifProfileEditor::deleteProfile(const QString& name)
+void MyMoneyQifProfileEditor::deleteProfile(const TQString& name)
{
KConfig* config = KGlobal::config();
config->deleteGroup("Profile-" + name);
config->setGroup("Profiles");
- QStringList list = config->readListEntry("profiles");
+ TQStringList list = config->readListEntry("profiles");
list.remove(name);
config->writeEntry("profiles", list);
m_isDirty = true;
}
-void MyMoneyQifProfileEditor::addProfile(const QString& name)
+void MyMoneyQifProfileEditor::addProfile(const TQString& name)
{
KConfig* config = KGlobal::config();
config->setGroup("Profiles");
- QStringList list = config->readListEntry("profiles");
+ TQStringList list = config->readListEntry("profiles");
list += name;
list.sort();
@@ -364,7 +364,7 @@ void MyMoneyQifProfileEditor::slotReset(void)
config->rollback();
config->reparseConfiguration();
- QString currentProfile = m_profile.profileName().mid(8);
+ TQString currentProfile = m_profile.profileName().mid(8);
loadProfileListFromConfig();
slotLoadProfileFromConfig(currentProfile);
m_isDirty = false;
@@ -373,7 +373,7 @@ void MyMoneyQifProfileEditor::slotReset(void)
void MyMoneyQifProfileEditor::slotRename(void)
{
bool ok;
- QString newName = enterName(ok);
+ TQString newName = enterName(ok);
if(ok == true) {
deleteProfile(m_profile.profileName().mid(8));
@@ -386,7 +386,7 @@ void MyMoneyQifProfileEditor::slotRename(void)
void MyMoneyQifProfileEditor::slotNew(void)
{
bool ok;
- QString newName = enterName(ok);
+ TQString newName = enterName(ok);
if(ok == true) {
m_profile.clear();
@@ -396,20 +396,20 @@ void MyMoneyQifProfileEditor::slotNew(void)
}
}
-const QString MyMoneyQifProfileEditor::enterName(bool& ok)
+const TQString MyMoneyQifProfileEditor::enterName(bool& ok)
{
- MyMoneyQifProfileNameValidator val(this, "Validator");
+ MyMoneyQifProfileNameValidator val(TQT_TQOBJECT(this), "Validator");
#if KDE_IS_VERSION(3,2,0)
- return KInputDialog::getText(i18n("QIF Profile Editor"),
+ return KInputDialog::getText(i18n("TQIF Profile Editor"),
i18n("Enter new profile name"),
- QString::null,
+ TQString(),
&ok,
this,
0,
&val,
0);
#else
- QString rc;
+ TQString rc;
// the blank in the next line as the value for the edit box is
// there on purpose, so that with the following call to validateAndSet
@@ -431,9 +431,9 @@ const QString MyMoneyQifProfileEditor::enterName(bool& ok)
void MyMoneyQifProfileEditor::slotDelete(void)
{
- QString profile = m_profile.profileName().mid(8);
+ TQString profile = m_profile.profileName().mid(8);
- if(KMessageBox::questionYesNo(this, i18n("Do you really want to delete profile '%1'?").arg(profile)) == KMessageBox::Yes) {
+ if(KMessageBox::questionYesNo(this, i18n("Do you really want to delete profile '%1'?").tqarg(profile)) == KMessageBox::Yes) {
int idx = m_profileListBox->currentItem();
m_profile.saveProfile();
deleteProfile(profile);
@@ -450,32 +450,32 @@ void MyMoneyQifProfileEditor::slotHelp(void)
kapp->invokeHelp("details.impexp.qifimp.profile");
}
-void MyMoneyQifProfileEditor::slotAmountTypeSelected(QListViewItem* item)
+void MyMoneyQifProfileEditor::slotAmountTypeSelected(TQListViewItem* item)
{
m_decimalBox->setCurrentText(item->text(2));
m_thousandsBox->setCurrentText(item->text(3));
m_selectedAmountType = item;
}
-void MyMoneyQifProfileEditor::slotDecimalChanged(const QString& val)
+void MyMoneyQifProfileEditor::slotDecimalChanged(const TQString& val)
{
if(m_selectedAmountType != 0) {
- QChar key = m_selectedAmountType->text(1)[0];
+ TQChar key = m_selectedAmountType->text(1)[0];
m_profile.setAmountDecimal(key, val[0]);
m_selectedAmountType->setText(2, val);
}
}
-void MyMoneyQifProfileEditor::slotThousandsChanged(const QString& val)
+void MyMoneyQifProfileEditor::slotThousandsChanged(const TQString& val)
{
if(m_selectedAmountType != 0) {
- QChar key = m_selectedAmountType->text(1)[0];
+ TQChar key = m_selectedAmountType->text(1)[0];
m_profile.setAmountThousands(key, val[0]);
m_selectedAmountType->setText(3, val);
}
}
-const QString MyMoneyQifProfileEditor::selectedProfile() const
+const TQString MyMoneyQifProfileEditor::selectedProfile() const
{
return m_profileListBox->currentText();
}