62
62
63
63
#include " qgsgeorefplugingui.h"
64
64
65
- class QgsGeorefDockWidget : public QDockWidget
65
+
66
+ QgsGeorefDockWidget::QgsGeorefDockWidget ( const QString & title, QWidget * parent, Qt::WindowFlags flags )
67
+ : QDockWidget( title, parent, flags )
66
68
{
67
- public:
68
- QgsGeorefDockWidget ( const QString & title, QWidget * parent = 0 , Qt::WindowFlags flags = 0 )
69
- : QDockWidget( title, parent, flags )
70
- {
71
- setObjectName ( " GeorefDockWidget" ); // set object name so the position can be saved
72
- }
69
+ setObjectName ( " GeorefDockWidget" ); // set object name so the position can be saved
70
+ }
73
71
74
- virtual void closeEvent ( QCloseEvent * ev )
75
- {
76
- deleteLater ();
77
- }
78
- };
72
+ void QgsGeorefDockWidget::closeEvent ( QCloseEvent * ev )
73
+ {
74
+ if (widget () && !widget ()->close ())
75
+ {
76
+ ev->ignore ();
77
+ return ;
78
+ }
79
+ deleteLater ();
80
+ }
79
81
80
82
QgsGeorefPluginGui::QgsGeorefPluginGui ( QgisInterface* theQgisInterface, QWidget* parent, Qt::WFlags fl )
81
83
: QMainWindow( parent, fl )
@@ -130,7 +132,6 @@ void QgsGeorefPluginGui::dockThisWindow( bool dock )
130
132
{
131
133
mDock = new QgsGeorefDockWidget ( tr ( " Georeferencer" ), mIface ->mainWindow () );
132
134
mDock ->setWidget ( this );
133
- connect ( this , SIGNAL ( destroyed () ), mDock , SLOT ( close () ) );
134
135
mIface ->addDockWidget ( Qt::BottomDockWidgetArea, mDock );
135
136
}
136
137
}
@@ -151,6 +152,7 @@ QgsGeorefPluginGui::~QgsGeorefPluginGui()
151
152
delete mToolAddPoint ;
152
153
delete mToolDeletePoint ;
153
154
delete mToolMovePoint ;
155
+
154
156
}
155
157
156
158
// ----------------------------- protected --------------------------------- //
@@ -929,8 +931,8 @@ void QgsGeorefPluginGui::createDockWidgets()
929
931
dockWidgetGCPpoints->setWidget ( mGCPListWidget );
930
932
931
933
connect ( mGCPListWidget , SIGNAL ( jumpToGCP ( uint ) ), this , SLOT ( jumpToGCP ( uint ) ) );
932
- connect ( mGCPListWidget , SIGNAL ( replaceDataPoint ( QgsGeorefDataPoint*, int ) ),
933
- this , SLOT ( replaceDataPoint ( QgsGeorefDataPoint*, int ) ) );
934
+ /* connect( mGCPListWidget, SIGNAL( replaceDataPoint( QgsGeorefDataPoint*, int ) ),
935
+ this, SLOT( replaceDataPoint( QgsGeorefDataPoint*, int ) ) );*/
934
936
connect ( mGCPListWidget , SIGNAL ( deleteDataPoint ( int ) ),
935
937
this , SLOT ( deleteDataPoint ( int ) ) );
936
938
connect ( mGCPListWidget , SIGNAL ( pointEnabled ( QgsGeorefDataPoint*, int ) ), this , SLOT ( updateGeorefTransform () ) );
0 commit comments