Ejemplo n.º 1
0
        private void setDirectory(string dir, string value)
        {
            foreach (EnvDTE.Project project in HelperFunctions.ProjectsInSolution(dte))
            {
                VCProject vcProject = project.Object as VCProject;
                if (vcProject == null || vcProject.Files == null)
                {
                    continue;
                }
                QtProject qtProject = QtProject.Create(project);
                if (qtProject == null)
                {
                    continue;
                }

                if (dir == "MocDir")
                {
                    string oldMocDir = QtVSIPSettings.GetMocDirectory(project);
                    QtVSIPSettings.SaveMocDirectory(project, value);
                    qtProject.UpdateMocSteps(oldMocDir);
                }
                else if (dir == "RccDir")
                {
                    string oldRccDir = QtVSIPSettings.GetRccDirectory(project);
                    QtVSIPSettings.SaveRccDirectory(project, value);
                    qtProject.RefreshRccSteps(oldRccDir);
                }
                else if (dir == "UicDir")
                {
                    string oldUicDir = QtVSIPSettings.GetUicDirectory(project);
                    QtVSIPSettings.SaveUicDirectory(project, value);
                    qtProject.UpdateUicSteps(oldUicDir, true);
                }
            }
        }
Ejemplo n.º 2
0
        public void OnBuildProjConfigBegin(string projectName, string projectConfig, string platform, string solutionConfig)
        {
            if (currentBuildAction != vsBuildAction.vsBuildActionBuild &&
                currentBuildAction != vsBuildAction.vsBuildActionRebuildAll)
            {
                return;     // Don't do anything, if we're not building.
            }

            Project project = null;

            foreach (var p in HelperFunctions.ProjectsInSolution(dte))
            {
                if (p.UniqueName == projectName)
                {
                    project = p;
                    break;
                }
            }
            if (project == null || !HelperFunctions.IsQtProject(project))
            {
                return;
            }

            if (QtProject.GetFormatVersion(project) >= Resources.qtMinFormatVersion_Settings)
            {
                return;
            }

            var qtpro          = QtProject.Create(project);
            var versionManager = QtVersionManager.The();
            var qtVersion      = versionManager.GetProjectQtVersion(project, platform);

            if (qtVersion == null)
            {
                Messages.DisplayCriticalErrorMessage(SR.GetString("ProjectQtVersionNotFoundError", projectName, projectConfig, platform));
                dte.ExecuteCommand("Build.Cancel", "");
                return;
            }

            if (!QtVSIPSettings.GetDisableAutoMocStepsUpdate())
            {
                if (qtpro.ConfigurationRowNamesChanged)
                {
                    qtpro.UpdateMocSteps(QtVSIPSettings.GetMocDirectory(project));
                }
            }

            // Solution config is given to function to get QTDIR property
            // set correctly also during batch build
            qtpro.SetQtEnvironment(qtVersion, solutionConfig, true);
            if (QtVSIPSettings.GetLUpdateOnBuild(project))
            {
                Translation.RunlUpdate(project);
            }
        }
Ejemplo n.º 3
0
 public VSQtSettings()
 {
     newMocDir                    = QtVSIPSettings.GetMocDirectory();
     newMocOptions                = QtVSIPSettings.GetMocOptions();
     newRccDir                    = QtVSIPSettings.GetRccDirectory();
     newUicDir                    = QtVSIPSettings.GetUicDirectory();
     newLUpdateOnBuild            = QtVSIPSettings.GetLUpdateOnBuild();
     newLUpdateOptions            = QtVSIPSettings.GetLUpdateOptions();
     newLReleaseOptions           = QtVSIPSettings.GetLReleaseOptions();
     newAskBeforeCheckoutFile     = QtVSIPSettings.GetAskBeforeCheckoutFile();
     newDisableCheckoutFiles      = QtVSIPSettings.GetDisableCheckoutFiles();
     newDisableAutoMOCStepsUpdate = QtVSIPSettings.GetDisableAutoMocStepsUpdate();
 }
Ejemplo n.º 4
0
 public ProjectQtSettings(EnvDTE.Project proj)
 {
     versionManager     = QtVersionManager.The();
     project            = proj;
     newMocDir          = oldMocDir = QtVSIPSettings.GetMocDirectory(project);
     newMocOptions      = oldMocOptions = QtVSIPSettings.GetMocOptions(project);
     newRccDir          = oldRccDir = QtVSIPSettings.GetRccDirectory(project);
     newUicDir          = oldUicDir = QtVSIPSettings.GetUicDirectory(project);
     newLUpdateOnBuild  = oldLUpdateOnBuild = QtVSIPSettings.GetLUpdateOnBuild(project);
     newLUpdateOptions  = oldLUpdateOptions = QtVSIPSettings.GetLUpdateOptions(project);
     newLReleaseOptions = oldLReleaseOptions = QtVSIPSettings.GetLReleaseOptions(project);
     newQtVersion       = oldQtVersion = versionManager.GetProjectQtVersion(project);
 }
Ejemplo n.º 5
0
        public VSQtSettings()
        {
            newMocDir                    = QtVSIPSettings.GetMocDirectory();
            newMocOptions                = QtVSIPSettings.GetMocOptions();
            newRccDir                    = QtVSIPSettings.GetRccDirectory();
            newUicDir                    = QtVSIPSettings.GetUicDirectory();
            newLUpdateOnBuild            = QtVSIPSettings.GetLUpdateOnBuild();
            newLUpdateOptions            = QtVSIPSettings.GetLUpdateOptions();
            newLReleaseOptions           = QtVSIPSettings.GetLReleaseOptions();
            newAskBeforeCheckoutFile     = QtVSIPSettings.GetAskBeforeCheckoutFile();
            newDisableCheckoutFiles      = QtVSIPSettings.GetDisableCheckoutFiles();
            newDisableAutoMOCStepsUpdate = QtVSIPSettings.GetDisableAutoMocStepsUpdate();

            var settingsManager = new ShellSettingsManager(Vsix.Instance);
            var store           = settingsManager.GetReadOnlySettingsStore(SettingsScope.UserSettings);

#if VS2013
            EnableQmlClassifier = store.GetBoolean(Statics.QmlClassifierPath,
                                                   Statics.QmlClassifierKey, true);
#else
            EnableQmlTextMate = store.GetBoolean(Statics.QmlTextMatePath,
                                                 Statics.QmlTextMateKey, true);
#endif
        }