Summary: | If n vectors are not found, kst should only display one error dialog, not n error dialogs | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Matthew Truch <matt> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Matthew Truch
2004-09-14 17:06:25 UTC
The message I receive (just once) when invalid vector names are used is the following: "The Kst file could not be loaded in its entirety due to missing objects or data." Could you give the message that you see, as presumably its not what I am seeing. > ------- Additional Comments From arwalker sumusltd com 2004-09-14 18:21 -------
> The message I receive (just once) when invalid vector names are used is the following:
>
> "The Kst file could not be loaded in its entirety due to missing objects or data."
>
> Could you give the message that you see, as presumably its not what I am seeing.
Sorry, I didn't give decent steps to reproduce:
Make a .kst file that has some vectors which exist, and some that don't.
You can do this by editing the kst file by hand (if you don' want to
modify your datasource to have different named vectors). Start kst with
that .kst file. At this point kst will not complain about the bad
vectors (and probably should, but that's another bug report); it will
just display them as zero. Now change the data file for all your
vectors to another valid data file. kst will complain about each
invalid vector with an individual error dialog.
CVS commit by arwalker: Display only a single error message for all the invalid vector sources. CCMAIL: 89498-done@bugs.kde.org M +16 -3 kstchangefiledialog_i.cpp 1.22 --- kdeextragear-2/kst/kst/kstchangefiledialog_i.cpp #1.21:1.22 @@ -71,6 +71,7 @@ void KstChangeFileDialogI::applyFileChan KstDataSourcePtr file; KstWriteLocker ml(&KST::dataSourceList.lock()); - KstDataSourceList::Iterator it = KST::dataSourceList.findFileName(_dataFile->url()); + QString invalidSources; + int invalid = 0; if (it == KST::dataSourceList.end()) { @@ -97,5 +98,9 @@ void KstChangeFileDialogI::applyFileChan vector->writeLock(); if (!file->isValidField(vector->field())) { - KMessageBox::sorry(this, i18n("%1: Field is not defined for the requested file.").arg(vector->field())); + if (invalid > 0) { + invalidSources += ", "; + } + invalidSources += vector->field(); + invalid++; } else { vector->changeFile(file); @@ -105,4 +110,12 @@ void KstChangeFileDialogI::applyFileChan } + if (!invalidSources.isEmpty()) { + if (invalid == 1) { + KMessageBox::sorry(this, i18n("The following field is not defined for the requested file:\n%1").arg(invalidSources)); + } else { + KMessageBox::sorry(this, i18n("The following fields are not defined for the requested file:\n%1").arg(invalidSources)); + } + } + file->writeUnlock(); file = 0L; |