[longomatch] Pass version to the GUI toolkit



commit 060e51a03b75c2a474a52fc6f2520d4aae0efcbc
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jan 26 08:17:41 2012 +0100

    Pass version to the GUI toolkit

 LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs |    1 +
 LongoMatch.GUI/Gui/Dialog/About.cs            |    6 ++----
 LongoMatch.GUI/Gui/GUIToolkit.cs              |    8 +++++++-
 LongoMatch.GUI/Gui/MainWindow.cs              |    2 +-
 LongoMatch/LongoMatchGtk.mdp                  |    1 +
 LongoMatch/Main.cs                            |    5 +++--
 6 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
index 7646716..ecbf052 100644
--- a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
@@ -28,6 +28,7 @@ namespace LongoMatch.Interfaces.GUI
 	public interface IGUIToolkit
 	{
 		IMainWindow MainWindow {get;}
+		Version Version {get;}
 	
 		/* Messages */
 		void InfoMessage(string message);
diff --git a/LongoMatch.GUI/Gui/Dialog/About.cs b/LongoMatch.GUI/Gui/Dialog/About.cs
index 1c7c8d4..f046bd7 100644
--- a/LongoMatch.GUI/Gui/Dialog/About.cs
+++ b/LongoMatch.GUI/Gui/Dialog/About.cs
@@ -25,11 +25,9 @@ namespace LongoMatch.Gui.Dialog
 {
 	public class AboutDialog: Gtk.AboutDialog
 	{
-		public AboutDialog ()
+		public AboutDialog (Version version)
 		{
-			Version version = Assembly.GetExecutingAssembly().GetName().Version;
-			if(Environment.OSVersion.Platform == PlatformID.Unix)
-				ProgramName = Constants.SOFTWARE_NAME;
+			ProgramName = Constants.SOFTWARE_NAME;
 			Version = String.Format("{0}.{1}.{2}",version.Major,version.Minor,version.Build);
 			Copyright = Constants.COPYRIGHT;
 			Website = Constants.WEBSITE;
diff --git a/LongoMatch.GUI/Gui/GUIToolkit.cs b/LongoMatch.GUI/Gui/GUIToolkit.cs
index cc389ea..224b594 100644
--- a/LongoMatch.GUI/Gui/GUIToolkit.cs
+++ b/LongoMatch.GUI/Gui/GUIToolkit.cs
@@ -38,8 +38,9 @@ namespace LongoMatch.Gui
 	{
 		IMainWindow mainWindow;
 		
-		public GUIToolkit ()
+		public GUIToolkit (Version version)
 		{
+			Version = version;
 			mainWindow = new MainWindow(this);
 			(mainWindow as MainWindow).Show();
 		}
@@ -50,6 +51,11 @@ namespace LongoMatch.Gui
 			}
 		}
 		
+		public Version Version {
+			get;
+			set;
+		}
+		
 		public void InfoMessage(string message) {
 			MessagePopup.PopupMessage(mainWindow as Gtk.Widget, Gtk.MessageType.Info, message);
 		}
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 556470a..1e5da7c 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -546,7 +546,7 @@ namespace LongoMatch.Gui
 
 		protected virtual void OnAboutActionActivated(object sender, System.EventArgs e)
 		{
-			var about = new LongoMatch.Gui.Dialog.AboutDialog();
+			var about = new LongoMatch.Gui.Dialog.AboutDialog(guiToolKit.Version);
 			about.TransientFor = this;
 			about.Run();
 			about.Destroy();
diff --git a/LongoMatch/LongoMatchGtk.mdp b/LongoMatch/LongoMatchGtk.mdp
index 7ecd637..b9f5b2c 100644
--- a/LongoMatch/LongoMatchGtk.mdp
+++ b/LongoMatch/LongoMatchGtk.mdp
@@ -21,6 +21,7 @@
   </Configurations>
   <Contents>
     <File subtype="Code" buildaction="Compile" name="Main.cs" />
+    <File subtype="Code" buildaction="Compile" name="AssemblyInfo.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index 1e4455d..80b0a23 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -21,6 +21,7 @@
 
 using System;
 using System.IO;
+using System.Reflection;
 using Gtk;
 using Mono.Unix;
 
@@ -54,12 +55,12 @@ namespace LongoMatch
 				return;
 
 			GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler(OnException);
-
+			Version version = Assembly.GetExecutingAssembly().GetName().Version;
 
 			try {
 				AddinsManager manager = new AddinsManager(Path.Combine(Config.HomeDir(), "addins"));
 				manager.LoadConfigModifierAddins();
-			    GUIToolkit guiToolkit = new GUIToolkit();
+			    GUIToolkit guiToolkit = new GUIToolkit(version);
 			    IMultimediaToolkit multimediaToolkit = new MultimediaFactory();
 			    manager.LoadExportProjectAddins(guiToolkit.MainWindow);
 				Core.Start(guiToolkit, multimediaToolkit);



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