aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2022-08-04 13:49:59 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2022-08-11 13:27:40 +0000
commitfff5de06992f6603814e06487cda7b1905d5fc59 (patch)
tree2fd09a3747241ca3159ecaeb348158d2f7d8bab7
parentfbcd2ee7e4160d1b5aa0169e2d24da3916416597 (diff)
Move code into Legacy namespace
Change-Id: I89956f95ac3338f609094ac3a5e51feac6eefcdf Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r--QtVsTools.Core/Legacy/QtProject.cs231
-rw-r--r--QtVsTools.Core/QtProject.cs213
-rw-r--r--QtVsTools.Package/Legacy/FormChangeQtVersion.cs7
-rw-r--r--QtVsTools.Package/Legacy/FormProjectQtSettings.cs6
-rw-r--r--QtVsTools.Package/Legacy/ProjectQtSettings.cs2
-rw-r--r--QtVsTools.Package/Legacy/QtMenu.cs12
-rw-r--r--QtVsTools.Package/Legacy/Translation.cs2
-rw-r--r--QtVsTools.Wizards/ProjectWizard/Designer/DesignerWizard.cs6
8 files changed, 254 insertions, 225 deletions
diff --git a/QtVsTools.Core/Legacy/QtProject.cs b/QtVsTools.Core/Legacy/QtProject.cs
index 58964df5..59da7cd1 100644
--- a/QtVsTools.Core/Legacy/QtProject.cs
+++ b/QtVsTools.Core/Legacy/QtProject.cs
@@ -26,10 +26,17 @@
**
****************************************************************************/
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using EnvDTE;
using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.VCProjectEngine;
namespace QtVsTools.Core.Legacy
{
+ using Core;
+
public static class QtProject
{
public static void MarkAsDesignerPluginProject(Core.QtProject qtPro)
@@ -41,6 +48,199 @@ namespace QtVsTools.Core.Legacy
qtPro.Project.Globals.set_VariablePersists("IsDesignerPlugin", true);
}
+ public static bool PromptChangeQtVersion(Project project, string oldVersion, string newVersion)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+
+ var versionManager = Core.QtVersionManager.The();
+ var viOld = versionManager.GetVersionInfo(oldVersion);
+ var viNew = versionManager.GetVersionInfo(newVersion);
+
+ if (viOld == null || viNew == null)
+ return true;
+
+ var oldIsWinRt = viOld.isWinRT();
+ var newIsWinRt = viNew.isWinRT();
+
+ if (newIsWinRt == oldIsWinRt || newIsWinRt == IsWinRT(project))
+ return true;
+
+ var caption = string.Format("Change Qt Version ({0})", project.Name);
+ var text = string.Format(
+ "Changing Qt version from {0} to {1}.\r\n" +
+ "Project might not build. Are you sure?",
+ newIsWinRt ? "Win32" : "WinRT",
+ newIsWinRt ? "WinRT" : "Win32"
+ );
+
+ return MessageBox.Show(text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
+ == DialogResult.Yes;
+ }
+
+ public static bool HasModule(Project project, int id)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+
+ var foundInIncludes = false;
+ var foundInLibs = false;
+
+ var vm = Core.QtVersionManager.The();
+ var versionInfo = vm.GetVersionInfo(project);
+ if (versionInfo == null)
+ versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
+ if (versionInfo == null)
+ return false; // neither a default or project Qt version
+ var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
+ if (info == null)
+ return false;
+
+ var vcPro = project.Object as VCProject;
+ foreach (VCConfiguration config in (IVCCollection)vcPro.Configurations) {
+ var compiler = CompilerToolWrapper.Create(config);
+ var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
+
+ if (compiler != null) {
+ if (compiler.GetAdditionalIncludeDirectories() == null)
+ continue;
+ var incPathList = info.GetIncludePath();
+ var includeDirs = compiler.GetAdditionalIncludeDirectoriesList();
+ foundInIncludes = (incPathList.Count > 0);
+ foreach (var incPath in incPathList) {
+ var fixedIncludeDir = FixFilePathForComparison(incPath);
+ if (!includeDirs.Any(dir =>
+ FixFilePathForComparison(dir) == fixedIncludeDir)) {
+ foundInIncludes = false;
+ break;
+ }
+ }
+ }
+
+ if (foundInIncludes)
+ break;
+
+ List<string> libs = null;
+ if (linker != null) {
+ var linkerWrapper = new LinkerToolWrapper(linker);
+ libs = linkerWrapper.AdditionalDependencies;
+ }
+
+ if (libs != null) {
+ var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
+ foundInLibs = moduleLibs.All(moduleLib => libs.Contains(moduleLib));
+ }
+ }
+ return foundInIncludes || foundInLibs;
+ }
+
+ public static void AddModule(Project project, int id)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+
+ if (HasModule(project, id))
+ return;
+
+ var vm = Core.QtVersionManager.The();
+ var versionInfo = vm.GetVersionInfo(project);
+ if (versionInfo == null)
+ versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
+
+ var vcPro = project.Object as VCProject;
+ foreach (VCConfiguration config in vcPro.Configurations as IVCCollection) {
+
+ var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
+ if (Core.QtProject.GetFormatVersion(project) >= Resources.qtMinFormatVersion_Settings) {
+ var config3 = config as VCConfiguration3;
+ if (config3 == null)
+ continue;
+ if (!string.IsNullOrEmpty(info.proVarQT)) {
+ var qtModulesValue = config.GetUnevaluatedPropertyValue("QtModules");
+ var qtModules = new HashSet<string>(
+ !string.IsNullOrEmpty(qtModulesValue)
+ ? qtModulesValue.Split(';')
+ : new string[] { });
+ qtModules.UnionWith(info.proVarQT.Split(' '));
+ config3.SetPropertyValue(Resources.projLabelQtSettings, true,
+ "QtModules", string.Join(";", qtModules));
+ }
+ // In V3 project format, compiler and linker options
+ // required by modules are set by Qt/MSBuild.
+ continue;
+ }
+
+ var compiler = CompilerToolWrapper.Create(config);
+ var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
+
+ if (compiler != null) {
+ foreach (var define in info.Defines)
+ compiler.AddPreprocessorDefinition(define);
+
+ var incPathList = info.GetIncludePath();
+ foreach (var incPath in incPathList)
+ compiler.AddAdditionalIncludeDirectories(incPath);
+ }
+ if (linker != null) {
+ var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
+ var linkerWrapper = new LinkerToolWrapper(linker);
+ var additionalDeps = linkerWrapper.AdditionalDependencies;
+ var dependenciesChanged = false;
+ if (additionalDeps == null || additionalDeps.Count == 0) {
+ additionalDeps = moduleLibs;
+ dependenciesChanged = true;
+ } else {
+ foreach (var moduleLib in moduleLibs) {
+ if (!additionalDeps.Contains(moduleLib)) {
+ additionalDeps.Add(moduleLib);
+ dependenciesChanged = true;
+ }
+ }
+ }
+ if (dependenciesChanged)
+ linkerWrapper.AdditionalDependencies = additionalDeps;
+ }
+ }
+ }
+
+ public static void RemoveModule(Project project, int id)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+
+ var vm = Core.QtVersionManager.The();
+ var versionInfo = vm.GetVersionInfo(project);
+ if (versionInfo == null)
+ versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
+
+ var vcPro = project.Object as VCProject;
+ foreach (VCConfiguration config in (IVCCollection)vcPro.Configurations) {
+ var compiler = CompilerToolWrapper.Create(config);
+ var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
+
+ var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
+ if (compiler != null) {
+ foreach (var define in info.Defines)
+ compiler.RemovePreprocessorDefinition(define);
+ var additionalIncludeDirs = compiler.AdditionalIncludeDirectories;
+ if (additionalIncludeDirs != null) {
+ var lst = new List<string>(additionalIncludeDirs);
+ foreach (var includePath in info.IncludePath) {
+ lst.Remove(includePath);
+ lst.Remove('\"' + includePath + '\"');
+ }
+ compiler.AdditionalIncludeDirectories = lst;
+ }
+ }
+ if (linker != null && linker.AdditionalDependencies != null) {
+ var linkerWrapper = new LinkerToolWrapper(linker);
+ var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
+ var additionalDependencies = linkerWrapper.AdditionalDependencies;
+ var dependenciesChanged = false;
+ foreach (var moduleLib in moduleLibs)
+ dependenciesChanged |= additionalDependencies.Remove(moduleLib);
+ if (dependenciesChanged)
+ linkerWrapper.AdditionalDependencies = additionalDependencies;
+ }
+ }
+ }
+
internal static bool IsDesignerPluginProject(Core.QtProject qtPro)
{
ThreadHelper.ThrowIfNotOnUIThread();
@@ -54,5 +254,36 @@ namespace QtVsTools.Core.Legacy
}
return b;
}
+
+
+ private static bool IsWinRT(Project project)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+
+ try {
+ var vcProject = project.Object as VCProject;
+ var vcConfigs = vcProject.Configurations as IVCCollection;
+ var vcConfig = vcConfigs.Item(1) as VCConfiguration;
+ var appType = vcConfig.GetEvaluatedPropertyValue("ApplicationType");
+ if (appType == "Windows Store")
+ return true;
+ } catch { }
+ return false;
+ }
+
+ private static string FixFilePathForComparison(string path)
+ {
+ return HelperFunctions.NormalizeRelativeFilePath(path).ToLower();
+ }
+
+ private static bool IsDebugConfiguration(VCConfiguration conf)
+ {
+ var tool = CompilerToolWrapper.Create(conf);
+ if (tool != null) {
+ return tool.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebug
+ || tool.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebugDLL;
+ }
+ return false;
+ }
}
}
diff --git a/QtVsTools.Core/QtProject.cs b/QtVsTools.Core/QtProject.cs
index 1443fe12..a9adf9fd 100644
--- a/QtVsTools.Core/QtProject.cs
+++ b/QtVsTools.Core/QtProject.cs
@@ -329,113 +329,6 @@ namespace QtVsTools.Core
return vcConfig.GetEvaluatedPropertyValue(propName);
}
- public void AddModule(int id)
- {
- ThreadHelper.ThrowIfNotOnUIThread();
-
- if (HasModule(id))
- return;
-
- var vm = QtVersionManager.The();
- var versionInfo = vm.GetVersionInfo(Project);
- if (versionInfo == null)
- versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
-
- foreach (VCConfiguration config in (IVCCollection)vcPro.Configurations) {
-
- var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
- if (FormatVersion >= Resources.qtMinFormatVersion_Settings) {
- var config3 = config as VCConfiguration3;
- if (config3 == null)
- continue;
- if (!string.IsNullOrEmpty(info.proVarQT)) {
- var qtModulesValue = config.GetUnevaluatedPropertyValue("QtModules");
- var qtModules = new HashSet<string>(
- !string.IsNullOrEmpty(qtModulesValue)
- ? qtModulesValue.Split(';')
- : new string[] { });
- qtModules.UnionWith(info.proVarQT.Split(' '));
- config3.SetPropertyValue(Resources.projLabelQtSettings, true,
- "QtModules", string.Join(";", qtModules));
- }
- // In V3 project format, compiler and linker options
- // required by modules are set by Qt/MSBuild.
- continue;
- }
-
- var compiler = CompilerToolWrapper.Create(config);
- var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
-
- if (compiler != null) {
- foreach (var define in info.Defines)
- compiler.AddPreprocessorDefinition(define);
-
- var incPathList = info.GetIncludePath();
- foreach (var incPath in incPathList)
- compiler.AddAdditionalIncludeDirectories(incPath);
- }
- if (linker != null) {
- var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
- var linkerWrapper = new LinkerToolWrapper(linker);
- var additionalDeps = linkerWrapper.AdditionalDependencies;
- var dependenciesChanged = false;
- if (additionalDeps == null || additionalDeps.Count == 0) {
- additionalDeps = moduleLibs;
- dependenciesChanged = true;
- } else {
- foreach (var moduleLib in moduleLibs) {
- if (!additionalDeps.Contains(moduleLib)) {
- additionalDeps.Add(moduleLib);
- dependenciesChanged = true;
- }
- }
- }
- if (dependenciesChanged)
- linkerWrapper.AdditionalDependencies = additionalDeps;
- }
- }
- }
-
- public void RemoveModule(int id)
- {
- ThreadHelper.ThrowIfNotOnUIThread();
-
- var vm = QtVersionManager.The();
- var versionInfo = vm.GetVersionInfo(Project);
- if (versionInfo == null)
- versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
-
- foreach (VCConfiguration config in (IVCCollection)vcPro.Configurations) {
- var compiler = CompilerToolWrapper.Create(config);
- var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
-
- var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
- if (compiler != null) {
- foreach (var define in info.Defines)
- compiler.RemovePreprocessorDefinition(define);
- var additionalIncludeDirs = compiler.AdditionalIncludeDirectories;
- if (additionalIncludeDirs != null) {
- var lst = new List<string>(additionalIncludeDirs);
- foreach (var includePath in info.IncludePath) {
- lst.Remove(includePath);
- lst.Remove('\"' + includePath + '\"');
- }
- compiler.AdditionalIncludeDirectories = lst;
- }
- }
- if (linker != null && linker.AdditionalDependencies != null) {
- var linkerWrapper = new LinkerToolWrapper(linker);
- var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
- var additionalDependencies = linkerWrapper.AdditionalDependencies;
- var dependenciesChanged = false;
- foreach (var moduleLib in moduleLibs)
- dependenciesChanged |= additionalDependencies.Remove(moduleLib);
- if (dependenciesChanged)
- linkerWrapper.AdditionalDependencies = additionalDependencies;
- }
- }
- }
-
public void UpdateModules(VersionInformation oldVersion, VersionInformation newVersion)
{
ThreadHelper.ThrowIfNotOnUIThread();
@@ -487,58 +380,11 @@ namespace QtVsTools.Core
}
}
+ // TODO: remove once all callers are moved into Legacy namespace
public bool HasModule(int id)
{
ThreadHelper.ThrowIfNotOnUIThread();
-
- var foundInIncludes = false;
- var foundInLibs = false;
-
- var vm = QtVersionManager.The();
- var versionInfo = vm.GetVersionInfo(Project);
- if (versionInfo == null)
- versionInfo = vm.GetVersionInfo(vm.GetDefaultVersion());
- if (versionInfo == null)
- return false; // neither a default or project Qt version
- var info = QtModules.Instance.Module(id, versionInfo.qtMajor);
- if (info == null)
- return false;
-
- foreach (VCConfiguration config in (IVCCollection)vcPro.Configurations) {
- var compiler = CompilerToolWrapper.Create(config);
- var linker = (VCLinkerTool)((IVCCollection)config.Tools).Item("VCLinkerTool");
-
- if (compiler != null) {
- if (compiler.GetAdditionalIncludeDirectories() == null)
- continue;
- var incPathList = info.GetIncludePath();
- var includeDirs = compiler.GetAdditionalIncludeDirectoriesList();
- foundInIncludes = (incPathList.Count > 0);
- foreach (var incPath in incPathList) {
- var fixedIncludeDir = FixFilePathForComparison(incPath);
- if (!includeDirs.Any(dir =>
- FixFilePathForComparison(dir) == fixedIncludeDir)) {
- foundInIncludes = false;
- break;
- }
- }
- }
-
- if (foundInIncludes)
- break;
-
- List<string> libs = null;
- if (linker != null) {
- var linkerWrapper = new LinkerToolWrapper(linker);
- libs = linkerWrapper.AdditionalDependencies;
- }
-
- if (libs != null) {
- var moduleLibs = info.GetLibs(IsDebugConfiguration(config), versionInfo);
- foundInLibs = moduleLibs.All(moduleLib => libs.Contains(moduleLib));
- }
- }
- return foundInIncludes || foundInLibs;
+ return Legacy.QtProject.HasModule(envPro, id);
}
public void AddUic4BuildStepMsBuild(
@@ -760,16 +606,6 @@ namespace QtVsTools.Core
return new List<string>();
}
- private static bool IsDebugConfiguration(VCConfiguration conf)
- {
- var tool = CompilerToolWrapper.Create(conf);
- if (tool != null) {
- return tool.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebug
- || tool.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebugDLL;
- }
- return false;
- }
-
private string GetPCHMocOptions(VCFile file, CompilerToolWrapper compiler)
{
ThreadHelper.ThrowIfNotOnUIThread();
@@ -2753,51 +2589,6 @@ namespace QtVsTools.Core
}
}
- public bool isWinRT()
- {
- ThreadHelper.ThrowIfNotOnUIThread();
-
- try {
- var vcProject = Project.Object as VCProject;
- var vcConfigs = vcProject.Configurations as IVCCollection;
- var vcConfig = vcConfigs.Item(1) as VCConfiguration;
- var appType = vcConfig.GetEvaluatedPropertyValue("ApplicationType");
- if (appType == "Windows Store")
- return true;
- } catch { }
- return false;
- }
-
- public bool PromptChangeQtVersion(string oldVersion, string newVersion)
- {
- ThreadHelper.ThrowIfNotOnUIThread();
-
- var versionManager = QtVersionManager.The();
- var viOld = versionManager.GetVersionInfo(oldVersion);
- var viNew = versionManager.GetVersionInfo(newVersion);
-
- if (viOld == null || viNew == null)
- return true;
-
- var oldIsWinRt = viOld.isWinRT();
- var newIsWinRt = viNew.isWinRT();
-
- if (newIsWinRt == oldIsWinRt || newIsWinRt == isWinRT())
- return true;
-
- var promptCaption = string.Format("Change Qt Version ({0})", Project.Name);
- var promptText = string.Format(
- "Changing Qt version from {0} to {1}.\r\n" +
- "Project might not build. Are you sure?",
- newIsWinRt ? "Win32" : "WinRT",
- newIsWinRt ? "WinRT" : "Win32"
- );
-
- return (MessageBox.Show(
- promptText, promptCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
- == DialogResult.Yes);
- }
-
/// <summary>
/// Changes the Qt version of this project.
/// </summary>
diff --git a/QtVsTools.Package/Legacy/FormChangeQtVersion.cs b/QtVsTools.Package/Legacy/FormChangeQtVersion.cs
index 2a12fdfd..a01aa99a 100644
--- a/QtVsTools.Package/Legacy/FormChangeQtVersion.cs
+++ b/QtVsTools.Package/Legacy/FormChangeQtVersion.cs
@@ -32,6 +32,9 @@ using Microsoft.VisualStudio.Shell;
namespace QtVsTools.Legacy
{
+ using Core;
+ using Legacy = Core.Legacy;
+
public partial class FormChangeQtVersion : Form
{
public FormChangeQtVersion()
@@ -69,13 +72,13 @@ namespace QtVsTools.Legacy
ThreadHelper.ThrowIfNotOnUIThread();
lbQtVersions.Items.Clear();
- var vm = Core.QtVersionManager.The();
+ var vm = QtVersionManager.The();
foreach (var versionName in vm.GetVersions())
lbQtVersions.Items.Add(versionName);
lbQtVersions.Items.Add("$(DefaultQtVersion)");
if (change == ChangeFor.Solution) {
- var qtVer = Core.Legacy.QtVersionManager
+ var qtVer = Legacy.QtVersionManager
.GetSolutionQtVersion(QtVsToolsPackage.Instance.Dte.Solution);
if (qtVer == null)
qtVer = vm.GetDefaultVersion();
diff --git a/QtVsTools.Package/Legacy/FormProjectQtSettings.cs b/QtVsTools.Package/Legacy/FormProjectQtSettings.cs
index 0c578a84..11e97fed 100644
--- a/QtVsTools.Package/Legacy/FormProjectQtSettings.cs
+++ b/QtVsTools.Package/Legacy/FormProjectQtSettings.cs
@@ -36,6 +36,7 @@ using EnvDTE;
namespace QtVsTools.Legacy
{
using Core;
+ using Legacy = Core.Legacy;
public partial class FormProjectQtSettings : Form
{
@@ -168,15 +169,14 @@ namespace QtVsTools.Legacy
private void SaveModules()
{
- qtProject = QtProject.Create(project);
for (var i = 0; i < moduleMap.Count; ++i) {
var item = moduleMap[i];
var isModuleChecked = item.checkbox.Checked;
if (isModuleChecked != item.initialValue) {
if (isModuleChecked)
- qtProject.AddModule(item.moduleId);
+ Legacy.QtProject.AddModule(project, item.moduleId);
else
- qtProject.RemoveModule(item.moduleId);
+ Legacy.QtProject.RemoveModule(project, item.moduleId);
}
}
}
diff --git a/QtVsTools.Package/Legacy/ProjectQtSettings.cs b/QtVsTools.Package/Legacy/ProjectQtSettings.cs
index e5288f7b..627c2de6 100644
--- a/QtVsTools.Package/Legacy/ProjectQtSettings.cs
+++ b/QtVsTools.Package/Legacy/ProjectQtSettings.cs
@@ -114,7 +114,7 @@ namespace QtVsTools.Legacy
Legacy.QtVSIPSettings.SaveQmlDebug(project, QmlDebug);
if (oldQtVersion != newQtVersion) {
- if (qtPro.PromptChangeQtVersion(oldQtVersion, newQtVersion)) {
+ if (Legacy.QtProject.PromptChangeQtVersion(project, oldQtVersion, newQtVersion)) {
var newProjectCreated = false;
var versionChanged = qtPro.ChangeQtVersion(
oldQtVersion, newQtVersion, ref newProjectCreated);
diff --git a/QtVsTools.Package/Legacy/QtMenu.cs b/QtVsTools.Package/Legacy/QtMenu.cs
index e3c37eb2..0e5e4cfa 100644
--- a/QtVsTools.Package/Legacy/QtMenu.cs
+++ b/QtVsTools.Package/Legacy/QtMenu.cs
@@ -30,10 +30,12 @@ using System.Windows.Forms;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
-using QtVsTools.Core;
namespace QtVsTools.Legacy
{
+ using Core;
+ using Legacy = Core.Legacy;
+
internal static class QtMenu
{
internal static void ShowFormProjectQtSettings(Project pro)
@@ -61,7 +63,7 @@ namespace QtVsTools.Legacy
return;
using (var formChangeQtVersion = new FormChangeQtVersion()) {
- formChangeQtVersion.UpdateContent(Legacy.ChangeFor.Project);
+ formChangeQtVersion.UpdateContent(ChangeFor.Project);
var ww = new MainWinWrapper(QtVsToolsPackage.Instance.Dte);
if (formChangeQtVersion.ShowDialog(ww) == DialogResult.OK) {
var qtVersion = formChangeQtVersion.GetSelectedQtVersion();
@@ -77,7 +79,7 @@ namespace QtVsTools.Legacy
string newQtVersion = null;
using (var formChangeQtVersion = new FormChangeQtVersion()) {
- formChangeQtVersion.UpdateContent(Legacy.ChangeFor.Solution);
+ formChangeQtVersion.UpdateContent(ChangeFor.Solution);
if (formChangeQtVersion.ShowDialog() != DialogResult.OK)
return;
newQtVersion = formChangeQtVersion.GetSelectedQtVersion();
@@ -103,11 +105,11 @@ namespace QtVsTools.Legacy
var created = false;
var qtProject = QtProject.Create(project);
- if (qtProject.PromptChangeQtVersion(OldQtVersion, newQtVersion))
+ if (Legacy.QtProject.PromptChangeQtVersion(project, OldQtVersion, newQtVersion))
qtProject.ChangeQtVersion(OldQtVersion, newQtVersion, ref created);
}
}
- Core.Legacy.QtVersionManager.SaveSolutionQtVersion(dte.Solution, newQtVersion);
+ Legacy.QtVersionManager.SaveSolutionQtVersion(dte.Solution, newQtVersion);
}
}
}
diff --git a/QtVsTools.Package/Legacy/Translation.cs b/QtVsTools.Package/Legacy/Translation.cs
index 608cec62..f213ed36 100644
--- a/QtVsTools.Package/Legacy/Translation.cs
+++ b/QtVsTools.Package/Legacy/Translation.cs
@@ -35,10 +35,10 @@ using Microsoft.VisualStudio.VCProjectEngine;
namespace QtVsTools.Legacy
{
using Core;
+ using Legacy = Core.Legacy;
using static Core.HelperFunctions;
using BuildAction = QtVsTools.Translation.BuildAction;
- using Legacy = Core.Legacy;
internal static class Translation
{
diff --git a/QtVsTools.Wizards/ProjectWizard/Designer/DesignerWizard.cs b/QtVsTools.Wizards/ProjectWizard/Designer/DesignerWizard.cs
index d0366c9f..e6a4e0c2 100644
--- a/QtVsTools.Wizards/ProjectWizard/Designer/DesignerWizard.cs
+++ b/QtVsTools.Wizards/ProjectWizard/Designer/DesignerWizard.cs
@@ -34,6 +34,8 @@ using EnvDTE;
namespace QtVsTools.Wizards.ProjectWizard
{
+ using Core;
+ using Legacy = Core.Legacy;
using QtVsTools.Common;
using Wizards.Common;
@@ -169,8 +171,8 @@ namespace QtVsTools.Wizards.ProjectWizard
{
var qtPro = Core.QtProject.Create(project);
if (qtPro != null) {
- Core.QtProject.MarkAsQtPlugin(qtPro);
- Core.Legacy.QtProject.MarkAsDesignerPluginProject(qtPro);
+ QtProject.MarkAsQtPlugin(qtPro);
+ Legacy.QtProject.MarkAsDesignerPluginProject(qtPro);
}
}
}