@@ -161,14 +161,10 @@ def update_active_plan_regulation_group_library(self):
161
161
self .regulation_groups_dock .update_regulation_groups (self .active_plan_regulation_group_library )
162
162
163
163
def create_new_regulation_group (self ):
164
- new_group = self ._open_regulation_group_form (RegulationGroup ())
165
- if new_group :
166
- iface .messageBar ().pushSuccess (None , f"Kaavamääräysryhmä { new_group !s} luotiin onnistuneesti." )
164
+ self ._open_regulation_group_form (RegulationGroup ())
167
165
168
166
def edit_regulation_group (self , regulation_group : RegulationGroup ):
169
- edited_group = self ._open_regulation_group_form (regulation_group )
170
- if edited_group :
171
- iface .messageBar ().pushSuccess (None , f"Kaavamääräysryhmää { edited_group !s} muokattiin onnistuneesti." )
167
+ self ._open_regulation_group_form (regulation_group )
172
168
173
169
def _open_regulation_group_form (self , regulation_group : RegulationGroup ):
174
170
regulation_group_form = PlanRegulationGroupForm (regulation_group , self .active_plan_regulation_group_library )
@@ -186,7 +182,6 @@ def _open_regulation_group_form(self, regulation_group: RegulationGroup):
186
182
187
183
def delete_regulation_group (self , group : RegulationGroup ):
188
184
if delete_regulation_group (group ):
189
- iface .messageBar ().pushSuccess (None , f"Kaavamääräysryhmä { group !s} poistettiin onnistuneesti." )
190
185
self .update_active_plan_regulation_group_library ()
191
186
192
187
def toggle_identify_plan_features (self , activate : bool ): # noqa: FBT001
@@ -256,9 +251,6 @@ def edit_plan(self):
256
251
if attribute_form .exec_ ():
257
252
feature = save_plan (attribute_form .model )
258
253
if feature :
259
- iface .messageBar ().pushSuccess (
260
- "" , f"Kaavan { attribute_form .model .name } tietoja muokattiin onnistuneesti."
261
- )
262
254
self .update_active_plan_regulation_group_library ()
263
255
264
256
def edit_lifecycles (self ):
@@ -306,11 +298,7 @@ def _plan_geom_digitized(self, feature: QgsFeature):
306
298
attribute_form = PlanAttributeForm (plan_model , self .regulation_group_libraries )
307
299
if attribute_form .exec_ ():
308
300
feat = save_plan (attribute_form .model )
309
- if feat :
310
- iface .messageBar ().pushSuccess ("" , f"Kaava { attribute_form .model .name } luotiin onnistuneesti." )
311
- plan_to_be_activated = feat ["id" ]
312
- else :
313
- plan_to_be_activated = self .previous_active_plan_id
301
+ plan_to_be_activated = feat ["id" ] if feat else self .previous_active_plan_id
314
302
else :
315
303
plan_to_be_activated = self .previous_active_plan_id
316
304
@@ -337,7 +325,6 @@ def _plan_feature_geom_digitized(self, feature: QgsFeature):
337
325
plan_feature , title , self .regulation_group_libraries , self .active_plan_regulation_group_library
338
326
)
339
327
if attribute_form .exec_ () and save_plan_feature (attribute_form .model ):
340
- iface .messageBar ().pushSuccess ("" , f"Kaavakohde { attribute_form .model !s} luotiin onnistuneesti." )
341
328
self .update_active_plan_regulation_group_library ()
342
329
343
330
def edit_plan_feature (self , feature : QgsFeature , layer_name : str ):
@@ -349,7 +336,6 @@ def edit_plan_feature(self, feature: QgsFeature, layer_name: str):
349
336
plan_feature , title , self .regulation_group_libraries , self .active_plan_regulation_group_library
350
337
)
351
338
if attribute_form .exec_ () and save_plan_feature (attribute_form .model ):
352
- iface .messageBar ().pushSuccess ("" , f"Kaavakohdetta { attribute_form .model !s} muokattiin onnistuneesti." )
353
339
self .update_active_plan_regulation_group_library ()
354
340
355
341
def set_active_plan (self , plan_id : str | None ):
@@ -392,13 +378,10 @@ def load_land_use_plan(self):
392
378
393
379
if dialog .exec_ () == QDialog .Accepted :
394
380
selected_plan_id = dialog .get_selected_plan_id ()
395
- selected_plan_name = dialog .get_selected_plan_name ()
396
381
self .commit_all_editable_layers ()
397
382
398
383
self .set_active_plan (selected_plan_id )
399
384
400
- iface .messageBar ().pushSuccess ("" , f"Kaava { selected_plan_name } avattiin onnistuneesti." )
401
-
402
385
def commit_all_editable_layers (self ):
403
386
"""Commit all changes in any editable layers."""
404
387
for layer in QgsProject .instance ().mapLayers ().values ():
@@ -437,7 +420,7 @@ def save_plan_jsons(self, plan_json, outline_json):
437
420
with open (self .json_plan_outline_path , "w" , encoding = "utf-8" ) as outline_file :
438
421
json .dump (outline_json , outline_file , ensure_ascii = False , indent = 2 )
439
422
440
- iface .messageBar ().pushSuccess ("" , "Kaava ja sen ulkoraja tallennettu onnistuneesti ." )
423
+ iface .messageBar ().pushSuccess ("" , "Kaava ja kaavan ulkoraja tallennettu." )
441
424
442
425
def unload (self ):
443
426
# Set pan map tool as active (to deactivate our custom tools to avoid errors)
0 commit comments