File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include " qgsembedlayerdialog.h"
2
+ #include " qgsproject.h"
2
3
#include " qgisapp.h"
3
4
#include < QDomDocument>
4
5
#include < QFileDialog>
5
6
#include < QFileInfo>
7
+ #include < QMessageBox>
6
8
#include < QSettings>
7
9
8
10
QgsEmbedLayerDialog::QgsEmbedLayerDialog ( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
@@ -72,6 +74,13 @@ void QgsEmbedLayerDialog::changeProjectFile()
72
74
return ;
73
75
}
74
76
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
+
75
84
mTreeWidget ->clear ();
76
85
77
86
// parse project file and fill tree
Original file line number Diff line number Diff line change 132
132
<addaction name =" mActionNewSpatialiteLayer" />
133
133
</widget >
134
134
<addaction name =" menuNew" />
135
+ <addaction name =" mActionEmbedLayers" />
135
136
<addaction name =" mActionAddOgrLayer" />
136
137
<addaction name =" mActionAddRasterLayer" />
137
138
<addaction name =" mActionAddPgLayer" />
234
235
<attribute name =" toolBarBreak" >
235
236
<bool >false</bool >
236
237
</attribute >
237
- <addaction name =" mActionEmbedLayers" />
238
238
<addaction name =" mActionAddOgrLayer" />
239
239
<addaction name =" mActionAddRasterLayer" />
240
240
<addaction name =" mActionAddPgLayer" />
1483
1483
</action >
1484
1484
<action name =" mActionEmbedLayers" >
1485
1485
<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 >
1487
1490
</property >
1488
1491
</action >
1489
1492
</widget >
You can’t perform that action at this time.
0 commit comments