* Changed some kind of broken translation strings (like replacements with a

fixed order).
* Style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40111 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-01-04 18:00:43 +00:00
parent 415b188949
commit 38109ac999
5 changed files with 161 additions and 165 deletions
+11 -11
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2009, Haiku, Inc. All rights reserved.
* Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -7,6 +7,7 @@
* Axel Dörfler <[email protected]>
*/
#include "BootManagerWindow.h"
#include <Alert.h>
@@ -20,7 +21,7 @@
#define B_TRANSLATE_CONTEXT "BootManager"
static const char* kSignature = "application/x-vnd.Haiku-bootman";
static const char* kSignature = "application/x-vnd.Haiku-BootManager";
class BootManager : public BApplication {
@@ -28,13 +29,13 @@ public:
BootManager();
virtual void ReadyToRun();
virtual void AboutRequested();
};
BootManager::BootManager()
: BApplication(kSignature)
:
BApplication(kSignature)
{
}
@@ -51,15 +52,14 @@ void
BootManager::AboutRequested()
{
BString aboutText;
const char* title = B_TRANSLATE_COMMENT("Haiku Boot Manager",
"About text title");
aboutText <<
title << "\n\n" <<
B_TRANSLATE("written by") << "\n"
const char* title = B_TRANSLATE_COMMENT("BootManager", "Application name");
aboutText << title << "\n\n"
<< B_TRANSLATE("written by")
<< "\n"
"\tDavid Dengg\n"
"\tMichael Pfeiffer\n"
"\n" <<
B_TRANSLATE_COMMENT("Copyright %year, Haiku Inc.\n",
"\n"
<< B_TRANSLATE_COMMENT("Copyright %year, Haiku Inc.\n",
"Leave %year untranslated");
aboutText.ReplaceLast("%year", "2008-2010");
BAlert *alert = new BAlert("about",
+68 -73
View File
@@ -1,5 +1,5 @@
/*
* Copyright 20082009, Haiku, Inc. All rights reserved.
* Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -9,23 +9,6 @@
#include "BootManagerController.h"
#include "WizardView.h"
#include "EntryPage.h"
#include "PartitionsPage.h"
#include "DefaultPartitionPage.h"
#include "DescriptionPage.h"
#include "FileSelectionPage.h"
#include "LegacyBootDrive.h"
#define USE_TEST_BOOT_DRIVE 0
#if USE_TEST_BOOT_DRIVE
#include "TestBootDrive.h"
#endif
#include <Alert.h>
#include <Application.h>
#include <Catalog.h>
@@ -35,6 +18,21 @@
#include <Path.h>
#include <String.h>
#include "DefaultPartitionPage.h"
#include "DescriptionPage.h"
#include "EntryPage.h"
#include "FileSelectionPage.h"
#include "LegacyBootDrive.h"
#include "PartitionsPage.h"
#include "WizardView.h"
#define USE_TEST_BOOT_DRIVE 0
#if USE_TEST_BOOT_DRIVE
# include "TestBootDrive.h"
#endif
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "BootManagerController"
@@ -96,10 +94,10 @@ BootManagerController::NextState(int32 state)
if (install) {
if (fBootDrive->IsBootMenuInstalled(&fSettings))
return kStatePartitions;
else
return kStateSaveMBR;
}
else
return kStateUninstall;
}
@@ -150,7 +148,8 @@ bool
BootManagerController::_HasSelectedPartitions()
{
BMessage message;
for (int32 i = 0; fSettings.FindMessage("partition", i, &message) == B_OK; i ++) {
for (int32 i = 0; fSettings.FindMessage("partition", i, &message) == B_OK;
i++) {
bool show;
if (message.FindBool("show", &show) == B_OK && show)
return true;
@@ -171,7 +170,8 @@ BootManagerController::_WriteBootMenu()
BAlert* alert = new BAlert("confirm", B_TRANSLATE("About to write the "
"boot menu to disk. Are you sure you want to continue?"),
B_TRANSLATE_COMMENT("Write boot menu", "Button"),
B_TRANSLATE_COMMENT("Back", "Button"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
B_TRANSLATE_COMMENT("Back", "Button"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
if (alert->Go() == 1)
return false;
@@ -279,19 +279,19 @@ BootManagerController::_CreateErrorEntryPage(BRect frame)
{
BString description;
if (fReadPartitionsStatus == kErrorBootSectorTooSmall)
description <<
B_TRANSLATE_COMMENT("Partition table not compatible", "Title") <<
"\n\n" <<
B_TRANSLATE("The partition table of the first hard disk is not "
if (fReadPartitionsStatus == kErrorBootSectorTooSmall) {
description << B_TRANSLATE_COMMENT("Partition table not compatible",
"Title") << "\n\n"
<< B_TRANSLATE("The partition table of the first hard disk is not "
"compatible with Boot Manager.\n"
"Boot Manager needs 2 KB available space before the first "
"partition.");
else
description <<
B_TRANSLATE_COMMENT("Error reading partition table", "Title") <<
"\n\n" <<
B_TRANSLATE("Boot Manager is unable to read the partition table!");
} else {
description << B_TRANSLATE_COMMENT("Error reading partition table",
"Title") << "\n\n"
<< B_TRANSLATE("Boot Manager is unable to read the partition "
"table!");
}
return new DescriptionPage(frame, "errorEntry", description.String(), true);
}
@@ -304,9 +304,9 @@ BootManagerController::_CreateSaveMBRPage(BRect frame)
BString disk;
fSettings.FindString("disk", &disk);
description <<
B_TRANSLATE_COMMENT("Backup Master Boot Record", "Title") << "\n\n" <<
B_TRANSLATE("The Master Boot Record (MBR) of the boot device:\n"
description << B_TRANSLATE_COMMENT("Backup Master Boot Record", "Title")
<< "\n\n" << B_TRANSLATE("The Master Boot Record (MBR) of the boot "
"device:\n"
"\t%s\n"
"will now be saved to disk. Please select a file to "
"save the MBR into.\n\n"
@@ -329,17 +329,15 @@ BootManagerController::_CreateMBRSavedPage(BRect frame)
fSettings.FindString("file", &file);
if (fSaveMBRStatus == B_OK) {
description <<
B_TRANSLATE_COMMENT("Old Master Boot Record saved", "Title") <<
"\n\n" <<
B_TRANSLATE("The old Master Boot Record was successfully saved to "
"%s.") << "\n";
description << B_TRANSLATE_COMMENT("Old Master Boot Record saved",
"Title") << "\n\n"
<< B_TRANSLATE("The old Master Boot Record was successfully "
"saved to %s.") << "\n";
} else {
description <<
B_TRANSLATE_COMMENT("Old Master Boot Record Saved failure", "Title") <<
"\n\n" <<
B_TRANSLATE("The old Master Boot Record could not be saved to %s") <<
"\n";
description << B_TRANSLATE_COMMENT("Old Master Boot Record Saved "
"failure", "Title") << "\n\n"
<< B_TRANSLATE("The old Master Boot Record could not be saved "
"to %s") << "\n";
}
description.ReplaceFirst("%s", file);
@@ -354,16 +352,15 @@ BootManagerController::_CreateInstallSummaryPage(BRect frame)
BString disk;
fSettings.FindString("disk", &disk);
description <<
B_TRANSLATE_COMMENT("Summary", "Title") << "\n\n" <<
B_TRANSLATE("About to write the following boot menu to the boot disk "
"(%s). Please verify the information below before continuing.") <<
"\n\n";
description << B_TRANSLATE_COMMENT("Summary", "Title") << "\n\n"
<< B_TRANSLATE("About to write the following boot menu to the boot "
"disk (%s). Please verify the information below before continuing.")
<< "\n\n";
description.ReplaceFirst("%s", disk);
BMessage message;
for (int32 i = 0; fSettings.FindMessage("partition", i, &message) == B_OK; i ++) {
for (int32 i = 0; fSettings.FindMessage("partition", i, &message) == B_OK;
i++) {
bool show;
if (message.FindBool("show", &show) != B_OK || !show)
continue;
@@ -390,14 +387,14 @@ BootManagerController::_CreateInstalledPage(BRect frame)
BString description;
if (fWriteBootMenuStatus == B_OK) {
description <<
B_TRANSLATE_COMMENT("Installation of boot menu completed", "Title") << "\n\n" <<
B_TRANSLATE("The boot manager has been successfully installed "
description << B_TRANSLATE_COMMENT("Installation of boot menu "
"completed", "Title") << "\n\n"
<< B_TRANSLATE("The boot manager has been successfully installed "
"on your system.");
} else {
description <<
B_TRANSLATE_COMMENT("Installation of boot menu failed", "Title") << "\n\n" <<
B_TRANSLATE("An error occurred writing the boot menu. "
description << B_TRANSLATE_COMMENT("Installation of boot menu failed",
"Title") << "\n\n"
<< B_TRANSLATE("An error occurred writing the boot menu. "
"The Master Boot Record might be destroyed, "
"you should restore the MBR now!");
}
@@ -410,11 +407,10 @@ WizardPageView*
BootManagerController::_CreateUninstallPage(BRect frame)
{
BString description;
description <<
B_TRANSLATE_COMMENT("Uninstall boot manager", "Title") << "\n\n" <<
B_TRANSLATE("Please locate the Master Boot Record (MBR) save file to "
"restore from. This is the file that was created when the "
description << B_TRANSLATE_COMMENT("Uninstall boot manager", "Title")
<< "\n\n"
<< B_TRANSLATE("Please locate the Master Boot Record (MBR) save file "
"to restore from. This is the file that was created when the "
"boot manager was first installed.");
return new FileSelectionPage(&fSettings, frame, "restoreMBR",
@@ -432,17 +428,16 @@ BootManagerController::_CreateUninstalledPage(BRect frame)
fSettings.FindString("file", &file);
if (fRestoreMBRStatus == B_OK) {
description <<
B_TRANSLATE_COMMENT("Uninstallation of boot menu completed", "Title") <<
"\n\n" <<
B_TRANSLATE("The Master Boot Record of the boot device "
"(%s) has been successfully restored from %s.");
description.ReplaceFirst("%s", disk);
description.ReplaceLast("%s", file);
description << B_TRANSLATE_COMMENT("Uninstallation of boot menu "
"completed", "Title") << "\n\n"
<< B_TRANSLATE("The Master Boot Record of the boot device "
"(%DISK) has been successfully restored from %FILE.");
description.ReplaceFirst("%DISK", disk);
description.ReplaceFirst("%FILE", file);
} else {
description <<
B_TRANSLATE_COMMENT("Uninstallation of boot menu failed", "Title") << "\n\n" <<
B_TRANSLATE("The Master Boot Record could not be restored!");
description << B_TRANSLATE_COMMENT("Uninstallation of boot menu "
"failed", "Title") << "\n\n"
<< B_TRANSLATE("The Master Boot Record could not be restored!");
}
return new DescriptionPage(frame, "summary", description.String(), true);
+6 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2008, Haiku, Inc. All rights reserved.
* Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -8,18 +8,20 @@
#ifndef BOOT_MANAGER_CONTROLLER_H
#define BOOT_MANAGER_CONTROLLER_H
#include "WizardController.h"
#include <Message.h>
class BootDrive;
class WizardView;
class WizardPageView;
class BRect;
/*
Remainder of Settings Message Format:
/* Remainder of Settings Message Format:
(See also BootDrive.h)
"install" bool (whether install or uninstall should be performed)
"file" String (the file where the backup of the MBR is saved)
@@ -27,8 +29,7 @@ class BRect;
"timeout" int32 (timeout in seconds, -1 for no timeout)
*/
class BootManagerController : public WizardController
{
class BootManagerController : public WizardController {
public:
BootManagerController();
virtual ~BootManagerController();
@@ -39,7 +40,6 @@ protected:
virtual WizardPageView* CreatePage(int32 state, WizardView* wizard);
private:
enum State {
kStateEntry,
kStateErrorEntry,
+5 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2008, Haiku, Inc. All rights reserved.
* Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -13,10 +13,11 @@
#include "BootManagerController.h"
class WizardView;
class BootManagerWindow : public BWindow
{
class BootManagerWindow : public BWindow {
public:
BootManagerWindow();
virtual ~BootManagerWindow();
@@ -25,9 +26,9 @@ public:
virtual bool QuitRequested();
private:
BootManagerController fController;
WizardView* fWizardView;
};
#endif // BOOT_MANAGER_WINDOW_H