12
12
from arho_feature_template .utils .misc_utils import get_active_plan_id
13
13
14
14
if TYPE_CHECKING :
15
- from qgis .PyQt .QtWidgets import QListView
15
+ from qgis .PyQt .QtWidgets import QListView , QProgressBar
16
16
17
17
ui_path = resources .files (__package__ ) / "validation_dock.ui"
18
18
DockClass , _ = uic .loadUiType (ui_path )
19
19
20
20
21
21
class ValidationDock (QgsDockWidget , DockClass ): # type: ignore
22
22
error_list_view : QListView
23
+ progress_bar : QProgressBar
23
24
24
25
def __init__ (self ):
25
26
super ().__init__ ()
@@ -37,6 +38,10 @@ def validate(self):
37
38
iface .messageBar ().pushMessage ("Virhe" , "Ei aktiivista kaavaa." , level = 3 )
38
39
return
39
40
41
+ # Disable button and show progress bar
42
+ self .validate_button .setEnabled (False )
43
+ self .progress_bar .setVisible (True )
44
+
40
45
self .lambda_service .validate_plan (active_plan_id )
41
46
42
47
def list_validation_errors (self , validation_json ):
@@ -76,3 +81,6 @@ def list_validation_errors(self, validation_json):
76
81
77
82
# Update the list view with the new errors and warnings
78
83
self .error_list_model .setStringList (new_errors )
84
+ # Hide progress bar and re-enable the button
85
+ self .progress_bar .setVisible (False )
86
+ self .validate_button .setEnabled (True )
0 commit comments