Summary: | datawizard should not sort available fields alphabetically | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Nicolas Brisset <nicolas.brisset> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Solaris | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Nicolas Brisset
2005-01-06 14:38:18 UTC
CVS commit by arwalker: CCMAIL: 96441-done@bugs.kde.org I think this addresses the problem. I've added an additional column to the list of vectors which is the position of the vector in the list. Sorting is done on this column by default, but can be changed by clicking on the column header. M +24 -6 datawizard.ui.h 1.105 --- kdeextragear-2/kst/kst/datawizard.ui.h #1.104:1.105 @@ -31,4 +31,7 @@ void DataWizard::init() connect(finishButton(), SIGNAL(clicked()), this, SLOT(finished())); + _vectors->addColumn(i18n("Position")); + _vectors->setSorting(1); + // No help button setHelpEnabled(_pageDataSource, false); @@ -114,4 +117,7 @@ void DataWizard::sourceChanged( const QS bool complete = false; QString fileType; + QString str; + int index = 0; + int count; if (ds) { @@ -143,7 +149,19 @@ void DataWizard::sourceChanged( const QS _xVector->completionObject()->insertItems(fl); _xVector->setEditable(!complete); + + count = fl.count(); + if (count > 0) { + count = 1+(int)log10((double)count); + } else { + count = 1; + } for (QStringList::ConstIterator it = fl.begin(); it != fl.end(); ++it) { - new QCheckListItem(_vectors, *it, QCheckListItem::CheckBox); + QCheckListItem *pItem = new QCheckListItem(_vectors, *it, QCheckListItem::CheckBox); + str.sprintf("%0*d", count, index); + pItem->setText(1, str); + index++; } + _vectors->sort(); + KST::vectorDefaults.sync(); QString defaultX = KST::vectorDefaults.wizardXVector(); @@ -310,5 +328,5 @@ void DataWizard::vectorSubset(const QStr QListViewItem *after = 0L; _vectors->clearSelection(); - _vectors->setSorting(2, true); // Qt 3.1 compat + _vectors->setSorting(3, true); // Qt 3.1 compat QRegExp re(filter, true /* case insensitive */, true /* wildcard */); QListViewItemIterator it(_vectors); |