/** * Set the values based on the @param security */ void KOnlineUpdateWizardPage::init2(const MyMoneySecurity& security) { int idx; if (security.value("kmm-online-quote-system") == "Finance::Quote") { FinanceQuoteProcess p; m_useFinanceQuote->setChecked(true); idx = m_onlineSourceCombo->findText(p.niceName(security.value("kmm-online-source"))); } else { idx = m_onlineSourceCombo->findText(security.value("kmm-online-source")); } // in case we did not find the entry, we use the empty one if (idx == -1) idx = m_onlineSourceCombo->findText(QString()); m_onlineSourceCombo->setCurrentIndex(idx); if (!security.value("kmm-online-factor").isEmpty()) m_onlineFactor->setValue(MyMoneyMoney(security.value("kmm-online-factor"))); }
void KNewInvestmentWizard::init2(void) { MyMoneySecurity tradingCurrency = MyMoneyFile::instance()->currency(m_security.tradingCurrency()); m_investmentSymbol->setText(m_security.tradingSymbol()); m_tradingMarket->setCurrentText(m_security.tradingMarket()); m_fraction->setValue(MyMoneyMoney(m_security.smallestAccountFraction(), 1)); m_tradingCurrencyEdit->setSecurity(tradingCurrency); if (m_security.value("kmm-online-quote-system") == "Finance::Quote") { FinanceQuoteProcess p; m_useFinanceQuote->setChecked(true); m_onlineSourceCombo->setCurrentText(p.niceName(m_security.value("kmm-online-source"))); } else { m_onlineSourceCombo->setCurrentText(m_security.value("kmm-online-source")); } if(!m_security.value("kmm-online-factor").isEmpty()) m_onlineFactor->setValue(MyMoneyMoney(m_security.value("kmm-online-factor"))); m_investmentIdentification->setText(m_security.value("kmm-security-id")); m_securityType->setCurrentText(KMyMoneyUtils::securityTypeToString(m_security.securityType())); slotCheckPage(m_security.value("kmm-online-source")); }