Skip to content

Commit

Permalink
Adding critical message when path exceed 250 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
SeqLaz committed Nov 14, 2024
1 parent e51f5c7 commit f380d49
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,25 @@ def show_package_page(self):
def run_package_project(self) -> None:
export_packaged_project = Path(self.packagedProjectFileWidget.filePath())

if export_packaged_project.suffix != ".qgs":
if len(str(export_packaged_project)) > 250:
QMessageBox.critical(
self,
self.tr("Path Too Long"),
self.tr(
"The file path exceeds 250 characters, which may cause issues."
),
)
return

if export_packaged_project.suffix.lower() != ".qgs":
QMessageBox.critical(
self,
self.tr("Invalid Filename"),
self.tr('The filename must have a ".qgs" extension.'),
)
return

else:
self.package_project()
self.package_project()

def package_project(self):
self.button_box.button(QDialogButtonBox.Save).setEnabled(False)
Expand Down

0 comments on commit f380d49

Please sign in to comment.