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

bool HtmlOptionsPage::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 134 of file htmloptionspage.cpp.

References OptionType::afterHtmlFile, OptionType::backColor, OptionType::beforeHtmlFile, OptionType::columnNum, OptionType::encoding, OptionType::galleryCSSFile, OptionType::galleryTemplate, OptionType::galleryTemplateFile, galleryTemplateList, OptionType::galleryTitle, OptionType::language, KalleryGlobals::options, KalleryGlobals::ref(), OptionType::tableColor, OptionType::textColor, OptionType::useFrames, and OptionType::visitedColor.

{
  KalleryGlobals::ref()->options.galleryTitle = PageTitleEdit->text();
  KalleryGlobals::ref()->options.language = GalleryLanguageCombo->currentText();
  int i = GalleryTemplateCombo->currentItem();
  KalleryGlobals::ref()->options.galleryTemplateFile = galleryTemplateList[i].left(galleryTemplateList[i].find('|'));
  KalleryGlobals::ref()->options.galleryTemplate =  GalleryTemplateCombo->currentText();
  KalleryGlobals::ref()->options.columnNum =  ColumnNumSpinBox->value();
  KalleryGlobals::ref()->options.tableColor = TableColorFrame->backgroundColor();
  KalleryGlobals::ref()->options.backColor = BackColorFrame->backgroundColor();
  KalleryGlobals::ref()->options.textColor = TextColorFrame->backgroundColor();
  KalleryGlobals::ref()->options.visitedColor = VisitedColorFrame->backgroundColor();
  KalleryGlobals::ref()->options.encoding = EncodingCombo->currentText();

  if (UseGalleryCSS->isChecked())
  {
    KalleryGlobals::ref()->options.galleryCSSFile = OwnGalleryCSSName->text();
    if (!QFileInfo(KalleryGlobals::ref()->options.galleryCSSFile).exists())
    {
      if (KMessageBox::warningYesNo(this,i18n("The file %1 is missing. Continue anyway?").arg(KalleryGlobals::ref()->options.galleryCSSFile),i18n("Missing file")) == KMessageBox::No)
      {
        return false;
      }
    }
  }
  else
  {
    KalleryGlobals::ref()->options.galleryCSSFile = "";
  }

  KalleryGlobals::ref()->options.beforeHtmlFile =  BeforeHtmlEdit->text();
  KalleryGlobals::ref()->options.afterHtmlFile =  AfterHtmlEdit->text();

  //Check the existance of the selected files.
  if ((!KalleryGlobals::ref()->options.beforeHtmlFile.isEmpty()) && (!QFileInfo(KalleryGlobals::ref()->options.beforeHtmlFile).exists()))
  {
    if (KMessageBox::warningYesNo(this,i18n("The file %1 is missing. Continue anyway?").arg(KalleryGlobals::ref()->options.beforeHtmlFile),i18n("Missing file")) == KMessageBox::No)
    {
       return false;
    }
  }
  if ((!KalleryGlobals::ref()->options.afterHtmlFile.isEmpty()) && (!QFileInfo(KalleryGlobals::ref()->options.afterHtmlFile).exists()))
  {
    if (KMessageBox::warningYesNo(this,i18n("The file %1 is missing. Continue anyway?").arg(KalleryGlobals::ref()->options.afterHtmlFile),i18n("Missing file")) == KMessageBox::No)
    {
       return false;
    }
  }

  if ((KalleryGlobals::ref()->options.galleryTemplateFile.find("gallery_frame.template") == -1) &&
    (KalleryGlobals::ref()->options.useFrames))
  {
    if (KMessageBox::warningYesNo(this,i18n("You have selected to use frames, but a non frame template. This is not good.\n Continue anyway?"),i18n("Settings missmatch")) == KMessageBox::No)
    {
      return false;
    }
  }

  return true;
}


Generated by  Doxygen 1.6.0   Back to index