From 0cf0bc6350100abfad482f07010b01371a0c2226 Mon Sep 17 00:00:00 2001 From: Mason Date: Thu, 7 Aug 2025 12:23:34 +0800 Subject: [PATCH] Restrict file dialog to .mflow files only and return to login on load error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove "All files (*)" option from file dialog, only allow .mflow files - Change error handling to return to login page instead of opening empty pipeline - Update error message to be more specific about file format requirements - Properly clean up dashboard window when file load fails 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- ui/windows/login.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/windows/login.py b/ui/windows/login.py index 07e792b..dfadca5 100644 --- a/ui/windows/login.py +++ b/ui/windows/login.py @@ -380,7 +380,7 @@ class DashboardLogin(QWidget): self, "Open Pipeline File", self.settings.get_default_project_location(), - "Pipeline files (*.mflow);;All files (*)" + "Pipeline files (*.mflow)" ) if file_path: @@ -436,10 +436,15 @@ class DashboardLogin(QWidget): except Exception as e: QMessageBox.warning( self, - "File Load Warning", + "File Load Error", f"Could not load pipeline file: {e}\n\n" - "Opening with empty pipeline instead." + "Please select a valid .mflow file." ) + # Close the dashboard window and return to login page + self.dashboard_window.close() + self.dashboard_window = None + self.show() # Show the login window again + return self.dashboard_window.show() self.hide() # Hide the login window