예제 #1
0
TPeopleApp::TPeopleApp()
	:
	BApplication(APP_SIG),
	fWindowCount(0)
{
	B_TRANSLATE_MARK_SYSTEM_NAME("People");

	//fPosition.Set(12, TITLE_BAR_HEIGHT, 12 + WIND_WIDTH,
	//	TITLE_BAR_HEIGHT + WIND_HEIGHT);
	BPoint pos = fPosition.LeftTop();

	BPath path;
	find_directory(B_USER_SETTINGS_DIRECTORY, &path, true);

	BDirectory dir(path.Path());
	BEntry entry;
	if (dir.FindEntry("People_data", &entry) == B_OK) {
		fPrefs = new BFile(&entry, B_READ_WRITE);
		if (fPrefs->InitCheck() == B_NO_ERROR) {
			fPrefs->Read(&pos, sizeof(BPoint));
			//if (BScreen(B_MAIN_SCREEN_ID).Frame().Contains(pos))
			///	fPosition.OffsetTo(pos);
		}
	} else {
		fPrefs = new BFile();
		if (dir.CreateFile("People_data", fPrefs) != B_OK) {
			delete fPrefs;
			fPrefs = NULL;
		}
	}
}
예제 #2
0
AboutApp::AboutApp()
	: BApplication("application/x-vnd.Haiku-About")
{
	B_TRANSLATE_MARK_SYSTEM_NAME("AboutSystem");

	AboutWindow *window = new(std::nothrow) AboutWindow();
	if (window)
		window->Show();
}