[haiku-commits] r40111 - haiku/trunk/src/apps/bootman

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 4 Jan 2011 19:00:43 +0100 (CET)

Author: axeld
Date: 2011-01-04 19:00:43 +0100 (Tue, 04 Jan 2011)
New Revision: 40111
Changeset: http://dev.haiku-os.org/changeset/40111

Modified:
   haiku/trunk/src/apps/bootman/BootManager.cpp
   haiku/trunk/src/apps/bootman/BootManagerController.cpp
   haiku/trunk/src/apps/bootman/BootManagerController.h
   haiku/trunk/src/apps/bootman/BootManagerWindow.cpp
   haiku/trunk/src/apps/bootman/BootManagerWindow.h
Log:
* Changed some kind of broken translation strings (like replacements with a
  fixed order).
* Style cleanup.


Modified: haiku/trunk/src/apps/bootman/BootManager.cpp
===================================================================
--- haiku/trunk/src/apps/bootman/BootManager.cpp        2011-01-04 17:53:55 UTC 
(rev 40110)
+++ haiku/trunk/src/apps/bootman/BootManager.cpp        2011-01-04 18:00:43 UTC 
(rev 40111)
@@ -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 <axeld@xxxxxxxxxxxxxxxx>
  */
 
+
 #include "BootManagerWindow.h"
 
 #include <Alert.h>
@@ -20,21 +21,21 @@
 #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 {
 public:
-       BootManager();
+                                                               BootManager();
 
-       virtual void ReadyToRun();
-
-       virtual void AboutRequested();
+       virtual void                            ReadyToRun();
+       virtual void                            AboutRequested();
 };
 
 
 BootManager::BootManager()
-       : BApplication(kSignature)
+       :
+       BApplication(kSignature)
 {
 }
 
@@ -42,7 +43,7 @@
 void
 BootManager::ReadyToRun()
 {
-       BootManagerWindow * window = new BootManagerWindow();
+       BootManagerWindow* window = new BootManagerWindow();
        window->Show();
 }
 
@@ -51,16 +52,15 @@
 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"
-               "\tDavid Dengg\n"
-               "\tMichael Pfeiffer\n"
-               "\n" <<
-               B_TRANSLATE_COMMENT("Copyright %year, Haiku Inc.\n",
-               "Leave %year untranslated");
+       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",
+                       "Leave %year untranslated");
        aboutText.ReplaceLast("%year", "2008-2010");
        BAlert *alert = new BAlert("about",
                aboutText.String(), B_TRANSLATE("OK"));

Modified: haiku/trunk/src/apps/bootman/BootManagerController.cpp
===================================================================
--- haiku/trunk/src/apps/bootman/BootManagerController.cpp      2011-01-04 
17:53:55 UTC (rev 40110)
+++ haiku/trunk/src/apps/bootman/BootManagerController.cpp      2011-01-04 
18:00:43 UTC (rev 40111)
@@ -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,33 +9,31 @@
 
 #include "BootManagerController.h"
 
-#include "WizardView.h"
+#include <Alert.h>
+#include <Application.h>
+#include <Catalog.h>
+#include <File.h>
+#include <FindDirectory.h>
+#include <Locale.h>
+#include <Path.h>
+#include <String.h>
 
-#include "EntryPage.h"
-#include "PartitionsPage.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"
+#      include "TestBootDrive.h"
 #endif
 
 
-#include <Alert.h>
-#include <Application.h>
-#include <Catalog.h>
-#include <File.h>
-#include <FindDirectory.h>
-#include <Locale.h>
-#include <Path.h>
-#include <String.h>
-
-
 #undef B_TRANSLATE_CONTEXT
 #define B_TRANSLATE_CONTEXT "BootManagerController"
 
@@ -90,19 +88,19 @@
 {
        switch (state) {
                case kStateEntry:
-                       {
-                               bool install;
-                               fSettings.FindBool("install", &install);
-                               if (install) {
-                                       if 
(fBootDrive->IsBootMenuInstalled(&fSettings))
-                                               return kStatePartitions;
-                                       else
-                                               return kStateSaveMBR;
-                               }
-                               else
-                                       return kStateUninstall;
+               {
+                       bool install;
+                       fSettings.FindBool("install", &install);
+                       if (install) {
+                               if (fBootDrive->IsBootMenuInstalled(&fSettings))
+                                       return kStatePartitions;
+
+                               return kStateSaveMBR;
                        }
 
+                       return kStateUninstall;
+               }
+
                case kStateErrorEntry:
                        be_app->PostMessage(B_QUIT_REQUESTED);
                        break;
@@ -150,7 +148,8 @@
 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;
@@ -168,16 +167,17 @@
 bool
 BootManagerController::_WriteBootMenu()
 {
-               BAlert* alert = new BAlert("confirm", B_TRANSLATE("About to 
write the "
+       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("Write boot menu", "Button"),
+               B_TRANSLATE_COMMENT("Back", "Button"), NULL, B_WIDTH_AS_USUAL,
+               B_WARNING_ALERT);
 
-               if (alert->Go() == 1)
-                       return false;
+       if (alert->Go() == 1)
+               return false;
 
-               fWriteBootMenuStatus = fBootDrive->WriteBootMenu(&fSettings);
-               return true;
+       fWriteBootMenuStatus = fBootDrive->WriteBootMenu(&fSettings);
+       return true;
 }
 
 
@@ -279,19 +279,19 @@
 {
        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 "
-                       "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!");
+       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!");
+       }
 
        return new DescriptionPage(frame, "errorEntry", description.String(), 
true);
 }
@@ -304,15 +304,15 @@
        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"
-               "\t%s\n"
-               "will now be saved to disk. Please select a file to "
-               "save the MBR into.\n\n"
-               "If something goes wrong with the installation or if "
-               "you later wish to remove the boot menu, simply run the "
-               "bootman program and choose the 'Uninstall' option.");
+       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"
+                       "If something goes wrong with the installation or if "
+                       "you later wish to remove the boot menu, simply run the 
"
+                       "bootman program and choose the 'Uninstall' option.");
        description.ReplaceFirst("%s", disk);
 
        return new FileSelectionPage(&fSettings, frame, "saveMBR",
@@ -329,17 +329,15 @@
        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 @@
        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 @@
        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 @@
 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 @@
        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);

Modified: haiku/trunk/src/apps/bootman/BootManagerController.h
===================================================================
--- haiku/trunk/src/apps/bootman/BootManagerController.h        2011-01-04 
17:53:55 UTC (rev 40110)
+++ haiku/trunk/src/apps/bootman/BootManagerController.h        2011-01-04 
18:00:43 UTC (rev 40111)
@@ -1,49 +1,49 @@
 /*
- * Copyright 2008, Haiku, Inc. All rights reserved.
+ * Copyright 2008-2010, Haiku, Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
- * 
+ *
  * Authors:
  *             Michael Pfeiffer <laplace@xxxxxxxxxxxxxxxxxxxxx>
  */
 #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:
-   (See also BootDrive.h)
+
+/*     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)
        "defaultPartition" int32 (index of default partition)
        "timeout" int32 (timeout in seconds, -1 for no timeout)
- */
+*/
 
-class BootManagerController : public WizardController
-{
+class BootManagerController : public WizardController {
 public:
-       BootManagerController();
-       virtual ~BootManagerController();
+                                                               
BootManagerController();
+       virtual                                         
~BootManagerController();
 
 protected:
-       virtual int32 InitialState();
-       virtual int32 NextState(int32 state);
-       virtual WizardPageView* CreatePage(int32 state, WizardView* wizard);
+       virtual int32                           InitialState();
+       virtual int32                           NextState(int32 state);
+       virtual WizardPageView*         CreatePage(int32 state, WizardView* 
wizard);
 
 private:
-
        enum State {
                kStateEntry,
                kStateErrorEntry,
-               
+
                // Install states
                kStateSaveMBR,
                kStateMBRSaved,
@@ -51,32 +51,32 @@
                kStateDefaultPartitions,
                kStateInstallSummary,
                kStateInstalled,
-               
+
                // Uninstall states
                kStateUninstall,
                kStateUninstalled
        };
-       
-       bool _HasSelectedPartitions();  
-       bool _WriteBootMenu();
-       bool _SaveMBR();
-       bool _RestoreMBR();
-       
-       WizardPageView* _CreateErrorEntryPage(BRect frame);
-       WizardPageView* _CreateSaveMBRPage(BRect frame);
-       WizardPageView* _CreateMBRSavedPage(BRect frame);
-       WizardPageView* _CreateInstallSummaryPage(BRect frame);
-       WizardPageView* _CreateInstalledPage(BRect frame);
-       WizardPageView* _CreateUninstallPage(BRect frame);
-       WizardPageView* _CreateUninstalledPage(BRect frame);
-       
-       BMessage fSettings;
-       BootDrive* fBootDrive;
-       
-       status_t fReadPartitionsStatus;
-       status_t fWriteBootMenuStatus;
-       status_t fSaveMBRStatus;
-       status_t fRestoreMBRStatus;
+
+                       bool                            
_HasSelectedPartitions();
+                       bool                            _WriteBootMenu();
+                       bool                            _SaveMBR();
+                       bool                            _RestoreMBR();
+
+                       WizardPageView*         _CreateErrorEntryPage(BRect 
frame);
+                       WizardPageView*         _CreateSaveMBRPage(BRect frame);
+                       WizardPageView*         _CreateMBRSavedPage(BRect 
frame);
+                       WizardPageView*         _CreateInstallSummaryPage(BRect 
frame);
+                       WizardPageView*         _CreateInstalledPage(BRect 
frame);
+                       WizardPageView*         _CreateUninstallPage(BRect 
frame);
+                       WizardPageView*         _CreateUninstalledPage(BRect 
frame);
+
+                       BMessage                        fSettings;
+                       BootDrive*                      fBootDrive;
+
+                       status_t                        fReadPartitionsStatus;
+                       status_t                        fWriteBootMenuStatus;
+                       status_t                        fSaveMBRStatus;
+                       status_t                        fRestoreMBRStatus;
 };
 
 

Modified: haiku/trunk/src/apps/bootman/BootManagerWindow.cpp
===================================================================
--- haiku/trunk/src/apps/bootman/BootManagerWindow.cpp  2011-01-04 17:53:55 UTC 
(rev 40110)
+++ haiku/trunk/src/apps/bootman/BootManagerWindow.cpp  2011-01-04 18:00:43 UTC 
(rev 40111)
@@ -33,7 +33,7 @@
 
 BootManagerWindow::BootManagerWindow()
        :
-       BWindow(BRect(100, 100, 500, 400), B_TRANSLATE_COMMENT("Boot Manager",
+       BWindow(BRect(100, 100, 500, 400), B_TRANSLATE_COMMENT("BootManager",
                "Window Title"),
                B_TITLED_WINDOW,
                B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE)

Modified: haiku/trunk/src/apps/bootman/BootManagerWindow.h
===================================================================
--- haiku/trunk/src/apps/bootman/BootManagerWindow.h    2011-01-04 17:53:55 UTC 
(rev 40110)
+++ haiku/trunk/src/apps/bootman/BootManagerWindow.h    2011-01-04 18:00:43 UTC 
(rev 40111)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2008, Haiku, Inc. All rights reserved.
+ * Copyright 2008-2010, Haiku, Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
- * 
+ *
  * Authors:
  *             Michael Pfeiffer <laplace@xxxxxxxxxxxxxxxxxxxxx>
  */
@@ -13,21 +13,22 @@
 
 #include "BootManagerController.h"
 
+
 class WizardView;
 
-class BootManagerWindow : public BWindow
-{
+
+class BootManagerWindow : public BWindow {
 public:
-       BootManagerWindow();
-       virtual ~BootManagerWindow();
+                                                               
BootManagerWindow();
+       virtual                                         ~BootManagerWindow();
 
-       virtual void MessageReceived(BMessage* message);
-       virtual bool QuitRequested();
-       
+       virtual void                            MessageReceived(BMessage* 
message);
+       virtual bool                            QuitRequested();
+
 private:
-
-       BootManagerController fController;      
-       WizardView* fWizardView;
+                       BootManagerController fController;
+                       WizardView*                     fWizardView;
 };
 
+
 #endif // BOOT_MANAGER_WINDOW_H


Other related posts:

  • » [haiku-commits] r40111 - haiku/trunk/src/apps/bootman - axeld