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