2 * Copyright 2002-2007, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Andrew McCall, mccall@digitalparadise.co.uk
7 * Mike Berg <mike@berg-net.us>
8 * Julun <host.haiku@gmx.de>
12 #include "TimeSettings.h"
13 #include "TimeMessages.h"
17 #include <FindDirectory.h>
21 TimeSettings::TimeSettings()
23 fSettingsFile("Time_preflet_window")
28 TimeSettings::~TimeSettings()
34 TimeSettings::LeftTop() const
37 BPoint
leftTop(-1000.0, -1000.0);
39 if (find_directory(B_USER_SETTINGS_DIRECTORY
, &path
) == B_OK
) {
40 path
.Append(fSettingsFile
.String());
42 BFile
file(path
.Path(), B_READ_ONLY
);
43 if (file
.InitCheck() == B_OK
) {
45 if (file
.Read(&tmp
, sizeof(BPoint
)) == sizeof(BPoint
))
55 TimeSettings::SetLeftTop(const BPoint leftTop
)
58 if (find_directory(B_USER_SETTINGS_DIRECTORY
, &path
) != B_OK
)
61 path
.Append(fSettingsFile
.String());
63 BFile
file(path
.Path(), B_WRITE_ONLY
| B_CREATE_FILE
);
64 if (file
.InitCheck() == B_OK
)
65 file
.Write(&leftTop
, sizeof(BPoint
));