当前位置: 首页>>代码示例>>C++>>正文


C++ BRoster::IsRunning方法代码示例

本文整理汇总了C++中BRoster::IsRunning方法的典型用法代码示例。如果您正苦于以下问题:C++ BRoster::IsRunning方法的具体用法?C++ BRoster::IsRunning怎么用?C++ BRoster::IsRunning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BRoster的用法示例。


在下文中一共展示了BRoster::IsRunning方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsRunning

/*
	bool IsRunning(entry_ref *ref) const
	@case 2			ref is not NULL, but no app with this ref is running
	@results		Should return false.
*/
void IsRunningTester::IsRunningTestB2()
{
	BRoster roster;
	entry_ref ref;
	CHK(find_test_app("AppRunTestApp1", &ref) == B_OK);
	CHK(roster.IsRunning(&ref) == false);
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:12,代码来源:IsRunningTester.cpp

示例2: mess

status_t
TBarView::SendDragMessage(const char* signature, entry_ref* ref)
{
	status_t err = B_ERROR;
	if (fDragMessage) {
		if (fRefsRcvdOnly) {
			// current message sent to apps is only B_REFS_RECEIVED
			fDragMessage->what = B_REFS_RECEIVED;
		}

		BRoster roster;
		if (signature && strlen(signature) > 0 && roster.IsRunning(signature)) {
			BMessenger mess(signature);
			// drag message is still owned by DB, copy is sent
			// can toss it after send
			err = mess.SendMessage(fDragMessage);
		} else if (ref) {
			FSLaunchItem((const entry_ref*)ref, (const BMessage*)fDragMessage,
				true, true);
		} else if (signature && strlen(signature) > 0) {
			roster.Launch(signature, fDragMessage);
		}
	}
	return err;
}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:25,代码来源:BarView.cpp

示例3: BMessage

bool
TDeskbarMenu::AddStandardDeskbarMenuItems()
{
	bool dragging = false;
	if (fBarView)
		dragging = fBarView->Dragging();

	BMenuItem* item;
	BRoster roster;
	if (!roster.IsRunning(kTrackerSignature)) {
		item = new BMenuItem(B_TRANSLATE("Restart Tracker"),
			new BMessage(kRestartTracker));
		AddItem(item);
		AddSeparatorItem();
	}

// One of them is used if HAIKU_DISTRO_COMPATIBILITY_OFFICIAL, and the other if
// not. However, we want both of them to end up in the catalog, so we have to
// make them visible to collectcatkeys in either case.
B_TRANSLATE_MARK_VOID("About Haiku")
B_TRANSLATE_MARK_VOID("About this system")

	item = new BMenuItem(
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
	B_TRANSLATE_NOCOLLECT("About Haiku")
#else
	B_TRANSLATE_NOCOLLECT("About this system")
#endif
		, new BMessage(kShowSplash));
	item->SetEnabled(!dragging);
	AddItem(item);

	static const char* kFindMenuItemStr
		= B_TRANSLATE_MARK("Find" B_UTF8_ELLIPSIS);

#ifdef SHOW_RECENT_FIND_ITEMS
	item = new BMenuItem(
		TrackerBuildRecentFindItemsMenu(kFindMenuItemStr),
		new BMessage(kFindButton));
#else
	item = new BMenuItem(B_TRANSLATE_NOCOLLECT(kFindMenuItemStr),
		new BMessage(kFindButton));
#endif
	item->SetEnabled(!dragging);
	AddItem(item);

	item = new BMenuItem(B_TRANSLATE("Show replicants"),
		new BMessage(kToggleDraggers));
	item->SetEnabled(!dragging);
	item->SetMarked(BDragger::AreDraggersDrawn());
	AddItem(item);

	static const char* kMountMenuStr = B_TRANSLATE_MARK("Mount");

#ifdef MOUNT_MENU_IN_DESKBAR
	DeskbarMountMenu* mountMenu = new DeskbarMountMenu(
		B_TRANSLATE_NOCOLLECT(kMountMenuStr));
	mountMenu->SetEnabled(!dragging);
	AddItem(mountMenu);
#endif

	item = new BMenuItem(B_TRANSLATE("Deskbar preferences" B_UTF8_ELLIPSIS),
		new BMessage(kConfigShow));
	item->SetTarget(be_app);
	AddItem(item);

	AddSeparatorItem();

	BMenu* shutdownMenu = new BMenu(B_TRANSLATE("Shutdown" B_UTF8_ELLIPSIS));

	item = new BMenuItem(B_TRANSLATE("Restart system"),
		new BMessage(kRebootSystem));
	item->SetEnabled(!dragging);
	shutdownMenu->AddItem(item);

	B_TRANSLATE_MARK_VOID("Suspend");

#ifdef APM_SUPPORT
	if (_kapm_control_(APM_CHECK_ENABLED) == B_OK) {
		item = new BMenuItem(B_TRANSLATE_NOCOLLECT("Suspend"),
			new BMessage(kSuspendSystem));
		item->SetEnabled(!dragging);
		shutdownMenu->AddItem(item);
	}
#endif

	item = new BMenuItem(B_TRANSLATE("Power off"),
		new BMessage(kShutdownSystem));
	item->SetEnabled(!dragging);
	shutdownMenu->AddItem(item);
	shutdownMenu->SetFont(be_plain_font);

	shutdownMenu->SetTargetForItems(be_app);
	BMessage* message = new BMessage(kShutdownSystem);
	message->AddBool("confirm", true);
	AddItem(new BMenuItem(shutdownMenu, message));

	fAddState = kAddingRecents;

	return true;
//.........这里部分代码省略.........
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:101,代码来源:DeskbarMenu.cpp

示例4: BMessage

bool
TBeMenu::AddStandardBeMenuItems()
{
	bool dragging = false;
	if (fBarView)
		dragging = fBarView->Dragging();

	BMenuItem* item;
	BRoster roster;
	if (!roster.IsRunning(kTrackerSignature)) {
		item = new BMenuItem(B_TRANSLATE("Restart Tracker"),
			new BMessage(kRestartTracker));
		AddItem(item);
		AddSeparatorItem();
	}

	static const char* kAboutHaikuMenuItemStr = B_TRANSLATE_MARK(
		"About Haiku" B_UTF8_ELLIPSIS);
	static const char* kAboutThisSystemMenuItemStr = B_TRANSLATE_MARK(
		"About this system" B_UTF8_ELLIPSIS);

	item = new BMenuItem(
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
	B_TRANSLATE(kAboutHaikuMenuItemStr)
#else
	B_TRANSLATE(kAboutThisSystemMenuItemStr)
#endif
		, new BMessage(kShowSplash));
	item->SetEnabled(!dragging);
	AddItem(item);

	static const char* kFindMenuItemStr =
		B_TRANSLATE_MARK("Find" B_UTF8_ELLIPSIS);

#ifdef SHOW_RECENT_FIND_ITEMS
	item = new BMenuItem(
		TrackerBuildRecentFindItemsMenu(kFindMenuItemStr),
		new BMessage(kFindButton));
#else
 	item = new BMenuItem(B_TRANSLATE(kFindMenuItemStr),
 		new BMessage(kFindButton));
#endif
	item->SetEnabled(!dragging);
	AddItem(item);

	item = new BMenuItem(B_TRANSLATE("Show replicants"),
		new BMessage(kToggleDraggers));
	item->SetEnabled(!dragging);
	item->SetMarked(BDragger::AreDraggersDrawn());
	AddItem(item);

	static const char* kMountMenuStr = B_TRANSLATE_MARK("Mount");

#ifdef MOUNT_MENU_IN_DESKBAR
	DeskbarMountMenu* mountMenu = new DeskbarMountMenu(
		B_TRANSLATE(kMountMenuStr));
	mountMenu->SetEnabled(!dragging);
	AddItem(mountMenu);
#endif

	item = new BMenuItem(B_TRANSLATE("Deskbar preferences" B_UTF8_ELLIPSIS),
		new BMessage(kConfigShow));
 	item->SetTarget(be_app);
	AddItem(item);

	AddSeparatorItem();

	BMenu* shutdownMenu = new BMenu(B_TRANSLATE("Shutdown" B_UTF8_ELLIPSIS));

	item = new BMenuItem(B_TRANSLATE("Restart system"),
		new BMessage(kRebootSystem));
	item->SetEnabled(!dragging);
	shutdownMenu->AddItem(item);

	static const char* kSuspendMenuItemStr = B_TRANSLATE_MARK("Suspend");

#ifdef APM_SUPPORT
	if (_kapm_control_(APM_CHECK_ENABLED) == B_OK) {
		item = new BMenuItem(kSuspendMenuItemStr), new BMessage(kSuspendSystem));
		item->SetEnabled(!dragging);
		shutdownMenu->AddItem(item);
	}
开发者ID:mariuz,项目名称:haiku,代码行数:82,代码来源:BeMenu.cpp


注:本文中的BRoster::IsRunning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。