KNewInvestmentWizard::KNewInvestmentWizard( QWidget *parent, const char *name ) :
  KNewInvestmentWizardDecl( parent, name )
{
  init1();
  slotCheckPage(QString());

  m_investmentSymbol->setFocus();
  connect(m_investmentSymbol, SIGNAL(lineChanged(const QString&)), this, SLOT(slotCheckForExistingSymbol(const QString&)));
}
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"));
}
KOnlineUpdateWizardPage::KOnlineUpdateWizardPage(QWidget *parent)
    : KOnlineUpdateWizardPageDecl(parent)
{
  m_onlineFactor->setValue(MyMoneyMoney::ONE);
  m_onlineFactor->setPrecision(4);

  // Connect signals-slots
  connect(m_useFinanceQuote, SIGNAL(toggled(bool)), this, SLOT(slotSourceChanged(bool)));

  // Register the fields with the QWizard and connect the
  // appropriate signals to update the "Next" button correctly
  registerField("onlineFactor", m_onlineFactor, "value");
  registerField("onlineSourceCombo", m_onlineSourceCombo, "currentText", SIGNAL(currentIndexChanged(QString)));
  registerField("useFinanceQuote", m_useFinanceQuote);
  connect(m_onlineSourceCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotCheckPage(QString)));
  connect(m_onlineFactor, SIGNAL(textChanged(QString)),
          this, SIGNAL(completeChanged()));

  connect(m_onlineSourceCombo, SIGNAL(activated(QString)),
          this, SIGNAL(completeChanged()));

  connect(m_useFinanceQuote, SIGNAL(toggled(bool)),
          this, SIGNAL(completeChanged()));
}
void KNewInvestmentWizard::next(void)
{
  KNewInvestmentWizardDecl::next();
  slotCheckPage();
}