Aggiunta funzione di debug nel Log ().

Leonardo Robol [2010-02-17 20:31]
Aggiunta funzione di debug nel Log ().
Filename
Dizzy/Log.cs
Dizzy/MainWindow.cs
gtk-gui/Dizzy.AuthDialog.cs
gtk-gui/MainWindow.cs
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));
ViewGit