Public Slots | Public Member Functions
Preferences Class Reference

#include <Preferences.h>

Inheritance diagram for Preferences:
QGpGuiTools::Dialog QGpGuiTools::FrameGrabber

List of all members.

Public Slots

void on_addPath_clicked ()
void on_addSep_clicked ()
void on_cacheSwapDirBut_clicked ()
void on_chronogramMakeUpBrowse_clicked ()
void on_chronogramMakeUpSwitch_toggled ()
void on_fileDefaults_clicked ()
void on_formatCustomAscii_clicked ()
void on_formatFixed_toggled ()
void on_graphicMakeUpBrowse_clicked ()
void on_graphicMakeUpSwitch_toggled ()
void on_mapMakeUpBrowse_clicked ()
void on_mapMakeUpSwitch_toggled ()
void on_moveToolDown_clicked ()
void on_moveToolUp_clicked ()
void on_poolDefaults_clicked ()
void on_removePath_clicked ()
void on_removeTool_clicked ()
void on_searchTool_clicked ()
void on_stationNameFile_clicked ()
void on_stationNameRxxx_clicked ()
void on_timeReferenceAsk_toggled ()
void on_timeReferenceFixedDate_toggled ()
void on_timeReferenceFixedTime_toggled ()
void on_timeReferenceNoCommon_toggled ()
void on_winDoIt_toggled ()
void updateAll ()

Public Member Functions

 Preferences (QWidget *parent=0, Qt::WFlags fl=0)
void saveToolList ()
 ~Preferences ()

Constructor & Destructor Documentation

Preferences::Preferences ( QWidget *  parent = 0,
Qt::WFlags  fl = 0 
)

References TRACE.

    : Dialog(parent, fl)
{
  TRACE;
  setupUi(this);

  QSettings reg;
  reg.beginGroup("Plugins");
  reg.beginGroup(GEOPSY_VERSION_TYPE);
  QStringList paths=reg.value( "Paths" ).toStringList();
  pathList->addItems(paths);
  setPluginList(reg.value( "pluginList" ).toStringList());

  QList< QPair<QString, SignalFileFormat> > formats=SignalFileFormat::importList();
  for(int i=0; i<formats.count(); i++) {
     fileFormat->addItem(formats.at(i).first);
  }
}

References TRACE.

{
  TRACE;
  // no need to delete child widgets, Qt does it all for us
}

Member Function Documentation

References QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString path=Message::getExistingDirectory(tr( "Add plugin search path" ));
  if( !path.isEmpty()) pathList->addItem(path);
}

References ToolSeparator::title(), and TRACE.

{
  TRACE;
  ToolSeparator tool;
  QListWidgetItem * item=new QListWidgetItem(tool.title());
  item->setData(32, "" );
  toolList->addItem(item);
}

References QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString path=Message::getExistingDirectory(tr( "Swap folder" ));
  if( !path.isEmpty()) cacheSwapDir->setText(path);
}

References fileName, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString fileName=Message::getOpenFileName(tr("Make-up for chronograms"), tr("Graph make-up (*.mkup)"));
  if( !fileName.isEmpty()) chronogramMakeUpEdit->setText(fileName);
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  bool b=chronogramMakeUpSwitch->isChecked();
  chronogramMakeUpEdit->setEnabled(b);
  chronogramMakeUpBrowse->setEnabled(b);
}

References GeopsyCore::GeopsyPreferences::askForFormat(), GeopsyCore::GeopsyPreferences::askForTimeReference(), GeopsyCore::SignalFileFormat::captionFilter(), GeopsyCore::GeopsyPreferences::fileFormat(), GeopsyCore::GeopsyPreferences::fixedDate(), GeopsyCore::GeopsyPreferences::fixedTime(), GeopsyCore::geopsyCore, GeopsyCore::GeopsyPreferences::isFixedDate(), GeopsyCore::GeopsyPreferences::isFixedTime(), GeopsyCore::GeopsyPreferences::isNoCommonTimeReference(), GeopsyCore::GeopsyPreferences::maxNofFiles(), GeopsyCore::GeopsyPreferences::oneWindowPerFile(), GeopsyCore::GeopsyCoreEngine::preferences(), GeopsyCore::GeopsyPreferences::restoreFileDefaults(), GeopsyCore::GeopsyPreferences::showGraphic(), GeopsyCore::GeopsyPreferences::showTable(), GeopsyCore::GeopsyPreferences::stationNameFile(), GeopsyCore::GeopsyPreferences::stationNameRxxx(), TRACE, updateAll(), and GeopsyCore::GeopsyPreferences::viewIfFewFiles().

{
  TRACE;
  geopsyCore->preferences()->restoreFileDefaults();
  GeopsyPreferences * prefs=geopsyCore->preferences();

  formatAsk->setChecked(prefs->askForFormat());
  formatFixed->setChecked(!prefs->askForFormat());
  QList<QPair<QString, SignalFileFormat> > formats=SignalFileFormat::importList();
  QPair<QString, SignalFileFormat> formatPair;
  formatPair.first=prefs->fileFormat().captionFilter();
  formatPair.second=prefs->fileFormat();
  formats.indexOf(formatPair);
  fileFormat->setCurrentIndex(formats.indexOf(formatPair));
  timeReferenceAsk->setChecked(prefs->askForTimeReference());
  timeReferenceFixedDate->setChecked(prefs->isFixedDate());
  timeReferenceFixedTime->setChecked(prefs->isFixedTime());
  timeReferenceDate->setDate(prefs->fixedDate());
  timeReferenceTime->setTime(prefs->fixedTime());
  timeReferenceNoCommon->setChecked(prefs->isNoCommonTimeReference());
  winDoIt->setChecked(prefs->viewIfFewFiles());
  winNofFiles->setValue(prefs->maxNofFiles());
  winTable->setChecked(prefs->showTable());
  winGraphic->setChecked(prefs->showGraphic());
  oneWindowPerFile->setChecked(prefs->oneWindowPerFile());
  stationNameFile->setChecked(prefs->stationNameFile());
  stationNameRxxx->setChecked(prefs->stationNameRxxx());
  updateAll();
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  fileFormat->setEnabled(formatFixed->isChecked());
}

References fileName, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString fileName=Message::getOpenFileName(tr("Make-up for graphics"), tr("Graph make-up (*.mkup)"));
  if( !fileName.isEmpty()) graphicMakeUpEdit->setText(fileName);
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  bool b=graphicMakeUpSwitch->isChecked();
  graphicMakeUpEdit->setEnabled(b);
  graphicMakeUpBrowse->setEnabled(b);
}

References fileName, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString fileName=Message::getOpenFileName(tr("Make-up for maps"), tr("Graph make-up (*.mkup)"));
  if( !fileName.isEmpty()) mapMakeUpEdit->setText(fileName);
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  bool b=mapMakeUpSwitch->isChecked();
  mapMakeUpEdit->setEnabled(b);
  mapMakeUpBrowse->setEnabled(b);
}

References TRACE.

{
  TRACE;
  int i=toolList->currentRow();
  if(i >= 0 && i < (int) toolList->count() - 1) {
    QListWidgetItem * item=toolList->takeItem(i);
    toolList->insertItem(i + 1, item);
  }
}

References TRACE.

{
  TRACE;
  int i=toolList->currentRow();
  if(i > 0) {
    QListWidgetItem * item=toolList->takeItem(i);
    toolList->insertItem(i - 1, item);
  }
}

References TRACE.

{
  TRACE;
  delete pathList->takeItem(pathList->currentRow());
}

References TRACE.

{
  TRACE;
  if(toolList->currentRow() >= 0)
    delete toolList->takeItem(toolList->currentRow());
}

References QGpCoreTools::PackageInfo::dllDir(), MSG_ID, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QStringList paths=getPaths();
  toolList->clear();
  bool ok;
  QStringList plugins=GeopsyPlugins::getList(File::getLibList(paths), ok);
  if(ok) {
    if(plugins.isEmpty()) {
#ifdef Q_WS_MAC
      QString dll="/Library/Geopsy/plugins";
#else
      const PackageInfo * p=PackageInfo::package("geopsy");
      ASSERT(p);
      QString dll=p->dllDir();
#endif
      Message::warning(MSG_ID, tr("Searching plugins"), tr("No plugin found in your search path(s). Search for plugins is not recursive, so "
                                                           "you must select the exact path of library installation (e.g. %1).")
                                                          .arg(dll));
    } else {
      setPluginList(plugins);
      Message::information(MSG_ID, tr("Searching plugins"), tr("Restart geopsy now to enjoy the new plugins."));
    }
  } else {
    Message::warning(MSG_ID, tr("Searching plugins"), tr("One ore more plugins in your search path(s) are "
                         "not compatible with this geopsy version. It is likely that old versions of plugins "
                         "were not de-installed properly."));
  }
}

References TRACE.

{
  TRACE;
  if(stationNameFile->isChecked()) stationNameRxxx->setChecked(false);
}

References TRACE.

{
  TRACE;
  if(stationNameRxxx->isChecked()) stationNameFile->setChecked(false);

}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  bool b=timeReferenceAsk->isChecked();
  if(b) {
    timeReferenceFixedDate->setChecked(false);
    timeReferenceFixedTime->setChecked(false);
    timeReferenceNoCommon->setChecked(false);
  }
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  timeReferenceDate->setEnabled(timeReferenceFixedDate->isChecked());
  if(timeReferenceFixedDate->isChecked()) {
    timeReferenceAsk->setChecked(false);
    timeReferenceNoCommon->setChecked(false);
  }
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  timeReferenceTime->setEnabled(timeReferenceFixedTime->isChecked());
  if(timeReferenceFixedTime->isChecked()) {
    timeReferenceAsk->setChecked(false);
    timeReferenceNoCommon->setChecked(false);
  }
}

References TRACE.

{
  TRACE;
  bool b=timeReferenceNoCommon->isChecked();
  if(b) {
    timeReferenceAsk->setChecked(false);
    timeReferenceFixedDate->setChecked(false);
    timeReferenceFixedTime->setChecked(false);
  }
}

References TRACE.

Referenced by updateAll().

{
  TRACE;
  winNofFiles->setEnabled(winDoIt->isChecked());
}

References TRACE.

Referenced by GeopsyMainWindow::setPreferences().

{
  TRACE;
  QStringList paths=getPaths();
  QSettings reg;
  reg.beginGroup("Plugins");
  reg.beginGroup(GEOPSY_VERSION_TYPE);
  reg.setValue( "Paths", paths);
  QStringList tools=getTools();
  reg.setValue( "pluginList", tools);
}
void Preferences::updateAll ( ) [slot]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines