[longomatch] Clean-up and Warnings removal



commit 25bd3034024753e5d61385bbbc34e1e20bded77c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Sep 8 15:34:55 2009 +0200

    Clean-up and Warnings removal

 LongoMatch/Compat/0.0/DatabaseMigrator.cs          |    1 -
 LongoMatch/Compat/0.0/TemplatesMigrator.cs         |    1 -
 LongoMatch/Gui/FileDescriptionWidget.cs            |   11 +++++++----
 LongoMatch/Gui/TransparentDrawingArea.cs           |   15 +--------------
 LongoMatch/Handlers/DrawingManager.cs              |    6 +-----
 LongoMatch/Handlers/EventsManager.cs               |    1 -
 LongoMatch/Main.cs                                 |   18 +-----------------
 .../LongoMatch.Gui.Popup.TransparentDrawingArea.cs |    2 --
 8 files changed, 10 insertions(+), 45 deletions(-)
---
diff --git a/LongoMatch/Compat/0.0/DatabaseMigrator.cs b/LongoMatch/Compat/0.0/DatabaseMigrator.cs
index bf217ab..ffd657e 100644
--- a/LongoMatch/Compat/0.0/DatabaseMigrator.cs
+++ b/LongoMatch/Compat/0.0/DatabaseMigrator.cs
@@ -73,7 +73,6 @@ namespace LongoMatch.Compat
 			v00.DB.DataBase backupDB;
 			ArrayList backupProjects;		
 			ArrayList newProjects = new ArrayList();
-			string results="";		
 			string backupDBFile=oldDBFile+".bak1";
 						
 			if (!File.Exists(oldDBFile)){
diff --git a/LongoMatch/Compat/0.0/TemplatesMigrator.cs b/LongoMatch/Compat/0.0/TemplatesMigrator.cs
index 2572d82..96b6b80 100644
--- a/LongoMatch/Compat/0.0/TemplatesMigrator.cs
+++ b/LongoMatch/Compat/0.0/TemplatesMigrator.cs
@@ -59,7 +59,6 @@ namespace LongoMatch.Compat
 			foreach (string templateFile in oldTPFiles){
 				v00.DB.Sections oldTemplate=null;
 				Sections newTemplate= null;
-				SectionsWriter writer;
 				string newFileName;
 				
 				SendEvent(String.Format("Converting template: {0}",Path.GetFileName(templateFile)));
diff --git a/LongoMatch/Gui/FileDescriptionWidget.cs b/LongoMatch/Gui/FileDescriptionWidget.cs
index df54d78..48458cc 100644
--- a/LongoMatch/Gui/FileDescriptionWidget.cs
+++ b/LongoMatch/Gui/FileDescriptionWidget.cs
@@ -135,10 +135,13 @@ namespace LongoMatch.Gui.Component
 				}
 				catch{
 					date = DateTime.Now;
-				}
-				
-				return DateTime.Parse(dateEntry.Text);}
-			set {dateEntry.Text = value.ToString(Catalog.GetString("MM/dd/yyyy"));}
+				}				
+				return date;
+			}
+			
+			set {
+				dateEntry.Text = value.ToString(Catalog.GetString("MM/dd/yyyy"));
+			}
 		}
 		
 		public Sections Sections{
diff --git a/LongoMatch/Gui/TransparentDrawingArea.cs b/LongoMatch/Gui/TransparentDrawingArea.cs
index c33e899..af7c658 100644
--- a/LongoMatch/Gui/TransparentDrawingArea.cs
+++ b/LongoMatch/Gui/TransparentDrawingArea.cs
@@ -15,14 +15,12 @@ namespace LongoMatch.Gui.Popup
 		private Pixmap pixmap;
 		private Pixmap shape;
 		private Gdk.GC shapeGC;
-		private Gdk.GC paintGC;
 		private Gdk.Color transparent;
 		private Gdk.Color opaque;		
 
 		//Mouse motion
 		private double lastx=-1;
 		private double lasty=-1;
-		private uint motionTime;
 
 		//Reshaping timeout
 		private uint timeoutId;
@@ -30,11 +28,10 @@ namespace LongoMatch.Gui.Popup
 		//Status
 		private bool modified;
 		private bool hardGrab;		
-		private bool ready;
 		
 		//Drawing Properties
 		private Gdk.Color foreground;
-		private int lineWidth = 7;
+		private int lineWidth;
 		
 		//"Parent" Widget we want to draw over
 		private Widget targetWidget;
@@ -137,19 +134,9 @@ namespace LongoMatch.Gui.Popup
 			//Create the pixmap that will contain the real drawing
 			//Used on Expose event to redraw the drawing area
 			pixmap = new Pixmap (drawingarea.GdkWindow,Gdk.Screen.Default.Width,Gdk.Screen.Default.Height);
-			paintGC= new Gdk.GC(pixmap);
-			pixmap.Colormap = Gdk.Rgb.Colormap;
 			pixmap.DrawRectangle(drawingarea.Style.BlackGC,true,0,0,Gdk.Screen.Default.Width,Gdk.Screen.Default.Height);
 		}
 		
-		private double Clamp(double val, double min, double max){
-			if (val < min)
-				return min;
-			if (val>max)
-				return max;
-			else return val;
-		}
-		
 		private void  DrawCairoLine(Context c, int x1, int y1, int x2, int y2,Gdk.Color color){
 			c.Color = new Cairo.Color(color.Red, color.Green, color.Blue, 1);
 			c.MoveTo (x1, y1);
diff --git a/LongoMatch/Handlers/DrawingManager.cs b/LongoMatch/Handlers/DrawingManager.cs
index 79604a1..9b2d3c9 100644
--- a/LongoMatch/Handlers/DrawingManager.cs
+++ b/LongoMatch/Handlers/DrawingManager.cs
@@ -31,12 +31,9 @@ namespace LongoMatch.Handlers
 		
 		TransparentDrawingArea drawingArea;
 		DrawingToolBox toolBox;
-		Widget targetWidget;
 		
 		public DrawingManager(DrawingToolBox toolBox, Widget targetWidget)
 		{
-			this.targetWidget=targetWidget;
-			targetWidget.AddEvents((int)(EventMask.ButtonReleaseMask));
 			drawingArea = new TransparentDrawingArea(targetWidget);
 			drawingArea.Hide();	
 			this.toolBox=toolBox;
@@ -76,8 +73,7 @@ namespace LongoMatch.Handlers
 		}
 		
 		protected virtual void OnClearDrawing(){
-			drawingArea.Clear();
-			
+			drawingArea.Clear();			
 		}
 	}
 }
\ No newline at end of file
diff --git a/LongoMatch/Handlers/EventsManager.cs b/LongoMatch/Handlers/EventsManager.cs
index e2dacff..bc977b1 100644
--- a/LongoMatch/Handlers/EventsManager.cs
+++ b/LongoMatch/Handlers/EventsManager.cs
@@ -260,7 +260,6 @@ namespace LongoMatch
 		
 		protected virtual void OnSnapshotSeries(MediaTimeNode tNode){
 			SnapshotsDialog sd;
-			IFramesCapturer capturer;
 			uint interval;
 			string seriesName;
 			string outDir;
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index 8b987de..1cd3e7a 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -208,23 +208,7 @@ namespace LongoMatch
 				//and let the user change it by hand
 				configDirectory=homeDirectory;
 			}		
-		}
-		
-		private static void PromptForHomeDir(){
-		    StreamWriter writer;
-			WorkspaceChooser chooser = new WorkspaceChooser();
-				
-			chooser.Run();
-			homeDirectory = System.IO.Path.Combine(chooser.WorkspaceFolder,"LongoMatch");	
-			configDirectory = homeDirectory;				
-			chooser.Destroy();
-			
-			using (writer = new StreamWriter (System.IO.Path.Combine(baseDirectory, "etc/"+WIN32_CONFIG_FILE))){
-				writer.WriteLine(homeDirectory);
-				writer.Flush();
-				writer.Close();
-			}
-		}
+		}		
 			
 		private static void OnException(GLib.UnhandledExceptionArgs args){			
 			ProcessExecutionError((Exception)args.ExceptionObject);				
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs
index 4119c6c..a1f55b3 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs
@@ -36,8 +36,6 @@ namespace LongoMatch.Gui.Popup {
             this.DefaultWidth = 644;
             this.DefaultHeight = 370;
             this.Show();
-            this.WindowStateEvent += new Gtk.WindowStateEventHandler(this.OnWindowStateEvent);
-            this.Focused += new Gtk.FocusedHandler(this.OnFocused);
             this.drawingarea.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler(this.OnDrawingareaMotionNotifyEvent);
             this.drawingarea.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.OnDrawingareaButtonPressEvent);
             this.drawingarea.ExposeEvent += new Gtk.ExposeEventHandler(this.OnDrawingareaExposeEvent);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]