14ec2ca4eSAxel Dörfler /* 24ec2ca4eSAxel Dörfler * Copyright 2008-2013 Haiku, Inc. All rights reserved. 34ec2ca4eSAxel Dörfler * Distributed under the terms of the MIT license. 44ec2ca4eSAxel Dörfler * 54ec2ca4eSAxel Dörfler * Authors: 64ec2ca4eSAxel Dörfler * Stephan Aßmus <superstippi@gmx.de> 74ec2ca4eSAxel Dörfler * Axel Dörfler, axeld@pinc-software.de. 84ec2ca4eSAxel Dörfler * Karsten Heimrich. <host.haiku@gmx.de> 94ec2ca4eSAxel Dörfler */ 104ec2ca4eSAxel Dörfler 114ec2ca4eSAxel Dörfler 124ec2ca4eSAxel Dörfler #include "InitParametersPanel.h" 134ec2ca4eSAxel Dörfler 144ec2ca4eSAxel Dörfler #include <driver_settings.h> 154ec2ca4eSAxel Dörfler #include <stdio.h> 164ec2ca4eSAxel Dörfler 174ec2ca4eSAxel Dörfler #include <Button.h> 184ec2ca4eSAxel Dörfler #include <Catalog.h> 194ec2ca4eSAxel Dörfler 204ec2ca4eSAxel Dörfler 214ec2ca4eSAxel Dörfler #undef B_TRANSLATION_CONTEXT 224ec2ca4eSAxel Dörfler #define B_TRANSLATION_CONTEXT "InitializeParametersPanel" 234ec2ca4eSAxel Dörfler 244ec2ca4eSAxel Dörfler 254ec2ca4eSAxel Dörfler InitParametersPanel::InitParametersPanel(BWindow* window, 264ec2ca4eSAxel Dörfler const BString& diskSystem, BPartition* partition) 274ec2ca4eSAxel Dörfler : 284ec2ca4eSAxel Dörfler AbstractParametersPanel(window) 294ec2ca4eSAxel Dörfler { 304ec2ca4eSAxel Dörfler Init(B_INITIALIZE_PARAMETER_EDITOR, diskSystem, partition); 314ec2ca4eSAxel Dörfler 32*5dcd02dfSHumdinger fOkButton->SetLabel(B_TRANSLATE("Format")); 334ec2ca4eSAxel Dörfler } 344ec2ca4eSAxel Dörfler 354ec2ca4eSAxel Dörfler 364ec2ca4eSAxel Dörfler InitParametersPanel::~InitParametersPanel() 374ec2ca4eSAxel Dörfler { 384ec2ca4eSAxel Dörfler } 394ec2ca4eSAxel Dörfler 404ec2ca4eSAxel Dörfler 414ec2ca4eSAxel Dörfler status_t 424ec2ca4eSAxel Dörfler InitParametersPanel::Go(BString& name, BString& parameters) 434ec2ca4eSAxel Dörfler { 444ec2ca4eSAxel Dörfler status_t status = AbstractParametersPanel::Go(parameters); 454ec2ca4eSAxel Dörfler if (status == B_OK) { 464ec2ca4eSAxel Dörfler void* handle = parse_driver_settings_string(parameters.String()); 474ec2ca4eSAxel Dörfler if (handle != NULL) { 484ec2ca4eSAxel Dörfler const char* string = get_driver_parameter(handle, "name", 494ec2ca4eSAxel Dörfler NULL, NULL); 504ec2ca4eSAxel Dörfler name.SetTo(string); 514ec2ca4eSAxel Dörfler delete_driver_settings(handle); 524ec2ca4eSAxel Dörfler } 534ec2ca4eSAxel Dörfler } 544ec2ca4eSAxel Dörfler 554ec2ca4eSAxel Dörfler return status; 564ec2ca4eSAxel Dörfler } 57