Bläddra i källkod

fix and improve starter - CROWN_OUTPUT_DIR must be defined

mikymod 11 år sedan
förälder
incheckning
deb3f0d4fb
2 ändrade filer med 16 tillägg och 31 borttagningar
  1. 14 12
      tools/gui/starter/MainWindow.cs
  2. 2 19
      tools/gui/starter/ProjectDialog.cs

+ 14 - 12
tools/gui/starter/MainWindow.cs

@@ -21,9 +21,9 @@ public partial class MainWindow: Gtk.Window
 		Release
 		Release
 	}
 	}
 
 
-	public string project_name = null;
-	public string source_path = null;
-	public string output_path = Environment.GetEnvironmentVariable("CROWN_OUTPUT_DIR") + "/";
+	public string m_project_name = null;
+	public string m_source_path = null;
+	public string m_output_path = Environment.GetEnvironmentVariable("CROWN_OUTPUT_DIR") + "/";
 
 
 	//--------------------------------------------------------------------------------
 	//--------------------------------------------------------------------------------
 	public MainWindow () : base (Gtk.WindowType.Toplevel)
 	public MainWindow () : base (Gtk.WindowType.Toplevel)
@@ -74,7 +74,7 @@ public partial class MainWindow: Gtk.Window
 		pd.Run ();
 		pd.Run ();
 		pd.Destroy ();
 		pd.Destroy ();
 
 
-		project_entry.Text = project_name;
+		project_entry.Text = m_project_name;
 	}
 	}
 
 
 	//--------------------------------------------------------------------------------
 	//--------------------------------------------------------------------------------
@@ -83,9 +83,10 @@ public partial class MainWindow: Gtk.Window
 		Platform platform = (Platform) platform_combobox.Active;
 		Platform platform = (Platform) platform_combobox.Active;
 		BuildMode build = (BuildMode) build_combobox.Active;
 		BuildMode build = (BuildMode) build_combobox.Active;
 
 
-		// Do not use MD for compiling because it cannot retrieve env value even though is specified in target environment.
+		// Do not use MonoDevelop for compiling because it cannot retrieve env value even though is specified in target environment.
 		// Use 'xbuild' command instead.
 		// Use 'xbuild' command instead.
 		string path = Environment.GetEnvironmentVariable("CROWN_INSTALL_DIR") + "/";
 		string path = Environment.GetEnvironmentVariable("CROWN_INSTALL_DIR") + "/";
+		string output_path = m_output_path;
 		string executable = "";
 		string executable = "";
 
 
 		switch (platform)
 		switch (platform)
@@ -93,7 +94,7 @@ public partial class MainWindow: Gtk.Window
 			case Platform.Linux32:
 			case Platform.Linux32:
 			{
 			{
 				path += "bin/linux32/";
 				path += "bin/linux32/";
-				output_path = output_path + project_name + "/linux32/";
+				output_path += m_project_name + "-linux32";
 				switch (build)
 				switch (build)
 				{
 				{
 				case BuildMode.Debug: executable = "crown-debug-32"; break;
 				case BuildMode.Debug: executable = "crown-debug-32"; break;
@@ -105,7 +106,7 @@ public partial class MainWindow: Gtk.Window
 			case Platform.Linux64:
 			case Platform.Linux64:
 			{
 			{
 				path += "bin/linux64/";
 				path += "bin/linux64/";
-				output_path = output_path + project_name + "/linux64/";
+				output_path += m_project_name + "-linux64";
 				switch (build)
 				switch (build)
 				{
 				{
 				case BuildMode.Debug: executable = "crown-debug-64"; break;
 				case BuildMode.Debug: executable = "crown-debug-64"; break;
@@ -117,7 +118,7 @@ public partial class MainWindow: Gtk.Window
 			case Platform.Windows32:
 			case Platform.Windows32:
 			{
 			{
 				path += "bin\\windows32\\";
 				path += "bin\\windows32\\";
-				output_path = output_path + project_name + "\\windows32\\";
+				output_path += m_project_name + "-windows32";
 				switch (build)
 				switch (build)
 				{
 				{
 				case BuildMode.Debug: executable = "crown-debug-32"; break;
 				case BuildMode.Debug: executable = "crown-debug-32"; break;
@@ -129,7 +130,7 @@ public partial class MainWindow: Gtk.Window
 			case Platform.Windows64:
 			case Platform.Windows64:
 			{
 			{
 				path += "bin\\windows64\\";
 				path += "bin\\windows64\\";
-				output_path = output_path + project_name + "\\windows64\\";
+				output_path += m_project_name + "-windows64";
 				switch (build)
 				switch (build)
 				{
 				{
 				case BuildMode.Debug: executable = "crown-debug-64"; break;
 				case BuildMode.Debug: executable = "crown-debug-64"; break;
@@ -139,10 +140,11 @@ public partial class MainWindow: Gtk.Window
 				break;
 				break;
 			}
 			}
 		}
 		}
-
-		string args = " --source-dir " + source_path;
+	
+		string args = " --source-dir " + m_source_path;
 		args += " --bundle-dir " + output_path;
 		args += " --bundle-dir " + output_path;
-		args += " --compile --continue --platform linux";
+		args += " --platform linux";
+		args += " --compile --continue";
 
 
 		System.IO.Directory.SetCurrentDirectory (path);
 		System.IO.Directory.SetCurrentDirectory (path);
 		System.Diagnostics.Process.Start (executable, args);
 		System.Diagnostics.Process.Start (executable, args);

+ 2 - 19
tools/gui/starter/ProjectDialog.cs

@@ -15,9 +15,8 @@ namespace starter
 
 
 		protected void OnProjectDialogOkClicked (object sender, EventArgs e)
 		protected void OnProjectDialogOkClicked (object sender, EventArgs e)
 		{
 		{
-			win.project_name = name_entry.Text;
-			win.source_path = source_entry.Text;
-			// win.destination_path = destination_entry.Text;
+			win.m_project_name = name_entry.Text;
+			win.m_source_path = source_entry.Text;
 		}
 		}
 
 
 		protected void OnSourceButtonClicked (object sender, EventArgs e)
 		protected void OnSourceButtonClicked (object sender, EventArgs e)
@@ -34,22 +33,6 @@ namespace starter
 
 
 			fc.Destroy ();
 			fc.Destroy ();
 		}
 		}
-/*
-		protected void OnDestinationButtonClicked (object sender, EventArgs e)
-		{
-			Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the file to open",
-				this,
-				FileChooserAction.SelectFolder,
-				"Cancel", ResponseType.Cancel,
-				"Open", ResponseType.Accept);
-			if (fc.Run () == (int)ResponseType.Accept) 
-			{
-				destination_entry.Text = fc.Filename;
-			}
-
-			fc.Destroy ();
-		}
-*/
 	}
 	}
 }
 }