2 * Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
3 * Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
4 * Distributed under the terms of the MIT License.
7 * Stephan Aßmus, superstippi@gmx.de
8 * John Scipione, jscipione@gmail.com
9 * Timothy Wayper, timmy@wunderbear.com
13 #include "CalcOptions.h"
21 CalcOptions::CalcOptions()
24 audio_feedback(false),
26 keypad_mode(KEYPAD_MODE_BASIC
)
32 CalcOptions::LoadSettings(const BMessage
* archive
)
35 uint8 keypad_mode_option
;
37 if (archive
->FindBool("auto num lock", &option
) == B_OK
)
38 auto_num_lock
= option
;
40 if (archive
->FindBool("audio feedback", &option
) == B_OK
)
41 audio_feedback
= option
;
43 if (archive
->FindBool("degree mode", &option
) == B_OK
)
46 if (archive
->FindUInt8("keypad mode", &keypad_mode_option
) == B_OK
)
47 keypad_mode
= keypad_mode_option
;
52 CalcOptions::SaveSettings(BMessage
* archive
) const
54 status_t ret
= archive
->AddBool("auto num lock", auto_num_lock
);
57 ret
= archive
->AddBool("audio feedback", audio_feedback
);
60 ret
= archive
->AddBool("degree mode", degree_mode
);
63 ret
= archive
->AddUInt8("keypad mode", keypad_mode
);