mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
7a6bda7716
in the context menu. Since there are only so few options, this is much more convenient. (Fixes part of #3236.) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28902 a95241bf-73f2-0310-859d-f6bbb57e9c96
57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
/*
|
|
* Copyright 2006-2009 Haiku, Inc. All Rights Reserved.
|
|
* Copyright 1997, 1998 R3 Software Ltd. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Timothy Wayper <timmy@wunderbear.com>
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
|
*/
|
|
|
|
#include "CalcOptions.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
#include <Message.h>
|
|
|
|
|
|
CalcOptions::CalcOptions()
|
|
: auto_num_lock(false),
|
|
audio_feedback(false),
|
|
show_keypad(true)
|
|
{
|
|
}
|
|
|
|
|
|
void
|
|
CalcOptions::LoadSettings(const BMessage* archive)
|
|
{
|
|
bool option;
|
|
|
|
if (archive->FindBool("auto num lock", &option) == B_OK)
|
|
auto_num_lock = option;
|
|
|
|
if (archive->FindBool("audio feedback", &option) == B_OK)
|
|
audio_feedback = option;
|
|
|
|
if (archive->FindBool("show keypad", &option) == B_OK)
|
|
show_keypad = option;
|
|
}
|
|
|
|
|
|
status_t
|
|
CalcOptions::SaveSettings(BMessage* archive) const
|
|
{
|
|
status_t ret = archive->AddBool("auto num lock", auto_num_lock);
|
|
|
|
if (ret == B_OK)
|
|
ret = archive->AddBool("audio feedback", audio_feedback);
|
|
|
|
if (ret == B_OK)
|
|
ret = archive->AddBool("show keypad", show_keypad);
|
|
|
|
return ret;
|
|
}
|
|
|