#include <GeopsyPreferences.h>
enum GeopsyCore::GeopsyPreferences::StationName [protected] |
{StationNameFile=0x0, StationNameRxxx=0x1};
enum GeopsyCore::GeopsyPreferences::TimeReference [protected] |
{AskTimeReference=0x0, FixedTimeReference=0x3, FixedDate=0x1, FixedTime=0x2, NoCommonTimeReference=0x4};
bool GeopsyCore::GeopsyPreferences::askForFormat | ( | ) | const [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::load(), Preferences::on_fileDefaults_clicked(), and save().
{return _askForFormat;}
bool GeopsyCore::GeopsyPreferences::askForTimeReference | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), and save().
{return _timeReference==AskTimeReference;}
uint GeopsyCore::GeopsyPreferences::cacheSize | ( | ) | [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::GeopsyCoreEngine(), Preferences::on_poolDefaults_clicked(), and save().
{return _cacheSize;}
QString GeopsyCore::GeopsyPreferences::cacheSwapDir | ( | ) | [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::GeopsyCoreEngine(), Preferences::on_poolDefaults_clicked(), and save().
{return _cacheSwapDir;}
QString GeopsyCore::GeopsyPreferences::chronogramMakeUpFile | ( | ) | const [inline] |
Referenced by ChronogramWindow::ChronogramWindow(), and ChronogramWindow::subPoolUpdate().
{return _chronogramMakeUpFile;}
SignalFileFormat GeopsyCore::GeopsyPreferences::fileFormat | ( | ) | const [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::load(), Preferences::on_fileDefaults_clicked(), and save().
{return _fileFormat;}
QDate GeopsyCore::GeopsyPreferences::fixedDate | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setTimeReference().
{return _fixedDate;}
QTime GeopsyCore::GeopsyPreferences::fixedTime | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setTimeReference().
{return _fixedTime;}
QString GeopsyCore::GeopsyPreferences::graphicMakeUpFile | ( | ) | const [inline] |
Referenced by GraphicWindow::GraphicWindow(), save(), and GraphicWindow::subPoolUpdate().
{return _graphicMakeUpFile;}
bool GeopsyCore::GeopsyPreferences::isFixedDate | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setTimeReference().
{return _timeReference & FixedDate;}
bool GeopsyCore::GeopsyPreferences::isFixedTime | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setTimeReference().
{return _timeReference & FixedTime;}
bool GeopsyCore::GeopsyPreferences::isFixedTimeReference | ( | ) | const [inline] |
Referenced by GeopsyCore::SignalFile::setTimeReference().
{return _timeReference & FixedTimeReference;}
bool GeopsyCore::GeopsyPreferences::isNoCommonTimeReference | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setTimeReference().
{return _timeReference==NoCommonTimeReference;}
void GeopsyCore::GeopsyPreferences::load | ( | ) |
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); }
QString GeopsyCore::GeopsyPreferences::mapMakeUpFile | ( | ) | const [inline] |
Referenced by MapWindow::MapWindow(), save(), and MapWindow::subPoolUpdate().
{return _mapMakeUpFile;}
int GeopsyCore::GeopsyPreferences::maxNofFiles | ( | ) | const [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::load(), Preferences::on_fileDefaults_clicked(), and save().
{return _maxNofFiles;}
bool GeopsyCore::GeopsyPreferences::oneWindowPerFile | ( | ) | const [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::load(), Preferences::on_fileDefaults_clicked(), GeopsyGui::CityLoader::on_loadBut_clicked(), and save().
{return _oneWindowPerFile;}
bool GeopsyCore::GeopsyPreferences::restoreChronogramMakeUp | ( | ) | const [inline] |
Referenced by ChronogramWindow::ChronogramWindow().
{return _chronogramMakeUp;}
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(); }
bool GeopsyCore::GeopsyPreferences::restoreGraphicMakeUp | ( | ) | const [inline] |
Referenced by GraphicWindow::GraphicWindow(), save(), ChronogramWindow::subPoolUpdate(), and GraphicWindow::subPoolUpdate().
{return _graphicMakeUp;}
bool GeopsyCore::GeopsyPreferences::restoreMapMakeUp | ( | ) | const [inline] |
Referenced by MapWindow::MapWindow(), save(), and MapWindow::subPoolUpdate().
{return _mapMakeUp;}
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(); }
void GeopsyCore::GeopsyPreferences::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; }
bool GeopsyCore::GeopsyPreferences::showGraphic | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), and save().
{return _showGraphic;}
bool GeopsyCore::GeopsyPreferences::showTable | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), and save().
{return _showTable;}
bool GeopsyCore::GeopsyPreferences::stationNameFile | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setSignalName().
{return _stationName==StationNameFile;}
bool GeopsyCore::GeopsyPreferences::stationNameRxxx | ( | ) | const [inline] |
Referenced by Preferences::on_fileDefaults_clicked(), save(), and GeopsyCore::SignalFile::setSignalName().
{return _stationName==StationNameRxxx;}
MetaDataFieldList& GeopsyCore::GeopsyPreferences::tableFields | ( | ) | [inline] |
Referenced by SignalTableItem::SignalTableItem().
{return _tableFields;}
bool GeopsyCore::GeopsyPreferences::viewIfFewFiles | ( | ) | const [inline] |
Referenced by GeopsyCore::GeopsyCoreEngine::load(), Preferences::on_fileDefaults_clicked(), and save().
{return _viewIfFewFiles;}
uint GeopsyCore::GeopsyPreferences::_askForFormat [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_cacheSize [protected] |
Referenced by load().
QString GeopsyCore::GeopsyPreferences::_cacheSwapDir [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_chronogramMakeUp [protected] |
QString GeopsyCore::GeopsyPreferences::_chronogramMakeUpFile [protected] |
Referenced by load().
QDate GeopsyCore::GeopsyPreferences::_fixedDate [protected] |
Referenced by load().
QTime GeopsyCore::GeopsyPreferences::_fixedTime [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_graphicMakeUp [protected] |
Referenced by load().
QString GeopsyCore::GeopsyPreferences::_graphicMakeUpFile [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_mapMakeUp [protected] |
Referenced by load().
QString GeopsyCore::GeopsyPreferences::_mapMakeUpFile [protected] |
Referenced by load().
int GeopsyCore::GeopsyPreferences::_maxNofFiles [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_oneWindowPerFile [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_showGraphic [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_showTable [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_stationName [protected] |
Referenced by load().
Referenced by load(), and saveNoAuto().
uint GeopsyCore::GeopsyPreferences::_timeReference [protected] |
Referenced by load().
uint GeopsyCore::GeopsyPreferences::_unused [protected] |
uint GeopsyCore::GeopsyPreferences::_viewIfFewFiles [protected] |
Referenced by load().