Skip to content

Commit dc6d8c8

Browse files
committedJun 3, 2011
Move embed action to layer menu
1 parent 6f37598 commit dc6d8c8

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
 

‎src/app/qgsembedlayerdialog.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#include "qgsembedlayerdialog.h"
2+
#include "qgsproject.h"
23
#include "qgisapp.h"
34
#include <QDomDocument>
45
#include <QFileDialog>
56
#include <QFileInfo>
7+
#include <QMessageBox>
68
#include <QSettings>
79

810
QgsEmbedLayerDialog::QgsEmbedLayerDialog( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
@@ -72,6 +74,13 @@ void QgsEmbedLayerDialog::changeProjectFile()
7274
return;
7375
}
7476

77+
//check we are not embedding from/to the same project
78+
if( mProjectFileLineEdit->text() == QgsProject::instance()->fileName() )
79+
{
80+
QMessageBox::critical( 0, tr("Recursive embeding not possible"), tr("It is not possible to embed layers / groups from the current project") );
81+
return;
82+
}
83+
7584
mTreeWidget->clear();
7685

7786
//parse project file and fill tree

‎src/ui/qgisapp.ui

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<addaction name="mActionNewSpatialiteLayer"/>
133133
</widget>
134134
<addaction name="menuNew"/>
135+
<addaction name="mActionEmbedLayers"/>
135136
<addaction name="mActionAddOgrLayer"/>
136137
<addaction name="mActionAddRasterLayer"/>
137138
<addaction name="mActionAddPgLayer"/>
@@ -234,7 +235,6 @@
234235
<attribute name="toolBarBreak">
235236
<bool>false</bool>
236237
</attribute>
237-
<addaction name="mActionEmbedLayers"/>
238238
<addaction name="mActionAddOgrLayer"/>
239239
<addaction name="mActionAddRasterLayer"/>
240240
<addaction name="mActionAddPgLayer"/>
@@ -1483,7 +1483,10 @@
14831483
</action>
14841484
<action name="mActionEmbedLayers">
14851485
<property name="text">
1486-
<string>Embed Layers</string>
1486+
<string>Embed layers and groups...</string>
1487+
</property>
1488+
<property name="toolTip">
1489+
<string>Embed layers and groups from other project files</string>
14871490
</property>
14881491
</action>
14891492
</widget>

0 commit comments

Comments
 (0)
Please sign in to comment.