Skip to content

Commit

Permalink
Export the list of safeguards in the markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Dec 5, 2023
1 parent 035a19c commit 7a69743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lizmap/dialogs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,9 @@ def radio_mode_normal_toggled(self):

def safeguards_to_markdown(self) -> str:
""" Export the list of safeguards to markdown. """
text = 'List of safeguards :\n'
text = '<details>\n'
text += '<summary>List of safeguards :</summary>\n'
text += '<br/>\n\n'
text += '* Mode : {}\n'.format('normal' if self.radio_normal.isChecked() else 'safe')
text += '* Allow parent folder : {}\n'.format('yes' if self.radio_allow_parent_folder.isChecked() else 'no')
if self.radio_allow_parent_folder.isChecked():
Expand All @@ -932,6 +934,7 @@ def safeguards_to_markdown(self) -> str:
text += '* Prevent PG Auth DB : {}\n'.format('yes' if self.safe_pg_auth_db.isChecked() else 'no')
text += '* Force PG user&pass : {}\n'.format('yes' if self.safe_pg_user_password.isChecked() else 'no')
text += '* Prevent ECW : {}\n'.format('yes' if self.safe_ecw.isChecked() else 'no')
text += '</details>'
return text

def save_settings(self):
Expand Down
1 change: 1 addition & 0 deletions lizmap/server_lwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ def context_menu_requested(self, position: QPoint):

def copy_as_markdown(self, data: str, action_data: str, action_required: bool):
""" Copy the server information. """
data += '\n' + self.parent.safeguards_to_markdown()
clipboard = QGuiApplication.clipboard()
clipboard.setText(data)
if not action_required:
Expand Down

0 comments on commit 7a69743

Please sign in to comment.