* Applied localization to the Installer.

* Some coding style fixes along the way.
 * Added German translation.

NOTE: The Installer will have to offer a way to change the current locale! So
any translations which are done at this point will have to receive one more
update after I added this feature.

NOTE2: There is something wrong with generating catalogs and the update-all
jam target. If you don't do a clean build, the build won't run through, but it
is enough to build for example an image and then run update-all on your actual
partition profile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35209 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-01-20 20:06:30 +00:00
parent 33e5fc1cb2
commit 4a2da42550
8 changed files with 342 additions and 203 deletions

View File

@ -0,0 +1,71 @@
1 de x-vnd.Haiku-Installer 3475867404
%3.1f MB PackagesView %3.1f MB
Installer\n\twritten by Jérôme Duval and Stephan Aßmus\n\tCopyright 2005-2010, Haiku.\n\n InstallerApp Installer\n\tgeschrieben von Jérôme Duval und Stephan Aßmus\n\tCopyright 2005-2001, Haiku.\n\n
Installation completed. Boot sector has been written to '%s'. Press Quit to leave the Installer or choose a new target volume to perform another installation. InstallerWindow Installation completed. Boot sector has been written to '%s'. Press Quit to leave the Installer or choose a new target volume to perform another installation.
Quit InstallerApp Beenden
Stop InstallerWindow In alert after pressing Stop Stop
Installation completed. Boot sector has been written to '%s'. Press Quit to restart the computer or choose a new target volume to perform another installation. InstallerWindow Installation completed. Boot sector has been written to '%s'. Press Quit to restart the computer or choose a new target volume to perform another installation.
Install progress: InstallerWindow Installationsfortschritt:
Starting Installation. InstallProgress Installation wird begonnen.
Are you sure you want to install onto the current boot disk? The Installer will have to reboot your machine if you proceed. InstallProgress Sind Sie sicher, dass Sie auf das aktuelle Startvolumen installieren wollen? Der Installer muss Ihr System neustarten, wenn Sie fortfahren.
Stop InstallerWindow Stop
OK InstallerApp OK
Choose the source and destination disk from the pop-up menus. Then click \"Begin\". InstallerWindow Wählen Sie die Quell- und Zielvolumen aus den Popupmenüs. Klicken Sie dann auf \"Start\".
Install from: InstallerWindow Quelle:
%1ld of %2ld InstallerWindow number of files copied %1ld von %2ld
Installer InstallerWindow Installer
Continue InstallerWindow In alert after pressing Stop Weiter
Write boot sector to '%s' InstallerWindow Bootsektor auf '%s' schreiben
Collecting copy information. InstallProgress Kopierinformationen werden gesammelt.
Choose the source disk from the pop-up menu. Then click \"Begin\". InstallerWindow Wählen Sie das Quellvolumen aus dem Popupmenü. Klicken Sie dann auf \"Start\".
%3.1f KB PackagesView %3.1f KB
Quit InstallerWindow Beenden
Boot sector successfully written. InstallProgress Bootsektor erfolgreich geschrieben.
Performing installation. InstallProgress Installation wird durchgeführt.
scanning… InstallerWindow scanning…
Boot sector not written because of an internal error. InstallProgress Bootsektor wegen eines internen Fehlers nicht geschrieben.
Finishing Installation. InstallProgress Installation wird abgeschlossen.
README InstallerApp LIESMICH
The destination disk may not have enough space. Try choosing a different disk or choose to not install optional items. InstallProgress Auf dem Zielvolumen gibt es eventuell nicht genug Platz. Wählen Sie ein anderes Volumen oder nehmen Sie optionale Pakete aus der Installation.
%Ld B PackagesView %Ld B
Scanning for disks… InstallerWindow Volumen werden gesucht…
The disk can't be mounted. Please choose a different disk. InstallProgress Das Volumen kann nicht eingebunden werden. Bitte wählen Sie ein anderes aus.
?? of ?? InstallerWindow Unknown progress ?? von ??
Launch the DriveSetup utility to partition\navailable hard drives and other media.\nPartitions can be initialized with the\nBe File System needed for a Haiku boot\npartition. InstallerWindow Starten Sie das DriveSetup Werkzeug um\nverfügbare Festplatten und andere Medien\nzu partitionieren. Partitionen können mit\ndem Be File System eingerichtet werden,\nwelches für ein Haiku Bootvolumen\nerforderlich ist.
Show optional packages InstallerWindow Optionale Pakete anzeigen
No partitions have been found that are suitable for installation. Please set up partitions and initialize at least one partition with the Be File System. InstallerWindow Es wurden keine Volumen gefunden, die für eine Installation geeignet sind. Bitte richten Sie Partitionen ein und initialisieren Sie mindestens eine mit dem Be File System.
Choose the disk you want to install onto from the pop-up menu. Then click \"Begin\". InstallerWindow Wählen Sie das Zielvolumen aus dem Popupmenü. Klicken Sie dann auf \"Start\".
%.1f TB PackagesView %.1f TB
Unknown Type InstallProgress Partition content type Unbekannter Typ
<none> InstallerWindow No partition available <nicht verfügbar>
Installation canceled. InstallProgress Installation abgebrochen.
You can't install the contents of a disk onto itself. Please choose a different disk. InstallProgress Sie können nicht den Inhalt eines Volumens in sich selbst installieren. Bitte wählen Sie ein anderes Volumen.
??? InstallerWindow Unknown currently copied item ???
Hide optional packages InstallerWindow Optionale Pakete ausblenden
Please close the DriveSetup window before closing the Installer window. InstallerWindow Bitte schließen Sie das DriveSetup Fenster bevor Sie das Installer Fenster schließen.
OK InstallerWindow OK
Set up partitions… InstallerWindow Partitionen einrichten…
The partition can't be mounted. Please choose a different partition. InstallProgress Das Volumen kann nicht eingebunden werden. Bitte wählen Sie ein anderes.
The mount point could not be retrieve. InstallProgress Der Einhängepunkt konnte nicht ermittelt werden.
Install anyway InstallProgress Trotzdem installieren
An error was encountered and the installation was not completed:\n\nError: %s InstallerWindow Es ist ein Fehler aufgetreten und die Installation wurde nicht fertiggestellt:\n\nFehler: %s
Press the Begin button to install from '%1s' onto '%2s'. InstallerWindow Klicken Sie den Startknopf um von '%1s' auf '%2s' zu installieren.
Running DriveSetup…\n\nClose DriveSetup to continue with the installation. InstallerWindow DriveSetup wird ausgeführt…\n\nSchließen Sie DriveSetup um mit der Installation fortzufahren.
OK InstallProgress OK
Please choose target InstallerWindow Bitte Ziel auswählen
??? InstallerWindow Unknown partition name ???
Begin InstallerWindow Start
Welcome to the Haiku Installer!\n\nIMPORTANT INFORMATION BEFORE INSTALLING HAIKU\n\nThis is alpha-quality software! It means there is a high risk of losing important data. Make frequent backups! You have been warned.\n\n1) If you are installing Haiku onto real hardware (not inside an emulator) it is recommended that you have already prepared a hard disk partition. The Installer and the DriveSetup tool offer to initialize existing partitions with the Haiku native file system, but the options to change the actual partition layout may not have been tested on a sufficiently great variety of computer installations so we do not recommend using it.\nIf you have not created a partition yet, simply reboot, create the partition using whatever tool you feel most comfortable with, and reboot into Haiku to continue with the installation. You could for example use the GParted Live-CD, it can also resize existing partitions to make room.\n\n2) The Installer will take no steps to integrate Haiku into an existing boot menu. The Haiku partition itself will be made bootable. If you have GRUB already installed, edit your /boot/grub/menu.lst by launching your favorite editor from a Terminal like this:\n\n\tsudo <your favorite text editor> /boot/grub/menu.lst\n\nYou'll note that GRUB uses a different naming strategy for hard drives than Linux.\n\nWith GRUB it's: (hdN,n)\n\nAll harddisks start with \"hd\"\n\"N\" is the hard disk number, starting with \"0\".\n\"n\" is the partition number, also starting with \"0\".\nThe first logical partition always has the number 4, regardless of the number of primary partitions.\n\nSo behind the other menu entries towards the bottom of the file, add something similar to these lines:\n\n\t# Haiku on /dev/sda7\n\ttitle\t\t\t\tHaiku\n\trootnoverify\t\t(hd0,6)\n\tchainloader\t\t+1\n\nYou can see the correct partition in GParted for example.\n\n3) When you successfully boot into Haiku for the first time, make sure to read our \"Welcome\" documentation, there is a link on the Desktop.\n\nHave fun and thanks a lot for trying out Haiku! We hope you like it! InstallerApp Willkommen zur Haiku Installation!\n\nWICHTIGE INFORMATIONEN VOR DER HAIKU INSTALLATION\n\nEs handelt sich um Software mit "Alphaqualität"! Demnach gibt es ein hohes Risiko, wichtige Daten zu verlieren. Erstellen Sie also regelmäßig Sicherungskopien! Sie wurden gewarnt.\n\n1) Wenn Sie Haiku auf echter Hardware installieren (nicht in einem Emulator), wird empfohlen, dass Sie vorher bereits eine Festplattenpartition eingerichtet haben. Der Installer und das DriveSetup Werkzeug erlauben das Initialisieren von bestehenden Partitionen mit dem Haiku Dateisystem, aber die Möglichkeiten, die Partitionsaufteilung der Festplatte zu ändern, wurden nicht auf einer hinreichend großen Anzahl von Computersystemen getestet, weshalb wir ihre Nutzung nicht empfehlen.\nFalls Sie noch keine Partition angelegt haben, starten Sie einfach neu, legen Sie die Partition mit einem Werkzeug Ihres Vertrauens an und starten Sie erneut die Haiku-Installation. Sie könnten beispielsweise die GParted-LiveCD verwenden, diese kann auch bestehende Partitionen ohne Datenverlust verkleinern, um Platz zu schaffen.\n\n2) Der Installer wird keine Schritte unternehmen, um Haiku in ein bestehendes Bootmenü zu integrieren. Die Haiku-Partition selbst wird bootfähig gemacht. Falls Sie GRUB als Bootmenü installiert haben, müssen Sie die Datei /boot/grub/menu.lst bearbeiten, indem Sie Ihren Lieblingstexteditor folgendermaßen in einem Terminal starten:\n\n\tsudo <Lieblingstexteditor> /boot/grub/menu.lst\n\nSie werden feststellen, dass GRUB ein etwas anderes Namensschema für Festplatten verwendet als Linux.\n\nIn GRUB lautet es: (hdN,n)\n\nAlle Festplatten beginnen mit \"hd\"\n\"N\" bezeichnet die Festplattennummer, angefangen bei \"0\".\n\"n\" ist die Partitionsnummer, auch mit \"0\" beginnend.\nDie erste logische Partition hat immer die Nummer 4, unabhängig von der Anzahl der primären Partitionen.\n\nDemnach müssen Sie hinter allen anderen Einträgen am Ende der Datei etwas wie die folgenden Zeilen einfügen:\n\n\t# Haiku auf /dev/sda7\n\ttitle\t\t\t\tHaiku\n\trootnoverify\t\t(hd0,6)\n\tchainloader\t\t+1\n\nDie richtige Partition sollte auch beispielsweise in GParted erkennbar sein.\n\n3) Wenn Sie Haiku das erste Mal erfolgreich gestartet haben, sollten Sie die Willkommensdokumentation lesen, eine Verküpfung wurde auf dem Desktop angelegt.\n\nViel Spaß und vielen Dank, dass Sie Haiku ausprobieren! Wir hoffen, dass es Ihnen gefällt!
Write boot sector InstallerWindow Bootsektor schreiben
DriveSetup, the application to configure disk partitions, could not be launched. InstallerWindow DriveSetup, das Werkzeug zum Einrichten von Partitionen, konnte nicht gestartet werden.
%3.1f GB PackagesView %3.1f GB
No optional packages available. PackagesView Keine optionalen Pakete verfügbar.
Additional disk space required: 0.0 KB InstallerWindow Zusätzlich benötigter Platz: 0,0 KB
Continue InstallerApp Weiter
Additional disk space required: %s InstallerWindow Zusätzlich benötigter Platz: %s
Cancel InstallProgress Abbrechen
Try installing anyway InstallProgress Trotzdem installieren
Are you sure you want to to stop the installation? InstallerWindow Möchten Sie die Installation wirklich abbrechen?
Writes the Haiku boot code to the partition start\nsector. This step is automatically performed by\nthe installation, but you can manually make a\npartition bootable in case you do not need to\nperform an installation. InstallerWindow Schreibt den Haiku Bootcode in den Startsektor\nder Zielpartition. Dieser Schritt wird bei einer\nInstallation automatisch ausgeführt, aber Sie\nkönnen ihn manuell auslösen, falls Sie bereits\nwissen, dass Sie keine Installation durchführen\nmüssen.
Onto: InstallerWindow Ziel:
The target volume is not empty. Are you sure you want to install anyway?\n\nNote: The 'system' folder will be a clean copy from the source volume, all other folders will be merged, whereas files and links that exist on both the source and target volume will be overwritten with the source volume version. InstallProgress Das Zielvolumen ist nicht leer. Sind Sie sicher, dass Sie mit der Installation fortfahren möchten?\n\nHinweis: Der Ordner 'system' würde eine saubere Kopie aus dem Quellvolumen, alle anderen Ordner werden zusammengefügt, wobei Dateien und Verknüpfungen, die es sowohl auf dem Ziel- als auch auf dem Quellvolumen gibt, mit der Version des Quellvolumens überschrieben werden.

View File

@ -9,6 +9,7 @@
#include <Alert.h>
#include <Button.h>
#include <GroupLayoutBuilder.h>
#include <Locale.h>
#include <Screen.h>
#include <ScrollView.h>
#include <TextView.h>
@ -41,58 +42,8 @@ static const uint32 kMsgAgree = 'agre';
//"IN THE SOFTWARE.";
static const char* kInfoText =
"Welcome to the Haiku Installer!\n\n"
"IMPORTANT INFORMATION BEFORE INSTALLING HAIKU\n\n"
"This is alpha-quality software! It means there is a high risk of losing "
"important data. Make frequent backups! You have been warned.\n\n"
"1) If you are installing Haiku onto real hardware (not inside an emulator) "
"it is recommended that you have already prepared a hard disk partition. The "
"Installer and the DriveSetup tool offer to initialize existing partitions "
"with the Haiku native file system, but the options to change the actual "
"partition layout may not have been tested on a sufficiently great variety of "
"computer installations so we do not recommend using it.\n"
"If you have not created a partition yet, simply reboot, create the partition "
"using whatever tool you feel most comfortable with, and reboot into Haiku to "
"continue with the installation. You could for example use the GParted "
"Live-CD, it can also resize existing partitions to make room.\n\n"
"2) The Installer will take no steps to integrate Haiku into an existing boot "
"menu. The Haiku partition itself will be made bootable. If you have GRUB "
"already installed, edit your /boot/grub/menu.lst by launching your favorite "
"editor from a Terminal like this:\n\n"
"\tsudo <your favorite text editor> /boot/grub/menu.lst\n\n"
"You'll note that GRUB uses a different naming strategy for hard drives than "
"Linux.\n\n"
"With GRUB it's: (hdN,n)\n\n"
"All harddisks start with \"hd\"\n"
"\"N\" is the hard disk number, starting with \"0\".\n"
"\"n\" is the partition number, also starting with \"0\".\n"
"The first logical partition always has the number 4, regardless of the "
"number of primary partitions.\n\n"
"So behind the other menu entries towards the bottom of the file, add "
"something similar to these lines:\n\n"
"\t# Haiku on /dev/sda7\n"
"\ttitle\t\t\t\tHaiku\n"
"\trootnoverify\t\t(hd0,6)\n"
"\tchainloader\t\t+1\n\n"
"You can see the correct partition in GParted for example.\n\n"
"3) When you successfully boot into Haiku for the first time, make sure to read "
"our \"Welcome\" documentation, there is a link on the Desktop.\n\n"
"Have fun and thanks a lot for trying out Haiku! We hope you like it!"
;
#undef TR_CONTEXT
#define TR_CONTEXT "InstallerApp"
int main(int, char **)
@ -104,7 +55,8 @@ int main(int, char **)
InstallerApp::InstallerApp()
: BApplication("application/x-vnd.Haiku-Installer")
:
BApplication("application/x-vnd.Haiku-Installer")
{
}
@ -128,9 +80,9 @@ InstallerApp::MessageReceived(BMessage* message)
void
InstallerApp::AboutRequested()
{
BAlert *alert = new BAlert("about", "Installer\n"
"\twritten by Jérôme Duval\n"
"\tCopyright 2005, Haiku.\n\n", "OK");
BAlert *alert = new BAlert("about", TR("Installer\n"
"\twritten by Jérôme Duval and Stephan Aßmus\n"
"\tCopyright 2005-2010, Haiku.\n\n"), TR("OK"));
BTextView *view = alert->TextView();
BFont font;
@ -148,6 +100,67 @@ InstallerApp::AboutRequested()
void
InstallerApp::ReadyToRun()
{
// Initilialize the Locale Kit
be_locale->GetAppCatalog(&fCatalog);
const char* infoText = TR(
"Welcome to the Haiku Installer!\n\n"
"IMPORTANT INFORMATION BEFORE INSTALLING HAIKU\n\n"
"This is alpha-quality software! It means there is a high risk of "
"losing important data. Make frequent backups! You have been "
"warned.\n\n"
"1) If you are installing Haiku onto real hardware (not inside an "
"emulator) it is recommended that you have already prepared a hard "
"disk partition. The Installer and the DriveSetup tool offer to "
"initialize existing partitions with the Haiku native file system, "
"but the options to change the actual partition layout may not have "
"been tested on a sufficiently great variety of computer "
"installations so we do not recommend using it.\n"
"If you have not created a partition yet, simply reboot, create the "
"partition using whatever tool you feel most comfortable with, and "
"reboot into Haiku to continue with the installation. You could for "
"example use the GParted Live-CD, it can also resize existing "
"partitions to make room.\n\n"
"2) The Installer will take no steps to integrate Haiku into an "
"existing boot menu. The Haiku partition itself will be made "
"bootable. If you have GRUB already installed, edit your "
"/boot/grub/menu.lst by launching your favorite editor from a "
"Terminal like this:\n\n"
"\tsudo <your favorite text editor> /boot/grub/menu.lst\n\n"
"You'll note that GRUB uses a different naming strategy for hard "
"drives than Linux.\n\n"
"With GRUB it's: (hdN,n)\n\n"
"All harddisks start with \"hd\"\n"
"\"N\" is the hard disk number, starting with \"0\".\n"
"\"n\" is the partition number, also starting with \"0\".\n"
"The first logical partition always has the number 4, regardless of "
"the number of primary partitions.\n\n"
"So behind the other menu entries towards the bottom of the file, add "
"something similar to these lines:\n\n"
"\t# Haiku on /dev/sda7\n"
"\ttitle\t\t\t\tHaiku\n"
"\trootnoverify\t\t(hd0,6)\n"
"\tchainloader\t\t+1\n\n"
"You can see the correct partition in GParted for example.\n\n"
"3) When you successfully boot into Haiku for the first time, make "
"sure to read our \"Welcome\" documentation, there is a link on the "
"Desktop.\n\n"
"Have fun and thanks a lot for trying out Haiku! We hope you like it!"
);
#if 1
// Show the EULA first.
BTextView* textView = new BTextView("eula", be_plain_font, NULL,
@ -155,22 +168,22 @@ InstallerApp::ReadyToRun()
textView->SetInsets(10, 10, 10, 10);
textView->MakeEditable(false);
textView->MakeSelectable(false);
textView->SetText(kInfoText);
textView->SetText(infoText);
BScrollView* scrollView = new BScrollView("eulaScroll",
textView, B_WILL_DRAW, false, true);
BButton* cancelButton = new BButton("Quit",
BButton* cancelButton = new BButton(TR("Quit"),
new BMessage(B_QUIT_REQUESTED));
cancelButton->SetTarget(this);
BButton* continueButton = new BButton("Continue",
BButton* continueButton = new BButton(TR("Continue"),
new BMessage(kMsgAgree));
continueButton->SetTarget(this);
continueButton->MakeDefault(true);
BRect eulaFrame = BRect(0, 0, 600, 450);
fEULAWindow = new BWindow(eulaFrame, "README",
fEULAWindow = new BWindow(eulaFrame, TR("README"),
B_MODAL_WINDOW, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
| B_AUTO_UPDATE_SIZE_LIMITS);

View File

@ -6,6 +6,8 @@
#define INSTALLER_APP_H
#include <Application.h>
#include <Catalog.h>
#include "InstallerWindow.h"
@ -19,6 +21,7 @@ public:
private:
BWindow* fEULAWindow;
BCatalog fCatalog;
};
#endif // INSTALLER_APP_H

View File

@ -14,12 +14,14 @@
#include <Autolock.h>
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <ClassInfo.h>
#include <Directory.h>
#include <FindDirectory.h>
#include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <LayoutUtils.h>
#include <Locale.h>
#include <MenuBar.h>
#include <MenuField.h>
#include <Path.h>
@ -43,6 +45,9 @@
#include "WorkerThread.h"
#undef TR_CONTEXT
#define TR_CONTEXT "InstallerWindow"
#define DRIVESETUP_SIG "application/x-vnd.Haiku-DriveSetup"
const uint32 BEGIN_MESSAGE = 'iBGN';
@ -143,8 +148,8 @@ layout_item_for(BView* view)
InstallerWindow::InstallerWindow()
: BWindow(BRect(-2000, -2000, -1800, -1800), "Installer", B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
: BWindow(BRect(-2000, -2000, -1800, -1800), TR("Installer"),
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fEncouragedToSetupPartitions(false),
fDriveSetupLaunched(false),
fInstallStatus(kReadyForInstall),
@ -162,19 +167,20 @@ InstallerWindow::InstallerWindow()
logoView->SetExplicitMaxSize(logoSize);
fStatusView->SetExplicitMinSize(BSize(logoSize.width * 0.66, B_SIZE_UNSET));
fDestMenu = new BPopUpMenu("scanning" B_UTF8_ELLIPSIS, true, false);
fSrcMenu = new BPopUpMenu("scanning" B_UTF8_ELLIPSIS, true, false);
fDestMenu = new BPopUpMenu(TR("scanning" B_UTF8_ELLIPSIS), true, false);
fSrcMenu = new BPopUpMenu(TR("scanning" B_UTF8_ELLIPSIS), true, false);
fSrcMenuField = new BMenuField("srcMenuField", "Install from: ", fSrcMenu,
NULL);
fSrcMenuField = new BMenuField("srcMenuField", TR("Install from:"),
fSrcMenu, NULL);
fSrcMenuField->SetAlignment(B_ALIGN_RIGHT);
fDestMenuField = new BMenuField("destMenuField", "Onto: ", fDestMenu, NULL);
fDestMenuField = new BMenuField("destMenuField", TR("Onto:"), fDestMenu,
NULL);
fDestMenuField->SetAlignment(B_ALIGN_RIGHT);
fPackagesSwitch = new PaneSwitch("options_button");
fPackagesSwitch->SetLabels("Hide optional packages",
"Show optional packages");
fPackagesSwitch->SetLabels(TR("Hide optional packages"),
TR("Show optional packages"));
fPackagesSwitch->SetMessage(new BMessage(SHOW_BOTTOM_MESSAGE));
fPackagesSwitch->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED,
B_SIZE_UNSET));
@ -186,26 +192,26 @@ InstallerWindow::InstallerWindow()
fPackagesView, B_WILL_DRAW, false, true);
const char* requiredDiskSpaceString
= "Additional disk space required: 0.0 KB";
= TR("Additional disk space required: 0.0 KB");
fSizeView = new BStringView("size_view", requiredDiskSpaceString);
fSizeView->SetAlignment(B_ALIGN_RIGHT);
fSizeView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
fSizeView->SetExplicitAlignment(
BAlignment(B_ALIGN_RIGHT, B_ALIGN_MIDDLE));
fProgressBar = new BStatusBar("progress", "Install progress: ");
fProgressBar = new BStatusBar("progress", TR("Install progress: "));
fProgressBar->SetMaxValue(100.0);
fBeginButton = new BButton("begin_button", "Begin",
fBeginButton = new BButton("begin_button", TR("Begin"),
new BMessage(BEGIN_MESSAGE));
fBeginButton->MakeDefault(true);
fBeginButton->SetEnabled(false);
fSetupButton = new BButton("setup_button",
"Set up partitions" B_UTF8_ELLIPSIS, new BMessage(SETUP_MESSAGE));
TR("Set up partitions" B_UTF8_ELLIPSIS), new BMessage(SETUP_MESSAGE));
fMakeBootableButton = new BButton("makebootable_button",
"Write boot sector", new BMessage(MSG_WRITE_BOOT_SECTOR));
TR("Write boot sector"), new BMessage(MSG_WRITE_BOOT_SECTOR));
fMakeBootableButton->SetEnabled(false);
SetLayout(new BGroupLayout(B_HORIZONTAL));
@ -252,17 +258,17 @@ InstallerWindow::InstallerWindow()
// Setup tool tips for the non-obvious features
fSetupButton->SetToolTip(
"Launch the DriveSetup utility to partition\n"
TR("Launch the DriveSetup utility to partition\n"
"available hard drives and other media.\n"
"Partitions can be initialized with the\n"
"Be File System needed for a Haiku boot\n"
"partition.");
"partition."));
fMakeBootableButton->SetToolTip(
"Writes the Haiku boot code to the partition start\n"
TR("Writes the Haiku boot code to the partition start\n"
"sector. This step is automatically performed by\n"
"the installation, but you can manually make a\n"
"partition bootable in case you do not need to\n"
"perform an installation.");
"perform an installation."));
// finish creating window
if (!be_roster->IsRunning(kDeskbarSignature))
@ -302,10 +308,10 @@ InstallerWindow::MessageReceived(BMessage *msg)
status_t error;
if (msg->FindInt32("error", &error) == B_OK) {
char errorMessage[2048];
snprintf(errorMessage, sizeof(errorMessage), "An error was "
snprintf(errorMessage, sizeof(errorMessage), TR("An error was "
"encountered and the installation was not completed:\n\n"
"Error: %s", strerror(error));
(new BAlert("error", errorMessage, "OK"))->Go();
"Error: %s"), strerror(error));
(new BAlert("error", errorMessage, TR("OK")))->Go();
}
_DisableInterface(false);
@ -334,7 +340,7 @@ InstallerWindow::MessageReceived(BMessage *msg)
fWorkerThread->SetSpaceRequired(size);
fInstallStatus = kInstalling;
fWorkerThread->StartInstall();
fBeginButton->SetLabel("Stop");
fBeginButton->SetLabel(TR("Stop"));
_DisableInterface(true);
fProgressBar->SetTo(0.0, NULL, NULL);
@ -375,16 +381,16 @@ InstallerWindow::MessageReceived(BMessage *msg)
char buffer[15];
fPackagesView->GetTotalSizeAsString(buffer);
char string[255];
sprintf(string, "Additional disk space required: %s", buffer);
sprintf(string, TR("Additional disk space required: %s"), buffer);
fSizeView->SetText(string);
break;
}
case ENCOURAGE_DRIVESETUP:
{
(new BAlert("use drive setup", "No partitions have been found that "
"are suitable for installation. Please set up partitions and "
"initialize at least one partition with the Be file system." ,
"OK"))->Go();
(new BAlert("use drive setup", TR("No partitions have been found "
"that are suitable for installation. Please set up partitions "
"and initialize at least one partition with the Be File "
"System."), TR("OK")))->Go();
}
case MSG_STATUS_MESSAGE:
{
@ -395,16 +401,21 @@ InstallerWindow::MessageReceived(BMessage *msg)
float progress;
if (msg->FindFloat("progress", &progress) == B_OK) {
const char* currentItem;
if (msg->FindString("item", &currentItem) != B_OK)
currentItem = "???";
if (msg->FindString("item", &currentItem) != B_OK) {
currentItem = TR_CMT("???",
"Unknown currently copied item");
}
BString trailingLabel;
int32 currentCount;
int32 maximumCount;
if (msg->FindInt32("current", &currentCount) == B_OK
&& msg->FindInt32("maximum", &maximumCount) == B_OK) {
trailingLabel << currentCount << " of " << maximumCount;
char buffer[64];
snprintf(buffer, sizeof(buffer), TR_CMT("%1ld of %2ld",
"number of files copied"), currentCount, maximumCount);
trailingLabel << buffer;
} else {
trailingLabel << "?? of ??";
trailingLabel << TR_CMT("?? of ??", "Unknown progress");
}
fProgressBar->SetTo(progress, currentItem,
trailingLabel.String());
@ -423,22 +434,28 @@ InstallerWindow::MessageReceived(BMessage *msg)
_SetCopyEngineCancelSemaphore(-1);
fBeginButton->SetLabel("Quit");
fBeginButton->SetLabel(TR("Quit"));
PartitionMenuItem* dstItem
= (PartitionMenuItem*)fDestMenu->FindMarked();
const char* quitString;
if (be_roster->IsRunning(kDeskbarSignature))
quitString = "leave the Installer";
else
quitString = "restart the computer";
char status[1024];
snprintf(status, sizeof(status), "Installation completed. "
"Boot sector has been written to '%s'. Press Quit to %s "
"or choose a new target volume to perform another "
"installation.", dstItem ? dstItem->Name() : "???", quitString);
if (be_roster->IsRunning(kDeskbarSignature)) {
snprintf(status, sizeof(status), TR("Installation completed. "
"Boot sector has been written to '%s'. Press Quit to "
"leave the Installer or choose a new target volume to "
"perform another installation."),
dstItem ? dstItem->Name() : TR_CMT("???",
"Unknown partition name"));
} else {
snprintf(status, sizeof(status), TR("Installation completed. "
"Boot sector has been written to '%s'. Press Quit to "
"restart the computer or choose a new target volume "
"to perform another installation."),
dstItem ? dstItem->Name() : TR_CMT("???",
"Unknown partition name"));
}
_SetStatusMessage(status);
fInstallStatus = kFinished;
_DisableInterface(false);
@ -457,9 +474,9 @@ InstallerWindow::MessageReceived(BMessage *msg)
fBeginButton->SetEnabled(!fDriveSetupLaunched);
_DisableInterface(fDriveSetupLaunched);
if (fDriveSetupLaunched)
_SetStatusMessage("Running DriveSetup" B_UTF8_ELLIPSIS
_SetStatusMessage(TR("Running DriveSetup" B_UTF8_ELLIPSIS
"\n\nClose DriveSetup to continue with the "
"installation.");
"installation."));
else
_ScanPartitions();
}
@ -481,8 +498,8 @@ InstallerWindow::QuitRequested()
{
if (fDriveSetupLaunched) {
(new BAlert("driveSetup",
"Please close the DriveSetup window before closing the "
"Installer window.", "OK"))->Go();
TR("Please close the DriveSetup window before closing the "
"Installer window."), TR("OK")))->Go();
return false;
}
_QuitCopyEngine(false);
@ -520,9 +537,9 @@ InstallerWindow::_LaunchDriveSetup()
BEntry entry(path.Path());
entry_ref ref;
if (entry.GetRef(&ref) != B_OK || be_roster->Launch(&ref) != B_OK) {
BAlert* alert = new BAlert("error", "DriveSetup, the application "
"to configure disk partitions, could not be launched.",
"OK");
BAlert* alert = new BAlert("error", TR("DriveSetup, the "
"application to configure disk partitions, could not be "
"launched."), TR("OK"));
alert->Go();
}
}
@ -542,7 +559,7 @@ InstallerWindow::_DisableInterface(bool disable)
void
InstallerWindow::_ScanPartitions()
{
_SetStatusMessage("Scanning for disks" B_UTF8_ELLIPSIS);
_SetStatusMessage(TR("Scanning for disks" B_UTF8_ELLIPSIS));
BMenuItem *item;
while ((item = fSrcMenu->RemoveItem((int32)0)))
@ -568,7 +585,7 @@ InstallerWindow::_UpdateControls()
label = srcItem->MenuLabel();
} else {
if (fSrcMenu->CountItems() == 0)
label = "<none>";
label = TR_CMT("<none>", "No partition available");
else
label = ((PartitionMenuItem*)fSrcMenu->ItemAt(0))->MenuLabel();
}
@ -597,36 +614,40 @@ InstallerWindow::_UpdateControls()
label = dstItem->MenuLabel();
} else {
if (fDestMenu->CountItems() == 0)
label = "<none>";
label = TR_CMT("<none>", "No partition available");
else
label = "Please choose target";
label = TR("Please choose target");
}
fDestMenuField->MenuItem()->SetLabel(label.String());
if (srcItem && dstItem) {
char message[255];
sprintf(message, "Press the Begin button to install from '%s' onto "
"'%s'.", srcItem->Name(), dstItem->Name());
sprintf(message, TR("Press the Begin button to install from '%1s' "
"onto '%2s'."), srcItem->Name(), dstItem->Name());
_SetStatusMessage(message);
} else if (srcItem) {
_SetStatusMessage("Choose the disk you want to install onto from the "
"pop-up menu. Then click \"Begin\".");
_SetStatusMessage(TR("Choose the disk you want to install onto from "
"the pop-up menu. Then click \"Begin\"."));
} else if (dstItem) {
_SetStatusMessage("Choose the source disk from the "
"pop-up menu. Then click \"Begin\".");
_SetStatusMessage(TR("Choose the source disk from the "
"pop-up menu. Then click \"Begin\"."));
} else {
_SetStatusMessage("Choose the source and destination disk from the "
"pop-up menus. Then click \"Begin\".");
_SetStatusMessage(TR("Choose the source and destination disk from the "
"pop-up menus. Then click \"Begin\"."));
}
fInstallStatus = kReadyForInstall;
fBeginButton->SetLabel("Begin");
fBeginButton->SetLabel(TR("Begin"));
fBeginButton->SetEnabled(srcItem && dstItem);
// adjust "Write Boot Sector" button
label = "Write boot sector";
if (dstItem)
label << " to \'" <<dstItem->Name() << '\'';
if (dstItem) {
char buffer[256];
snprintf(buffer, sizeof(buffer), TR("Write boot sector to '%s'"),
dstItem->Name());
label = buffer;
} else
label = TR("Write boot sector");
fMakeBootableButton->SetEnabled(dstItem);
fMakeBootableButton->SetLabel(label.String());
@ -646,7 +667,6 @@ InstallerWindow::_PublishPackages()
if (!item)
return;
#ifdef __HAIKU__
BPath directory;
BDiskDeviceRoster roster;
BDiskDevice device;
@ -659,9 +679,6 @@ InstallerWindow::_PublishPackages()
return;
} else
return; // shouldn't happen
#else
BPath directory = "/BeOS 5 PE Max Edition V3.1 beta";
#endif
directory.Append(PACKAGES_DIRECTORY);
BDirectory dir(directory.Path());
@ -671,10 +688,9 @@ InstallerWindow::_PublishPackages()
BEntry packageEntry;
BList packages;
while (dir.GetNextEntry(&packageEntry) == B_OK) {
Package *package = Package::PackageFromEntry(packageEntry);
if (package) {
Package* package = Package::PackageFromEntry(packageEntry);
if (package != NULL)
packages.AddItem(package);
}
}
packages.SortItems(_ComparePackages);
@ -715,8 +731,9 @@ InstallerWindow::_QuitCopyEngine(bool askUser)
bool quit = true;
if (askUser) {
quit = (new BAlert("cancel",
"Are you sure you want to to stop the installation?",
"Continue", "Stop", 0,
TR("Are you sure you want to to stop the installation?"),
TR_CMT("Continue", "In alert after pressing Stop"),
TR_CMT("Stop", "In alert after pressing Stop"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0;
}
@ -732,18 +749,18 @@ InstallerWindow::_QuitCopyEngine(bool askUser)
int
InstallerWindow::_ComparePackages(const void *firstArg, const void *secondArg)
InstallerWindow::_ComparePackages(const void* firstArg, const void* secondArg)
{
const Group *group1 = *static_cast<const Group * const *>(firstArg);
const Group *group2 = *static_cast<const Group * const *>(secondArg);
const Package *package1 = dynamic_cast<const Package *>(group1);
const Package *package2 = dynamic_cast<const Package *>(group2);
const Group* group1 = *static_cast<const Group* const *>(firstArg);
const Group* group2 = *static_cast<const Group* const *>(secondArg);
const Package* package1 = dynamic_cast<const Package*>(group1);
const Package* package2 = dynamic_cast<const Package*>(group2);
int sameGroup = strcmp(group1->GroupName(), group2->GroupName());
if (sameGroup != 0)
return sameGroup;
if (!package2)
if (package2 == NULL)
return -1;
if (!package1)
if (package1 == NULL)
return 1;
return strcmp(package1->Name(), package2->Name());
}

View File

@ -12,5 +12,19 @@ Application Installer :
ProgressReporter.cpp
UnzipEngine.cpp
WorkerThread.cpp
: be tracker translation libshared.a $(TARGET_LIBSTDC++)
: Installer.rdef ;
: be tracker translation libshared.a $(TARGET_LIBSTDC++) liblocale.so
: Installer.rdef
;
DoCatalogs Installer :
x-vnd.Haiku-Installer
:
InstallerApp.cpp
InstallerWindow.cpp
PackageViews.cpp
ProgressReporter.cpp
WorkerThread.cpp
: en.catalog
: de.catkeys
;

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <Catalog.h>
#include <ControlLook.h>
#include <Directory.h>
#include <Entry.h>
@ -21,40 +22,41 @@
#include "InstallerWindow.h"
#undef TR_CONTEXT
#define TR_CONTEXT "PackagesView"
#define ICON_ATTRIBUTE "INSTALLER PACKAGE: ICON"
void SizeAsString(off_t size, char *string);
void
SizeAsString(off_t size, char *string)
{
double kb = size / 1024.0;
if (kb < 1.0) {
sprintf(string, "%Ld B", size);
sprintf(string, TR("%Ld B"), size);
return;
}
float mb = kb / 1024.0;
if (mb < 1.0) {
sprintf(string, "%3.1f KB", kb);
sprintf(string, TR("%3.1f KB"), kb);
return;
}
float gb = mb / 1024.0;
if (gb < 1.0) {
sprintf(string, "%3.1f MB", mb);
sprintf(string, TR("%3.1f MB"), mb);
return;
}
float tb = gb / 1024.0;
if (tb < 1.0) {
sprintf(string, "%3.1f GB", gb);
sprintf(string, TR("%3.1f GB"), gb);
return;
}
sprintf(string, "%.1f TB", tb);
sprintf(string, TR("%.1f TB"), tb);
}
Package::Package(const char *folder)
: Group(),
:
Group(),
fSize(0),
fIcon(NULL)
{
@ -115,7 +117,8 @@ Package::PackageFromEntry(BEntry &entry)
if (directory.GetAttrInfo(ICON_ATTRIBUTE, &info) == B_OK) {
char buffer[info.size];
BMessage msg;
if ((directory.ReadAttr(ICON_ATTRIBUTE, info.type, 0, buffer, info.size) == info.size)
if ((directory.ReadAttr(ICON_ATTRIBUTE, info.type, 0, buffer,
info.size) == info.size)
&& (msg.Unflatten(buffer) == B_OK)) {
package->SetIcon(new BBitmap(&msg));
}
@ -145,7 +148,8 @@ Group::~Group()
PackageCheckBox::PackageCheckBox(BRect rect, Package *item)
: BCheckBox(rect.OffsetBySelf(7, 0), "pack_cb", item->Name(), NULL),
:
BCheckBox(rect.OffsetBySelf(7, 0), "pack_cb", item->Name(), NULL),
fPackage(item)
{
}
@ -189,7 +193,8 @@ PackageCheckBox::MouseMoved(BPoint point, uint32 transit,
GroupView::GroupView(BRect rect, Group *group)
: BStringView(rect, "group", group->GroupName()),
:
BStringView(rect, "group", group->GroupName()),
fGroup(group)
{
SetFont(be_bold_font);
@ -206,13 +211,15 @@ GroupView::~GroupView()
PackagesView::PackagesView(BRect rect, const char* name)
: BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS)
:
BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS)
{
}
PackagesView::PackagesView(const char* name)
: BView(name, B_WILL_DRAW | B_FRAME_EVENTS)
:
BView(name, B_WILL_DRAW | B_FRAME_EVENTS)
{
}
@ -226,7 +233,7 @@ PackagesView::~PackagesView()
void
PackagesView::Clean()
{
BView *view;
BView* view;
while ((view = ChildAt(0))) {
if (dynamic_cast<GroupView*>(view)
|| dynamic_cast<PackageCheckBox*>(view)) {
@ -239,7 +246,7 @@ PackagesView::Clean()
void
PackagesView::AddPackages(BList &packages, BMessage *msg)
PackagesView::AddPackages(BList& packages, BMessage* msg)
{
int32 count = packages.CountItems();
BRect rect = Bounds();
@ -249,18 +256,18 @@ PackagesView::AddPackages(BList &packages, BMessage *msg)
rect.top = 0;
BString lastGroup = "";
for (int32 i = 0; i < count; i++) {
void *item = packages.ItemAt(i);
Package *package = static_cast<Package *>(item);
void* item = packages.ItemAt(i);
Package* package = static_cast<Package*>(item);
if (lastGroup != BString(package->GroupName())) {
rect.OffsetBy(0, 1);
lastGroup = package->GroupName();
Group *group = new Group();
Group* group = new Group();
group->SetGroupName(package->GroupName());
GroupView *view = new GroupView(rect, group);
AddChild(view);
rect.OffsetBy(0, 17);
}
PackageCheckBox *checkBox = new PackageCheckBox(rect, package);
PackageCheckBox* checkBox = new PackageCheckBox(rect, package);
checkBox->SetValue(package->OnByDefault()
? B_CONTROL_ON : B_CONTROL_OFF);
checkBox->SetEnabled(!package->AlwaysOn());
@ -274,12 +281,12 @@ PackagesView::AddPackages(BList &packages, BMessage *msg)
void
PackagesView::GetTotalSizeAsString(char *string)
PackagesView::GetTotalSizeAsString(char* string)
{
int32 count = CountChildren();
int32 size = 0;
for (int32 i = 0; i < count; i++) {
PackageCheckBox *cb = dynamic_cast<PackageCheckBox*>(ChildAt(i));
PackageCheckBox* cb = dynamic_cast<PackageCheckBox*>(ChildAt(i));
if (cb && cb->Value())
size += cb->GetPackage()->Size();
}
@ -288,12 +295,12 @@ PackagesView::GetTotalSizeAsString(char *string)
void
PackagesView::GetPackagesToInstall(BList *list, int32 *size)
PackagesView::GetPackagesToInstall(BList* list, int32* size)
{
int32 count = CountChildren();
*size = 0;
for (int32 i = 0; i < count; i++) {
PackageCheckBox *cb = dynamic_cast<PackageCheckBox*>(ChildAt(i));
PackageCheckBox* cb = dynamic_cast<PackageCheckBox*>(ChildAt(i));
if (cb && cb->Value()) {
list->AddItem(cb->GetPackage());
*size += cb->GetPackage()->Size();
@ -338,7 +345,7 @@ PackagesView::Draw(BRect updateRect)
if (CountChildren() > 0)
return;
be_control_look->DrawLabel(this, "No optional packages available.",
be_control_look->DrawLabel(this, TR("No optional packages available."),
Bounds(), updateRect, ViewColor(), BControlLook::B_DISABLED,
BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));
}

View File

@ -1,12 +1,18 @@
/*
* Copyright 2009, Stephan Aßmus <superstippi@gmx.de>
* All rights reserved. Distributed under the terms of the MIT License.
* Copyright 2009-2010, Stephan Aßmus <superstippi@gmx.de>
* All rights reserved. Distributed under the terms of the MIT License.
*/
#include "ProgressReporter.h"
#include <stdio.h>
#include <Catalog.h>
#undef TR_CONTEXT
#define TR_CONTEXT "InstallProgress"
ProgressReporter::ProgressReporter(const BMessenger& messenger,
BMessage* message)
@ -42,7 +48,7 @@ ProgressReporter::Reset()
if (fMessage) {
BMessage message(*fMessage);
message.AddString("status", "Collecting copy information.");
message.AddString("status", TR("Collecting copy information."));
fMessenger.SendMessage(&message);
}
}
@ -66,7 +72,7 @@ ProgressReporter::StartTimer()
if (fMessage) {
BMessage message(*fMessage);
message.AddString("status", "Performing installation.");
message.AddString("status", TR("Performing installation."));
fMessenger.SendMessage(&message);
}
}

View File

@ -10,6 +10,7 @@
#include <Alert.h>
#include <Autolock.h>
#include <Catalog.h>
#include <Directory.h>
#include <DiskDeviceVisitor.h>
#include <DiskDeviceTypes.h>
@ -31,6 +32,9 @@
#include "UnzipEngine.h"
#define TR_CONTEXT "InstallProgress"
//#define COPY_TRACE
#ifdef COPY_TRACE
#define CALLED() printf("CALLED %s\n",__PRETTY_FUNCTION__)
@ -76,7 +80,8 @@ private:
WorkerThread::WorkerThread(InstallerWindow *window)
: BLooper("copy_engine"),
:
BLooper("copy_engine"),
fWindow(window),
fPackages(NULL),
fSpaceRequired(0),
@ -100,8 +105,8 @@ WorkerThread::MessageReceived(BMessage* message)
{
int32 id;
if (message->FindInt32("id", &id) != B_OK) {
_SetStatusMessage("Boot sector not written because of an "
" internal error.");
_SetStatusMessage(TR("Boot sector not written because of an "
" internal error."));
break;
}
@ -113,32 +118,34 @@ WorkerThread::MessageReceived(BMessage* message)
if (fDDRoster.GetPartitionWithID(id, &device, &partition) == B_OK) {
if (!partition->IsMounted()) {
if (partition->Mount() < B_OK) {
_SetStatusMessage("The partition can't be mounted. "
"Please choose a different partition.");
_SetStatusMessage(TR("The partition can't be mounted. "
"Please choose a different partition."));
break;
}
}
if (partition->GetMountPoint(&targetDirectory) != B_OK) {
_SetStatusMessage("The mount point could not be retrieve.");
_SetStatusMessage(TR("The mount point could not be "
"retrieve."));
break;
}
} else if (fDDRoster.GetDeviceWithID(id, &device) == B_OK) {
if (!device.IsMounted()) {
if (device.Mount() < B_OK) {
_SetStatusMessage("The disk can't be mounted. Please "
"choose a different disk.");
_SetStatusMessage(TR("The disk can't be mounted. "
"Please choose a different disk."));
break;
}
}
if (device.GetMountPoint(&targetDirectory) != B_OK) {
_SetStatusMessage("The mount point could not be retrieve.");
_SetStatusMessage(TR("The mount point could not be "
"retrieve."));
break;
}
}
_LaunchFinishScript(targetDirectory);
// TODO: Get error from executing script!
_SetStatusMessage("Boot sector successfully written.");
_SetStatusMessage(TR("Boot sector successfully written."));
}
default:
BLooper::MessageReceived(message);
@ -216,7 +223,7 @@ WorkerThread::_LaunchInitScript(BPath &path)
command += "\"";
command += path.Path();
command += "\"";
_SetStatusMessage("Starting Installation.");
_SetStatusMessage(TR("Starting Installation."));
system(command.String());
}
@ -232,7 +239,7 @@ WorkerThread::_LaunchFinishScript(BPath &path)
command += "\"";
command += path.Path();
command += "\"";
_SetStatusMessage("Finishing Installation.");
_SetStatusMessage(TR("Finishing Installation."));
system(command.String());
}
@ -250,6 +257,8 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
status_t err = B_OK;
int32 entries = 0;
entry_ref testRef;
const char* mountError = TR("The disk can't be mounted. Please choose "
"a different disk.");
BMessenger messenger(fWindow);
ProgressReporter reporter(messenger, new BMessage(MSG_STATUS_MESSAGE));
@ -265,12 +274,11 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
// check if target is initialized
// ask if init or mount as is
if (fDDRoster.GetPartitionWithID(targetItem->ID(), &device, &partition) == B_OK) {
if (fDDRoster.GetPartitionWithID(targetItem->ID(), &device,
&partition) == B_OK) {
if (!partition->IsMounted()) {
if ((err = partition->Mount()) < B_OK) {
_SetStatusMessage("The disk can't be mounted. Please choose a "
"different disk.");
_SetStatusMessage(mountError);
ERR("BPartition::Mount");
goto error;
}
@ -286,8 +294,7 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
} else if (fDDRoster.GetDeviceWithID(targetItem->ID(), &device) == B_OK) {
if (!device.IsMounted()) {
if ((err = device.Mount()) < B_OK) {
_SetStatusMessage("The disk can't be mounted. Please choose a "
"different disk.");
_SetStatusMessage(mountError);
ERR("BDiskDevice::Mount");
goto error;
}
@ -305,9 +312,9 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
// check if target has enough space
if ((fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired)
&& ((new BAlert("", "The destination disk may not have enough space. "
"Try choosing a different disk or choose to not install optional "
"items.", "Try installing anyway", "Cancel", 0,
&& ((new BAlert("", TR("The destination disk may not have enough "
"space. Try choosing a different disk or choose to not install "
"optional items."), TR("Try installing anyway"), TR("Cancel"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
goto error;
}
@ -327,16 +334,16 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
// check not installing on itself
if (strcmp(srcDirectory.Path(), targetDirectory.Path()) == 0) {
_SetStatusMessage("You can't install the contents of a disk onto "
"itself. Please choose a different disk.");
_SetStatusMessage(TR("You can't install the contents of a disk onto "
"itself. Please choose a different disk."));
goto error;
}
// check not installing on boot volume
if ((strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0)
&& ((new BAlert("", "Are you sure you want to install onto the "
&& ((new BAlert("", TR("Are you sure you want to install onto the "
"current boot disk? The Installer will have to reboot your "
"machine if you proceed.", "OK", "Cancel", 0,
"machine if you proceed."), TR("OK"), TR("Cancel"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
_SetStatusMessage("Installation stopped.");
goto error;
@ -363,13 +370,13 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
}
if (entries != 0
&& ((new BAlert("", "The target volume is not empty. Are you sure you "
&& ((new BAlert("", TR("The target volume is not empty. Are you sure you "
"want to install anyway?\n\nNote: The 'system' folder will be a "
"clean copy from the source volume, all other folders will be "
"merged, whereas files and links that exist on both the source "
"and target volume will be overwritten with the source volume "
"version.",
"Install anyway", "Cancel", 0,
"version."),
TR("Install anyway"), TR("Cancel"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
// TODO: Would be cool to offer the option here to clean additional
// folders at the user's choice (like /boot/common and /boot/develop).
@ -448,7 +455,7 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
error:
BMessage statusMessage(MSG_RESET);
if (err == B_CANCELED)
_SetStatusMessage("Installation canceled.");
_SetStatusMessage(TR("Installation canceled."));
else
statusMessage.AddInt32("error", err);
ERR("_PerformInstall failed");
@ -520,7 +527,7 @@ make_partition_label(BPartition* partition, char* label, char* menuLabel,
if (showContentType) {
const char* type = partition->ContentType();
if (type == NULL)
type = "Unknown Type";
type = TR_CMT("Unknown Type", "Partition content type");
sprintf(label, "%s - %s [%s] (%s)", partition->ContentName(), size,
path.Path(), type);
@ -554,7 +561,8 @@ SourceVisitor::Visit(BPartition *partition, int32 level)
BPath path;
if (partition->GetPath(&path) == B_OK)
printf("SourceVisitor::Visit(BPartition *) : %s\n", path.Path());
printf("SourceVisitor::Visit(BPartition *) : %s\n", partition->ContentName());
printf("SourceVisitor::Visit(BPartition *) : %s\n",
partition->ContentName());
if (partition->ContentType() == NULL)
return false;