#include <Preferences.h>
| 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); } }
| void Preferences::on_addPath_clicked | ( | ) | [slot] |
References QGpCoreTools::tr(), and TRACE.
| void Preferences::on_addSep_clicked | ( | ) | [slot] |
References ToolSeparator::title(), and TRACE.
{
TRACE;
ToolSeparator tool;
QListWidgetItem * item=new QListWidgetItem(tool.title());
item->setData(32, "" );
toolList->addItem(item);
}
| void Preferences::on_cacheSwapDirBut_clicked | ( | ) | [slot] |
References QGpCoreTools::tr(), and TRACE.
| void Preferences::on_chronogramMakeUpBrowse_clicked | ( | ) | [slot] |
| void Preferences::on_chronogramMakeUpSwitch_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
bool b=chronogramMakeUpSwitch->isChecked();
chronogramMakeUpEdit->setEnabled(b);
chronogramMakeUpBrowse->setEnabled(b);
}
| void Preferences::on_fileDefaults_clicked | ( | ) | [slot] |
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();
}
| void Preferences::on_formatCustomAscii_clicked | ( | ) | [slot] |
Edits list of custom ASCII formats
References GeopsyCore::GeopsyCoreEngine::customFileFormats(), GeopsyCore::geopsyCore, GeopsyCore::CustomFileFormats::save(), CustomAsciiFormatsEditor::setFormats(), GeopsyCore::CustomFileFormats::setFormats(), and TRACE.
{
TRACE;
CustomAsciiFormatsEditor * d=new CustomAsciiFormatsEditor(this);
d->setFormats(*geopsyCore->customFileFormats());
if(d->exec()==QDialog::Accepted) {
CustomFileFormats * f=geopsyCore->customFileFormats();
f->setFormats(*d);
f->save();
}
delete d;
}
| void Preferences::on_formatFixed_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
fileFormat->setEnabled(formatFixed->isChecked());
}
| void Preferences::on_graphicMakeUpBrowse_clicked | ( | ) | [slot] |
| void Preferences::on_graphicMakeUpSwitch_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
bool b=graphicMakeUpSwitch->isChecked();
graphicMakeUpEdit->setEnabled(b);
graphicMakeUpBrowse->setEnabled(b);
}
| void Preferences::on_mapMakeUpBrowse_clicked | ( | ) | [slot] |
| void Preferences::on_mapMakeUpSwitch_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
bool b=mapMakeUpSwitch->isChecked();
mapMakeUpEdit->setEnabled(b);
mapMakeUpBrowse->setEnabled(b);
}
| void Preferences::on_moveToolDown_clicked | ( | ) | [slot] |
| void Preferences::on_moveToolUp_clicked | ( | ) | [slot] |
| void Preferences::on_poolDefaults_clicked | ( | ) | [slot] |
References GeopsyCore::GeopsyPreferences::cacheSize(), GeopsyCore::GeopsyPreferences::cacheSwapDir(), GeopsyCore::geopsyCore, GeopsyCore::GeopsyCoreEngine::preferences(), GeopsyCore::GeopsyPreferences::restorePoolDefaults(), and TRACE.
{
TRACE;
geopsyCore->preferences()->restorePoolDefaults();
GeopsyPreferences * prefs=geopsyCore->preferences();
cacheSize->setValue(prefs->cacheSize());
cacheSwapDir->setText(prefs->cacheSwapDir());
}
| void Preferences::on_removePath_clicked | ( | ) | [slot] |
| void Preferences::on_removeTool_clicked | ( | ) | [slot] |
| void Preferences::on_searchTool_clicked | ( | ) | [slot] |
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."));
}
}
| void Preferences::on_stationNameFile_clicked | ( | ) | [slot] |
| void Preferences::on_stationNameRxxx_clicked | ( | ) | [slot] |
| void Preferences::on_timeReferenceAsk_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
bool b=timeReferenceAsk->isChecked();
if(b) {
timeReferenceFixedDate->setChecked(false);
timeReferenceFixedTime->setChecked(false);
timeReferenceNoCommon->setChecked(false);
}
}
| void Preferences::on_timeReferenceFixedDate_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
timeReferenceDate->setEnabled(timeReferenceFixedDate->isChecked());
if(timeReferenceFixedDate->isChecked()) {
timeReferenceAsk->setChecked(false);
timeReferenceNoCommon->setChecked(false);
}
}
| void Preferences::on_timeReferenceFixedTime_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
timeReferenceTime->setEnabled(timeReferenceFixedTime->isChecked());
if(timeReferenceFixedTime->isChecked()) {
timeReferenceAsk->setChecked(false);
timeReferenceNoCommon->setChecked(false);
}
}
| void Preferences::on_timeReferenceNoCommon_toggled | ( | ) | [slot] |
| void Preferences::on_winDoIt_toggled | ( | ) | [slot] |
References TRACE.
Referenced by updateAll().
{
TRACE;
winNofFiles->setEnabled(winDoIt->isChecked());
}
| void Preferences::saveToolList | ( | ) |
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] |
References on_chronogramMakeUpSwitch_toggled(), on_formatFixed_toggled(), on_graphicMakeUpSwitch_toggled(), on_mapMakeUpSwitch_toggled(), on_timeReferenceAsk_toggled(), on_timeReferenceFixedDate_toggled(), on_timeReferenceFixedTime_toggled(), on_winDoIt_toggled(), and TRACE.
Referenced by on_fileDefaults_clicked(), and GeopsyMainWindow::setPreferences().