haiku/src/apps/deskcalc/CalcOptions.cpp
Stephan Aßmus 7a6bda7716 Got rid of the options window and implemented them directly
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
2009-01-14 19:12:42 +00:00

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;
}