From 90e7d21528ef49139db7bb6ff59fafe5f9ed977a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <korli@users.berlios.de>
Date: Sat, 7 Feb 2009 15:18:12 +0000
Subject: [PATCH] * Truncates Installer menu fields volume labels. This fixes
 bug #2192.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29148 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
 src/apps/installer/InstallerWindow.cpp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp
index d6199d0a5b..76f2e9874f 100644
--- a/src/apps/installer/InstallerWindow.cpp
+++ b/src/apps/installer/InstallerWindow.cpp
@@ -370,28 +370,31 @@ void
 InstallerWindow::AdjustMenus()
 {
 	PartitionMenuItem *item1 = (PartitionMenuItem *)fSrcMenu->FindMarked();
+	BString label;
 	if (item1) {
-		fSrcMenuField->MenuItem()->SetLabel(item1->MenuLabel());
+		label = item1->MenuLabel();
 	} else {
 		if (fSrcMenu->CountItems() == 0)
-			fSrcMenuField->MenuItem()->SetLabel("<none>");
+			label = "<none>";
 		else {
-			fSrcMenuField->MenuItem()->SetLabel(
-				((PartitionMenuItem *)fSrcMenu->ItemAt(0))->MenuLabel());
+			label = ((PartitionMenuItem *)fSrcMenu->ItemAt(0))->MenuLabel();
 		}
 	}
+	fSrcMenuField->TruncateString(&label, B_TRUNCATE_END, 260);
+	fSrcMenuField->MenuItem()->SetLabel(label.String());
 
 	PartitionMenuItem *item2 = (PartitionMenuItem *)fDestMenu->FindMarked();
 	if (item2) {
-		fDestMenuField->MenuItem()->SetLabel(item2->MenuLabel());
+		label = item2->MenuLabel();
 	} else {
 		if (fDestMenu->CountItems() == 0)
-			fDestMenuField->MenuItem()->SetLabel("<none>");
+			label = "<none>";
 		else {
-			fDestMenuField->MenuItem()->SetLabel(
-				((PartitionMenuItem *)fDestMenu->ItemAt(0))->MenuLabel());
+			label = ((PartitionMenuItem *)fDestMenu->ItemAt(0))->MenuLabel();
 		}
 	}
+	fDestMenuField->TruncateString(&label, B_TRUNCATE_END, 260);
+	fDestMenuField->MenuItem()->SetLabel(label.String());
 	char message[255];
 	sprintf(message, "Press the Begin button to install from '%s' onto '%s'",
 		item1 ? item1->Name() : "null", item2 ? item2->Name() : "null");