From 0f3afdf783982da7ef9dc1eaeb23239653953990 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Wed, 10 Feb 2010 14:05:31 +0100 Subject: [PATCH] Aggiunti metodi per provare a gestire intelligentemente i widget. --- Dizzy/EventManager.cs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Dizzy/EventManager.cs b/Dizzy/EventManager.cs index d9c0888..324087c 100644 --- a/Dizzy/EventManager.cs +++ b/Dizzy/EventManager.cs @@ -22,7 +22,14 @@ namespace Dizzy { public static MessageDialog searchInProgress = null; - + + // Gestione dei file e dei task. Questi devono essere inizializzati + // Appena sono creati. + public static FileTreeView fileTreeView = null; + public static TaskTreeView taskTreeView = null; + public static void RegisterFileTreeView (ref FileTreeView f) { fileTreeView = f; } + public static void RegisterTaskTreeView (ref TaskTreeView t) { taskTreeView = t; } + public EventManager () {} // Metodo generico per segnalare un'errore dell'applicazione. @@ -73,5 +80,22 @@ namespace Dizzy }); } } + + public static void FileTreeViewAddFile(File f) + { + if (fileTreeView == null) { return; } + GLib.Idle.Add(delegate { + fileTreeView.AddFile (f); + return false; + }); + } + + public static void FileTreeViewClear() { + if (fileTreeView == null) { return; } + GLib.Idle.Add(delegate { + fileTreeView.Clear (); + return false; + }); + } } } -- 2.1.4