From 825c2d76d2a5f4fa54af946c164f5dbaca62c729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Mon, 14 Mar 2011 17:24:52 +0000 Subject: [PATCH] Disallow quitting Installer silently, midinstall, in the LiveCD/post-install case. Allow quitting Installer without first quitting BootManager/DriveSetup in the LiveCD/post-install case. Make use of B_TRANSLATE_APP_NAME. Stop-icon in abortive BAlerts. Please review. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40951 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/installer/InstallerWindow.cpp | 61 +++++++++++++++----------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp index 7d8c7e2a3d..24305d2ca1 100644 --- a/src/apps/installer/InstallerWindow.cpp +++ b/src/apps/installer/InstallerWindow.cpp @@ -153,8 +153,10 @@ layout_item_for(BView* view) InstallerWindow::InstallerWindow() - : BWindow(BRect(-2000, -2000, -1800, -1800), B_TRANSLATE("Installer"), - B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS), + : + BWindow(BRect(-2000, -2000, -1800, -1800), + B_TRANSLATE_APP_NAME("Installer"), B_TITLED_WINDOW, + B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS), fEncouragedToSetupPartitions(false), fDriveSetupLaunched(false), fBootmanLaunched(false), @@ -566,33 +568,42 @@ InstallerWindow::MessageReceived(BMessage *msg) bool InstallerWindow::QuitRequested() { - if (fDriveSetupLaunched && fBootmanLaunched) { - (new BAlert(B_TRANSLATE("Quit Boot Manager and DriveSetup"), - B_TRANSLATE("Please close the Boot Manager and DriveSetup windows " - "before closing the Installer window."), B_TRANSLATE("OK")))->Go(); - return false; - } else if (fDriveSetupLaunched) { - (new BAlert(B_TRANSLATE("Quit DriveSetup"), - B_TRANSLATE("Please close the DriveSetup window before closing " - "the Installer window."), B_TRANSLATE("OK")))->Go(); - return false; - } else if (fBootmanLaunched) { - (new BAlert(B_TRANSLATE("Quit Boot Manager"), - B_TRANSLATE("Please close the Boot Manager window before closing " - "the Installer window."), B_TRANSLATE("OK")))->Go(); - return false; - } - - if (fInstallStatus != kFinished && (Flags() & B_NOT_MINIMIZABLE) != 0) { + if ((Flags() & B_NOT_MINIMIZABLE) != 0) { // This means Deskbar is not running, i.e. Installer is the only // thing on the screen and we will reboot the machine once it quits. - if ((new BAlert("reallyQuit", - B_TRANSLATE("Are you sure you want to abort the installation and " - "restart the system?"), - B_TRANSLATE("Cancel"), - B_TRANSLATE("Restart system")))->Go() == 0) { + + if (fDriveSetupLaunched && fBootmanLaunched) { + (new BAlert(B_TRANSLATE("Quit Boot Manager and DriveSetup"), + B_TRANSLATE("Please close the Boot Manager and DriveSetup " + "windows before closing the Installer window."), + B_TRANSLATE("OK")))->Go(); + return false; + } else if (fDriveSetupLaunched) { + (new BAlert(B_TRANSLATE("Quit DriveSetup"), + B_TRANSLATE("Please close the DriveSetup window before closing " + "the Installer window."), B_TRANSLATE("OK")))->Go(); + return false; + } else if (fBootmanLaunched) { + (new BAlert(B_TRANSLATE("Quit Boot Manager"), + B_TRANSLATE("Please close the Boot Manager window before " + "closing the Installer window."), B_TRANSLATE("OK")))->Go(); return false; } + + if (fInstallStatus != kFinished) + if ((new BAlert(B_TRANSLATE_APP_NAME("Installer"), + B_TRANSLATE("Are you sure you want to abort the installation " + "and restart the system?"), + B_TRANSLATE("Cancel"), B_TRANSLATE("Restart system"), NULL, + B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) + return false; + + } else if (fInstallStatus == kInstalling) { + if ((new BAlert(B_TRANSLATE_APP_NAME("Installer"), + B_TRANSLATE("Are you sure you want to abort the installation?"), + B_TRANSLATE("Cancel"), B_TRANSLATE("Abort"), NULL, + B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) + return false; } _QuitCopyEngine(false);