public ImportMakefileDialog (Project project, MakefileData tmpData, string name)
		{
			this.TransientFor = IdeApp.Workbench.RootWindow;
			this.project = project;
			
			Title = GettextCatalog.GetString ("Makefile Project Import");
			Modal = true;
			
			VBox box = new VBox ();
			box.Spacing = 6;
			
			Gtk.Label lab = new Gtk.Label ();
			lab.Wrap = true;
			lab.Xalign = 0;
			lab.WidthRequest = 500;
			lab.Text = GettextCatalog.GetString (
				"{0} is going to create a project bound to a Makefile. Please enter the name you want to give to the new project.",
				BrandingService.ApplicationName
			);
			box.PackStart (lab, false, false, 0);
			
			HBox hb = new HBox ();
			hb.Spacing = 6;
			hb.PackStart (new Gtk.Label (GettextCatalog.GetString ("Project Name:")), false, false, 0);
			nameEntry = new Gtk.Entry ();
			nameEntry.Text = name;
			hb.PackStart (nameEntry, true, true, 0);
			box.PackStart (hb, false, false, 0);
			
			box.PackStart (new Gtk.HSeparator (), false, false, 0);
			
			optionsWidget = new MakefileOptionPanelWidget (this, project, tmpData);
			
			box.PackStart (optionsWidget, false, false, 0);
			box.BorderWidth = 6;
			
			this.VBox.PackStart (box, true, true, 0);
			
			this.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
			this.AddButton (Gtk.Stock.Ok, ResponseType.Ok);
			ShowAll ();
			
			optionsWidget.SetImportMode ();
		}
		public object Clone ()
		{
			MakefileData data = new MakefileData ();
			data.OwnerProject = this.OwnerProject;
			data.IntegrationEnabled = this.IntegrationEnabled;
			data.RelativeMakefileName = this.RelativeMakefileName;
			data.BuildTargetName = this.BuildTargetName;
			data.CleanTargetName = this.CleanTargetName;
			data.ExecuteTargetName = this.ExecuteTargetName;
			data.ParallelProcesses = this.ParallelProcesses;
			
			data.BuildFilesVar = new MakefileVar (this.BuildFilesVar);
			data.DeployFilesVar = new MakefileVar (this.DeployFilesVar);
			data.ResourcesVar = new MakefileVar (this.ResourcesVar);
			data.OthersVar = new MakefileVar (this.OthersVar);
			data.GacRefVar = new MakefileVar (this.GacRefVar);
			data.AsmRefVar = new MakefileVar (this.AsmRefVar);
			data.ProjectRefVar = new MakefileVar (this.ProjectRefVar);

			data.SyncReferences = this.SyncReferences;
			data.IsAutotoolsProject = this.IsAutotoolsProject;
			data.RelativeConfigureInPath = this.RelativeConfigureInPath;
			data.OutputDirVar = this.OutputDirVar;
			data.AssemblyNameVar = this.AssemblyNameVar;

			data.CustomErrorRegex = this.CustomErrorRegex;
			data.CustomWarningRegex = this.CustomWarningRegex;
			data.MessageRegexName = this.MessageRegexName;
			// This shouldn't be required
			//data.unresolvedReferences = new List<string> (this.UnresolvedReferences);

			return data;
		}
		public MakefileOptionPanelWidget (Window parentDialog, Project project, MakefileData tmpData)
			: this ()
		{
			this.data = tmpData;
			this.parentDialog = parentDialog;
			isDotNetProject = (project is DotNetProject);
			if (!isDotNetProject) {
				// Disable all References combos etc for non-dotnet projects
				cbKeepRefSync.Sensitive = false;
				HandleKeepRefSyncClicked (cbKeepRefSync);
			}

			if (data == null) {
				//Use defaults
				data = new MakefileData ();
				data.OwnerProject = project;

				this.cbEnableMakefileIntegration.Active = false;

				FindExistingMakefile (project);

				this.fileEntryMakefilePath.DefaultPath = project.BaseDirectory;

				FillCompilerMessageCombo ();

				HandleEnableMakefileIntegrationClicked (false);
				//FIXME: Look for configure.in in parent dirs
			} else {
				this.fileEntryMakefilePath.Path = data.AbsoluteMakefileName;
				this.fileEntryMakefilePath.DefaultPath = data.AbsoluteMakefileName;
				this.cbEnableMakefileIntegration.Active = data.IntegrationEnabled;

				FillCompilerMessageCombo ();
				SetActiveVar (comboMessageType, data.MessageRegexName);

				HandleEnableMakefileIntegrationClicked (cbEnableMakefileIntegration.Active);
			}

			//FIXME: ResetAll  : use for new data, use for new makefile
			//Load values
			this.fileEntryMakefilePath.BrowserTitle = GettextCatalog.GetString ("Makefile");
		
			this.cbKeepFilesSync.Active = data.BuildFilesVar.Sync;
			this.entryFilesPattern.Text = data.BuildFilesVar.Prefix;

			this.cbKeepDeployFilesSync.Active = data.DeployFilesVar.Sync;
			this.entryDeployFilesPattern.Text = data.DeployFilesVar.Prefix;
	
			this.cbKeepResourcesSync.Active = data.ResourcesVar.Sync;
			this.entryResourcesPattern.Text = data.ResourcesVar.Prefix;
			
			this.cbKeepOthersSync.Active = data.OthersVar.Sync;
			this.entryOthersPattern.Text = data.OthersVar.Prefix;
			
			if (data.BuildFilesVar.Sync || data.DeployFilesVar.Sync || data.ResourcesVar.Sync || data.OthersVar.Sync) {
				// Enable File sync if any of the filevars are set to sync
				this.cbFileSync.Active = true;
				HandleFileSyncClicked (cbFileSync);
			}
			
			//References
			this.cbKeepRefSync.Active = data.SyncReferences;

			this.entryGacRefPattern.Text = data.GacRefVar.Prefix;
			this.entryAsmRefPattern.Text = data.AsmRefVar.Prefix;
			this.entryProjectRefPattern.Text = data.ProjectRefVar.Prefix;
			
			this.cbAutotoolsProject.Active = data.IsAutotoolsProject;
			HandleCbAutotoolsProjectClicked (cbAutotoolsProject);

			this.fileEntryConfigureInPath.Path = data.AbsoluteConfigureInPath;
			if (String.IsNullOrEmpty (data.AbsoluteConfigureInPath))
				this.fileEntryConfigureInPath.DefaultPath = project.ParentSolution.BaseDirectory;
			else
				this.fileEntryConfigureInPath.DefaultPath = data.AbsoluteConfigureInPath;

			this.BuildTargetName.Text = data.BuildTargetName;
			this.ExecuteTargetName.Text = data.ExecuteTargetName;
			this.CleanTargetName.Text = data.CleanTargetName;
			spinProcesses.Value = data.ParallelProcesses;
			
			cbBuildTarget.Active = BuildTargetName.Sensitive = data.BuildTargetName != string.Empty;
			cbRunTarget.Active = ExecuteTargetName.Sensitive = data.ExecuteTargetName != string.Empty;
			cbCleanTarget.Active = CleanTargetName.Sensitive = data.CleanTargetName != string.Empty;

			HandleComboMessageTypeChanged (comboMessageType);

			this.fileEntryMakefilePath.FocusChildSet += new FocusChildSetHandler (OnMakefilePathFocusChildSet);
			
			((Gtk.Container) comboAssemblyName.Parent).Remove (comboAssemblyName);
			((Gtk.Container) lblAssemblyNameVar.Parent).Remove (lblAssemblyNameVar);

			((Gtk.Container) comboOutputDir.Parent).Remove (comboOutputDir);
			((Gtk.Container) lblOutputDirVar.Parent).Remove (lblOutputDirVar);
			
			loading = false;
		}
		protected override void OnReadProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject)
		{
			base.OnReadProject (monitor, msproject);
			var ext = msproject.GetMonoDevelopProjectExtension ("MonoDevelop.Autotools.MakefileInfo");
			if (ext == null)
				return;

			data = MakefileData.Read (ext);
			if (data == null)
				return;

			monitor.BeginTask (GettextCatalog.GetString ("Updating project from Makefile"), 1);
			try { 
				data.OwnerProject = Project;
				if (data.SupportsIntegration)
					data.UpdateProject (monitor, false);
				monitor.Step (1);
			} catch (Exception e) {
				monitor.ReportError (GettextCatalog.GetString (
					"\tError loading Makefile for project {0}", Project.Name), e);
			} finally {
				monitor.EndTask ();
			}
		}
		public static void SetMakefileData (this Project project, MakefileData data)
		{
			var ex = project.GetService<MakefileProjectExtension> ();
			if (ex != null)
				ex.MakefileData = data;
		}
		public ProjectFileWrapper (ProjectFile file)
		{
			this.file = file;
			data = file.Project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
		}
		public ProjectFileWrapper (ProjectFile file)
		{
			this.file = file;
			data = file.Project.GetMakefileData ();
		}