Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/wizards/newinvestmentwizard/kinvestmentdetailswizardpage.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 37 | { | |||
---|---|---|---|---|---|
70 | m_roundingMethod->addItem(i18nc("Rounding method", "Ceil"), AlkValue::RoundCeil); | 70 | m_roundingMethod->addItem(i18nc("Rounding method", "Ceil"), AlkValue::RoundCeil); | ||
71 | m_roundingMethod->addItem(i18nc("Rounding method", "Floor"), AlkValue::RoundFloor); | 71 | m_roundingMethod->addItem(i18nc("Rounding method", "Floor"), AlkValue::RoundFloor); | ||
72 | m_roundingMethod->addItem(i18nc("Rounding method", "Truncate"), AlkValue::RoundTruncate); | 72 | m_roundingMethod->addItem(i18nc("Rounding method", "Truncate"), AlkValue::RoundTruncate); | ||
73 | registerField("roundingMethod", m_roundingMethod, "currentData", SIGNAL(currentIndexChanged(int))); | 73 | registerField("roundingMethod", m_roundingMethod, "currentData", SIGNAL(currentIndexChanged(int))); | ||
74 | 74 | | |||
75 | registerField("fraction", m_fraction, "value", SIGNAL(textChanged())); | 75 | registerField("fraction", m_fraction, "value", SIGNAL(textChanged())); | ||
76 | connect(m_fraction, SIGNAL(textChanged(QString)), | 76 | connect(m_fraction, SIGNAL(textChanged(QString)), | ||
77 | this, SIGNAL(completeChanged())); | 77 | this, SIGNAL(completeChanged())); | ||
78 | | ||||
79 | registerField("pricePrecision", m_pricePrecision, "value", SIGNAL(valueChanged())); | ||||
78 | } | 80 | } | ||
79 | 81 | | |||
80 | /** | 82 | /** | ||
81 | * Set the values based on the @param security | 83 | * Set the values based on the @param security | ||
82 | */ | 84 | */ | ||
83 | void KInvestmentDetailsWizardPage::init2(const MyMoneySecurity& security) | 85 | void KInvestmentDetailsWizardPage::init2(const MyMoneySecurity& security) | ||
84 | { | 86 | { | ||
85 | MyMoneySecurity tradingCurrency = MyMoneyFile::instance()->currency(security.tradingCurrency()); | 87 | MyMoneySecurity tradingCurrency = MyMoneyFile::instance()->currency(security.tradingCurrency()); | ||
86 | m_investmentSymbol->setText(security.tradingSymbol()); | 88 | m_investmentSymbol->setText(security.tradingSymbol()); | ||
87 | m_tradingMarket->setCurrentIndex(m_tradingMarket->findText(security.tradingMarket(), Qt::MatchExactly)); | 89 | m_tradingMarket->setCurrentIndex(m_tradingMarket->findText(security.tradingMarket(), Qt::MatchExactly)); | ||
88 | if (security.roundingMethod() == AlkValue::RoundNever) | 90 | if (security.roundingMethod() == AlkValue::RoundNever) | ||
89 | m_roundingMethod->setCurrentIndex(0); | 91 | m_roundingMethod->setCurrentIndex(0); | ||
90 | else | 92 | else | ||
91 | m_roundingMethod->setCurrentIndex(m_roundingMethod->findData(security.roundingMethod())); | 93 | m_roundingMethod->setCurrentIndex(m_roundingMethod->findData(security.roundingMethod())); | ||
92 | m_fraction->setValue(MyMoneyMoney(security.smallestAccountFraction(), 1)); | 94 | m_fraction->setValue(MyMoneyMoney(security.smallestAccountFraction(), 1)); | ||
95 | m_pricePrecision->setValue(security.pricePrecision()); | ||||
93 | m_tradingCurrencyEdit->setSecurity(tradingCurrency); | 96 | m_tradingCurrencyEdit->setSecurity(tradingCurrency); | ||
94 | 97 | | |||
95 | m_investmentIdentification->setText(security.value("kmm-security-id")); | 98 | m_investmentIdentification->setText(security.value("kmm-security-id")); | ||
96 | } | 99 | } | ||
97 | 100 | | |||
98 | /** | 101 | /** | ||
99 | * Update the "Next" button | 102 | * Update the "Next" button | ||
100 | */ | 103 | */ | ||
Show All 37 Lines |