Logo Search packages:      
Sourcecode: tellico version File versions

void MainWindow::slotHandleConfigChange (  )  [slot]

Handles updating everything when the configuration is changed via the configuration dialog. This slot is called when the OK or Apply button is clicked in the dialog

Definition at line 1483 of file mainwindow.cpp.

References Tellico::Data::Field::autoCapitalize(), Tellico::Data::Field::autoFormat(), Tellico::ViewStack::entryView(), Tellico::ConfigDialog::saveConfiguration(), Tellico::EntryView::setXSLTFile(), and Tellico::GroupView::showCount().

Referenced by slotShowConfigDialog().

                                        {
  // for some reason, the m_config pointer is getting changed, but
  // I can't figure out where, so just to be on the safe side
  if(m_config != kapp->config()) {
    m_config = kapp->config();
  }

  const bool autoCapitalize = Data::Field::autoCapitalize();
  const bool autoFormat = Data::Field::autoFormat();

  m_configDlg->saveConfiguration(m_config);

  if(autoCapitalize != Data::Field::autoCapitalize() || autoFormat != Data::Field::autoFormat()) {
    // invalidate all groups
    Kernel::self()->collection()->invalidateGroups();
    // refreshing the title causes the group view to refresh
    Controller::self()->slotRefreshField(Kernel::self()->collection()->fieldByName(QString::fromLatin1("title")));
  }

  // make sure to update the other that depend on options being changed
  m_config->setGroup("General Options");
  m_groupView->showCount(m_config->readBoolEntry("Show Group Count"));

  m_config->setGroup(QString::fromLatin1("Options - %1").arg(Kernel::self()->collection()->entryName()));
  QString entryXSLTFile = m_config->readEntry("Entry Template", QString::fromLatin1("Default"));
  if(entryXSLTFile.isEmpty()) {
    entryXSLTFile = QString::fromLatin1("Default"); // should never happen, but just in case
  }
  m_viewStack->entryView()->setXSLTFile(entryXSLTFile + QString::fromLatin1(".xsl"));
}


Generated by  Doxygen 1.6.0   Back to index