Skip to content

Commit

Permalink
Sort workspaces list in new project wizard - this is mainly for suppo…
Browse files Browse the repository at this point in the history
…rt agents who need to find the right one in a list of more than 100 of them
  • Loading branch information
erpas committed Jul 9, 2024
1 parent 0ee19d5 commit ad18f57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Mergin/create_project_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def initializePage(self):

def populate_namespace_cbo(self):
if self.parent.workspaces is not None:
for ws in self.parent.workspaces:
for ws in sorted(self.parent.workspaces, key=lambda x: x["name"].lower()):
is_writable = ws.get("role", "owner") in ["owner", "admin", "writer"]
self.project_owner_cbo.addItem(ws["name"], is_writable)

Expand Down
7 changes: 5 additions & 2 deletions scripts/deploy_win.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import os
import shutil

profile = "default"

this_dir = os.path.dirname(os.path.realpath(__file__))
home_dir = os.path.expanduser("~")
dest_dir_plug = os.path.join(home_dir, "AppData", "Roaming", "QGIS", "QGIS3", "profiles", "default", "python", "plugins", "Mergin")
dest_dir_plug = os.path.join(home_dir, "AppData", "Roaming", "QGIS", "QGIS3", "profiles", profile, "python", "plugins", "Mergin")
print(dest_dir_plug)
src_dir_plug = os.path.join(os.path.dirname(this_dir), "Mergin")
try:
shutil.rmtree(dest_dir_plug)
except OSError:
pass # directory doesn't not exist
print("Could not remove Mergin")
shutil.copytree(src_dir_plug, dest_dir_plug)

0 comments on commit ad18f57

Please sign in to comment.