Skip to content

Commit

Permalink
better function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Oct 5, 2023
1 parent cbaf63a commit 5d057b7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions QgisModelBaker/gui/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ def __init__(self, base_config, iface):
self.auto_pan_button.clicked.connect(self._auto_pan_button_clicked)
self.auto_zoom_button.clicked.connect(self._auto_zoom_button_clicked)

save_config_file_action = QAction(
save_config_file_path_action = QAction(
QgsApplication.getThemeIcon("/mActionFileSave.svg"),
self.tr("Save config file to project..."),
self.tr("Save config file path to project..."),
self,
)
save_config_file_action.triggered.connect(self._save_config_file)
self.config_file_tool_button.addAction(save_config_file_action)
load_config_file_action = QAction(
save_config_file_path_action.triggered.connect(self._save_config_file_path)
self.config_file_tool_button.addAction(save_config_file_path_action)
load_config_file_path_action = QAction(
QgsApplication.getThemeIcon("/mActionFileOpen.svg"),
self.tr("Load config file from project..."),
self.tr("Load config file path from project..."),
self,
)
load_config_file_action.triggered.connect(self._load_config_file)
self.config_file_tool_button.addAction(load_config_file_action)
load_config_file_path_action.triggered.connect(self._load_config_file_path)
self.config_file_tool_button.addAction(load_config_file_path_action)
self.config_file_tool_button.clicked.connect(self._select_config_file)

def _reset_current_values(self):
Expand Down Expand Up @@ -299,7 +299,7 @@ def set_current_layer(self, layer):
self.filter_data_panel.setup_dialog(self._basket_handling())
self.export_models_panel.setup_dialog(True)

self._load_config_file()
self._load_config_file_path()

self.setDisabled(False)

Expand Down Expand Up @@ -383,7 +383,6 @@ def _run(self, edited_command=None):
validator.configuration.valid_config = self._absolute_path(
self.config_file_line_edit.text()
)
print(validator.configuration.valid_config)

self.progress_bar.setValue(20)
validation_result_state = False
Expand Down Expand Up @@ -657,7 +656,7 @@ def _select_config_file(self):
if filename:
self.config_file_line_edit.setText(self._relative_path(filename))

def _save_config_file(self):
def _save_config_file_path(self):
filename = self.config_file_line_edit.text()

QgsExpressionContextUtils.setProjectVariable(
Expand All @@ -666,7 +665,7 @@ def _save_config_file(self):
self._relative_path(filename),
)

def _load_config_file(self):
def _load_config_file_path(self):
filename = QgsExpressionContextUtils.projectScope(
QgsProject.instance()
).variable("validator_config")
Expand Down

0 comments on commit 5d057b7

Please sign in to comment.