Skip to content
Permalink
Browse files

[georef] Add reset menu action to remove GCP and close current

raster (fix #6215)
  • Loading branch information
nyalldawson committed Jun 21, 2015
1 parent f3d032a commit eaaa98fd4599aef44237c69f1a54808d66e64b51
@@ -200,6 +200,25 @@ void QgsGeorefPluginGui::closeEvent( QCloseEvent *e )
}
}

void QgsGeorefPluginGui::reset()
{
if ( QMessageBox::question( this,
tr( "Reset Georeferencer" ),
tr( "Reset georeferencer and clear all GCP points?" ),
QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel ) != QMessageBox::Cancel )
{
mRasterFileName.clear();
mModifiedRasterFileName.clear();
setWindowTitle( tr( "Georeferencer" ) );

//delete old points
clearGCPData();

//delete any old rasterlayers
removeOldLayer();
}
}

// -------------------------- private slots -------------------------------- //
// File slots
void QgsGeorefPluginGui::openRaster()
@@ -823,6 +842,8 @@ void QgsGeorefPluginGui::layerWillBeRemoved( QString theLayerId )
void QgsGeorefPluginGui::createActions()
{
// File actions
connect( mActionReset, SIGNAL( triggered() ), this, SLOT( reset() ) );

mActionOpenRaster->setIcon( getThemeIcon( "/mActionAddRasterLayer.svg" ) );
connect( mActionOpenRaster, SIGNAL( triggered() ), this, SLOT( openRaster() ) );

@@ -1021,8 +1042,6 @@ void QgsGeorefPluginGui::createMenus()
menuSettings->addMenu( mPanelMenu );
menuSettings->addMenu( mToolbarMenu );
}

menuBar()->addAction( tr( "Help" ), this, SLOT( contextHelp() ) );
}

void QgsGeorefPluginGui::createDockWidgets()
@@ -60,6 +60,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas

private slots:
// file
void reset();
void openRaster();
void doGeoreference();
void generateGDALScript();
@@ -27,6 +27,7 @@
<property name="title">
<string>File</string>
</property>
<addaction name="mActionReset"/>
<addaction name="mActionOpenRaster"/>
<addaction name="separator"/>
<addaction name="mActionStartGeoref"/>
@@ -375,7 +376,18 @@
<string>Full Histogram Stretch</string>
</property>
</action>
<action name="mActionReset">
<property name="icon">
<iconset resource="../../../images/images.qrc">
<normaloff>:/images/themes/default/mIconClear.png</normaloff>:/images/themes/default/mIconClear.png</iconset>
</property>
<property name="text">
<string>Reset Georeferencer</string>
</property>
</action>
</widget>
<resources/>
<resources>
<include location="../../../images/images.qrc"/>
</resources>
<connections/>
</ui>

0 comments on commit eaaa98f

Please sign in to comment.
You can’t perform that action at this time.