All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Protected Types | Protected Attributes
GeopsyCore::GeopsyPreferences Class Reference

#include <GeopsyPreferences.h>

List of all members.

Public Member Functions

bool askForFormat () const
bool askForTimeReference () const
uint cacheSize ()
QString cacheSwapDir ()
QString chronogramMakeUpFile () const
SignalFileFormat fileFormat () const
QDate fixedDate () const
QTime fixedTime () const
 GeopsyPreferences ()
QString graphicMakeUpFile () const
bool isFixedDate () const
bool isFixedTime () const
bool isFixedTimeReference () const
bool isNoCommonTimeReference () const
void load ()
QString mapMakeUpFile () const
int maxNofFiles () const
bool oneWindowPerFile () const
bool restoreChronogramMakeUp () const
void restoreFileDefaults ()
bool restoreGraphicMakeUp () const
bool restoreMapMakeUp () const
void restorePoolDefaults ()
void save ()
void saveNoAuto ()
bool showGraphic () const
bool showTable () const
bool stationNameFile () const
bool stationNameRxxx () const
MetaDataFieldListtableFields ()
bool viewIfFewFiles () const
 ~GeopsyPreferences ()

Protected Types

enum  StationName { StationNameFile = 0x0, StationNameRxxx = 0x1 }
enum  TimeReference {
  AskTimeReference = 0x0, FixedTimeReference = 0x3, FixedDate = 0x1, FixedTime = 0x2,
  NoCommonTimeReference = 0x4
}

Protected Attributes

uint _askForFormat:1
uint _cacheSize
QString _cacheSwapDir
uint _chronogramMakeUp:1
QString _chronogramMakeUpFile
SignalFileFormat _fileFormat
QDate _fixedDate
QTime _fixedTime
uint _graphicMakeUp:1
QString _graphicMakeUpFile
uint _mapMakeUp:1
QString _mapMakeUpFile
int _maxNofFiles
uint _oneWindowPerFile:1
uint _showGraphic:1
uint _showTable:1
uint _stationName:2
MetaDataFieldList _tableFields
uint _timeReference:3
uint _unused:19
uint _viewIfFewFiles:1

Member Enumeration Documentation

Enumerator:
StationNameFile 
StationNameRxxx 
Enumerator:
AskTimeReference 
FixedTimeReference 
FixedDate 
FixedTime 
NoCommonTimeReference 

Constructor & Destructor Documentation

References load(), save(), and TRACE.

{
  TRACE;
  // Load preferences from registry
  load();
  save();
}

References TRACE.

{
  TRACE;
}

Member Function Documentation

QDate GeopsyCore::GeopsyPreferences::fixedDate ( ) const [inline]
QTime GeopsyCore::GeopsyPreferences::fixedTime ( ) const [inline]

Cache all preferences and set default values if not found in registry

References _askForFormat, _cacheSize, _cacheSwapDir, _fileFormat, _fixedDate, _fixedTime, _graphicMakeUp, _graphicMakeUpFile, _mapMakeUp, _mapMakeUpFile, _maxNofFiles, _oneWindowPerFile, _showGraphic, _showTable, _stationName, _tableFields, _timeReference, _viewIfFewFiles, AskTimeReference, GeopsyCore::SignalFileFormat::captionFilter(), FixedDate, FixedTime, GeopsyCore::SignalFileFormat::importList(), NoCommonTimeReference, GeopsyCore::MetaDataFieldList::readRegistry(), StationNameFile, StationNameRxxx, str, TRACE, and GeopsyCore::SignalFileFormat::Unknown.

Referenced by GeopsyPreferences(), restoreFileDefaults(), and restorePoolDefaults().

{
  TRACE;
  QSettings reg;
  // Loading preferences
  reg.beginGroup("DialogOptions");
  reg.beginGroup("Preferences");
  reg.beginGroup("preferenceTab");
  reg.beginGroup("qt_tabwidget_stackedwidget");
  reg.beginGroup("loadTab");

  reg.beginGroup("fileFormatGroup");
  _askForFormat=reg.value("formatAsk", false).toBool();
  QList< QPair<QString, SignalFileFormat> > formats=SignalFileFormat::importList();
  // TODO devel branch: implement it in a better way, function in SignalFileFormat::captionFilterToFormat()
  _fileFormat=SignalFileFormat(SignalFileFormat::Unknown);
  QString caption=reg.value("fileFormat", _fileFormat.captionFilter()).toString();
  for(QList< QPair<QString, SignalFileFormat> >::iterator it=formats.begin(); it!=formats.end(); it++) {
    if(it->first==caption) {
      _fileFormat=it->second;
    }
  }
  reg.endGroup();

  reg.beginGroup("timeReferenceGroup");
  _timeReference=AskTimeReference;
  if(reg.value("timeReferenceNoCommon", false).toBool()) {
    _timeReference=NoCommonTimeReference;
  } else if(!reg.value("timeReferenceAsk", false).toBool()) {
    if(reg.value("timeReferenceFixedDate", false).toBool())
      _timeReference |= FixedDate;
    if(reg.value("timeReferenceFixedTime",true).toBool())
      _timeReference |= FixedTime;
    }
  QString str;
  str=reg.value("timeReferenceDate", "1/1/2000").toString();
  _fixedDate.setYMD(str.section("/",2,2).toInt(),
                    str.section("/",1,1).toInt(),
                    str.section("/",0,0).toInt());
  str=reg.value("timeReferenceTime","00:00:00").toString();
  _fixedTime.setHMS(str.section(":",0,0).toInt(),
                    str.section(":",1,1).toInt(),
                    str.section(":",2,2).toInt());
  reg.endGroup();

  reg.beginGroup("viewerGroup");
  _viewIfFewFiles=reg.value("winDoIt",true).toBool();
  _maxNofFiles=reg.value("winNofFiles",2).toInt();
  _showTable=reg.value("winTable",true).toBool();
  _showGraphic=reg.value("winGraphic",true).toBool();
  _oneWindowPerFile=reg.value("onePerWindow",true).toBool();
  reg.endGroup();

  reg.beginGroup("namesGroup");
  if(reg.value("stationNameRxxx",false).toBool())
    _stationName=StationNameRxxx;
  else
    _stationName=StationNameFile;
  reg.endGroup();

  reg.endGroup(); // loadTab

  // Memory management
  reg.beginGroup("poolTab");
  _cacheSize=reg.value("cacheSize",512).toInt();
  _cacheSwapDir=reg.value("cacheSwapDir",QDir::home().absoluteFilePath(".geopsyswap")).toString();
  reg.endGroup();

  // Viewers tab
  reg.beginGroup("viewersTab");
  reg.beginGroup("viewerAppearanceGroup");
  _graphicMakeUp=reg.value( "graphicMakeUpSwitch", false).toBool();
  _graphicMakeUpFile=reg.value( "graphicMakeUpEdit" ).toString();
  _mapMakeUp=reg.value( "mapMakeUpSwitch", false).toBool();
  _mapMakeUpFile=reg.value( "mapMakeUpEdit" ).toString();
  reg.endGroup();
  reg.endGroup();

  reg.endGroup();
  reg.endGroup();

  reg.endGroup();
  reg.endGroup();
  // Table fields in viewers tab
  _tableFields.readRegistry(reg);
}

References load(), save(), and TRACE.

Referenced by Preferences::on_fileDefaults_clicked().

{
  TRACE;
  // Remove all preferences from settings
  QSettings * reg=new QSettings;
  reg->beginGroup("DialogOptions");
  reg->beginGroup("Preferences");
  reg->beginGroup("preferenceTab");
  reg->beginGroup("qt_tabwidget_stackedwidget");

  reg->beginGroup("loadTab");
  reg->remove("");
  delete reg;
  // Load preference to assign the default values
  load();
  // Save back defaults to settings
  save();
}

References load(), save(), and TRACE.

Referenced by Preferences::on_poolDefaults_clicked().

{
  TRACE;
  // Remove all preferences from settings
  QSettings * reg=new QSettings;
  reg->beginGroup("DialogOptions");
  reg->beginGroup("Preferences");
  reg->beginGroup("preferenceTab");
  reg->beginGroup("qt_tabwidget_stackedwidget");

  reg->beginGroup("poolTab");
  reg->remove("");
  delete reg;
  // Load preference to assign the default values
  load();
  // Save back defaults to settings
  save();
}

References askForFormat(), askForTimeReference(), cacheSize(), cacheSwapDir(), fileFormat(), fixedDate(), fixedTime(), graphicMakeUpFile(), isFixedDate(), isFixedTime(), isNoCommonTimeReference(), mapMakeUpFile(), maxNofFiles(), oneWindowPerFile(), restoreGraphicMakeUp(), restoreMapMakeUp(), saveNoAuto(), showGraphic(), showTable(), stationNameFile(), stationNameRxxx(), TRACE, and viewIfFewFiles().

Referenced by GeopsyPreferences(), restoreFileDefaults(), and restorePoolDefaults().

{
  TRACE;
  QSettings * reg=new QSettings;
  reg->beginGroup("DialogOptions");
  reg->beginGroup("Preferences");
  reg->beginGroup("preferenceTab");
  reg->beginGroup("qt_tabwidget_stackedwidget");

  reg->beginGroup("loadTab");

  reg->beginGroup("fileFormatGroup");
  reg->setValue("formatAsk",askForFormat());
  reg->setValue("formatFixed",!askForFormat());
  reg->setValue("fileFormat", fileFormat().captionFilter());
  reg->endGroup();

  reg->beginGroup("timeReferenceGroup");
  reg->setValue("timeReferenceAsk",askForTimeReference());
  reg->setValue("timeReferenceFixedDate",isFixedDate());
  reg->setValue("timeReferenceFixedTime",isFixedTime());
  reg->setValue("timeReferenceDate",fixedDate().toString("dd/MM/yyyy"));
  reg->setValue("timeReferenceTime",fixedTime().toString("hh:mm:ss"));
  reg->setValue("timeReferenceNoCommon",isNoCommonTimeReference());
  reg->endGroup();

  reg->beginGroup("viewerGroup");
  reg->setValue("winDoIt",viewIfFewFiles());
  reg->setValue("winNofFiles",maxNofFiles());
  reg->setValue("winTable",showTable());
  reg->setValue("winGraphic",showGraphic());
  reg->setValue("oneWindowPerFile",oneWindowPerFile());
  reg->endGroup();

  reg->beginGroup("namesGroup");
  reg->setValue("stationNameFile",stationNameFile());
  reg->setValue("stationNameRxxx",stationNameRxxx());
  reg->endGroup();

  reg->endGroup();

  reg->beginGroup("poolTab");
  reg->setValue("cacheSize",cacheSize());
  reg->setValue("cacheSwapDir",cacheSwapDir());
  reg->endGroup();

  reg->beginGroup("viewersTab");
  reg->beginGroup("viewerAppearanceGroup");
  reg->setValue("graphicMakeUpSwitch",restoreGraphicMakeUp());
  reg->setValue("graphicMakeUpEdit",graphicMakeUpFile());
  reg->setValue("mapMakeUpSwitch",restoreMapMakeUp());
  reg->setValue("mapMakeUpEdit",mapMakeUpFile());
  reg->endGroup();
  reg->endGroup();

  delete reg;
  saveNoAuto();
}

References _tableFields, TRACE, and GeopsyCore::MetaDataFieldList::writeRegistry().

Referenced by save().

{
  TRACE;
  QSettings * reg=new QSettings;
  _tableFields.writeRegistry(*reg);
  delete reg;
}

Member Data Documentation

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load().

Referenced by load(), and saveNoAuto().

Referenced by load().

Referenced by load().


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