Example #1
0
        public void Load(DProject proj, DProjectConfiguration config)
        {
            project = proj;
            configuration = config;

            cbUseDefaultCompiler.Active = proj.UseDefaultCompilerVendor;
            cbIsUnittestConfig.Active = config.UnittestMode;
            cbPreferOneStepCompilation.Active = proj.PreferOneStepBuild;

            OnUseDefaultCompilerChanged ();
            Gtk.TreeIter iter;
            if (cmbCompiler.Model.GetIterFirst (out iter))
                do {
                    if (proj.UsedCompilerVendor == cmbCompiler.Model.GetValue (iter, 0) as string) {
                        cmbCompiler.SetActiveIter (iter);
                        break;
                    }
                } while (cmbCompiler.Model.IterNext (ref iter));

            extraCompilerTextView.Buffer.Text = config.ExtraCompilerArguments;
            extraLinkerTextView.Buffer.Text = config.ExtraLinkerArguments;

            check_LinkThirdPartyLibs.Active = configuration.LinkinThirdPartyLibraries;

            text_BinDirectory.Text = proj.GetRelativeChildPath(config.OutputDirectory);
            text_TargetFile.Text = config.Output;
            text_ObjectsDirectory.Text = config.ObjectDirectory;
            text_DDocDir.Text = config.DDocDirectory;

            if(config.CustomDebugIdentifiers==null)
                text_debugConstants.Text = "";
            else
                text_debugConstants.Text = string.Join(";",config.CustomDebugIdentifiers);
            if(config.CustomVersionIdentifiers == null)
                text_versionConstants.Text = "";
            else
                text_versionConstants.Text = string.Join(";", config.CustomVersionIdentifiers);
            spin_debugLevel.Value = (double)config.DebugLevel;

            // Disable debug-specific fields on non-debug configurations
            text_debugConstants.Sensitive = spin_debugLevel.Sensitive = config.DebugMode;

            if (model_compileTarget.GetIterFirst (out iter))
                do {
                    if (config.CompileTarget == (DCompileTarget)model_compileTarget.GetValue (iter, 1)) {
                        combo_ProjectType.SetActiveIter (iter);
                        break;
                    }
                } while (model_compileTarget.IterNext (ref iter));

            text_Libraries.Buffer.Text = string.Join ("\n", config.ExtraLibraries);
        }
Example #2
0
        public void Load(DProject proj, DProjectConfiguration config)
        {
            project = proj;
            configuration = config;

            cbUseDefaultCompiler.Active = proj.UseDefaultCompilerVendor;
            cbIsUnittestConfig.Active = config.UnittestMode;
            cbPreferOneStepCompilation.Active = proj.PreferOneStepBuild;

            OnUseDefaultCompilerChanged ();
            Gtk.TreeIter iter;
            if (cmbCompiler.Model.GetIterFirst (out iter))
                do {
                    if (proj.UsedCompilerVendor == cmbCompiler.Model.GetValue (iter, 0) as string) {
                        cmbCompiler.SetActiveIter (iter);
                        break;
                    }
                } while (cmbCompiler.Model.IterNext (ref iter));

            extraCompilerTextView.Buffer.Text = config.ExtraCompilerArguments;
            extraLinkerTextView.Buffer.Text = config.ExtraLinkerArguments;

            check_LinkThirdPartyLibs.Active = configuration.LinkinThirdPartyLibraries;

            text_BinDirectory.Text = proj.GetRelativeChildPath(config.OutputDirectory);
            text_TargetFile.Text = config.Output;
            text_ObjectsDirectory.Text = config.ObjectDirectory;
            text_DDocDir.Text = config.DDocDirectory;

            if(config.CustomDebugIdentifiers==null)
                text_debugConstants.Text = "";
            else
                text_debugConstants.Text = string.Join(";",config.CustomDebugIdentifiers);
            if(config.CustomVersionIdentifiers == null)
                text_versionConstants.Text = "";
            else
                text_versionConstants.Text = string.Join(";", config.CustomVersionIdentifiers);
            spin_debugLevel.Value = (double)config.DebugLevel;

            // Disable debug-specific fields on non-debug configurations
            text_debugConstants.Sensitive = spin_debugLevel.Sensitive = config.DebugMode;

            if (model_compileTarget.GetIterFirst (out iter))
                do {
                    if (config.CompileTarget == (DCompileTarget)model_compileTarget.GetValue (iter, 1)) {
                        combo_ProjectType.SetActiveIter (iter);
                        break;
                    }
                } while (model_compileTarget.IterNext (ref iter));

            text_Libraries.Buffer.Text = string.Join ("\n", config.ExtraLibraries);

            model_Platforms.Clear();
            var blackListed = new List<string>();
            foreach (var cfg in proj.Configurations)
                if (cfg.Name == config.Name && cfg.Platform != config.Platform)
                    blackListed.Add(cfg.Platform.ToLower());

            var platform_lower = config.Platform.ToLower();
            foreach (var platform in proj.SupportedPlatforms)
            {
                // Skip already taken platforms
                if(blackListed.Contains(platform.ToLower()))
                    continue;

                var it = model_Platforms.Append();
                if (platform_lower == platform.ToLower())
                    combo_Platform.SetActiveIter(it);
                model_Platforms.SetValue(it, 0, platform);
            }
        }