File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1107,6 +1107,7 @@ def on_send_geojson_layer_to_qchat(self) -> None:
11071107 duration = self .settings .notify_push_duration ,
11081108 )
11091109 return
1110+
11101111 layer = self .iface .activeLayer ()
11111112 if not layer :
11121113 self .log (
@@ -1117,6 +1118,7 @@ def on_send_geojson_layer_to_qchat(self) -> None:
11171118 duration = self .settings .notify_push_duration ,
11181119 )
11191120 return
1121+
11201122 if layer .type () != QgsMapLayer .LayerType .VectorLayer :
11211123 self .log (
11221124 message = self .tr ("Only vector layers can be sent on QChat" ),
@@ -1127,6 +1129,21 @@ def on_send_geojson_layer_to_qchat(self) -> None:
11271129 )
11281130 return
11291131
1132+ if (
1133+ not QMessageBox .warning (
1134+ self ,
1135+ self .tr ("Sure ?" ),
1136+ self .tr (
1137+ """The "{layer_name}" layer will be sent to QChat.
1138+
1139+ Are you sure ?"""
1140+ ).format (layer_name = layer .name ()),
1141+ QMessageBox .StandardButton .Yes | QMessageBox .StandardButton .No ,
1142+ )
1143+ == QMessageBox .StandardButton .Yes
1144+ ):
1145+ return
1146+
11301147 exporter = QgsJsonExporter (layer )
11311148 exporter .setSourceCrs (layer .crs ())
11321149 exporter .setDestinationCrs (layer .crs ())
You can’t perform that action at this time.
0 commit comments