Skip to content

Commit

Permalink
Move embed action to layer menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 9, 2011
1 parent 9a90855 commit 71d96a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/app/qgsembedlayerdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "qgsembedlayerdialog.h"
#include "qgsproject.h"
#include "qgisapp.h"
#include <QDomDocument>
#include <QFileDialog>
#include <QFileInfo>
#include <QMessageBox>
#include <QSettings>

QgsEmbedLayerDialog::QgsEmbedLayerDialog( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
Expand Down Expand Up @@ -72,6 +74,13 @@ void QgsEmbedLayerDialog::changeProjectFile()
return;
}

//check we are not embedding from/to the same project
if( mProjectFileLineEdit->text() == QgsProject::instance()->fileName() )
{
QMessageBox::critical( 0, tr("Recursive embeding not possible"), tr("It is not possible to embed layers / groups from the current project") );
return;
}

mTreeWidget->clear();

//parse project file and fill tree
Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
<addaction name="mActionNewSpatialiteLayer"/>
</widget>
<addaction name="menuNew"/>
<addaction name="mActionEmbedLayers"/>
<addaction name="mActionAddOgrLayer"/>
<addaction name="mActionAddRasterLayer"/>
<addaction name="mActionAddPgLayer"/>
Expand Down Expand Up @@ -234,7 +235,6 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="mActionEmbedLayers"/>
<addaction name="mActionAddOgrLayer"/>
<addaction name="mActionAddRasterLayer"/>
<addaction name="mActionAddPgLayer"/>
Expand Down Expand Up @@ -1483,7 +1483,10 @@
</action>
<action name="mActionEmbedLayers">
<property name="text">
<string>Embed Layers</string>
<string>Embed layers and groups...</string>
</property>
<property name="toolTip">
<string>Embed layers and groups from other project files</string>
</property>
</action>
</widget>
Expand Down

0 comments on commit 71d96a2

Please sign in to comment.