Logo Search packages:      
Sourcecode: kallery version File versions  Download package

bool SelectSourcePage::processPage (  )  [virtual]

Reads the settings from the page.

Returns:
true if everything's ok, and the user can go to the next page, otherwise returns false.

Implements WizardPageBase.

Definition at line 100 of file selectsourcepage.cpp.

References OptionType::imageList, KalleryGlobals::options, and KalleryGlobals::ref().

{
  if (KalleryGlobals::ref()->options.imageList.isEmpty())
  {
    KMessageBox::error(this,i18n("There was no image added to the project.\nPlease add at least one image file."),i18n("Empty list error"), true);
    return false;
  }
  //Check for duplicate filename, they cause problems. It can be a long process...
  QString tmpString = "";
  uint k = 0;
  for (uint i = 0; i < KalleryGlobals::ref()->options.imageList.count();  i++)
  {
    for (uint j = i + 1; j < KalleryGlobals::ref()->options.imageList.count(); j++)
    {
      if (QFileInfo(KalleryGlobals::ref()->options.imageList[i]).fileName() == QFileInfo(KalleryGlobals::ref()->options.imageList[j]).fileName())
      {
        k++;
        if (k < 11 )
          tmpString += KalleryGlobals::ref()->options.imageList[i] + "  <->  " + KalleryGlobals::ref()->options.imageList[j] + "\n";
      }
    }
  }

  if (k > 10)
    tmpString += i18n("\n... and %1 other files are also conflicting.").arg(k-10);
  if (tmpString.isEmpty())
  {
    return true;
  }
  else
  {
    KMessageBox::error(this,i18n("Conflicting/duplicate filenames were found: \n\n %1").arg(tmpString),i18n("Duplicate filename error"),true);
    return false;
  }
}


Generated by  Doxygen 1.6.0   Back to index