Commit a83c7571 authored by Allan Anderson's avatar Allan Anderson
Browse files

BUG:305573

Fix handling of multiple columns
parent 138a8629
This diff is collapsed.
......@@ -28,8 +28,6 @@
#include "csvimporterplugin.h"
#define MAXCOL 25 // maximum no. of columns (arbitrary value)
class ConvertDate;
class Parse;
class BankingPage;
......@@ -391,7 +389,8 @@ public slots:
void decimalSymbolSelected(int val);
private:
QString m_columnType[MAXCOL];// holds field types - date, payee, etc.
QStringList m_columnTypeList; // holds field types - date, payee, etc.
QString m_currentUI;
QString m_decimalSymbol;
QString m_previousType;
......
......@@ -78,45 +78,13 @@ void InvestmentDlg::init()
m_csvDialog->ui->tableWidget->setWordWrap(false);
m_csvDialog->m_pageCompletion->ui->comboBox_decimalSymbol->setCurrentIndex(-1);
for (int i = 0; i < MAXCOL; i++) {
QString t;
t.setNum(i + 1);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_amountCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_dateCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_memoCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_priceCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_quantityCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_typeCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_feeCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_symbolCol->addItem(t);
m_csvDialog->m_pageInvestment->ui->comboBoxInv_detailCol->addItem(t);
}
connect(m_csvDialog->m_wizard->button(QWizard::CustomButton1), SIGNAL(clicked()), m_investProcessing, SLOT(slotFileDialogClicked()));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_memoCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(memoColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_typeCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(typeColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_dateCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(dateColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_quantityCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(quantityColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_priceCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(priceColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_amountCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(amountColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_feeCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(feeColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_symbolCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(symbolColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_detailCol, SIGNAL(currentIndexChanged(int)), m_investProcessing, SLOT(detailColumnSelected(int)));
connect(m_csvDialog->m_pageInvestment->ui->comboBoxInv_securityName, SIGNAL(currentIndexChanged(int)), m_csvDialog->m_pageInvestment, SLOT(slotsecurityNameChanged(int)));
connect(m_investProcessing, SIGNAL(statementReady(MyMoneyStatement&)), this, SIGNAL(statementReady(MyMoneyStatement&)));
}
void InvestmentDlg::changedType(const QString& newType)
{
if ((newType == "buy") || (newType == "sell") || (newType == "divx") ||
(newType == "reinvdiv") || (newType == "shrsin") || (newType == "shrsout")) {
m_investProcessing->setTrInvestDataType(newType);
}
}
void InvestmentDlg::saveSettings()
{
if ((m_csvDialog->m_fileType != "Invest") || (m_investProcessing->inFileName().isEmpty())) { // don't save if no file loaded
......
......@@ -34,8 +34,6 @@ email : agander93@gmail.com
#include <mymoneystatement.h>
#define invMAXCOL 25 // maximum no. of columns (arbitrary value)
class CSVDialog;
class ConvertDate;
class InvestProcessing;
......@@ -55,7 +53,6 @@ public:
SymbolTableDlg* m_redefine;
InvestProcessing* m_investProcessing;
void clearComboBoxText();
void init();
void saveSettings();
......@@ -70,12 +67,6 @@ private:
private slots:
/**
* This slot is called following the user selecting a new investment type
* in the RedefineDlg window. The new value is saved.
*/
void changedType(const QString&);
signals:
/**
* This signal is raised when the plugin has completed a transaction. This
......
......@@ -39,8 +39,6 @@ email : agander93@gmail.com
#include <mymoneystatement.h>
#define invMAXCOL 25 // maximum no. of columns (arbitrary value)
class ConvertDate;
class CSVDialog;
class InvestmentDlg;
......@@ -414,6 +412,7 @@ private:
} m_trInvestData;
QList<csvSplit> m_csvSplitsList;
QList<QTextCodec *> m_codecs;
bool m_amountSelected;
bool m_brokerage;
......@@ -451,7 +450,6 @@ private:
QString m_accountName;
QString m_brokerBuff;
QString m_columnType[invMAXCOL];
QString m_dateFormat;
QString m_fieldDelimiterCharacter;
QString m_textDelimiterCharacter;
......@@ -462,7 +460,7 @@ private:
QString m_securityName;
QString m_tempBuffer;
QList<QTextCodec *> m_codecs;
QStringList m_columnTypeList; // holds field types - date, payee, etc.
KUrl m_url;
QFile* m_inFile;
......
......@@ -59,7 +59,6 @@ RedefineDlg::RedefineDlg()
m_widget = new RedefineDlgDecl();
setMainWidget(m_widget);
m_widget->tableWidget->setColumnCount(defMAXCOL);
m_widget->tableWidget->setToolTip(i18n("Results table"));
m_widget->tableWidget->setRowCount(2);
m_mainWidth = m_widget->tableWidget->size().width();
......
......@@ -23,8 +23,6 @@ email : agander93@gmail.com
#include "mymoneymoney.h"
#include "ui_redefinedlgdecl.h"
#define defMAXCOL 25
class InvestmentDlg;
class MyMoneyMoney;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment