Example #1
0
LocalMessageSender::LocalMessageSender (const char *receiverName, const char *receiverDomain)
	: DependencyObject (Type::LOCALMESSAGESENDER)
{
	this->receiverName = g_strdup (receiverName);

	this->senderDomain = NULL;

	Deployment *deployment = Deployment::GetCurrent();
	if (deployment && deployment->GetXapLocation ()) {
		this->senderDomain = g_strdup (deployment->GetXapLocation ()->GetHost ());
	}

	if (this->senderDomain == NULL)
		this->senderDomain = g_strdup ("");

	this->receiverDomain = g_strdup (receiverDomain && *receiverDomain ? receiverDomain : senderDomain);

	sender = NULL;
}
Example #2
0
bool
Application::IsInstallable ()
{
	Deployment *deployment = Deployment::GetCurrent ();
	const Uri *location = deployment->GetXapLocation ();

	if (!location)
		return false;

	return location->IsScheme ("file") || location->IsScheme ("http") || location->IsScheme ("https");
}
Example #3
0
static void
bug_report_info (AboutConfigDialogPage *page)
{
	Surface *surface = page->GetDialog()->GetSurface();
	Deployment *deployment = page->GetDialog()->GetDeployment();
	MoonWindowGtk *window = page->GetDialog()->GetWindow();

	GtkWidget *dlg = gtk_dialog_new_with_buttons ("But Report Info",
						      NULL /* FIXME parent */,
						      (GtkDialogFlags)(GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT),
						      "Close", GTK_RESPONSE_CLOSE,
						      NULL);

	GtkWidget *vbox = GTK_DIALOG (dlg)->vbox;

	GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
	GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
						     GTK_ICON_SIZE_BUTTON);
	GtkWidget *label = gtk_label_new ("Cut and paste the information below into your bug report.  "
					  "Be aware this contains information about the current silverlight "
					  "application you are viewing.");
	GtkWidget *textview;
	GtkTextBuffer *buffer = gtk_text_buffer_new (NULL);
	GString *str = g_string_new ("");

	g_string_append_printf (str, "Source: %s\n", deployment->GetXapLocation());
	g_string_append_printf (str, "Width: %dpx\n", window->GetWidth ());
	g_string_append_printf (str, "Height: %dpx\n", window->GetHeight ());
	g_string_append_printf (str, "Background: %s\n", color_to_string (surface->GetBackgroundColor ()));
	g_string_append_printf (str, "RuntimeVersion: %s\n", deployment->GetRuntimeVersion() ? deployment->GetRuntimeVersion() : "(Unknown)");
	g_string_append_printf (str, "Windowless: %s\n", window->GetWidget() == NULL ? "yes" : "no");
	g_string_append_printf (str, "MaxFrameRate: %i\n", surface->GetTimeManager()->GetMaximumRefreshRate());

	g_string_append_printf (str, "Codecs: %s\n",
				Media::IsMSCodecsInstalled () ? "ms-codecs" :
#if INCLUDE_FFMPEG
				"ffmpeg"
#else
				"none"
#endif
				);


	g_string_append (str, "Build configuration: ");

#if DEBUG
	g_string_append (str, "debug");
#else
	g_string_append (str, "release");
#endif
#if SANITY
	g_string_append (str, ", sanity checks");
#endif
#if OBJECT_TRACKING
	g_string_append (str, ", object tracking");
#endif

	g_string_append (str, "\n");

	gtk_text_buffer_set_text (buffer, str->str, str->len);

	textview = gtk_text_view_new_with_buffer (buffer);

	g_string_free (str, TRUE);

	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);

	GtkWidget *image_align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
	gtk_container_add (GTK_CONTAINER (image_align), image);

	gtk_box_pack_start (GTK_BOX (hbox), image_align, FALSE, FALSE, 0);
	gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);

	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

	gtk_box_pack_start (GTK_BOX (vbox), textview, TRUE, TRUE, 0);

	gtk_widget_show_all (vbox);

	if (GTK_RESPONSE_CLOSE == gtk_dialog_run (GTK_DIALOG (dlg)))
		gtk_widget_destroy (dlg);
}