[longomatch] Use constants for some project strings



commit 76531433cec8f9e52324f1debd1a2dfde2a08ca0
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jun 24 23:24:20 2010 +0200

    Use constants for some project strings

 LongoMatch/Common/Constants.cs           |    7 +++++++
 LongoMatch/Gui/Dialog/ProjectsManager.cs |    2 +-
 LongoMatch/Gui/MainWindow.cs             |    8 ++++----
 LongoMatch/Main.cs                       |   11 ++++++-----
 LongoMatch/Utils/ProjectUtils.cs         |    2 +-
 5 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/LongoMatch/Common/Constants.cs b/LongoMatch/Common/Constants.cs
index da92263..722d56e 100644
--- a/LongoMatch/Common/Constants.cs
+++ b/LongoMatch/Common/Constants.cs
@@ -22,6 +22,11 @@ using Gdk;
 namespace LongoMatch.Common
 {
 	class Constants{
+		public const string SOFTWARE_NAME = "LongoMatch";
+		
+		public const string PROJECT_NAME = SOFTWARE_NAME + " project";
+		
+		public const string DB_FILE = "longomatch.db";
 		
 		public const string COPYRIGHT =  "Copyright ©2007-2010 Andoni Morales Alastruey";
 		
@@ -59,6 +64,8 @@ Petr Kovar (cs)";
 		
 		public const string WEBSITE = "http://www.longomatch.ylatuya.es";;
 		
+		public const string MANUAL = "http://www.longomatch.ylatuya.es/documentation/manual.html";;
+		
 		public const ModifierType STEP = Gdk.ModifierType.ShiftMask;
 		
 		public const Key SEEK_BACKWARD = Gdk.Key.Left;
diff --git a/LongoMatch/Gui/Dialog/ProjectsManager.cs b/LongoMatch/Gui/Dialog/ProjectsManager.cs
index 7ec4190..2c0ecbb 100644
--- a/LongoMatch/Gui/Dialog/ProjectsManager.cs
+++ b/LongoMatch/Gui/Dialog/ProjectsManager.cs
@@ -200,7 +200,7 @@ namespace LongoMatch.Gui.Dialog
 			                "gtk-save",ResponseType.Accept);
 			fChooser.SetCurrentFolder(MainClass.HomeDir());
 			FileFilter filter = new FileFilter();
-			filter.Name = "LongoMatch Project";
+			filter.Name = Constants.PROJECT_NAME;
 			filter.AddPattern("*.lpr");
 
 			fChooser.AddFilter(filter);
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index 49070c9..26a401b 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -144,7 +144,7 @@ namespace LongoMatch.Gui
 				timelinewidget1.Project = project;
 				
 			} else {
-				Title = "LongoMatch";
+				Title = Constants.SOFTWARE_NAME;
 				isLive = true;
 				if (projectType == ProjectType.CaptureProject) {
 					capturerBin.CaptureProperties = props;
@@ -240,7 +240,7 @@ namespace LongoMatch.Gui
 		private void ResetGUI(){
 			bool playlistVisible = playlistwidget2.Visible;	
 
-			Title = "LongoMatch";
+			Title = Constants.SOFTWARE_NAME;
 			playerbin1.Visible = true;
 			playerbin1.LogoMode = true;
 			capturerBin.Visible = false;
@@ -477,7 +477,7 @@ namespace LongoMatch.Gui
 		protected virtual void OnHelpAction1Activated(object sender, System.EventArgs e)
 		{
 			try {
-				System.Diagnostics.Process.Start("http://www.longomatch.ylatuya.es/documentation/manual.html";);
+				System.Diagnostics.Process.Start(Constants.MANUAL);
 			} catch {}
 		}
 		
@@ -486,7 +486,7 @@ namespace LongoMatch.Gui
 			Version version = Assembly.GetExecutingAssembly().GetName().Version;
 			Gtk.AboutDialog about = new AboutDialog();
 			if (Environment.OSVersion.Platform == PlatformID.Unix)
-				about.ProgramName = "LongoMatch";
+				about.ProgramName = Constants.PROJECT_NAME;
 			about.Version = String.Format("{0}.{1}.{2}",version.Major,version.Minor,version.Build);
 			about.Copyright = Constants.COPYRIGHT;
 			about.Website = Constants.WEBSITE;
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index fceee32..7cd01fd 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -1,4 +1,4 @@
-// Main.cs
+// Main.cs
 //
 //  Copyright (C) 2007-2009 Andoni Morales Alastruey
 //
@@ -23,6 +23,7 @@ using System;
 using System.IO;
 using Gtk;
 using Mono.Unix;
+using LongoMatch.Common;
 using LongoMatch.Gui;
 using LongoMatch.Gui.Dialog;
 using LongoMatch.DB;
@@ -48,14 +49,14 @@ namespace LongoMatch
 			baseDirectory = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"../../");
 			homeDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
 			configDirectory = System.IO.Path.Combine(homeDirectory,".longomatch");
-			homeDirectory = System.IO.Path.Combine(homeDirectory,"LongoMatch");
+			homeDirectory = System.IO.Path.Combine(homeDirectory,Constants.SOFTWARE_NAME);
 
 			if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
 				SetUpWin32Config();
 			}
 
 			//Iniciamos la internalización
-			Catalog.Init("longomatch",RelativeToPrefix("share/locale"));
+			Catalog.Init(Constants.SOFTWARE_NAME.ToLower(),RelativeToPrefix("share/locale"));
 
 			//Iniciamos la aplicación
 			Application.Init();
@@ -69,7 +70,7 @@ namespace LongoMatch
 			CheckFiles();
 
 			//Iniciamos la base de datos
-			db = new DataBase(Path.Combine(DBDir(),"longomatch.db"));
+			db = new DataBase(Path.Combine(DBDir(),Constants.DB_FILE));
 
 			//Check for previous database
 			CheckOldFiles();
@@ -206,7 +207,7 @@ namespace LongoMatch
 		}
 
 		private static void ProcessExecutionError(Exception ex) {
-			string logFile ="LongoMatch-" + DateTime.Now +".log";
+			string logFile = Constants.PROJECT_NAME + "-" + DateTime.Now +".log";
 			string message;
 
 			logFile = logFile.Replace("/","-");
diff --git a/LongoMatch/Utils/ProjectUtils.cs b/LongoMatch/Utils/ProjectUtils.cs
index 4ec29ff..9d83c91 100644
--- a/LongoMatch/Utils/ProjectUtils.cs
+++ b/LongoMatch/Utils/ProjectUtils.cs
@@ -83,7 +83,7 @@ namespace LongoMatch.Utils
 			                                                   "gtk-open",ResponseType.Accept);
 			fChooser.SetCurrentFolder(MainClass.HomeDir());
 			filter = new FileFilter();
-			filter.Name = "LongoMatch Project";
+			filter.Name = Constants.PROJECT_NAME;
 			filter.AddPattern("*.lpr");			
 			fChooser.AddFilter(filter);
 			



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