Ejemplo n.º 1
0
// NOTE: this is used from 'mscorlib.dll' System.IO.IsolatedStorage/MoonIsolatedStorageFile.cs
// NOTE: we let the caller supply the string so i18n can occur in managed land only
gboolean
isolated_storage_increase_quota_to (const char *primary_text, const char* secondary_text)
{
#if PAL_GTK_WINDOWING
	// the dialog is displayed only if the action leading to this call was initiated directly from the user
	if (!Deployment::GetCurrent ()->GetSurface ()->IsUserInitiatedEvent ())
		return false;

	Surface *surface = Deployment::GetCurrent ()->GetSurface ();

	GtkWidget *widget = gtk_message_dialog_new_with_markup (NULL,
						GTK_DIALOG_MODAL,
						GTK_MESSAGE_QUESTION,
						GTK_BUTTONS_YES_NO,
						primary_text);

	gtk_window_set_title (GTK_WINDOW (widget), PACKAGE_STRING);
	gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (widget), secondary_text);

	gboolean result = (gtk_dialog_run (GTK_DIALOG (widget)) == GTK_RESPONSE_YES);
	surface->SetCurrentDeployment ();
	gtk_widget_destroy (widget);
	return result;
#else
	return TRUE;
#endif
}
Ejemplo n.º 2
0
static void
option_cell_toggled (GtkCellRendererToggle *cell_renderer,
		     gchar *path,
		     GtkTreeModel *model) 
{
	GtkTreeIter iter;
	GtkTreePath *tree_path;
	gboolean set;
	guint32 flag;
	Surface *surface;

	tree_path = gtk_tree_path_new_from_string (path);

	if (!gtk_tree_model_get_iter (model,
				      &iter,
				      tree_path)) {
		gtk_tree_path_free (tree_path);
		return;
	}

	gtk_tree_path_free (tree_path);

	gtk_tree_model_get (model,
			    &iter,
			    OPTION_COLUMN_TOGGLE, &set,
			    OPTION_COLUMN_FLAG, &flag,
			    OPTION_COLUMN_SURFACE, &surface,
			    -1);

	// we're toggling here
	set = !set;

	surface->SetCurrentDeployment ();

	// toggle the debug state for moonlight
	surface->SetRuntimeOption ((RuntimeInitFlag)flag, set);

	// and reflect the change in the UI
	gtk_list_store_set (GTK_LIST_STORE (model),
			    &iter,
			    OPTION_COLUMN_TOGGLE, set,
			    -1);
}