[QGIS Commit] r13561 - trunk/qgis/src/plugins/georeferencer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon May 24 08:43:04 EDT 2010


Author: mmassing
Date: 2010-05-24 08:43:04 -0400 (Mon, 24 May 2010)
New Revision: 13561

Modified:
   trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
   trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.h
Log:
georeferencer: fix closeEvent handling for dock widget.

Modified: trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-05-24 12:42:54 UTC (rev 13560)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-05-24 12:43:04 UTC (rev 13561)
@@ -62,20 +62,22 @@
 
 #include "qgsgeorefplugingui.h"
 
-class QgsGeorefDockWidget : public QDockWidget
+
+QgsGeorefDockWidget::QgsGeorefDockWidget( const QString & title, QWidget * parent, Qt::WindowFlags flags )
+    : QDockWidget( title, parent, flags )
 {
-  public:
-    QgsGeorefDockWidget( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
-        : QDockWidget( title, parent, flags )
-    {
-      setObjectName( "GeorefDockWidget" ); // set object name so the position can be saved
-    }
+  setObjectName( "GeorefDockWidget" ); // set object name so the position can be saved
+}
 
-    virtual void closeEvent( QCloseEvent * ev )
-    {
-      deleteLater();
-    }
-};
+void QgsGeorefDockWidget::closeEvent( QCloseEvent * ev )
+{
+  if (widget() && !widget()->close())
+  {
+    ev->ignore();
+    return;
+  }
+  deleteLater();
+}
 
 QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget* parent, Qt::WFlags fl )
     : QMainWindow( parent, fl )
@@ -130,7 +132,6 @@
   {
     mDock = new QgsGeorefDockWidget( tr( "Georeferencer" ), mIface->mainWindow() );
     mDock->setWidget( this );
-    connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
     mIface->addDockWidget( Qt::BottomDockWidgetArea, mDock );
   }
 }
@@ -151,6 +152,7 @@
   delete mToolAddPoint;
   delete mToolDeletePoint;
   delete mToolMovePoint;
+
 }
 
 // ----------------------------- protected --------------------------------- //
@@ -929,8 +931,8 @@
   dockWidgetGCPpoints->setWidget( mGCPListWidget );
 
   connect( mGCPListWidget, SIGNAL( jumpToGCP( uint ) ), this, SLOT( jumpToGCP( uint ) ) );
-  connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint*, int ) ),
-           this, SLOT( replaceDataPoint( QgsGeorefDataPoint*, int ) ) );
+  /*connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint*, int ) ),
+           this, SLOT( replaceDataPoint( QgsGeorefDataPoint*, int ) ) );*/
   connect( mGCPListWidget, SIGNAL( deleteDataPoint( int ) ),
            this, SLOT( deleteDataPoint( int ) ) );
   connect( mGCPListWidget, SIGNAL( pointEnabled( QgsGeorefDataPoint*, int ) ), this, SLOT( updateGeorefTransform() ) );

Modified: trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.h
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.h	2010-05-24 12:42:54 UTC (rev 13560)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.h	2010-05-24 12:43:04 UTC (rev 13561)
@@ -225,4 +225,13 @@
 
     QDockWidget* mDock;
 };
+
+class QgsGeorefDockWidget : public QDockWidget
+{
+    Q_OBJECT
+  public:
+    QgsGeorefDockWidget( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 );
+    virtual void closeEvent( QCloseEvent * ev );
+};
+
 #endif



More information about the QGIS-commit mailing list