Brief description of class still missing. More...
#include <MainEnvironment.h>
Public Member Functions | |
virtual void | helpAbout () |
MainEnvironment () | |
virtual void | newDocument () |
virtual void | openDocument () |
void | openDocument (QString fileName) |
QList< MapProject * > | projects () const |
~MainEnvironment () | |
Protected Member Functions | |
virtual void | askForClose (bool &ok) |
virtual bool | quit () |
Brief description of class still missing.
Full description of class still missing
Description of constructor still missing
References QGpGuiTools::MultiDocumentEnvironment::createEditActions(), QGpGuiTools::MultiDocumentEnvironment::createFileActions(), QGpGuiTools::MultiDocumentEnvironment::createHelpActions(), QGpGuiTools::MultiDocumentEnvironment::createWindowsActions(), and TRACE.
: MultiDocumentEnvironment() { TRACE; createFileActions(); createEditActions(); createWindowsActions(); createHelpActions(); }
void MainEnvironment::askForClose | ( | bool & | ok | ) | [protected, virtual] |
Reimplemented from QGpGuiTools::MultiDocumentEnvironment.
References TRACE.
{ TRACE; printf("Ask for close\n"); ok=true; }
void MainEnvironment::helpAbout | ( | ) | [virtual] |
Reimplemented from QGpGuiTools::MultiDocumentEnvironment.
References MSG_ID, QGpCoreTools::tr(), and TRACE.
void MainEnvironment::newDocument | ( | ) | [virtual] |
Reimplemented from QGpGuiTools::MultiDocumentEnvironment.
References MainWindow::createView(), QGpGuiTools::MultiDocumentEnvironment::currentWindow(), MainWindow::setActiveProject(), TRACE, and MapProject::view().
Referenced by main().
{ TRACE; MapProject * p=createProject(); MainWindow * w=static_cast<MainWindow *>(currentWindow()); w->createView(p); w->setActiveProject(p->view(0)); }
virtual void MainEnvironment::openDocument | ( | ) | [inline, virtual] |
Reimplemented from QGpGuiTools::MultiDocumentEnvironment.
References openDocument().
Referenced by main(), and openDocument().
{openDocument(QString::null);}
void MainEnvironment::openDocument | ( | QString | fileName | ) |
References MainWindow::createView(), QGpGuiTools::MultiDocumentEnvironment::currentWindow(), MapProject::open(), MainWindow::setActiveProject(), TRACE, and MapProject::view().
{ TRACE; MapProject * p=createProject(); if(p->open(fileName)) { MainWindow * w=static_cast<MainWindow *>(currentWindow()); w->createView(p); w->setActiveProject(p->view(0)); } else { delete p; } }
QList< MapProject * > MainEnvironment::projects | ( | ) | const |
References MainWindow::projects(), TRACE, QGpCoreTools::unique(), w, and QGpGuiTools::MultiDocumentEnvironment::windows().
Referenced by quit().
{ TRACE; QList<MapProject *> pList; const QList<MultiDocumentWindow *>& winList=windows(); for(QList<MultiDocumentWindow *>::const_iterator it=winList.begin(); it!=winList.end(); it++) { MainWindow * w=static_cast<MainWindow *>(*it); pList.append(w->projects()); } qSort(pList); unique(pList); return pList; }
bool MainEnvironment::quit | ( | ) | [protected, virtual] |
Return true to accept quitting application
Reimplemented from QGpGuiTools::MultiDocumentEnvironment.
References MapProject::isClosable(), MainWindow::projectClosed(), projects(), TRACE, and QGpGuiTools::MultiDocumentEnvironment::windows().
{ TRACE; QList<MapProject *> pList=projects(); const QList<MultiDocumentWindow *>& winList=windows(); for(QList<MapProject *>::iterator it=pList.begin(); it!=pList.end(); it++) { MapProject * p=*it; if(!p->isClosable()) { return false; } for(QList<MultiDocumentWindow *>::const_iterator it=winList.begin(); it!=winList.end(); it++) { MainWindow * w=static_cast<MainWindow *>(*it); w->projectClosed(p); } delete p; } return MultiDocumentEnvironment::quit(); }