diff --git a/gui/__main__.py b/gui/__main__.py index 8aa34e1..29579fd 100644 --- a/gui/__main__.py +++ b/gui/__main__.py @@ -32,25 +32,34 @@ if is_compatable: # SCREEN FAILED TABLES if not made_tables: - logger.error(f"[DB MANAGEMENT] Critical Failure with starting the models of the database.") + custom_error = "Critical Failure with starting the models of the database." + logger.error(f"[DB MANAGEMENT] {custom_error}") close_session() + from v2.ui.popups.Database_version import show_recovery_dialog + choice = show_recovery_dialog({"message": custom_error, "db_version": 0, "status": "cant_make"}) + logger.info(f"[DB MANAGEMENT] From the database error options, the user picked {choice}") sys.exit() # ASSUME TABLES CREATED logger.info("[DB MANAGEMENT] Tables successfully made or initialized if pre-existing") - # original reason was he had no database, now tag it that he's got the new version, - if reason == "no_database": - logger.info(f"[DB MANAGEMENT] User had no database to begin with, so after we created the database, we are about to insert the new version in the DB metadata table for next time.") - # UPDATE DATA did_it_insert = insert_new_version(session, Constants.DB_VERSION_THIS_APP_WANTS) if not did_it_insert: logger.error(f"[DB MANAGEMENT] Critical Failure with updating/inserting the new DB version into the database.") - logger.info(f"[DB MANAGEMENT] Launcher is now passing it off to launch the main GUI window...") + # Load GUI either way: from main_ui import start_ui - force_sync = False + + # If the user lacks a database, we want to force them to sync the new data, to avoid NoneType errors when enabling existing profiles, + if reason == "no_database": + logger.info(f"[DB MANAGEMENT] User had no database to begin with, so now we're entering GUI with sync on..") + force_sync = False + else: + logger.info(f"[DB MANAGEMENT] Launcher is now passing it off to launch the main GUI window WITHOUT force sync..") + force_sync = False + + # Start GUI either way: start_ui(force_sync) # ============================================================================ diff --git a/gui/v2/ui/popups/Database_version.py b/gui/v2/ui/popups/Database_version.py index bde74b0..d42c2d6 100644 --- a/gui/v2/ui/popups/Database_version.py +++ b/gui/v2/ui/popups/Database_version.py @@ -52,15 +52,26 @@ class DatabaseConflictDialog(QDialog): icon_label.setFont(QFont("Segoe UI", 48)) header_layout.addWidget(icon_label, 0, Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter) - # Title + ######## Title Section. ############## + + # First which messages to display, + if check["status"] == "version_mismatch": + error_title = "Database Compatibility" + error_subtitle = "Your App version and Database don't match" + else: + error_title = "Database Error" + error_subtitle = "The Database can't properly start" + + # then display them: title_layout = QVBoxLayout() title_layout.setSpacing(5) - title = QLabel("Database Compatibility") + + title = QLabel(error_title) title.setFont(QFont("Segoe UI", 18, QFont.Weight.Bold)) title.setStyleSheet("color: white;") title_layout.addWidget(title) - subtitle = QLabel("Your App version and Database don't match") + subtitle = QLabel(error_subtitle) subtitle.setFont(QFont("Segoe UI", 11)) subtitle.setStyleSheet("color: rgba(255, 255, 255, 0.8);") title_layout.addWidget(subtitle) diff --git a/pyproject.toml b/pyproject.toml index 3ed7c25..572b4fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sp-hydra-veil-gui" -version = "2.4.3" +version = "2.4.4" authors = [ { name = "Simplified Privacy" }, ] @@ -12,7 +12,7 @@ classifiers = [ "Operating System :: POSIX :: Linux", ] dependencies = [ - "sp-hydra-veil-core == 2.3.6", + "sp-hydra-veil-core == 2.3.7", "pyperclip ~= 1.9.0", "pyqt6 ~= 6.7.1", "qrcode[pil] ~= 8.2"