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


C++ Application::GetInstallState方法代码示例

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


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

示例1:

void
MoonWindowGtk::RightClickMenu ()
{
	Deployment *deployment = Deployment::GetCurrent ();
	OutOfBrowserSettings *settings;
	GtkWidget *menu_item;
	GtkWidget *menu;
	char *name;

	menu = gtk_menu_new();

	menu_item = gtk_menu_item_new_with_label ("Moonlight Settings");

	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
	g_signal_connect_swapped (G_OBJECT(menu_item), "activate", G_CALLBACK (show_moonlight_dialog), this);

	if (deployment && (settings = deployment->GetOutOfBrowserSettings ())) {
		Application *application = deployment->GetCurrentApplication ();
		
		switch (application->GetInstallState ()) {
		case InstallStateNotInstalled:
			if (application->IsInstallable () && settings->GetShowInstallMenuItem ()) {
				name = g_strdup_printf ("Install %s onto this computer...", settings->GetShortName ());
				menu_item = gtk_menu_item_new_with_label (name);
				gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
				g_signal_connect_swapped (G_OBJECT(menu_item), "activate", G_CALLBACK (install_application), this);
				g_free (name);
			}
			break;
		case InstallStateInstalled:
			menu_item = gtk_menu_item_new_with_label ("Remove this application...");
			gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
			g_signal_connect_swapped (G_OBJECT(menu_item), "activate", G_CALLBACK (uninstall_application), this);
			break;
		default:
			break;
		}
	}

	gtk_widget_show_all (menu);
	gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
}
开发者ID:499940913,项目名称:moon,代码行数:42,代码来源:window-gtk.cpp


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