Skip to content

Commit

Permalink
Fix First Time Creating New Project Bug #545
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyMWhitehead authored and philipbaileynar committed Dec 13, 2024
1 parent b052952 commit b647f70
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/view/frm_new_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self, parent, last_parent_project: str=None, project: Project = Non
self.metadata_widget = MetadataWidget(self, metadata_json)
self.setupUi()

# get a default root path
self.root_path = parse_posix_path(os.path.expanduser('~'))
self.last_project_folder = last_parent_project
if self.last_project_folder is not None:
if os.path.isdir(self.last_project_folder):
Expand Down Expand Up @@ -59,8 +61,11 @@ def update_project_folder(self):
clean_name = ''.join(e for e in text.replace(" ", "_") if e.isalnum() or e == "_")

if len(clean_name) > 0:
self.project_folder = parse_posix_path(os.path.join(self.root_path, clean_name, f'{clean_name}.gpkg'))
self.project_folder = parse_posix_path(os.path.join(self.root_path, clean_name, 'qris.gpkg'))
self.txtPath.setText(self.project_folder)
else:
self.project_folder = None
self.txtPath.setText(parse_posix_path(self.root_path))

def get_tags(self):
"""Returns a list of tags from the tags text box"""
Expand Down Expand Up @@ -131,7 +136,7 @@ def on_creating_schema(self):

def browse_root_folder(self):

browse_folder = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select an Existing Folder to create a New QRiS Project Folder in', self.last_project_folder)
browse_folder = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select an Existing Folder to create a New QRiS Project Folder in', self.root_path)
if browse_folder:
self.last_project_folder = browse_folder
self.root_path = parse_posix_path(browse_folder)
Expand Down

0 comments on commit b647f70

Please sign in to comment.