Beispiel #1
0
QgsGrassEdit::~QgsGrassEdit()
{
  QgsDebugMsg( "entered." );

  // we can only call some methods if init was complete,
  // note that we cannot use mValid because it is disabled before
  // destructor is called
  if ( mInited )
  {
    // delete tool if exists
    delete mMapTool;

    eraseDynamic();
    mRubberBandLine->hide();
    mRubberBandIcon->hide();
    mRubberBandLine->reset();
    delete mRubberBandLine;
    delete mRubberBandIcon;

    delete mCanvasEdit;

    mCanvas->refresh();

    saveWindowLocation();
  }
  mRunning = false;
}
Beispiel #2
0
QgsBookmarks::~QgsBookmarks()
{
  delete mQgisModel;
  delete mProjectModel;
  QSqlDatabase::removeDatabase( QStringLiteral( "bookmarks" ) );
  saveWindowLocation();
}
Beispiel #3
0
void QgsGrassRegion::accept()
{
  // TODO: better repaint region
  QSettings settings;

  bool on = settings.value( "/GRASS/region/on", true ).toBool();

  if ( on )
  {
    mPlugin->switchRegion( false ); // delete
  }

  QgsGrass::setLocation( QgsGrass::getDefaultGisdbase(), QgsGrass::getDefaultLocation() );
  G__setenv(( char * ) "MAPSET", QgsGrass::getDefaultMapset().toLatin1().data() );

  if ( G_put_window( &mWindow ) == -1 )
  {
    QMessageBox::warning( 0, tr( "Warning" ), tr( "Cannot write region" ) );
    return;
  }

  if ( on )
  {
    mPlugin->switchRegion( on );  // draw new
  }

  saveWindowLocation();
  mCanvas->setMapTool( NULL );
  QDialog::accept();
}
Beispiel #4
0
void QgsGrassTools::closeEvent( QCloseEvent *e )
{
  saveWindowLocation();
  e->accept();
}
Beispiel #5
0
void QgsGrassTools::close( void )
{
  saveWindowLocation();
  hide();
}
Beispiel #6
0
QgsGrassTools::~QgsGrassTools()
{
  QgsDebugMsg( "entered." );
  saveWindowLocation();
}
Beispiel #7
0
void QgsMeasureDialog::closeEvent( QCloseEvent *e )
{
    saveWindowLocation();
    e->accept();
}
Beispiel #8
0
/*
 * Window geometry is saved during move and resize events rather then when
 * the window is closed because HelpViewer is a subprocess which could be
 * closed by the parent process invoking QProcess::terminate(). When this
 * happens, the HelpViewer process receives the signal WM_CLOSE on Windows
 * and SIGTERM on Mac and Unix. There is no way to catch these using Qt;
 * OS specific code must be written. To avoid OS specific code, the window
 * geometry is saved as it changes.
 */
void QgsHelpViewer::moveEvent( QMoveEvent *event )
{
  Q_UNUSED( event );
  saveWindowLocation();
}
Beispiel #9
0
void QgsHelpViewer::resizeEvent( QResizeEvent *event )
{
  Q_UNUSED( event );
  saveWindowLocation();
}
Beispiel #10
0
void QgsMeasureDialog::reject()
{
  saveWindowLocation();
  restart();
  QDialog::close();
}
Beispiel #11
0
QgsBookmarks::~QgsBookmarks()
{
    saveWindowLocation();
}
Beispiel #12
0
void QgsGrassRegion::reject()
{
  saveWindowLocation();
  mCanvas->setMapTool( NULL );
  QDialog::reject();
}
void QgsHelpViewer::resizeEvent( QResizeEvent *event )
{
  saveWindowLocation();
}
/*
 * Window geometry is saved during move and resize events rather then when
 * the window is closed because HelpViewer is a subprocess which could be
 * closed by the parent process invoking QProcess::terminate(). When this
 * happens, the HelpViewer process receives the signal WM_CLOSE on Windows
 * and SIGTERM on Mac and Unix. There is no way to catch these using Qt;
 * OS specific code must be written. To avoid OS specific code, the window
 * geometry is saved as it changes.
 */
void QgsHelpViewer::moveEvent( QMoveEvent *event )
{
  saveWindowLocation();
}
Beispiel #15
0
QgsBookmarks::~QgsBookmarks()
{
  saveWindowLocation();
  sInstance = 0;
}