#include <GeopsyMainWindow.h>
| GeopsyMainWindow::GeopsyMainWindow | ( | QWidget * | parent = 0, |
| Qt::WFlags | fl = 0 |
||
| ) |
References _dbStatusChecksum, _dbStatusTimer, _directoryMonitor, _fList, _gList, _progressBar, _progressHideTimer, _seedLink, _subPoolWin, _tableEditionLocked, _toolFactory, _viewChronogramAction, _viewGraphicAction, _viewMapAction, _viewTableAction, _waveformConsole, _ws, activeWindowChanged(), QGpGuiTools::UpdateIcon::addPlugins(), QGpGuiTools::LogWidget::addView(), asyncIncreaseProgressValue(), asyncSetProgressMaximum(), asyncSetProgressValue(), asyncShowMessage(), databaseInfo, QGpCoreTools::endl(), hideProgressBar(), increaseProgressValue(), newChronogramWindow(), newGraphicWindow(), newMapWindow(), newTableWindow(), SigSelectionDnD::setDragEnabled(), QGpGuiTools::ProgressBar::setMaximum(), QGpGuiTools::UpdateIcon::setName(), setProgressMaximum(), setProgressValue(), QGpGuiTools::UpdateIcon::setVersion(), QGpGuiTools::UpdateIcon::setVersionType(), QGpGuiTools::setWidgetColor(), showDBStatus(), showMessage(), statusBar(), QGpCoreTools::tr(), and TRACE.
:
QMainWindow(parent, fl)
{
TRACE;
QSettings reg;
resize(QSize( 674, 523).expandedTo(minimumSizeHint()) );
setWindowIcon(QIcon( ":/images/logo-16x16.png" ));
setWindowTitle(tr("Geopsy"));
setAttribute(Qt::WA_DeleteOnClose, false);
_ws=new QWorkspace(this);
_ws->setScrollBarsEnabled(true);
_dbStatusChecksum=0;
_dbStatusTimer.setInterval(1000);
connect (&_dbStatusTimer, SIGNAL(timeout()), this, SLOT(showDBStatus()));
_dbStatusTimer.start();
connect (this, SIGNAL(asyncSetProgressMaximum(int)), this, SLOT(setProgressMaximum(int)), Qt::QueuedConnection);
connect (this, SIGNAL(asyncSetProgressValue(int)), this, SLOT(setProgressValue(int)), Qt::QueuedConnection);
connect (this, SIGNAL(asyncIncreaseProgressValue(int)), this, SLOT(increaseProgressValue(int)), Qt::QueuedConnection);
connect (this, SIGNAL(asyncShowMessage(QString)), this, SLOT(showMessage( QString) ), Qt::QueuedConnection);
QDockWidget * gDock=new DockWidget(this);
gDock->setObjectName("Groups");
gDock->setWindowTitle(tr("Groups"));
gDock->setFeatures(QDockWidget::AllDockWidgetFeatures);
gDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
_gList=new GroupWidget;
gDock->setWidget(_gList);
addDockWidget(Qt::LeftDockWidgetArea, gDock);
QDockWidget * fDock=new DockWidget(this);
fDock->setObjectName("Files");
fDock->setWindowTitle(tr("Files"));
fDock->setFeatures (QDockWidget::AllDockWidgetFeatures);
fDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
_fList=new FileView (fDock);
fDock->setWidget(_fList);
addDockWidget(Qt::LeftDockWidgetArea, fDock);
tabifyDockWidget(gDock, fDock);
QDockWidget * cDock=new DockWidget(this);
cDock->setObjectName("WaveformConsole");
cDock->setWindowTitle(tr("Waveform console"));
cDock->setFeatures (QDockWidget::AllDockWidgetFeatures);
cDock->setAllowedAreas(Qt::AllDockWidgetAreas);
_waveformConsole=new WaveformConsole (cDock);
cDock->setWidget(_waveformConsole);
addDockWidget(Qt::LeftDockWidgetArea, cDock);
QDockWidget * logDock=new QDockWidget(this);
logDock->setObjectName( "Log" );
logDock->setWindowTitle(tr( "Log" ));
logDock->setFeatures (QDockWidget::AllDockWidgetFeatures);
logDock->setAllowedAreas(Qt::AllDockWidgetAreas);
LogWidget * logs=new LogWidget(logDock);
logs->addView(QThread::currentThread(), tr("Messages"));
logDock->setWidget(logs);
addDockWidget(Qt::LeftDockWidgetArea, logDock);
tabifyDockWidget(cDock, logDock);
setWidgetColor(_ws, QColor(220, 220, 220) );
connect(_ws, SIGNAL(windowActivated( QWidget * )),
this, SLOT(activeWindowChanged( QWidget * )) );
setCentralWidget(_ws);
databaseInfo=new QLabel(statusBar());
statusBar() ->addPermanentWidget(databaseInfo, 0);
UpdateIcon * liveUpdate=new UpdateIcon(statusBar());
liveUpdate->setName("geopsy");
liveUpdate->setVersion(GEOPSY_VERSION);
liveUpdate->setVersionType(GEOPSY_VERSION_TYPE);
reg.beginGroup("Plugins");
liveUpdate->addPlugins(reg.value("pluginList").toStringList());
statusBar()->addPermanentWidget(liveUpdate, 0);
reg.endGroup();
_progressBar=new ProgressBar(statusBar());
_progressBar->setMinimum(0);
_progressBar->setMaximum(100);
_progressBar->setMaximumWidth(100);
_progressBar->setMaximumHeight(20);
_progressBar->setVisible(false);
connect(&_progressHideTimer, SIGNAL(timeout()), this, SLOT(hideProgressBar()));
_progressHideTimer.setInterval(2000);
_progressHideTimer.setSingleShot(true);
statusBar() ->addPermanentWidget(_progressBar, 0);
statusBar() ->setSizeGripEnabled(true);
statusBar() ->showMessage(tr( "Ready" ), 2000);
addActions();
_subPoolWin=0;
_tableEditionLocked=true;
_toolFactory=0;
_seedLink=0;
_directoryMonitor=0;
activeWindowChanged(0);
// The ToolButton are added automatically by actions
// Try to get a pointer to them and add the DnD event filter
QToolButton * viewGraphicToolBut=0, * viewTableToolBut=0, * viewMapToolBut=0, * viewChronogramToolBut=0;
QList<QToolButton *> toolButList=findChildren<QToolButton *>();
for(QList<QToolButton *>::iterator it=toolButList.begin(); it!=toolButList.end();++it) {
if(( *it) ->defaultAction()==_viewGraphicAction)
viewGraphicToolBut=* it;
else if(( *it) ->defaultAction()==_viewTableAction)
viewTableToolBut=* it;
else if(( *it) ->defaultAction()==_viewMapAction)
viewMapToolBut=* it;
else if(( *it) ->defaultAction()==_viewChronogramAction)
viewChronogramToolBut=* it;
}
ASSERT(viewGraphicToolBut!=0 && viewTableToolBut!=0 && viewMapToolBut!=0);
if(viewGraphicToolBut!=0 && viewTableToolBut!=0 && viewMapToolBut!=0 && viewChronogramToolBut!= 0) {
SigSelectionDnD * sigDnD=new SigSelectionDnD(viewGraphicToolBut);
sigDnD->setDragEnabled(false);
connect(sigDnD, SIGNAL(selectionDropped( const SubSignalPool& )),
this, SLOT(newGraphicWindow( const SubSignalPool& )) );
sigDnD=new SigSelectionDnD(viewTableToolBut);
sigDnD->setDragEnabled(false);
connect(sigDnD, SIGNAL(selectionDropped( const SubSignalPool& )),
this, SLOT(newTableWindow( const SubSignalPool& )) );
sigDnD=new SigSelectionDnD(viewMapToolBut);
sigDnD->setDragEnabled(false);
connect(sigDnD, SIGNAL(selectionDropped( const SubSignalPool& )),
this, SLOT(newMapWindow( const SubSignalPool& )) );
sigDnD=new SigSelectionDnD(viewChronogramToolBut);
sigDnD->setDragEnabled(false);
connect(sigDnD, SIGNAL(selectionDropped( const SubSignalPool& )),
this, SLOT(newChronogramWindow( const SubSignalPool& )) );
}
if(!restoreState(reg.value("Workspace").toByteArray(), 0)) {
App::stream() << tr("Cannot restore main window state") << endl;
}
setAcceptDrops(true);
}
| void GeopsyMainWindow::activeWindowChanged | ( | QWidget * | w | ) | [slot] |
References _fileImportAction, _subPoolWin, _viewSetDataFieldsAction, _waveformConsole, _ws, GeopsyCore::SubSignalPool::isReadOnlySamples(), WaveformConsole::setCurrentSubPool(), setSubPoolActionEnabled(), GeopsyGui::SubPoolWindow::subPool(), GeopsyGui::SubPoolWindow::tool(), TRACE, and windowsMenuSetCurrent().
Referenced by GeopsyMainWindow().
{
TRACE;
SubPoolWindow * subPoolWin=qobject_cast<SubPoolWindow *>(w);
if(subPoolWin) {
setSubPoolActionEnabled(!subPoolWin->tool(), !subPoolWin->subPool().isReadOnlySamples());
if(w->inherits( "TableWindow" )) {
_fileImportAction->setEnabled(true);
_viewSetDataFieldsAction->setEnabled(true);
} else {
_fileImportAction->setEnabled(false);
_viewSetDataFieldsAction->setEnabled(false);
}
_waveformConsole->setCurrentSubPool(subPoolWin);
_subPoolWin=subPoolWin;
} else {
setSubPoolActionEnabled(false, true);
_subPoolWin=0;
_waveformConsole->setCurrentSubPool(0);
}
windowsMenuSetCurrent(_ws->activeWindow());
}
| void GeopsyMainWindow::addWindow | ( | QWidget * | w | ) | [slot] |
Add window w to geopsy window system. This function belongs to GeopsyGui interface, hence a common way to invoque is:
geopsyGui->addWindow(w);
To close the window, you must call removeWindow() before deleting the window.
References _ws, TRACE, and windowsMenuAdd().
Referenced by Engine::addWindow(), directoryMonitor(), newChronogramWindow(), newGraphicWindow(), newMapWindow(), newTableWindow(), seedlink(), and setHeader().
{
TRACE;
new SizeGrip(w);
_ws->addWindow(w);
windowsMenuAdd(w);
}
| void GeopsyMainWindow::asyncIncreaseProgressValue | ( | int | value | ) | [signal] |
Referenced by GeopsyMainWindow(), and increaseProgressValue().
| void GeopsyMainWindow::asyncSetProgressMaximum | ( | int | value | ) | [signal] |
Referenced by GeopsyMainWindow(), and setProgressMaximum().
| void GeopsyMainWindow::asyncSetProgressValue | ( | int | value | ) | [signal] |
Referenced by GeopsyMainWindow(), and setProgressValue().
| void GeopsyMainWindow::asyncShowMessage | ( | QString | message | ) | [signal] |
Referenced by GeopsyMainWindow(), and showMessage().
| void GeopsyMainWindow::clearAll | ( | ) | [slot] |
References _directoryMonitor, _fList, closeAllWindows(), geopsyGui, FileView::refresh(), GeopsyGui::DirectoryMonitor::removeAllFiles(), QGpCoreTools::tr(), TRACE, and warnBeforeClear().
{
TRACE;
if(warnBeforeClear(tr( "Clearing all ..." ))) {
closeAllWindows();
qApp->processEvents(QEventLoop::DeferredDeletion);
geopsyGui->clear();
_fList->refresh();
if(_directoryMonitor) _directoryMonitor->removeAllFiles();
update();
}
}
| Q_SCRIPTABLE void GeopsyMainWindow::closeAllWindows | ( | ) | [inline, slot] |
| void GeopsyMainWindow::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
| void GeopsyMainWindow::createNewGroup | ( | ) | [slot] |
References _subPoolWin, GeopsyCore::SubSignalPool::addSignal(), GeopsyCore::SubSignalPool::at(), GeopsyCore::SubSignalPool::count(), GroupProperties::folder(), GeopsyCore::Signal::header(), GeopsyCore::SubSignalPool::isEmpty(), GroupProperties::isMultiGroup(), QGpCoreTools::log(), MSG_ID, GeopsyCore::AbstractSignalGroup::name(), QGpGuiTools::Dialog::setMainWidget(), GroupProperties::setNameFromHistory(), GeopsyCore::AbstractSignalGroup::setParent(), QGpCoreTools::ExpressionString::setPattern(), GroupProperties::setProperties(), GeopsyCore::SignalGroup::setSignals(), GroupProperties::setValues(), GroupProperties::splitKey(), GeopsyGui::SubPoolWindow::subPool(), QGpCoreTools::tr(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
SignalGroup * g=new SignalGroup;
g->setSignals(_subPoolWin->subPool());
Dialog * d=new Dialog(this);
GroupProperties * dg=new GroupProperties(this);
d->setMainWidget(dg);
Settings::getWidget(d, "GroupProperties");
QList<AbstractSignalGroup *> gList;
gList.append(g);
dg->setValues(gList);
dg->setNameFromHistory();
while(d->exec()==QDialog::Accepted) {
Settings::setWidget(d, "GroupProperties");
dg->setProperties(g);
Settings::setHistory("GroupNames", g->name());
if(dg->isMultiGroup()) {
MetaDataIndex key=dg->splitKey();
SubSignalPool& subPool=_subPoolWin->subPool();
Signal * sig=subPool.at(0);
QVariant val=sig->header(key);
SubSignalPool splitGroupSubPool;
splitGroupSubPool.addSignal(sig);
SignalExpressionContext context;
ExpressionString gName;
QString log;
StreamRedirection sr(new StringStream(&log));
if(!gName.setPattern(g->name(), &context)) {
Message::warning(MSG_ID, tr("Create new group(s)"), tr("Error(s) while parsing group name pattern:\n\n%1").arg(log));
continue;
}
int gi=1;
for(int i=1; i<subPool.count(); i++ ) {
sig=subPool.at(i);
if(val!=sig->header(key) ) {
addSplitGroup(splitGroupSubPool, dg->folder(), gName, context, i-splitGroupSubPool.count()+1, gi++ );
val=sig->header(key);
}
splitGroupSubPool.addSignal(sig);
}
if(!splitGroupSubPool.isEmpty()) {
addSplitGroup(splitGroupSubPool, dg->folder(), gName, context, subPool.count()-splitGroupSubPool.count()+1, gi);
}
delete g;
} else {
g->setParent(dg->folder());
}
delete d;
return;
}
delete g;
delete d;
}
| SubPoolWindow* GeopsyMainWindow::currentSubPoolWin | ( | ) | [inline] |
References _subPoolWin.
{return _subPoolWin;}
| void GeopsyMainWindow::directoryMonitor | ( | ) | [slot] |
References _directoryMonitor, addWindow(), showWindow(), and TRACE.
{
TRACE;
MessageContext mc;
if(!_directoryMonitor) {
_directoryMonitor=new DirectoryMonitor();
addWindow(_directoryMonitor);
}
showWindow(_directoryMonitor);
}
| void GeopsyMainWindow::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
| void GeopsyMainWindow::dragMoveEvent | ( | QDragMoveEvent * | event | ) | [protected, virtual] |
| void GeopsyMainWindow::dropEvent | ( | QDropEvent * | event | ) | [protected, virtual] |
References _fList, GeopsyCore::geopsyCore, GeopsyCore::GeopsyCoreEngine::load(), and TRACE.
{
TRACE;
if(e->mimeData()->hasUrls()) {
QList<QUrl> urls=e->mimeData()->urls();
QUrl url;
QStringList files;
MessageContext mc;
foreach(url,urls) {
files << url.toLocalFile();
}
geopsyCore->load(files, SignalFileFormat::Unknown, true);
_fList->reset();
}
e->acceptProposedAction();
}
| void GeopsyMainWindow::exportSignal | ( | ) | [slot] |
References _subPoolWin, GeopsyCore::SignalFileFormat::caption(), fileName, GeopsyCore::SignalFileFormat::filter(), ExportFileType::format(), format, GeopsyCore::SignalFileFormat::id(), ExportFileType::maximumSignalsPerFile(), GeopsyCore::SubSignalPool::maximumTimePickCount(), MSG_ID, GeopsyCore::SubSignalPool::save(), ExportFileType::setFormatList(), GeopsyGui::SubPoolWindow::subPool(), QGpCoreTools::tr(), TRACE, and ExportFileType::useOriginalBaseName().
{
TRACE;
MessageContext mc;
if( !_subPoolWin) return ;
ExportFileType * d=new ExportFileType(this);
d->setFormatList(_subPoolWin->inherits( "TableWindow" ));
Settings::getWidget(d);
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
SignalFileFormat format=d->format();
bool useOriginalBaseName=d->useOriginalBaseName();
int maxSignalsPerFile=d->maximumSignalsPerFile();
if(format.id()==SignalFileFormat::Temporary) {
if(strcmp( _subPoolWin->metaObject() ->className(), "TableWindow" )==0)
(( TableWindow* ) _subPoolWin) ->exportTable();
delete d;
return;
}
if(format.id()==SignalFileFormat::Tomo) {
ExportPick * d=new ExportPick(this);
d->pickNo->setMaximum(_subPoolWin->subPool().maximumTimePickCount());
Settings::getWidget(d);
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
QString fileName=Message::getSaveFileName(tr( "Export %1" ).arg(format.caption()),
tr("%1 (%2)").arg(format.caption())
.arg(format.filter()));
if(!fileName.isEmpty()) {
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
if(!_subPoolWin->subPool().save(fileName, useOriginalBaseName, format, d->pickNo->value())) {
Message::warning(MSG_ID, tr("Export %1").arg(format.caption()),
tr("Error export file %1, see log for details").arg(fileName));
}
}
}
delete d;
} else {
QString filePath;
if(useOriginalBaseName) {
filePath=Message::getExistingDirectory(tr("Export %1").arg(format.caption()));
} else {
filePath=Message::getSaveFileName(tr( "Export %1" ).arg(format.caption()),
tr("%1 (%2)").arg(format.caption()).arg(format.filter()));
}
if(!filePath.isEmpty()) {
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
if(!_subPoolWin->subPool().save(filePath, useOriginalBaseName, format, maxSignalsPerFile, 0)) {
Message::warning(MSG_ID, tr("Export %1").arg(format.caption()),
tr("Error export file %1, see log for details").arg(filePath));
}
}
}
}
delete d;
}
| void GeopsyMainWindow::fftAmpl | ( | ) | [slot] |
References _fftAmplitudeAction, _fftPhaseAction, _fftTimeAction, _subPoolWin, GeopsyGui::SubPoolWindow::fastFourierTransform(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
_subPoolWin->fastFourierTransform(DoubleSignal::Spectrum);
_fftTimeAction->setChecked(false);
_fftAmplitudeAction->setChecked(true);
_fftPhaseAction->setChecked(false);
}
| void GeopsyMainWindow::fftPhase | ( | ) | [slot] |
References _fftAmplitudeAction, _fftPhaseAction, _fftTimeAction, _subPoolWin, GeopsyGui::SubPoolWindow::fastFourierTransform(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
_subPoolWin->fastFourierTransform(DoubleSignal::Phase);
_fftTimeAction->setChecked(false);
_fftAmplitudeAction->setChecked(false);
_fftPhaseAction->setChecked(true);
}
| void GeopsyMainWindow::fftTime | ( | ) | [slot] |
References _fftAmplitudeAction, _fftPhaseAction, _fftTimeAction, _subPoolWin, GeopsyGui::SubPoolWindow::fastFourierTransform(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
_subPoolWin->fastFourierTransform(DoubleSignal::Waveform);
_fftTimeAction->setChecked(true);
_fftAmplitudeAction->setChecked(false);
_fftPhaseAction->setChecked(false);
}
| void GeopsyMainWindow::filesRemoved | ( | const QList< SignalFile * > & | fList | ) |
References _directoryMonitor, and GeopsyGui::DirectoryMonitor::removeFile().
Referenced by FileView::remove().
{
if(_directoryMonitor) {
for(QList<SignalFile *>::ConstIterator it=fList.begin();it!=fList.end();++it) {
_directoryMonitor->removeFile((*it)->name());
}
}
}
| void GeopsyMainWindow::helpAbout | ( | ) | [slot] |
References TRACE.
{
TRACE;
GeopsyAboutDialog * d=new GeopsyAboutDialog(this);
d->exec();
delete d;
}
| void GeopsyMainWindow::helpDocumentation | ( | ) | [slot] |
| void GeopsyMainWindow::hideProgressBar | ( | ) | [slot] |
References _progressBar, and TRACE.
Referenced by GeopsyMainWindow().
{
TRACE;
_progressBar->hide();
}
| void GeopsyMainWindow::importTable | ( | ) | [slot] |
References _subPoolWin, TableWindow::importTable(), and TRACE.
{
TRACE;
TableWindow * tableWin=qobject_cast<TableWindow *>(_subPoolWin);
if(tableWin) {
tableWin->importTable();
}
}
| void GeopsyMainWindow::increaseProgressValue | ( | int | value = 1 | ) | [slot] |
References _progressBar, asyncIncreaseProgressValue(), QGpCoreTools::AbstractProgress::increaseValue(), and TRACE.
Referenced by GeopsyMainWindow(), and Engine::increaseProgressValue().
{
TRACE;
if(QThread::currentThread()==Application::instance()->mainThread()) {
_progressBar->increaseValue(value);
} else {
emit asyncIncreaseProgressValue(value);
}
}
| void GeopsyMainWindow::initTools | ( | ) |
| bool GeopsyMainWindow::isTableEditionLocked | ( | ) | [inline] |
References _tableEditionLocked.
{return _tableEditionLocked;}
| void GeopsyMainWindow::load | ( | ) | [slot] |
References _fList, GeopsyCore::geopsyCore, GeopsyCore::GeopsyCoreEngine::load(), and TRACE.
{
TRACE;
MessageContext mc;
geopsyCore->load(QStringList(), SignalFileFormat::Unknown, true);
_fList->reset();
}
| void GeopsyMainWindow::loadCity | ( | ) | [slot] |
References GeopsyGui::CityLoader::scan(), and TRACE.
{
TRACE;
CityLoader * d=new CityLoader(this);
Settings::getWidget(d);
d->scan();
d->exec();
Settings::setWidget(d);
delete d;
}
| void GeopsyMainWindow::loadFilePattern | ( | ) | [slot] |
References _fList, baseDir, LoadFilePattern::baseDirectory(), LoadFilePattern::filePattern(), GeopsyCore::geopsyCore, GeopsyCore::GeopsyCoreEngine::load(), LoadFilePattern::saveHistory(), and TRACE.
{
TRACE;
LoadFilePattern * d=new LoadFilePattern;
Settings::getWidget(d);
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
d->saveHistory();
MessageContext mc;
QDir baseDir=d->baseDirectory();
geopsyCore->load(baseDir.absoluteFilePath(d->filePattern()),
SignalFileFormat::Unknown, true);
_fList->reset();
}
delete d;
}
| QAction * GeopsyMainWindow::newAction | ( | const QAction & | original, |
| QWidget * | parent = 0 |
||
| ) | [static] |
References TRACE.
Referenced by FileView::setSignalWindow(), and GroupView::setSignalWindow().
{
TRACE;
QAction * a=new QAction(original.icon(), original.text(), parent);
a->setShortcut(original.shortcut());
a->setToolTip(original.toolTip());
return a;
}
| SubPoolWindow * GeopsyMainWindow::newChronogramWindow | ( | ) | [slot] |
References TRACE.
Referenced by GeopsyMainWindow(), and Engine::newChronogramWindow().
{
TRACE;
return newChronogramWindow(SubSignalPool());
}
| SubPoolWindow * GeopsyMainWindow::newChronogramWindow | ( | const SubSignalPool & | subPool | ) | [slot] |
References addWindow(), GeopsyGui::SubPoolWindow::setSubPool(), showWindow(), and TRACE.
{
TRACE;
ChronogramWindow * win=new ChronogramWindow();
win->setSubPool(subPool);
addWindow(win);
showWindow(win);
return win;
}
| AbstractGraphicWindow * GeopsyMainWindow::newGraphicWindow | ( | ) | [slot] |
References TRACE.
Referenced by GeopsyMainWindow(), FileView::newGraphicWindow(), Engine::newGraphicWindow(), GroupView::newGraphicWindow(), setToolFactory(), and showLoadedSignals().
{
TRACE;
return newGraphicWindow(SubSignalPool());
}
| AbstractGraphicWindow * GeopsyMainWindow::newGraphicWindow | ( | const SubSignalPool & | subPool | ) | [slot] |
References addWindow(), GeopsyGui::SubPoolWindow::setSubPool(), showWindow(), and TRACE.
{
TRACE;
GraphicWindow * win=new GraphicWindow();
win->setSubPool(subPool);
addWindow(win);
showWindow(win);
return win;
}
| SubPoolWindow * GeopsyMainWindow::newMapWindow | ( | ) | [slot] |
References TRACE.
Referenced by GeopsyMainWindow(), FileView::newMapWindow(), Engine::newMapWindow(), and GroupView::newMapWindow().
{
TRACE;
return newMapWindow(SubSignalPool());
}
| SubPoolWindow * GeopsyMainWindow::newMapWindow | ( | const SubSignalPool & | subPool | ) | [slot] |
References addWindow(), GeopsyGui::SubPoolWindow::setSubPool(), showWindow(), MapWindow::signalsUpdate(), and TRACE.
{
TRACE;
MapWindow * win=new MapWindow();
win->setSubPool(subPool);
addWindow(win);
showWindow(win);
win->signalsUpdate();
return win;
}
| SubPoolWindow * GeopsyMainWindow::newTableWindow | ( | ) | [slot] |
References TRACE.
Referenced by GeopsyMainWindow(), FileView::newTableWindow(), Engine::newTableWindow(), GroupView::newTableWindow(), and showLoadedSignals().
{
TRACE;
return newTableWindow(SubSignalPool());
}
| SubPoolWindow * GeopsyMainWindow::newTableWindow | ( | const SubSignalPool & | subPool | ) | [slot] |
References addWindow(), GeopsyGui::SubPoolWindow::setSubPool(), showWindow(), and TRACE.
{
TRACE;
TableWindow * win=new TableWindow();
win->setSubPool(subPool);
addWindow(win);
showWindow(win);
return win;
}
| void GeopsyMainWindow::openDB | ( | QString | fileName = QString::null | ) | [slot] |
| ProgressBar* GeopsyMainWindow::progressBar | ( | ) | const [inline] |
| virtual ProgressBar* GeopsyMainWindow::progressBar | ( | ) | [inline, virtual] |
References _progressBar.
{return _progressBar;}
| int GeopsyMainWindow::progressMaximum | ( | ) | [slot] |
References _progressBar, QGpGuiTools::ProgressBar::maximum(), and TRACE.
Referenced by Engine::progressMaximum().
{
TRACE;
return _progressBar->maximum();
}
| int GeopsyMainWindow::progressValue | ( | ) | [slot] |
References _progressBar, TRACE, and QGpGuiTools::ProgressBar::value().
Referenced by Engine::progressValue().
{
TRACE;
return _progressBar->value();
}
| void GeopsyMainWindow::quit | ( | bool | force = false | ) | [slot] |
References closeAllWindows(), QGpCoreTools::tr(), TRACE, and warnBeforeClear().
Referenced by closeEvent().
{
TRACE;
if(force || warnBeforeClear(tr( "Quitting ..." )) ) {
closeAllWindows();
qApp->processEvents(); // wait for all windows to be closed
qApp->quit();
}
}
| void GeopsyMainWindow::refreshLists | ( | ) |
References _fList, FileView::refresh(), and TRACE.
Referenced by modeGui(), and Engine::refreshLists().
| void GeopsyMainWindow::removeWindow | ( | QWidget * | w | ) | [slot] |
Remove window w from geopsy window system. This function belongs to GeopsyGui interface, hence a common way to invoque is:
geopsyGui->removeWindow(w);
Window w is not deleted. It must be done after calling this function.
References TRACE, and windowsMenuRemove().
Referenced by Engine::removeWindow().
{
TRACE;
windowsMenuRemove(w);
}
| void GeopsyMainWindow::saveDB | ( | ) | [slot] |
References _fList, GeopsyCore::GeopsyCoreEngine::currentDB(), GeopsyCore::geopsyCore, FileView::refresh(), GeopsyCore::SignalDB::save(), TRACE, and viewRefreshNow().
Referenced by warnBeforeClear().
{
TRACE;
geopsyCore->currentDB()->save( );
_fList->refresh();
viewRefreshNow(); /* force updating of all viewers, as the ID and file name may have changed
when signal samples are modified. The user may be confused if those fields
are not updated. */
}
| void GeopsyMainWindow::saveDBAs | ( | ) | [slot] |
| void GeopsyMainWindow::seedlink | ( | QByteArray | serverAddress = 0, |
| qint16 | serverPort = 0, |
||
| QString | streamSelection = QString::null |
||
| ) | [slot] |
References _seedLink, addWindow(), geopsyGui, GeopsySLinkGui::SeedLinkLoader::selectStreams(), GeopsySLinkGui::SeedLinkLoader::setServer(), showWindow(), and TRACE.
Referenced by modeGui().
{
TRACE;
if(!_seedLink) {
_seedLink=new SeedLinkLoader();
connect(_seedLink, SIGNAL(dataChanged( Signal *, TimeRange)),
static_cast<Engine *>(geopsyGui), SLOT(signalDataChanged(Signal *)));
addWindow(_seedLink);
if(!serverAddress.isEmpty() && serverPort!=0) {
_seedLink->setServer(serverAddress, serverPort);
if(!streamSelection.isEmpty()) {
_seedLink->selectStreams(streamSelection);
}
}
}
showWindow(_seedLink);
}
| void GeopsyMainWindow::setHeader | ( | ) | [slot] |
References _subPoolWin, addWindow(), showWindow(), GeopsyGui::SubPoolWindow::subPool(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
SetHeader * d=new SetHeader(&_subPoolWin->subPool(), this);
connect(_subPoolWin, SIGNAL(aboutToClose()), d, SLOT(close()));
addWindow(d);
showWindow(d);
}
| void GeopsyMainWindow::setPreferences | ( | ) | [slot] |
References _toolFactory, ToolFactory::createPreferenceTabs(), geopsyGui, Preferences::saveToolList(), ToolFactory::setPreferences(), TRACE, and Preferences::updateAll().
Referenced by startupPreferences().
{
TRACE;
Preferences * d=new Preferences(this);
_toolFactory->createPreferenceTabs(d->preferenceTab);
Settings::getWidget(d);
d->paramEditor->initTableFields(geopsyGui->preferences()->tableFields());
d->updateAll();
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
d->saveToolList();
d->paramEditor->getTableFields(geopsyGui->preferences()->tableFields());
geopsyGui->preferences()->saveNoAuto();
geopsyGui->preferences()->load();
_toolFactory->setPreferences();
}
delete d;
}
| void GeopsyMainWindow::setProgressMaximum | ( | int | value | ) | [slot] |
References _progressBar, _progressHideTimer, asyncSetProgressMaximum(), QGpGuiTools::ProgressBar::setMaximum(), QGpGuiTools::ProgressBar::show(), and TRACE.
Referenced by GeopsyMainWindow(), and Engine::setProgressMaximum().
{
TRACE;
if(QThread::currentThread()==Application::instance()->mainThread()) {
_progressBar->setMaximum(value);
_progressBar->show();
_progressHideTimer.stop();
} else {
emit asyncSetProgressMaximum(value);
}
}
| void GeopsyMainWindow::setProgressValue | ( | int | value | ) | [slot] |
References _progressBar, _progressHideTimer, asyncSetProgressValue(), QGpGuiTools::ProgressBar::maximum(), QGpGuiTools::ProgressBar::setValue(), and TRACE.
Referenced by GeopsyMainWindow(), and Engine::setProgressValue().
{
TRACE;
if(QThread::currentThread()==Application::instance()->mainThread()) {
if(value==_progressBar->maximum()) {
_progressHideTimer.start();
}
_progressBar->setValue(value);
} else {
emit asyncSetProgressValue(value);
}
}
| void GeopsyMainWindow::setReceivers | ( | ) | [slot] |
References _subPoolWin, GeopsyCore::SubSignalPool::begin(), GeopsyCore::SubSignalPool::end(), StationCoordinates::init(), StationCoordinates::lookup(), MSG_ID, GeopsyCore::Signal::setHeaderModified(), StationCoordinates::setReadOnly(), GeopsyCore::Signal::setReceiver(), GeopsyGui::SubPoolWindow::subPool(), GeopsyGui::SubPoolWindow::subPoolUpdate(), QGpCoreTools::tr(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
StationCoordinates * d=new StationCoordinates(this);
Settings::getWidget(d);
if(d->init(&_subPoolWin->subPool())) {
Message::warning(MSG_ID, tr("Set receivers"),
tr("Stations with different coordinates have the same name. You will not be "
"able to change coordinates of signals. First change the signal names."),
Message::ok());
d->setReadOnly(true);
}
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
SubSignalPool::iterator it;
SubSignalPool& subPool=_subPoolWin->subPool();
for(it=subPool.begin();it!=subPool.end();++it) {
Signal * sig=*it;
bool ok;
Point p=d->lookup(sig, ok);
if(ok) sig->setReceiver(p);
sig->setHeaderModified(true);
}
_subPoolWin->subPoolUpdate();
}
delete d;
}
| void GeopsyMainWindow::setSources | ( | ) | [slot] |
References _subPoolWin, GeopsyCore::SubSignalPool::begin(), GeopsyCore::SubSignalPool::end(), SourceCoordinates::init(), SourceCoordinates::initLookup(), StationCoordinates::lookup(), GeopsyCore::Signal::setHeaderModified(), GeopsyCore::Signal::setSource(), GeopsyGui::SubPoolWindow::subPool(), GeopsyGui::SubPoolWindow::subPoolUpdate(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
SourceCoordinates * d=new SourceCoordinates(this);
Settings::getWidget(d);
d->init(&_subPoolWin->subPool());
while(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
if(d->initLookup()) {
SubSignalPool::iterator it;
SubSignalPool& subPool=_subPoolWin->subPool();
for(it=subPool.begin();it!=subPool.end();++it) {
Signal * sig=*it;
bool ok;
Point p=d->lookup(sig, ok);
if(ok) sig->setSource(p);
sig->setHeaderModified(true);
}
_subPoolWin->subPoolUpdate();
break;
}
}
delete d;
}
| void GeopsyMainWindow::setSubPoolActionEnabled | ( | bool | b, |
| bool | rw | ||
| ) | [slot] |
References _editMenu, _fileExportAction, _fileImportAction, _toolsMenu, _viewSetDataFieldsAction, _waveMenu, and TRACE.
Referenced by activeWindowChanged().
{
TRACE;
_fileExportAction->setEnabled(b);
_fileImportAction->setEnabled(b);
_viewSetDataFieldsAction->setEnabled(b);
_waveMenu->setEnabled(b);
if(b) {
QList<QAction *> aList=_waveMenu->actions();
for(QList<QAction *>::iterator it=aList.begin(); it!=aList.end(); it++ ) {
if((*it)->data().toBool()) (*it)->setEnabled(rw);
}
}
_editMenu->setEnabled(b);
_toolsMenu->setEnabled(b);
}
| void GeopsyMainWindow::setTableLocked | ( | bool | l | ) | [slot] |
References _tableEditionLocked, _ws, TableWindow::setEditionLocked(), and TRACE.
{
TRACE;
_tableEditionLocked=l;
QWidgetList windows=_ws->windowList(QWorkspace::CreationOrder);
int n=windows.count();
for(int i=0;i < n;i++ ) {
TableWindow * table=qobject_cast<TableWindow *>(windows.at(i) );
if(table) {
table->setEditionLocked(_tableEditionLocked);
}
}
}
| void GeopsyMainWindow::setToolFactory | ( | ToolFactory * | tf | ) |
References _fList, _gList, _importSignalMenu, _toolFactory, _toolsBar, _toolsMenu, ToolFactory::addActions(), ToolFactory::createImportActions(), newGraphicWindow(), SigSelectionDnD::setDragEnabled(), GroupWidget::setSignalWindow(), FileView::setSignalWindow(), and TRACE.
Referenced by Engine::setMainWindow().
{
TRACE;
ASSERT(_toolFactory==0);
_toolFactory=tf;
_toolFactory->addActions(_toolsMenu);
// Get list of tool buttons before actions of tools
QList<QToolButton *> toolButListBefore=findChildren<QToolButton *>();
_toolFactory->addActions(_toolsBar);
// Get list of tool buttons after actions of tools
QList<QToolButton *> toolButListAfter=findChildren<QToolButton *>();
for(QList<QToolButton *>::iterator it=toolButListAfter.begin(); it!=toolButListAfter.end();++it) {
if( ! toolButListBefore.contains( *it) ) {
SigSelectionDnD * sigDnD=new SigSelectionDnD( *it);
sigDnD->setDragEnabled(false);
connect(sigDnD, SIGNAL(selectionDropped( const SubSignalPool& )),
_toolFactory, SLOT(newGraphicWindow( const SubSignalPool& )) );
}
}
_fList->setSignalWindow(this);
_gList->setSignalWindow(this);
// Add eventually actions defined in user plugins for importing signals
QList<QAction *> customActions=_toolFactory->createImportActions(this);
foreach(QAction * a, customActions) {
_importSignalMenu->addAction(a);
}
}
| void GeopsyMainWindow::showDBStatus | ( | ) | [slot] |
References _dbStatusChecksum, GeopsyCore::GeopsyCoreEngine::cache(), GeopsyCore::SignalFilePool::count(), GeopsyCore::SignalDB::count(), GeopsyCore::GeopsyCoreEngine::currentDB(), databaseInfo, GeopsyCore::SignalDB::filePool(), QGpCoreTools::Cache::freeMegaBytes(), GeopsyCore::geopsyCore, GeopsyCore::SignalDB::name(), DinverCore::qHash(), QGpCoreTools::tr(), and TRACE.
Referenced by GeopsyMainWindow().
{
TRACE;
SignalDB & db=*geopsyCore->currentDB();
Cache& cache=*geopsyCore->cache();
uint checksum=db.count();
checksum+=db.filePool().count();
checksum+=(int)(cache.freeMegaBytes()*1e6);
checksum+=qHash(db.name());
if(checksum!=_dbStatusChecksum) {
databaseInfo->setText(tr("%1 signals, %2 files, free cache %3 Mb")
.arg(db.count())
.arg(db.filePool().count())
.arg(cache.freeMegaBytes()));
setWindowTitle("Geopsy - "+db.name());
_dbStatusChecksum=checksum;
}
}
| void GeopsyMainWindow::showLoadedSignals | ( | const SubSignalPool & | subPool | ) | [slot] |
References _fList, geopsyGui, newGraphicWindow(), newTableWindow(), FileView::refresh(), and TRACE.
Referenced by Engine::showLoadedSignals().
{
TRACE;
if(geopsyGui->preferences() ->showTable())
newTableWindow(subPool);
if(geopsyGui->preferences() ->showGraphic())
newGraphicWindow(subPool);
_fList->refresh();
}
| void GeopsyMainWindow::showMessage | ( | QString | message | ) | [slot] |
References asyncShowMessage(), statusBar(), and TRACE.
Referenced by GeopsyMainWindow(), and Engine::showMessage().
{
TRACE;
if(QThread::currentThread()==Application::instance()->mainThread()) {
statusBar()->showMessage(message);
} else {
emit asyncShowMessage(message);
}
}
| void GeopsyMainWindow::showToolBarMenu | ( | ) | [slot] |
References _toolBarsMenu, and TRACE.
{
TRACE;
_toolBarsMenu->clear();
QList<QDockWidget *> dockwidgetList=findChildren<QDockWidget *>();
QAction * a;
for(QList<QDockWidget *>::iterator it=dockwidgetList.begin();it!=dockwidgetList.end();++it) {
a=new QAction(( *it) ->windowTitle(), this);
a->setCheckable(true);
if(( *it) ->isVisible())
a->setChecked(true);
connect(a, SIGNAL(toggled( bool) ), *it, SLOT(setVisible( bool) ));
_toolBarsMenu->addAction(a);
}
_toolBarsMenu->addSeparator();
QList<QToolBar *> toolBarList=findChildren<QToolBar *>();
for(QList<QToolBar *>::iterator it=toolBarList.begin();it!=toolBarList.end();++it) {
a=new QAction(( *it) ->windowTitle(), this);
a->setCheckable(true);
if(( *it) ->isVisible())
a->setChecked(true);
connect(a, SIGNAL(toggled( bool) ), *it, SLOT(setVisible( bool) ));
_toolBarsMenu->addAction(a);
}
}
| void GeopsyMainWindow::showWindow | ( | QWidget * | w | ) | [slot] |
Do not call QWidget::show() directly. Use this function instead. This function belongs to GeopsyGui interface, hence a common way to invoque is:
geopsyGui->showWindow(w);
Referenced by directoryMonitor(), newChronogramWindow(), newGraphicWindow(), newMapWindow(), newTableWindow(), seedlink(), setHeader(), Engine::showWindow(), and windowsMenuTriggered().
| void GeopsyMainWindow::sort | ( | ) | [slot] |
References _subPoolWin, SortKeys::getKeys(), GeopsyCore::SubSignalPool::sort(), GeopsyGui::SubPoolWindow::subPool(), GeopsyGui::SubPoolWindow::subPoolUpdate(), and TRACE.
{
TRACE;
if( !_subPoolWin) return ;
SortKeys * d=new SortKeys(this);
Settings::getWidget(d);
if(d->exec()==QDialog::Accepted) {
Settings::setWidget(d);
d->getKeys();
_subPoolWin->subPool().sort();
_subPoolWin->subPoolUpdate();
}
delete d;
}
| void GeopsyMainWindow::startupPreferences | ( | ) |
References setPreferences(), and TRACE.
Referenced by modeGui().
{
TRACE;
// Ask for preferences if specified in QSettings
QSettings * reg=new QSettings;
reg->beginGroup( "DialogOptions/Preferences" );
if(reg->value( "again", true).toBool()) {
reg->setValue( "again", true);
delete reg;
setPreferences();
} else
delete reg;
}
| virtual QStatusBar* GeopsyMainWindow::statusBar | ( | ) | [inline, virtual] |
Referenced by GeopsyMainWindow(), showMessage(), and Engine::statusBar().
{return QMainWindow::statusBar();}
| void GeopsyMainWindow::tileHorizontal | ( | ) | [slot] |
{
TRACE;
// primitive horizontal tiling
QWidgetList windows=_ws->windowList(QWorkspace::CreationOrder);
if( !windows.count())
return ;
int heightForEach=_ws->height()/windows.count();
int y=0;
for(int i=0; i < windows.count(); ++i) {
QWidget *window=windows.at(i);
if(window->windowState() & Qt::WindowMaximized) {
// prevent flicker
window->hide();
window->showNormal();
}
int preferredHeight=window->minimumHeight() + window->parentWidget() ->baseSize().height();
int actHeight=(preferredHeight > heightForEach) ? preferredHeight : heightForEach;
window->parentWidget() ->setGeometry(0, y, _ws->width(), actHeight);
y += actHeight;
}
}
| ToolFactory* GeopsyMainWindow::toolFactory | ( | ) | [inline] |
References _toolFactory.
Referenced by FileView::contextMenuEvent(), GroupView::contextMenuEvent(), FileView::newTool(), and GroupView::newTool().
{return _toolFactory;}
| void GeopsyMainWindow::updateWindowTitle | ( | QWidget * | w | ) | [slot] |
Call this function whenever the title of the window change. A usual place for this function is inside a re-implementation of QWidget::setWindowTitle(). This function belongs to GeopsyGui interface, hence a common way to invoque is:
geopsyGui->updateWindowTitle(w);
References TRACE.
Referenced by Engine::updateWindowTitle().
| virtual bool GeopsyMainWindow::useProgress | ( | ) | [inline, virtual] |
{return true;}
| const QAction* GeopsyMainWindow::viewGraphicAction | ( | ) | const [inline] |
References _viewGraphicAction.
Referenced by FileView::setSignalWindow(), and GroupView::setSignalWindow().
{return _viewGraphicAction;}
| const QAction* GeopsyMainWindow::viewMapAction | ( | ) | const [inline] |
References _viewMapAction.
Referenced by FileView::setSignalWindow(), and GroupView::setSignalWindow().
{return _viewMapAction;}
| void GeopsyMainWindow::viewRefreshNow | ( | ) | [slot] |
Referenced by saveDB().
{
TRACE;
QWidgetList windows=_ws->windowList(QWorkspace::CreationOrder);
int n=windows.count();
for(int i=0;i < n;i++ ) {
QWidget * w=windows.at(i);
if(w->inherits( "GraphicWindow" ))
(( GraphicWindow * ) w) ->signalLayer() ->graphContent() ->deepUpdate();
else if(w->inherits( "MapWindow" ) || w->inherits( "TableWindow" ))
(( SubPoolWindow * ) w) ->signalsUpdate();
}
}
| void GeopsyMainWindow::viewSetDataFields | ( | ) | [slot] |
References _subPoolWin, and TRACE.
{
TRACE;
if(_subPoolWin && _subPoolWin->inherits( "TableWindow" ))
(( TableWindow * ) _subPoolWin) ->setDataFields();
}
| const QAction* GeopsyMainWindow::viewTableAction | ( | ) | const [inline] |
References _viewTableAction.
Referenced by FileView::setSignalWindow(), and GroupView::setSignalWindow().
{return _viewTableAction;}
| bool GeopsyMainWindow::warnBeforeClear | ( | QString | action | ) | [protected] |
References GeopsyCore::GeopsyCoreEngine::currentDB(), GeopsyCore::geopsyCore, GeopsyCore::SignalDB::isModified(), MSG_ID, saveDB(), QGpCoreTools::tr(), and TRACE.
Referenced by clearAll(), and quit().
{
TRACE;
if(geopsyCore->currentDB()->isModified()) {
switch (Message::warning(MSG_ID, action,
tr("Do you want to save the changes to the current database?"),
Message::yes(), Message::no(), Message::cancel())) {
case Message::Answer0:
saveDB();
if(geopsyCore->currentDB() ->isModified())
return false;
case Message::Answer1:
break;
default:
return false;
}
} else if(Message::question(MSG_ID, action, tr("Are you sure?"), Message::no(), Message::yes())
==Message::Answer0)
return false;
return true;
}
| void GeopsyMainWindow::windowsMenuAdd | ( | QWidget * | w | ) | [slot] |
References _windowsMenu, TRACE, TRACE_LOG, TRACE_LOG_INT, TRACE_LOG_POINTER, and windowsMenuTriggered().
Referenced by addWindow().
{
TRACE;
// Bug 766 only under Mac 10.6
#ifdef Q_WS_MAC
TRACE_LOG;
#endif
if(_windowsMenu->actions().count()==8)
setWindowsMenuEnabled(true);
const QIcon icon=w->windowIcon();
QString title=w->windowTitle();
if(title.length() > 35)
title=title.left(35) + "...";
QAction * a=new QAction(title, this);
#ifdef Q_WS_MAC
TRACE_LOG_POINTER(a);
#endif
if( !icon.isNull())
a->setIcon(icon);
connect(a, SIGNAL(triggered()), this, SLOT(windowsMenuTriggered()) );
QByteArray windowPtr(( const char * ) & w, sizeof(QWidget * ));
a->setData(windowPtr);
a->setCheckable(true);
#ifdef Q_WS_MAC
TRACE_LOG_POINTER(w);
#endif
_windowsMenu->addAction(a);
#ifdef Q_WS_MAC
TRACE_LOG_INT(_windowsMenu->actions().count());
#endif
}
| void GeopsyMainWindow::windowsMenuRemove | ( | QWidget * | w | ) | [slot] |
References _windowsMenu, TRACE, TRACE_LOG, TRACE_LOG_INT, and TRACE_LOG_POINTER.
Referenced by removeWindow().
{
TRACE;
// Bug 766 only under Mac 10.6
#ifdef Q_WS_MAC
TRACE_LOG;
#endif
QAction * a=windowsMenuAction(w);
#ifdef Q_WS_MAC
TRACE_LOG_POINTER(a);
#endif
if(a)
_windowsMenu->removeAction(a);
#ifdef Q_WS_MAC
TRACE_LOG_INT(_windowsMenu->actions().count());
#endif
if(_windowsMenu->actions().count()==8)
setWindowsMenuEnabled(false);
}
| void GeopsyMainWindow::windowsMenuSetCurrent | ( | QWidget * | w | ) | [slot] |
References _windowsMenu, TRACE, TRACE_BUG, TRACE_BUG_INT, TRACE_BUG_N, and TRACE_BUG_POINTER.
Referenced by activeWindowChanged(), and windowsMenuTriggered().
{
TRACE;
#ifdef Q_WS_MAC
TRACE_BUG;
#endif
QList<QAction *> aList=_windowsMenu->actions();
#ifdef Q_WS_MAC
TRACE_BUG_N(1);
#endif
for(int i=8;i < aList.count();i++ ) {
QAction * a=aList.at(i);
QWidget * wa=*reinterpret_cast<QWidget **>(a->data().toByteArray().data());
#ifdef Q_WS_MAC
TRACE_BUG_N(2);
TRACE_BUG_INT(aList.count());
TRACE_BUG_INT(i);
TRACE_BUG_POINTER(a);
TRACE_BUG_POINTER(wa);
#endif
if(wa==w)
a->setChecked(true);
else
a->setChecked(false);
#ifdef Q_WS_MAC
TRACE_BUG_N(3);
#endif
}
}
| void GeopsyMainWindow::windowsMenuTriggered | ( | ) | [slot] |
References showWindow(), TRACE, and windowsMenuSetCurrent().
Referenced by windowsMenuAdd().
{
TRACE;
QAction * a=qobject_cast<QAction *>(sender());
if(a) {
QWidget * w=*(QWidget ** ) a->data().toByteArray().data();
if(w) {
qApp->setActiveWindow(this);
showWindow(w);
w->setFocus();
windowsMenuSetCurrent(w);
}
}
}
| void GeopsyMainWindow::windowsMinimize | ( | ) | [slot] |
| QWorkspace* GeopsyMainWindow::workspace | ( | ) | [inline] |
friend class GeopsyMainWindowInt [friend] |
uint GeopsyMainWindow::_dbStatusChecksum [protected] |
Referenced by GeopsyMainWindow(), and showDBStatus().
QTimer GeopsyMainWindow::_dbStatusTimer [protected] |
Referenced by GeopsyMainWindow().
DirectoryMonitor* GeopsyMainWindow::_directoryMonitor [protected] |
Referenced by clearAll(), directoryMonitor(), filesRemoved(), and GeopsyMainWindow().
QMenu* GeopsyMainWindow::_editMenu [protected] |
Referenced by setSubPoolActionEnabled().
QAction* GeopsyMainWindow::_fftAmplitudeAction [protected] |
Referenced by fftAmpl(), fftPhase(), and fftTime().
QAction* GeopsyMainWindow::_fftPhaseAction [protected] |
Referenced by fftAmpl(), fftPhase(), and fftTime().
QAction* GeopsyMainWindow::_fftTimeAction [protected] |
Referenced by fftAmpl(), fftPhase(), and fftTime().
QAction* GeopsyMainWindow::_fileExportAction [protected] |
Referenced by setSubPoolActionEnabled().
QAction* GeopsyMainWindow::_fileImportAction [protected] |
Referenced by activeWindowChanged(), and setSubPoolActionEnabled().
FileView* GeopsyMainWindow::_fList [protected] |
Referenced by clearAll(), dropEvent(), GeopsyMainWindow(), load(), loadFilePattern(), openDB(), refreshLists(), saveDB(), saveDBAs(), setToolFactory(), and showLoadedSignals().
GroupWidget* GeopsyMainWindow::_gList [protected] |
Referenced by GeopsyMainWindow(), openDB(), and setToolFactory().
QMenu* GeopsyMainWindow::_importSignalMenu [protected] |
Referenced by setToolFactory().
ProgressBar* GeopsyMainWindow::_progressBar [protected] |
QTimer GeopsyMainWindow::_progressHideTimer [protected] |
Referenced by GeopsyMainWindow(), setProgressMaximum(), and setProgressValue().
SeedLinkLoader* GeopsyMainWindow::_seedLink [protected] |
Referenced by GeopsyMainWindow(), and seedlink().
SubPoolWindow* GeopsyMainWindow::_subPoolWin [protected] |
bool GeopsyMainWindow::_tableEditionLocked [protected] |
Referenced by GeopsyMainWindow(), isTableEditionLocked(), and setTableLocked().
QMenu* GeopsyMainWindow::_toolBarsMenu [protected] |
Referenced by showToolBarMenu().
ToolFactory* GeopsyMainWindow::_toolFactory [protected] |
Referenced by GeopsyMainWindow(), setPreferences(), setToolFactory(), and toolFactory().
QToolBar* GeopsyMainWindow::_toolsBar [protected] |
Referenced by setToolFactory().
QMenu* GeopsyMainWindow::_toolsMenu [protected] |
Referenced by setSubPoolActionEnabled(), and setToolFactory().
QAction* GeopsyMainWindow::_viewChronogramAction [protected] |
Referenced by GeopsyMainWindow().
QAction* GeopsyMainWindow::_viewGraphicAction [protected] |
Referenced by GeopsyMainWindow(), and viewGraphicAction().
QAction* GeopsyMainWindow::_viewMapAction [protected] |
Referenced by GeopsyMainWindow(), and viewMapAction().
QMenu* GeopsyMainWindow::_viewMenu [protected] |
QAction* GeopsyMainWindow::_viewSetDataFieldsAction [protected] |
Referenced by activeWindowChanged(), and setSubPoolActionEnabled().
QAction* GeopsyMainWindow::_viewTableAction [protected] |
Referenced by GeopsyMainWindow(), and viewTableAction().
WaveformConsole* GeopsyMainWindow::_waveformConsole [protected] |
Referenced by activeWindowChanged(), and GeopsyMainWindow().
QMenu* GeopsyMainWindow::_waveMenu [protected] |
Referenced by setSubPoolActionEnabled().
QAction* GeopsyMainWindow::_windowsCascadeAction [protected] |
QAction* GeopsyMainWindow::_windowsCloseAllAction [protected] |
QMenu* GeopsyMainWindow::_windowsMenu [protected] |
Referenced by windowsMenuAdd(), windowsMenuRemove(), and windowsMenuSetCurrent().
QAction* GeopsyMainWindow::_windowsMinimizeAction [protected] |
QAction* GeopsyMainWindow::_windowsTileHAction [protected] |
QAction* GeopsyMainWindow::_windowsTileVAction [protected] |
QWorkspace* GeopsyMainWindow::_ws [protected] |
| QLabel* GeopsyMainWindow::databaseInfo |
Referenced by GeopsyMainWindow(), and showDBStatus().