Hi mono's..

Is it possible to make MoMa use the user's dir to save/work the Reports?

thanks!


Index: DefinitionDownloader.cs
===================================================================
--- DefinitionDownloader.cs	(revision 75003)
+++ DefinitionDownloader.cs	(working copy)
@@ -19,7 +19,7 @@
 		{
 			InitializeComponent ();
 
-			image_directory = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Resources");
+			image_directory = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Resources");
 			LoadImages ();
 		}
 
@@ -44,7 +44,7 @@
 			Application.DoEvents ();
 			
 			try {
-				string definition_directory = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Definitions");
+				string definition_directory = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Definitions");
 				
 				if (!Directory.Exists (definition_directory))
 					Directory.CreateDirectory (definition_directory);
@@ -100,4 +100,4 @@
 			}
 		}
 	}
-}
\ No newline at end of file
+}
Index: MainForm.cs
===================================================================
--- MainForm.cs	(revision 75003)
+++ MainForm.cs	(working copy)
@@ -25,7 +25,7 @@
 		{
 			InitializeComponent ();
 
-			image_directory = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Resources");
+			image_directory = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Resources");
 			LoadImages ();
 			
 			// Process.Start doesn't work on Unix, so we'll just hide the link
@@ -217,9 +217,9 @@
 			int pinvokecount = 0;
 			int missingcount = 0;
 
-			string todo_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "monotodo.txt");
-			string nie_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "exception.txt");
-			string missing_defs = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "missing.txt");
+			string todo_defs = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "monotodo.txt");
+			string nie_defs = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "exception.txt");
+			string missing_defs = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "missing.txt");
 
 			// Load the definition files
 			FileDefinition definitions = (FileDefinition)MonoVersionCombo.SelectedItem;
@@ -234,10 +234,10 @@
 				aa.ScanAssemblyForPInvokes ((string)lvi.Tag);
 
 			// Start the results reports
-			if (!Directory.Exists (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports")))
-				Directory.CreateDirectory (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports"));
+			if (!Directory.Exists (Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports")))
+				Directory.CreateDirectory (Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports"));
 
-			string output_path = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports");
+			string output_path = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports");
 			XhtmlTextWriter report = aa.BeginHtmlReport (new FileStream (Path.Combine (output_path, "output.html"), FileMode.Create));
 			StreamWriter submit_report = aa.BeginTextReport (new FileStream (Path.Combine (output_path, "submit.txt"), FileMode.Create));
 
@@ -326,7 +326,7 @@
 
 		private void ResultsDetailLink_LinkClicked (object sender, LinkLabelLinkClickedEventArgs e)
 		{
-			string report_file = Path.Combine (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports"), "output.html");
+			string report_file = Path.Combine (Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports"), "output.html");
 
 			try {
 				System.Diagnostics.Process.Start (report_file);
@@ -343,7 +343,7 @@
 
 		private void ViewReportButton_Click (object sender, EventArgs e)
 		{
-			string report_file = Path.Combine (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports"), "submit.txt");
+			string report_file = Path.Combine (Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports"), "submit.txt");
 			
 			try {	        
 				System.Diagnostics.Process.Start (report_file);	
@@ -356,7 +356,7 @@
 		private void SubmitReportButton_Click (object sender, EventArgs e)
 		{
 			SubmitReportButton.Enabled = false;
-			string output_path = Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Reports");
+			string output_path = Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Reports");
 			string file = Path.Combine (output_path, "submit.txt");
 
 			try {
@@ -397,7 +397,7 @@
 		{
 			MonoVersionCombo.Items.Clear ();
 			
-			foreach (FileDefinition fd in DefinitionHandler.FindAvailableVersions (Path.Combine (Path.GetDirectoryName (Application.ExecutablePath), "Definitions")))
+			foreach (FileDefinition fd in DefinitionHandler.FindAvailableVersions (Path.Combine (Path.GetDirectoryName (Application.LocalUserAppDataPath), "Definitions")))
 				MonoVersionCombo.Items.Add (fd);
 
 			if (MonoVersionCombo.Items.Count > 0)
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to