Lines Matching defs:partition

107 	virtual bool Visit(BPartition* partition, int32 level)
109 _AddPartition(partition);
114 void _AddPartition(BPartition* partition) const
116 // add the partition itself
117 fPartitionList->AddPartition(partition);
121 status_t status = partition->GetPartitioningInfo(&info);
123 partition_id parentID = partition->ID();
160 virtual bool Visit(BPartition* partition, int32 level)
162 partition->Mount();
397 // if partition list behaves when partitions disappear
617 MainWindow::_SetToDiskAndPartition(partition_id disk, partition_id partition,
620 //printf("MainWindow::_SetToDiskAndPartition(disk: %ld, partition: %ld, "
621 // "parent: %ld)\n", disk, partition, parent);
638 fCurrentPartitionID = partition;
701 BPartition* partition = disk->FindDescendant(selectedPartition);
718 item->SetEnabled(partition != NULL
719 && partition->CanInitialize(diskSystem.PrettyName()));
723 // Disk is selected, and DiskSystem is a partition map
734 popUpItem->SetEnabled(partition != NULL
735 && partition->CanInitialize(diskSystem.PrettyName()));
742 if (partition != NULL) {
743 bool writable = !partition->IsReadOnly()
744 && partition->Device()->HasMedia();
745 bool notMountedAndWritable = !partition->IsMounted() && writable;
750 && partition->IsDevice()
754 && partition->CanEditParameters());
756 && partition->CanEditParameters());
759 && !partition->IsDevice());
761 && !partition->IsDevice());
763 fMountMenuItem->SetEnabled(!partition->IsMounted());
764 fMountContextMenuItem->SetEnabled(!partition->IsMounted());
770 if (partition->IsMounted()) {
771 // see if this partition is the boot volume
775 && partition->GetVolume(&volume) == B_OK) {
817 const BPartition* partition, status_t error) const
821 if (partition && _message.FindFirst("%s") >= 0) {
823 name << "\"" << partition->ContentName() << "\"";
852 _DisplayPartitionError(B_TRANSLATE("You need to select a partition "
857 BPartition* partition = disk->FindDescendant(selectedPartition);
858 if (!partition) {
860 "partition by ID."));
864 if (!partition->IsMounted()) {
865 status_t status = partition->Mount();
867 _DisplayPartitionError(B_TRANSLATE("Could not mount partition %s."),
868 partition, status);
875 B_TRANSLATE("The partition %s is already mounted."), partition);
884 _DisplayPartitionError(B_TRANSLATE("You need to select a partition "
889 BPartition* partition = disk->FindDescendant(selectedPartition);
890 if (!partition) {
892 "partition by ID."));
896 if (partition->IsMounted()) {
898 partition->GetMountPoint(&path);
899 status_t status = partition->Unmount();
901 BString message = B_TRANSLATE("Could not unmount partition");
902 message << " \"" << partition->ContentName() << "\":\n\t"
914 status = partition->Unmount(B_FORCE_UNMOUNT);
921 B_TRANSLATE("Could not unmount partition %s."),
922 partition, status);
931 B_TRANSLATE("The partition %s is already unmounted."),
932 partition);
953 _DisplayPartitionError(B_TRANSLATE("You need to select a partition "
963 BPartition* partition = disk->FindDescendant(selectedPartition);
964 if (!partition) {
966 "partition by ID."));
970 if (partition->IsMounted()) {
971 if (partition->Unmount() != B_OK) {
972 // Probably it's the system partition
974 B_TRANSLATE("The partition cannot be unmounted."));
1006 } else if (partition->ContentName()
1007 && strlen(partition->ContentName()) > 0) {
1009 "want to format the partition \"%s\"? You will be asked "
1011 message.ReplaceFirst("%s", partition->ContentName());
1012 } else if (partition->Type() == intelExtendedPartition) {
1020 "want to format the partition? You will be asked again "
1049 partition);
1055 status = partition->ValidateInitialize(diskSystem.PrettyName(),
1059 "initialization parameters failed."), partition, status);
1063 BString previousName = partition->ContentName();
1065 status = partition->Initialize(diskSystem.PrettyName(),
1068 _DisplayPartitionError(B_TRANSLATE("Initialization of the partition "
1069 "%s failed. (Nothing has been written to disk.)"), partition,
1074 // Also set the partition name in the partition table if supported
1075 if (partition->CanSetName()
1076 && partition->ValidateSetName(&validatedName) == B_OK) {
1077 partition->SetName(validatedName.String());
1085 if (partition->IsDevice()) {
1094 "All data on the partition %s will be irretrievably lost if you "
1099 if (partition->IsDevice()) {
1107 "All data on the selected partition will be irretrievably lost "
1123 // The partition pointer is toast now! Use the partition ID to
1125 partition = disk->FindDescendant(selectedPartition);
1129 _DisplayPartitionError(B_TRANSLATE("The partition %s has been "
1130 "successfully formatted.\n"), partition);
1133 "successfully initialized.\n"), partition);
1138 "partition %s!\n"), partition, status);
1141 "disk %s!\n"), partition, status);
1153 _DisplayPartitionError(B_TRANSLATE("The currently selected partition "
1167 "partition row."));
1173 _DisplayPartitionError(B_TRANSLATE("The currently selected partition "
1174 "does not have a parent partition."));
1179 _DisplayPartitionError(B_TRANSLATE("The selected partition does not "
1203 _DisplayPartitionError(B_TRANSLATE("There's no space on the partition "
1204 "where a child partition could be created."));
1235 "All data on the partition will be irretrievably lost if you do "
1248 _DisplayPartitionError(B_TRANSLATE("Creation of the partition has "
1258 "partition. No changes have been written to disk."), NULL, status);
1275 _DisplayPartitionError(B_TRANSLATE("You need to select a partition "
1285 BPartition* partition = disk->FindDescendant(selectedPartition);
1286 if (!partition) {
1288 "partition by ID."));
1292 BPartition* parent = partition->Parent();
1294 _DisplayPartitionError(B_TRANSLATE("The currently selected partition "
1295 "does not have a parent partition."));
1307 if (!parent->CanDeleteChild(partition->Index())) {
1309 B_TRANSLATE("Cannot delete the selected partition."));
1315 "want to delete the selected partition?\n\n"
1316 "All data on the partition will be irretrievably lost if you "
1317 "do so!"), B_TRANSLATE("Delete partition"), B_TRANSLATE("Cancel"), NULL,
1325 status = parent->DeleteChild(partition->Index());
1328 "partition."), NULL, status);
1335 _DisplayPartitionError(B_TRANSLATE("Failed to delete the partition. "
1349 _DisplayPartitionError(B_TRANSLATE("You need to select a partition "
1359 BPartition* partition = disk->FindDescendant(selectedPartition);
1360 if (partition == NULL) {
1362 "partition by ID."));
1374 ChangeParametersPanel* panel = new ChangeParametersPanel(this, partition);
1386 if (partition->CanSetType())
1387 status = partition->ValidateSetType(type.String());
1388 if (status == B_OK && partition->CanSetName())
1389 status = partition->ValidateSetName(&name);
1398 "want to change parameters of the selected partition?\n\n"
1399 "The partition may no longer be recognized by other operating systems "
1408 if (partition->CanSetType())
1409 status = partition->SetType(type.String());
1410 if (status == B_OK && partition->CanSetName())
1411 status = partition->SetName(name.String());
1412 if (status == B_OK && partition->CanEditParameters())
1413 status = partition->SetParameters(parameters.String());
1418 "partition."), NULL, status);
1426 "of the partition. No changes have been written to disk."), NULL,