From 1482a2f41e25b9f9158d8ed6efe5a48379927151 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Wed, 17 Feb 2010 21:31:13 +0100 Subject: [PATCH] Aggiunta funzione di debug nel Log (). --- Dizzy/Log.cs | 13 +++++++++++++ Dizzy/MainWindow.cs | 2 +- gtk-gui/Dizzy.AuthDialog.cs | 1 + gtk-gui/MainWindow.cs | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Dizzy/Log.cs b/Dizzy/Log.cs index 6be287e..8582c21 100644 --- a/Dizzy/Log.cs +++ b/Dizzy/Log.cs @@ -11,6 +11,9 @@ namespace Dizzy public delegate void LogEvent (string message); public static event LogEvent StatusBarUpdate; + /* Debug mode */ + public static bool debugMode = false; + public Log () { } @@ -57,5 +60,15 @@ namespace Dizzy Console.WriteLine (message); Console.ForegroundColor = initial; } + + public static void Debug(string domain, string message) { + if (!debugMode) + return; + ConsoleColor initial = Console.ForegroundColor; + Console.Write (" ==> "); + Console.ForegroundColor = ConsoleColor.Magenta; + Console.WriteLine (message); + Console.ForegroundColor = initial; + } } } diff --git a/Dizzy/MainWindow.cs b/Dizzy/MainWindow.cs index 26d4da9..e12f276 100644 --- a/Dizzy/MainWindow.cs +++ b/Dizzy/MainWindow.cs @@ -57,7 +57,7 @@ public partial class MainWindow : Gtk.Window { if (protocol != null) { - Log.Info ("Calling Protocol.Disconnect ()"); + Log.Debug ("Call", "Calling Protocol.Disconnect ()"); protocol.Disconnect (); } diff --git a/gtk-gui/Dizzy.AuthDialog.cs b/gtk-gui/Dizzy.AuthDialog.cs index 15fef70..a657f08 100644 --- a/gtk-gui/Dizzy.AuthDialog.cs +++ b/gtk-gui/Dizzy.AuthDialog.cs @@ -69,6 +69,7 @@ namespace Dizzy { w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.table1 = new Gtk.Table(((uint)(2)), ((uint)(2)), false); + this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild diff --git a/gtk-gui/MainWindow.cs b/gtk-gui/MainWindow.cs index 9fc6b09..ca1cc1c 100644 --- a/gtk-gui/MainWindow.cs +++ b/gtk-gui/MainWindow.cs @@ -127,6 +127,7 @@ public partial class MainWindow { this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild this.table1 = new Gtk.Table(((uint)(2)), ((uint)(3)), false); + this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); this.table1.BorderWidth = ((uint)(5)); -- 2.1.4