TPeopleApp::TPeopleApp()
	:
	BApplication(APP_SIG),
	fWindowCount(0)
{
	B_TRANSLATE_MARK_SYSTEM_NAME_VOID("People");

	fPosition.Set(6, TITLE_BAR_HEIGHT, 70 + 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
int
main(int argc, char **argv)
{
	B_TRANSLATE_MARK_SYSTEM_NAME_VOID("Tracker");
	BApplication app("application/x-vnd.Haiku-TrackerPreferences");

	// launch Tracker if it's not running
	be_roster->Launch("application/x-vnd.Be-TRAK");

	BMessage message;
	message.what = B_EXECUTE_PROPERTY;
	message.AddSpecifier("Preferences");

	BMessenger("application/x-vnd.Be-TRAK").SendMessage(&message);

	return 0;
}
Пример #3
0
SlideShowSaver::SlideShowSaver(BMessage *archive, image_id image)
	:
	BScreenSaver(archive, image), fLock("SlideShow Lock")
{
	B_TRANSLATE_MARK_SYSTEM_NAME_VOID("SlideShowSaver");

	fNewDirectory = true;
	fBitmap = NULL;
	fShowBorder = true;
	fShowCaption = true;

	fSettings = new LiveSettings("SlideShowSaver_Settings",
		gDefaultSettings, sizeof(gDefaultSettings) / sizeof(LiveSetting));
	fSettings->LoadSettings();
		// load settings from the settings file

	fSettings->AddObserver(this);
}
Пример #4
0
WatchApp::WatchApp() : BApplication(APP_SIGNATURE)
{
	B_TRANSLATE_MARK_SYSTEM_NAME_VOID("WebWatch");

	// Here we tell the Deskbar that we want to add a new replicant, and
	// where it can find this replicant (in our app). Because we only run
	// less than a second, there is no need for our title to appear inside
	// the Deskbar. Therefore, the application flags inside our resource
	// file should be set to B_BACKGROUND_APP.

	BDeskbar deskbar;
	if (!deskbar.HasItem(DESKBAR_ITEM_NAME))
	{
		entry_ref ref;
		be_roster->FindApp(APP_SIGNATURE, &ref);
		deskbar.AddItem(&ref);
	}

	PostMessage(B_QUIT_REQUESTED);
}
Пример #5
0
Clock::Clock(BMessage *message, image_id image)
	:
	BScreenSaver(message, image)
{
	B_TRANSLATE_MARK_SYSTEM_NAME_VOID("SimpleClock");
}