[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/office/kmymoney/kmymoney/wizards/newinvestmentwizard
From: Alvaro Soliverez <asoliverez () gmail ! com>
Date: 2010-07-28 0:12:51
Message-ID: 20100728001251.E25F8AC779 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1155738 by asoliverez:
Fixed the type of investment combo to not overwrite the first item with the current \
type.
Moved strings around, but there are no new or modified strings.
BUG:245964
CCMAIL:kde-i18n-doc@kde.org
M +15 -2 kinvestmenttypewizardpage.cpp
M +0 -15 kinvestmenttypewizardpagedecl.ui
--- trunk/extragear/office/kmymoney/kmymoney/wizards/newinvestmentwizard/kinvestmenttypewizardpage.cpp \
#1155737:1155738 @@ -19,8 +19,8 @@
// ----------------------------------------------------------------------------
// QT Includes
+#include <QStringListModel>
-
// ----------------------------------------------------------------------------
// KDE Includes
@@ -31,11 +31,24 @@
KInvestmentTypeWizardPage::KInvestmentTypeWizardPage(QWidget *parent)
: KInvestmentTypeWizardPageDecl(parent)
{
+ QStringListModel *model = new QStringListModel();
+ QStringList types;
+ types << i18n("Stock") << i18n("Mutual Fund") << i18n("Bond");
+ model->setStringList(types);
+ model->sort(0, Qt::AscendingOrder);
+
+ m_securityType->setModel(model);
}
void KInvestmentTypeWizardPage::init2(const MyMoneySecurity& security)
{
- m_securityType->setItemText(m_securityType->currentIndex(), \
KMyMoneyUtils::securityTypeToString(security.securityType())); + //get the current \
text of the security and set the combo index accordingly + QString text = \
KMyMoneyUtils::securityTypeToString(security.securityType()); + for(int i = 0; i < \
m_securityType->count(); ++i) { + if(m_securityType->itemText(i) == text)
+ m_securityType->setCurrentIndex(i);
+ }
+
// Register the fields with the QWizard
registerField("securityType", m_securityType, "currentText", \
SIGNAL(currentIndexChanged(const QString&))); }
--- trunk/extragear/office/kmymoney/kmymoney/wizards/newinvestmentwizard/kinvestmenttypewizardpagedecl.ui \
#1155737:1155738 @@ -78,21 +78,6 @@
</item>
<item>
<widget class="KComboBox" name="m_securityType">
- <item>
- <property name="text">
- <string>Stock</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Mutual Fund</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Bond</string>
- </property>
- </item>
</widget>
</item>
<item>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic