aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2023-06-21 11:43:34 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2023-06-22 09:47:15 +0000
commit7875baf92569a56c7d922bf38581c2f7f4efc52a (patch)
tree6df1253f85edd77dc929fcb6a157b2703de6a2c9
parent9ba83c4d570e1ad2ef911d7f3f57183091102db4 (diff)
Package: Move Qt MSBuild and Option related classes to core library
With this change, all QtProject/Qt MsBuild related classes are moved into the core library. Also moves 'Option' related files into the core library as discussed. Some code needed to be adapted. Exception: QtVersionProvider and QtModulesEditor need to stay in package, otherwise they will not be picked up by the MEF component framework. Change-Id: I9aacd62df38ebc4a9676c2021bb50b1f99e7b7d0 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r--QtVsTools.Core/MsBuild/QtModulesPopup.xaml (renamed from QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml)2
-rw-r--r--QtVsTools.Core/MsBuild/QtModulesPopup.xaml.cs (renamed from QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml.cs)4
-rw-r--r--QtVsTools.Core/MsBuild/QtMsBuildConverter.cs (renamed from QtVsTools.Package/Package/QtMsBuildConverter.cs)16
-rw-r--r--QtVsTools.Core/MsBuild/QtProjectBuild.cs (renamed from QtVsTools.Package/QtMsBuild/QtProjectBuild.cs)41
-rw-r--r--QtVsTools.Core/MsBuild/QtProjectIntelliSense.cs (renamed from QtVsTools.Package/QtMsBuild/QtProjectIntelliSense.cs)23
-rw-r--r--QtVsTools.Core/MsBuild/QtProjectLogger.cs (renamed from QtVsTools.Package/QtMsBuild/QtProjectLogger.cs)38
-rw-r--r--QtVsTools.Core/MsBuild/QtProjectTracker.cs (renamed from QtVsTools.Package/QtMsBuild/QtProjectTracker.cs)25
-rw-r--r--QtVsTools.Core/Options/QtOptionsPage.cs (renamed from QtVsTools.Package/Options/QtOptionsPage.cs)117
-rw-r--r--QtVsTools.Core/Options/QtVersionsPage.cs (renamed from QtVsTools.Package/Options/QtVersionsPage.cs)9
-rw-r--r--QtVsTools.Core/Options/QtVersionsTable.cs (renamed from QtVsTools.Package/Options/QtVersionsTable.cs)4
-rw-r--r--QtVsTools.Core/Options/QtVersionsTable.xaml (renamed from QtVsTools.Package/Options/QtVersionsTable.xaml)2
-rw-r--r--QtVsTools.Core/QtVsTools.Core.csproj29
-rw-r--r--QtVsTools.Package/Editors/Editor.QtDesigner.cs1
-rw-r--r--QtVsTools.Package/MsBuild/QtModulesEditor.cs (renamed from QtVsTools.Package/QtMsBuild/QtModulesEditor.cs)7
-rw-r--r--QtVsTools.Package/MsBuild/QtVersionProvider.cs (renamed from QtVsTools.Package/QtMsBuild/QtVersionProvider.cs)28
-rw-r--r--QtVsTools.Package/Package/DteEventsHandler.cs1
-rw-r--r--QtVsTools.Package/Package/Notifications.cs3
-rw-r--r--QtVsTools.Package/Package/QtHelp.cs7
-rw-r--r--QtVsTools.Package/Package/QtMainMenu.cs5
-rw-r--r--QtVsTools.Package/Package/QtProjectContextMenu.cs1
-rw-r--r--QtVsTools.Package/Package/QtSolutionContextMenu.cs1
-rw-r--r--QtVsTools.Package/Package/Translation.cs1
-rw-r--r--QtVsTools.Package/QtVsTools.Package.csproj29
-rw-r--r--QtVsTools.Package/QtVsToolsPackage.cs9
24 files changed, 214 insertions, 189 deletions
diff --git a/QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml b/QtVsTools.Core/MsBuild/QtModulesPopup.xaml
index 5cd1d347..b86b2ce4 100644
--- a/QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml
+++ b/QtVsTools.Core/MsBuild/QtModulesPopup.xaml
@@ -2,7 +2,7 @@
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
*************************************************************************************************-->
-<vsui:DialogWindow x:Class="QtVsTools.QtMsBuild.QtModulesPopup"
+<vsui:DialogWindow x:Class="QtVsTools.Core.MsBuild.QtModulesPopup"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vsui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
diff --git a/QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml.cs b/QtVsTools.Core/MsBuild/QtModulesPopup.xaml.cs
index 6fa667ec..773cda86 100644
--- a/QtVsTools.Package/QtMsBuild/QtModulesPopup.xaml.cs
+++ b/QtVsTools.Core/MsBuild/QtModulesPopup.xaml.cs
@@ -1,4 +1,4 @@
-/***************************************************************************************************
+/***************************************************************************************************
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
***************************************************************************************************/
@@ -9,7 +9,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.VisualStudio.PlatformUI;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Core.MsBuild
{
public partial class QtModulesPopup : DialogWindow
{
diff --git a/QtVsTools.Package/Package/QtMsBuildConverter.cs b/QtVsTools.Core/MsBuild/QtMsBuildConverter.cs
index 36812d8e..6b10d6c8 100644
--- a/QtVsTools.Package/Package/QtMsBuildConverter.cs
+++ b/QtVsTools.Core/MsBuild/QtMsBuildConverter.cs
@@ -8,18 +8,18 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
+using EnvDTE;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.VCProjectEngine;
-namespace QtVsTools
+namespace QtVsTools.Core.MsBuild
{
using Core;
- using Core.MsBuild;
using VisualStudio;
- static class QtMsBuildConverter
+ public static class QtMsBuildConverter
{
private const string CancelConversion = "Project conversion canceled.";
private const string ErrorConversion = "Error converting project {0}";
@@ -28,7 +28,9 @@ namespace QtVsTools
{
ThreadHelper.ThrowIfNotOnUIThread();
- var allProjects = HelperFunctions.ProjectsInSolution(QtVsToolsPackage.Instance.Dte);
+ var dte = VsServiceProvider.GetService<SDTE, DTE>();
+
+ var allProjects = HelperFunctions.ProjectsInSolution(dte);
if (allProjects.Count == 0)
return WarningMessage("No projects to convert.");
@@ -69,7 +71,7 @@ namespace QtVsTools
})
.ToList();
- var solution = QtVsToolsPackage.Instance.Dte.Solution;
+ var solution = dte.Solution;
string solutionPath = solution.FileName;
solution.Close(true);
@@ -92,7 +94,7 @@ namespace QtVsTools
}
if (!ConvertProject(projectPath)) {
waitDialog?.Stop();
- QtVsToolsPackage.Instance.Dte.Solution.Open(solutionPath);
+ dte.Solution.Open(solutionPath);
return ErrorMessage(string.Format(ErrorConversion,
Path.GetFileName(projectPath)));
}
@@ -101,7 +103,7 @@ namespace QtVsTools
waitDialog?.Stop();
- QtVsToolsPackage.Instance.Dte.Solution.Open(solutionPath);
+ dte.Solution.Open(solutionPath);
if (canceled && projCount < projectPaths.Count) {
MessageBox.Show($"Conversion canceled. {projectPaths.Count - projCount} "
+ "projects were not converted.", "Qt VS Tools",
diff --git a/QtVsTools.Package/QtMsBuild/QtProjectBuild.cs b/QtVsTools.Core/MsBuild/QtProjectBuild.cs
index 90ab1307..4c6d5f7a 100644
--- a/QtVsTools.Package/QtMsBuild/QtProjectBuild.cs
+++ b/QtVsTools.Core/MsBuild/QtProjectBuild.cs
@@ -14,17 +14,18 @@ using Microsoft.Build.Evaluation;
using Microsoft.Build.Execution;
using Microsoft.Build.Framework;
using Microsoft.VisualStudio.ProjectSystem;
+using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TaskStatusCenter;
using Microsoft.VisualStudio.Threading;
using Microsoft.VisualStudio.VCProjectEngine;
+using Task = System.Threading.Tasks.Task;
using Thread = System.Threading.Thread;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Core.MsBuild
{
using Common;
- using Core;
- using Core.MsBuild;
+ using Options;
using VisualStudio;
using static Common.EnumExt;
@@ -50,11 +51,11 @@ namespace QtVsTools.QtMsBuild
.GetService<SVsTaskStatusCenterService, IVsTaskStatusCenterService>);
private QtProject QtProject { get; set; }
- UnconfiguredProject UnconfiguredProject { get; set; }
- ConfiguredProject ConfiguredProject { get; set; }
- Dictionary<string, string> Properties { get; set; }
- List<string> Targets { get; set; }
- LoggerVerbosity LoggerVerbosity { get; set; }
+ private UnconfiguredProject UnconfiguredProject { get; set; }
+ private ConfiguredProject ConfiguredProject { get; set; }
+ private Dictionary<string, string> Properties { get; set; }
+ private List<string> Targets { get; set; }
+ private LoggerVerbosity LoggerVerbosity { get; set; }
static Task BuildDispatcher { get; set; }
@@ -87,7 +88,7 @@ namespace QtVsTools.QtMsBuild
RequestTimer.Restart();
await tracker.Initialized;
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} "
+ $"QtProjectBuild({Thread.CurrentThread.ManagedThreadId}): "
+ $"Request [{configName}] {tracker.UnconfiguredProject.FullPath}");
@@ -143,7 +144,9 @@ namespace QtVsTools.QtMsBuild
static async Task BuildDispatcherLoopAsync()
{
ITaskHandler2 dispatchStatus = null;
- while (!QtVsToolsPackage.Instance.Zombied) {
+ if (VsServiceProvider.Instance is not AsyncPackage package)
+ return;
+ while (!package.Zombied) {
while (BuildQueue.IsEmpty || RequestTimer.ElapsedMilliseconds < 1000) {
if (BuildQueue.IsEmpty && dispatchStatus != null) {
dispatchStatus.Dismiss();
@@ -213,8 +216,11 @@ namespace QtVsTools.QtMsBuild
configProps, null, new ProjectCollection());
var loggerVerbosity = LoggerVerbosity;
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation)
- loggerVerbosity = QtVsToolsPackage.Instance.Options.BuildLoggerVerbosity;
+ if (Options.Get() is { BuildDebugInformation: true }) {
+ if (Options.Get() is {} options)
+ loggerVerbosity = options.BuildLoggerVerbosity;
+ }
+
var buildParams = new BuildParameters
{
Loggers = loggerVerbosity != LoggerVerbosity.Quiet
@@ -227,7 +233,7 @@ namespace QtVsTools.QtMsBuild
hostServices: null,
flags: BuildRequestDataFlags.ProvideProjectStateAfterBuild);
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} "
+ $"QtProjectBuild({Thread.CurrentThread.ManagedThreadId}): "
+ $"Build [{ConfiguredProject.ProjectConfiguration.Name}] "
@@ -243,10 +249,9 @@ namespace QtVsTools.QtMsBuild
BuildResult result = null;
while (result == null) {
try {
- result = BuildManager.DefaultBuildManager.Build(
- buildParams, buildRequest);
+ result = BuildManager.DefaultBuildManager.Build(buildParams, buildRequest);
} catch (InvalidOperationException) {
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} "
+ $"QtProjectBuild({Thread.CurrentThread.ManagedThreadId}): "
+ $"[{ConfiguredProject.ProjectConfiguration.Name}] "
@@ -256,7 +261,7 @@ namespace QtVsTools.QtMsBuild
}
}
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
string resMsg;
StringBuilder resInfo = new StringBuilder();
if (result.OverallResult == BuildResultCode.Success) {
@@ -317,7 +322,7 @@ namespace QtVsTools.QtMsBuild
$"== {path}: starting build...{Environment.NewLine}"
+ $" * Properties: {properties}{Environment.NewLine}"
+ $" * Targets: {string.Join(";", Targets)}{Environment.NewLine}",
- clear: !QtVsToolsPackage.Instance.Options.BuildDebugInformation,
+ clear: Options.Get() is not { BuildDebugInformation: true },
activate: true);
}
diff --git a/QtVsTools.Package/QtMsBuild/QtProjectIntelliSense.cs b/QtVsTools.Core/MsBuild/QtProjectIntelliSense.cs
index 5dff846e..3d9887b7 100644
--- a/QtVsTools.Package/QtMsBuild/QtProjectIntelliSense.cs
+++ b/QtVsTools.Core/MsBuild/QtProjectIntelliSense.cs
@@ -12,12 +12,13 @@ using Microsoft.VisualStudio.Threading;
using Task = System.Threading.Tasks.Task;
using Thread = System.Threading.Thread;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Core.MsBuild
{
using Core;
- using Core.MsBuild;
+ using Options;
+ using VisualStudio;
- static class QtProjectIntellisense
+ public static class QtProjectIntellisense
{
public static void Refresh(
QtProject qtProject,
@@ -36,7 +37,7 @@ namespace QtVsTools.QtMsBuild
if (QtProjectTracker.GetOrAdd(qtProject) is not {} tracker)
return;
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} "
+ $"QtProjectIntellisense({Thread.CurrentThread.ManagedThreadId}): "
+ $"Refreshing: [{configId ?? "(all configs)"}] {qtProject.VcProjectPath}");
@@ -49,16 +50,16 @@ namespace QtVsTools.QtMsBuild
if (selectedFiles != null)
properties["SelectedFiles"] = string.Join(";", selectedFiles);
var targets = new List<string> { "QtVars" };
- if (QtVsToolsPackage.Instance.Options.BuildRunQtTools)
+ if (Options.Get() is { BuildRunQtTools: true })
targets.Add("Qt");
- IEnumerable<string> configs;
- if (configId != null) {
- configs = new[] { configId };
+ var configs = Enumerable.Empty<string>();
+ if (configId == null) {
+ if (tracker.UnconfiguredProject.Services.ProjectConfigurationsService is {} service)
+ configs = (await service.GetKnownProjectConfigurationsAsync()).Select(
+ x => x.Name);
} else {
- var knownConfigs = await tracker.UnconfiguredProject.Services
- .ProjectConfigurationsService.GetKnownProjectConfigurationsAsync();
- configs = knownConfigs.Select(x => x.Name);
+ configs = new[] { configId };
}
foreach (var config in configs) {
diff --git a/QtVsTools.Package/QtMsBuild/QtProjectLogger.cs b/QtVsTools.Core/MsBuild/QtProjectLogger.cs
index 70374a33..f8da1349 100644
--- a/QtVsTools.Package/QtMsBuild/QtProjectLogger.cs
+++ b/QtVsTools.Core/MsBuild/QtProjectLogger.cs
@@ -5,11 +5,11 @@
using Microsoft.Build.Framework;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Core.MsBuild
{
using Core;
- class QtProjectLogger : ILogger
+ internal class QtProjectLogger : ILogger
{
public LoggerVerbosity Verbosity { get; set; }
public string Parameters { get; set; }
@@ -42,17 +42,17 @@ namespace QtVsTools.QtMsBuild
private void MessageRaised(object sender, BuildMessageEventArgs e)
{
- if (Verbosity <= LoggerVerbosity.Quiet)
- return;
- if (Verbosity <= LoggerVerbosity.Minimal && e.SenderName != "Message")
- return;
- if (Verbosity <= LoggerVerbosity.Normal && e.Importance != MessageImportance.High)
- return;
- if (Verbosity <= LoggerVerbosity.Detailed
- && (e.Importance == MessageImportance.Low || e.SenderName == "MSBuild")) {
- return;
+ switch (Verbosity) {
+ case <= LoggerVerbosity.Quiet:
+ case <= LoggerVerbosity.Minimal when e.SenderName != "Message":
+ case <= LoggerVerbosity.Normal when e.Importance != MessageImportance.High:
+ case <= LoggerVerbosity.Detailed
+ when e.Importance == MessageImportance.Low || e.SenderName == "MSBuild":
+ break;
+ default:
+ Messages.Print(e.Message);
+ break;
}
- Messages.Print(e.Message);
}
private void TargetStarted(object sender, TargetStartedEventArgs e)
@@ -85,17 +85,19 @@ namespace QtVsTools.QtMsBuild
private void AnyEventRaised(object sender, BuildEventArgs e)
{
- if (Verbosity < LoggerVerbosity.Diagnostic
- || e is BuildMessageEventArgs or BuildErrorEventArgs or BuildWarningEventArgs
- or TargetStartedEventArgs or TargetFinishedEventArgs or TaskStartedEventArgs
- or TaskFinishedEventArgs) {
+ if (Verbosity < LoggerVerbosity.Diagnostic)
+ return;
+
+ if (e is BuildMessageEventArgs or BuildErrorEventArgs or BuildWarningEventArgs
+ or TargetStartedEventArgs or TargetFinishedEventArgs or TaskStartedEventArgs
+ or TaskFinishedEventArgs) {
return;
}
+
Messages.Print(e.Message);
}
public void Shutdown()
- {
- }
+ {}
}
}
diff --git a/QtVsTools.Package/QtMsBuild/QtProjectTracker.cs b/QtVsTools.Core/MsBuild/QtProjectTracker.cs
index 8bc3fb80..5e1e27c2 100644
--- a/QtVsTools.Package/QtMsBuild/QtProjectTracker.cs
+++ b/QtVsTools.Core/MsBuild/QtProjectTracker.cs
@@ -18,16 +18,16 @@ using Microsoft.VisualStudio.VCProjectEngine;
using Task = System.Threading.Tasks.Task;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Core.MsBuild
{
using Common;
using Core;
- using Core.MsBuild;
+ using Options;
using VisualStudio;
using SubscriberAction = ActionBlock<IProjectVersionedValue<IProjectSubscriptionUpdate>>;
- class QtProjectTracker : Concurrent<QtProjectTracker>
+ public class QtProjectTracker : Concurrent<QtProjectTracker>
{
static LazyFactory StaticLazy { get; } = new();
@@ -70,7 +70,7 @@ namespace QtVsTools.QtMsBuild
/// project tracking is disabled by the user (via settings).</returns>
public static QtProjectTracker GetOrAdd(QtProject project)
{
- if (project == null || !QtVsToolsPackage.Instance.Options.ProjectTracking)
+ if (project == null || Options.Get() is not { ProjectTracking: true })
return null;
lock (StaticCriticalSection) {
if (Instances.TryGetValue(project.VcProjectPath, out var tracker))
@@ -96,18 +96,19 @@ namespace QtVsTools.QtMsBuild
static async Task InitDispatcherLoopAsync()
{
- while (!QtVsToolsPackage.Instance.Zombied) {
+ if (VsServiceProvider.Instance is not AsyncPackage package)
+ return;
+
+ while (!package.Zombied) {
while (InitQueue.IsEmpty)
await Task.Delay(100);
if (InitQueue.TryDequeue(out var tracker)) {
if (InitStatus == null) {
- await QtVsToolsPackage.Instance.JoinableTaskFactory
- .SwitchToMainThreadAsync();
+ await package.JoinableTaskFactory.SwitchToMainThreadAsync();
tracker.BeginInitStatus();
await TaskScheduler.Default;
} else {
- await QtVsToolsPackage.Instance.JoinableTaskFactory
- .SwitchToMainThreadAsync();
+ await package.JoinableTaskFactory.SwitchToMainThreadAsync();
tracker.UpdateInitStatus(0);
await TaskScheduler.Default;
}
@@ -157,7 +158,7 @@ namespace QtVsTools.QtMsBuild
var configProject = await UnconfiguredProject.LoadConfiguredProjectAsync(config);
UpdateInitStatus(p += d);
configProject.ProjectUnloading += OnProjectUnloadingAsync;
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} "
+ $"QtProjectTracker({Thread.CurrentThread.ManagedThreadId}): "
+ $"Started tracking [{config.Name}] {QtProject.VcProjectPath}");
@@ -169,7 +170,7 @@ namespace QtVsTools.QtMsBuild
async Task OnProjectUnloadingAsync(object sender, EventArgs args)
{
if (sender is ConfiguredProject project) {
- if (QtVsToolsPackage.Instance.Options.BuildDebugInformation) {
+ if (Options.Get() is { BuildDebugInformation: true }) {
Messages.Print($"{DateTime.Now:HH:mm:ss.FFF} QtProjectTracker: "
+ $"Stopped tracking [{project.ProjectConfiguration.Name}] "
+ $"{project.UnconfiguredProject.FullPath}");
@@ -205,7 +206,7 @@ namespace QtVsTools.QtMsBuild
} catch (Exception exception) {
exception.Log();
}
- InitStatus.RegisterTask(new Task(() => throw new InvalidOperationException()));
+ InitStatus?.RegisterTask(new Task(() => throw new InvalidOperationException()));
}
}
diff --git a/QtVsTools.Package/Options/QtOptionsPage.cs b/QtVsTools.Core/Options/QtOptionsPage.cs
index d289d3c2..6352fbf6 100644
--- a/QtVsTools.Package/Options/QtOptionsPage.cs
+++ b/QtVsTools.Core/Options/QtOptionsPage.cs
@@ -15,13 +15,23 @@ using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.Win32;
using EnvDTE;
-namespace QtVsTools.Options
+namespace QtVsTools.Core.Options
{
using Core;
using VisualStudio;
using static Utils;
using static Common.EnumExt;
+ public static class Options
+ {
+ public static QtOptionsPage Get()
+ {
+ if (VsServiceProvider.Instance is not AsyncPackage package)
+ return null;
+ return package.GetDialogPage(typeof(QtOptionsPage)) as QtOptionsPage;
+ }
+ }
+
public class QtOptionsPage : DialogPage
{
public enum QtMsBuild
@@ -77,7 +87,7 @@ namespace QtVsTools.Options
public enum Timeout : uint { Disabled = 0 }
- class TimeoutConverter : EnumConverter
+ private class TimeoutConverter : EnumConverter
{
public TimeoutConverter(Type t) : base(t)
{ }
@@ -99,7 +109,9 @@ namespace QtVsTools.Options
uint n = 0;
try {
n = Convert.ToUInt32(value);
- } catch { }
+ } catch (Exception e) {
+ e.Log();
+ }
return (Timeout)n;
}
@@ -110,12 +122,12 @@ namespace QtVsTools.Options
Type destinationType)
{
if (destinationType == typeof(string))
- return value.ToString();
+ return value?.ToString();
return base.ConvertTo(context, culture, value, destinationType);
}
}
- class EnableDisableConverter : BooleanConverter
+ private class EnableDisableConverter : BooleanConverter
{
public override object ConvertFrom(
ITypeDescriptorContext context,
@@ -144,7 +156,9 @@ namespace QtVsTools.Options
[Category("QML Debugging")]
[DisplayName("Process debug events")]
- [Description("Set to false to turn off processing of all debug events by the QML debug engine, effectively excluding it from the debugging environment. Disabling the QML debug engine will skip debugging of QML code for all projects.")]
+ [Description("Set to false to turn off processing of all debug events by the QML debug "
+ + "engine, effectively excluding it from the debugging environment. Disabling the "
+ + "QML debug engine will skip debugging of QML code for all projects.")]
public bool QmlDebuggerEnabled { get; set; }
[Category("QML Debugging")]
@@ -158,9 +172,11 @@ namespace QtVsTools.Options
[ReadOnly(true)]
private string QtHelpKeyBinding { get; set; }
+ public enum SourcePreference { Online, Offline }
+
[Category("Help")]
[DisplayName("Preferred source")]
- public QtHelp.SourcePreference HelpPreference { get; set; }
+ public SourcePreference HelpPreference { get; set; }
[Category("Help")]
[DisplayName("Try Qt documentation when F1 is pressed")]
@@ -241,7 +257,7 @@ namespace QtVsTools.Options
QtMsBuildPath = "";
QmlDebuggerEnabled = true;
QmlDebuggerTimeout = (Timeout)60000;
- HelpPreference = QtHelp.SourcePreference.Online;
+ HelpPreference = SourcePreference.Online;
TryQtHelpOnF1Pressed = true;
DesignerDetached = LinguistDetached = ResourceEditorDetached = false;
@@ -257,7 +273,7 @@ namespace QtVsTools.Options
//
var dte = VsServiceProvider.GetService<SDTE, DTE>();
var f1QtHelpBindings = dte.Commands.Item("QtVSTools.F1QtHelp")?.Bindings as Array;
- var binding = f1QtHelpBindings.Cast<string>()
+ var binding = f1QtHelpBindings?.Cast<string>()
.Select(x => x.Split(new[] { "::" }, StringSplitOptions.None))
.Select(x => new { Scope = x.FirstOrDefault(), Shortcut = x.LastOrDefault() })
.FirstOrDefault();
@@ -272,25 +288,24 @@ namespace QtVsTools.Options
try {
QtMsBuildPath = Environment.GetEnvironmentVariable("QTMSBUILD");
- using (var key = Registry.CurrentUser
- .OpenSubKey(@"SOFTWARE\" + Resources.registryPackagePath, writable: false)) {
- if (key == null)
- return;
- Load(() => QmlDebuggerEnabled, key, QmlDebug.Enable);
- Load(() => QmlDebuggerTimeout, key, QmlDebug.Timeout);
- Load(() => HelpPreference, key, Help.Preference);
- Load(() => TryQtHelpOnF1Pressed, key, Help.TryOnF1Pressed);
- Load(() => DesignerDetached, key, Designer.Detached);
- Load(() => LinguistDetached, key, Linguist.Detached);
- Load(() => ResourceEditorDetached, key, ResEditor.Detached);
- Load(() => ProjectTracking, key, BkgBuild.ProjectTracking);
- Load(() => BuildRunQtTools, key, BkgBuild.RunQtTools);
- Load(() => BuildDebugInformation, key, BkgBuild.DebugInfo);
- Load(() => BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity);
- Load(() => NotifyInstalled, key, Notifications.Installed);
- Load(() => UpdateProjectFormat, key, Notifications.UpdateProjectFormat);
- Load(() => LinkNatvis, key, Natvis.Link);
- }
+ using var key = Registry.CurrentUser
+ .OpenSubKey(@"SOFTWARE\" + Resources.registryPackagePath, writable: false);
+ if (key == null)
+ return;
+ Load(() => QmlDebuggerEnabled, key, QmlDebug.Enable);
+ Load(() => QmlDebuggerTimeout, key, QmlDebug.Timeout);
+ Load(() => HelpPreference, key, Help.Preference);
+ Load(() => TryQtHelpOnF1Pressed, key, Help.TryOnF1Pressed);
+ Load(() => DesignerDetached, key, Designer.Detached);
+ Load(() => LinguistDetached, key, Linguist.Detached);
+ Load(() => ResourceEditorDetached, key, ResEditor.Detached);
+ Load(() => ProjectTracking, key, BkgBuild.ProjectTracking);
+ Load(() => BuildRunQtTools, key, BkgBuild.RunQtTools);
+ Load(() => BuildDebugInformation, key, BkgBuild.DebugInfo);
+ Load(() => BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity);
+ Load(() => NotifyInstalled, key, Notifications.Installed);
+ Load(() => UpdateProjectFormat, key, Notifications.UpdateProjectFormat);
+ Load(() => LinkNatvis, key, Natvis.Link);
} catch (Exception exception) {
exception.Log();
}
@@ -307,31 +322,30 @@ namespace QtVsTools.Options
"QTMSBUILD", QtMsBuildPath, EnvironmentVariableTarget.Process);
}
- using (var key = Registry.CurrentUser
- .CreateSubKey(@"SOFTWARE\" + Resources.registryPackagePath)) {
- if (key == null)
- return;
- Save(QmlDebuggerEnabled, key, QmlDebug.Enable);
- Save(QmlDebuggerTimeout, key, QmlDebug.Timeout);
- Save(HelpPreference, key, Help.Preference);
- Save(TryQtHelpOnF1Pressed, key, Help.TryOnF1Pressed);
- Save(DesignerDetached, key, Designer.Detached);
- Save(LinguistDetached, key, Linguist.Detached);
- Save(ResourceEditorDetached, key, ResEditor.Detached);
- Save(ProjectTracking, key, BkgBuild.ProjectTracking);
- Save(BuildRunQtTools, key, BkgBuild.RunQtTools);
- Save(BuildDebugInformation, key, BkgBuild.DebugInfo);
- Save(BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity);
- Save(NotifyInstalled, key, Notifications.Installed);
- Save(UpdateProjectFormat, key, Notifications.UpdateProjectFormat);
- Save(LinkNatvis, key, Natvis.Link);
- }
+ using var key = Registry.CurrentUser
+ .CreateSubKey(@"SOFTWARE\" + Resources.registryPackagePath);
+ if (key == null)
+ return;
+ Save(QmlDebuggerEnabled, key, QmlDebug.Enable);
+ Save(QmlDebuggerTimeout, key, QmlDebug.Timeout);
+ Save(HelpPreference, key, Help.Preference);
+ Save(TryQtHelpOnF1Pressed, key, Help.TryOnF1Pressed);
+ Save(DesignerDetached, key, Designer.Detached);
+ Save(LinguistDetached, key, Linguist.Detached);
+ Save(ResourceEditorDetached, key, ResEditor.Detached);
+ Save(ProjectTracking, key, BkgBuild.ProjectTracking);
+ Save(BuildRunQtTools, key, BkgBuild.RunQtTools);
+ Save(BuildDebugInformation, key, BkgBuild.DebugInfo);
+ Save(BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity);
+ Save(NotifyInstalled, key, Notifications.Installed);
+ Save(UpdateProjectFormat, key, Notifications.UpdateProjectFormat);
+ Save(LinkNatvis, key, Natvis.Link);
} catch (Exception exception) {
exception.Log();
}
}
- void Save<T>(T property, RegistryKey key, Enum name)
+ private static void Save<T>(T property, RegistryKey key, Enum name)
{
object value = property;
if (Equals<T, bool>())
@@ -340,10 +354,11 @@ namespace QtVsTools.Options
value = Convert.ToInt32(property);
else if (typeof(T).IsEnum)
value = Enum.GetName(typeof(T), property);
- key.SetValue(name.Cast<string>(), value);
+ if (value != null)
+ key.SetValue(name.Cast<string>(), value);
}
- void Load<T>(Expression<Func<T>> propertyByRef, RegistryKey key, Enum name)
+ private void Load<T>(Expression<Func<T>> propertyByRef, RegistryKey key, Enum name)
{
var propertyExpr = (MemberExpression)propertyByRef.Body;
var property = (PropertyInfo)propertyExpr.Member;
@@ -358,7 +373,7 @@ namespace QtVsTools.Options
property.SetValue(this, value);
}
- bool Equals<T1, T2>()
+ private static bool Equals<T1, T2>()
{
return typeof(T1) == typeof(T2);
}
diff --git a/QtVsTools.Package/Options/QtVersionsPage.cs b/QtVsTools.Core/Options/QtVersionsPage.cs
index 58069be5..12667a4a 100644
--- a/QtVsTools.Package/Options/QtVersionsPage.cs
+++ b/QtVsTools.Core/Options/QtVersionsPage.cs
@@ -11,10 +11,11 @@ using System.Windows;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
-namespace QtVsTools.Options
+namespace QtVsTools.Core.Options
{
using Common;
using Core;
+ using QtVsTools.VisualStudio;
using static QtVersionsTable;
using static Utils;
@@ -121,8 +122,8 @@ namespace QtVsTools.Options
exception.Log();
}
- if (Notifications.NoQtVersion.IsOpen && VersionManager.GetVersions()?.Any() == true)
- Notifications.NoQtVersion.Close();
+ //if (Notifications.NoQtVersion.IsOpen && VersionManager.GetVersions()?.Any() == true)
+ // Notifications.NoQtVersion.Close();
}
protected override void OnApply(PageApplyEventArgs e)
@@ -159,7 +160,7 @@ namespace QtVsTools.Options
var errorMessage = "Invalid Qt versions:\r\n"
+ $"{string.Join("\r\n", errorMessages.Select(errMsg => " * " + errMsg))}";
VsShellUtilities.ShowMessageBox(
- QtVsToolsPackage.Instance,
+ VsServiceProvider.Instance as IServiceProvider,
errorMessage,
"Qt VS Tools",
OLEMSGICON.OLEMSGICON_WARNING,
diff --git a/QtVsTools.Package/Options/QtVersionsTable.cs b/QtVsTools.Core/Options/QtVersionsTable.cs
index f6beb1b2..652c40ee 100644
--- a/QtVsTools.Package/Options/QtVersionsTable.cs
+++ b/QtVsTools.Core/Options/QtVersionsTable.cs
@@ -1,4 +1,4 @@
-/***************************************************************************************************
+/***************************************************************************************************
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
***************************************************************************************************/
@@ -12,7 +12,7 @@ using System.Windows.Controls;
using System.Windows.Media;
using Microsoft.Win32;
-namespace QtVsTools.Options
+namespace QtVsTools.Core.Options
{
using Common;
using Core;
diff --git a/QtVsTools.Package/Options/QtVersionsTable.xaml b/QtVsTools.Core/Options/QtVersionsTable.xaml
index c37b28aa..ec7b272c 100644
--- a/QtVsTools.Package/Options/QtVersionsTable.xaml
+++ b/QtVsTools.Core/Options/QtVersionsTable.xaml
@@ -4,7 +4,7 @@
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
***************************************************************************************************/
-->
-<UserControl x:Class="QtVsTools.Options.QtVersionsTable"
+<UserControl x:Class="QtVsTools.Core.Options.QtVersionsTable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
diff --git a/QtVsTools.Core/QtVsTools.Core.csproj b/QtVsTools.Core/QtVsTools.Core.csproj
index 83db0e47..a8b735c3 100644
--- a/QtVsTools.Core/QtVsTools.Core.csproj
+++ b/QtVsTools.Core/QtVsTools.Core.csproj
@@ -47,10 +47,12 @@
// -->
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+ <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Windows.Forms" />
@@ -64,8 +66,10 @@
<ItemGroup>
<PackageReference Include="$(Name_Microsoft_VSSDK_BuildTools)" Version="$(Version_Microsoft_VSSDK_BuildTools)" />
<PackageReference Include="$(Name_Microsoft_VisualStudio_SDK)" Version="$(Version_Microsoft_VisualStudio_SDK)" ExcludeAssets="runtime" />
+ <PackageReference Include="$(Name_Microsoft_VisualStudio_ProjectSystem)" Version="$(Version_Microsoft_VisualStudio_ProjectSystem)" />
<PackageReference Include="$(Name_Microsoft_Build)" Version="$(Version_Microsoft_Build)" />
<PackageReference Include="$(Name_Newtonsoft_Json)" Version="$(Version_Newtonsoft_Json)" />
+ <PackageReference Include="$(Name_Microsoft_VisualStudio_Composition)" Version="$(Version_Microsoft_VisualStudio_Composition)" />
<PackageReference Include="$(Name_Microsoft_VisualStudio_Workspace)" Version="$(Version_Microsoft_VisualStudio_Workspace)" />
<PackageReference Include="$(Name_Microsoft_VisualStudio_Workspace_VSIntegration)" Version="$(Version_Microsoft_VisualStudio_Workspace_VSIntegration)" />
</ItemGroup>
@@ -132,12 +136,27 @@
<Compile Include="MsBuild\IPropertyStorageProvider.cs" />
<Compile Include="MsBuild\IVsMacroExpander.cs" />
<Compile Include="MsBuild\QtMoc.cs" />
+ <Compile Include="MsBuild\QtModulesPopup.xaml.cs">
+ <DependentUpon>QtModulesPopup.xaml</DependentUpon>
+ </Compile>
<Compile Include="MsBuild\QtMsBuildContainer.cs" />
+ <Compile Include="MsBuild\QtMsBuildConverter.cs" />
<Compile Include="MsBuild\QtProject.cs" />
+ <Compile Include="MsBuild\QtProjectBuild.cs" />
+ <Compile Include="MsBuild\QtProjectIntelliSense.cs" />
+ <Compile Include="MsBuild\QtProjectLogger.cs" />
+ <Compile Include="MsBuild\QtProjectTracker.cs" />
<Compile Include="MsBuild\QtRcc.cs" />
<Compile Include="MsBuild\QtRepc.cs" />
<Compile Include="MsBuild\QtTool.cs" />
<Compile Include="MsBuild\QtUic.cs" />
+ <Compile Include="Options\QtOptionsPage.cs" />
+ <Compile Include="Options\QtVersionsPage.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Options\QtVersionsTable.cs">
+ <DependentUpon>QtVersionsTable.xaml</DependentUpon>
+ </Compile>
<Compile Include="ProjectFormat.cs" />
<Compile Include="HelperFunctions.cs" />
<Compile Include="Messages.cs" />
@@ -193,6 +212,16 @@
<EmbeddedResource Include="Resources\newitem.png" />
<EmbeddedResource Include="Resources\newitem_d.png" />
</ItemGroup>
+ <ItemGroup>
+ <Page Include="MsBuild\QtModulesPopup.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Options\QtVersionsTable.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\transform.targets" />
</Project> \ No newline at end of file
diff --git a/QtVsTools.Package/Editors/Editor.QtDesigner.cs b/QtVsTools.Package/Editors/Editor.QtDesigner.cs
index 5cd61695..9536cf62 100644
--- a/QtVsTools.Package/Editors/Editor.QtDesigner.cs
+++ b/QtVsTools.Package/Editors/Editor.QtDesigner.cs
@@ -14,7 +14,6 @@ using Task = System.Threading.Tasks.Task;
namespace QtVsTools.Editors
{
using Core.MsBuild;
- using QtMsBuild;
using VisualStudio;
[Guid(GuidString)]
diff --git a/QtVsTools.Package/QtMsBuild/QtModulesEditor.cs b/QtVsTools.Package/MsBuild/QtModulesEditor.cs
index c5e970fd..d3161613 100644
--- a/QtVsTools.Package/QtMsBuild/QtModulesEditor.cs
+++ b/QtVsTools.Package/MsBuild/QtModulesEditor.cs
@@ -3,17 +3,18 @@
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
***************************************************************************************************/
-using Microsoft.VisualStudio.ProjectSystem;
-using Microsoft.VisualStudio.ProjectSystem.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
+using Microsoft.VisualStudio.ProjectSystem;
+using Microsoft.VisualStudio.ProjectSystem.Properties;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Package.MsBuild
{
using Core;
+ using QtVsTools.Core.MsBuild;
[Export(typeof(IPropertyPageUIValueEditor))]
[ExportMetadata("Name", "QtModulesEditor")]
diff --git a/QtVsTools.Package/QtMsBuild/QtVersionProvider.cs b/QtVsTools.Package/MsBuild/QtVersionProvider.cs
index e31bc125..0487ea33 100644
--- a/QtVsTools.Package/QtMsBuild/QtVersionProvider.cs
+++ b/QtVsTools.Package/MsBuild/QtVersionProvider.cs
@@ -7,12 +7,12 @@ using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading.Tasks;
-using Microsoft.Win32;
+using Microsoft.Build.Framework.XamlTypes;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Properties;
-using Microsoft.Build.Framework.XamlTypes;
+using Microsoft.Win32;
-namespace QtVsTools.QtMsBuild
+namespace QtVsTools.Package.MsBuild
{
[ExportDynamicEnumValuesProvider("QtVersionProvider")]
[AppliesTo("IntegratedConsoleDebugging")]
@@ -34,18 +34,16 @@ namespace QtVsTools.QtMsBuild
public async Task<ICollection<IEnumValue>> GetListedValuesAsync()
{
- using (var qtVersions = Registry.CurrentUser.OpenSubKey(@"Software\Digia\Versions")) {
-
- return await Task.FromResult(
- qtVersions.GetSubKeyNames()
- .Select(x => new PageEnumValue(new EnumValue
- {
- Name = x,
- DisplayName = x
- }))
- .Cast<IEnumValue>()
- .ToList());
- }
+ using var qtVersions = Registry.CurrentUser.OpenSubKey(@"Software\Digia\Versions");
+ return await Task.FromResult(
+ qtVersions?.GetSubKeyNames()
+ .Select(x => new PageEnumValue(new EnumValue
+ {
+ Name = x,
+ DisplayName = x
+ }))
+ .Cast<IEnumValue>()
+ .ToList());
}
public async Task<IEnumValue> TryCreateEnumValueAsync(string userSuppliedValue)
diff --git a/QtVsTools.Package/Package/DteEventsHandler.cs b/QtVsTools.Package/Package/DteEventsHandler.cs
index e13f721e..64760d94 100644
--- a/QtVsTools.Package/Package/DteEventsHandler.cs
+++ b/QtVsTools.Package/Package/DteEventsHandler.cs
@@ -17,7 +17,6 @@ namespace QtVsTools
using Core;
using Core.CMake;
using Core.MsBuild;
- using QtMsBuild;
using VisualStudio;
using static Utils;
diff --git a/QtVsTools.Package/Package/Notifications.cs b/QtVsTools.Package/Package/Notifications.cs
index c0008748..d6bc4ac2 100644
--- a/QtVsTools.Package/Package/Notifications.cs
+++ b/QtVsTools.Package/Package/Notifications.cs
@@ -13,6 +13,7 @@ using Microsoft.VisualStudio.Shell;
namespace QtVsTools
{
using Core;
+ using Core.MsBuild;
using Common;
using VisualStudio;
@@ -53,7 +54,7 @@ namespace QtVsTools
Text = "Select Qt version...",
CloseInfoBar = false,
OnClicked = () =>
- QtVsToolsPackage.Instance.ShowOptionPage(typeof(Options.QtVersionsPage))
+ QtVsToolsPackage.Instance.ShowOptionPage(typeof(Core.Options.QtVersionsPage))
}
};
}
diff --git a/QtVsTools.Package/Package/QtHelp.cs b/QtVsTools.Package/Package/QtHelp.cs
index c5d95ee9..39c8ca5c 100644
--- a/QtVsTools.Package/Package/QtHelp.cs
+++ b/QtVsTools.Package/Package/QtHelp.cs
@@ -18,11 +18,10 @@ namespace QtVsTools
{
using Core;
using VisualStudio;
+ using static Core.Options.QtOptionsPage.SourcePreference;
public class QtHelp
{
- public enum SourcePreference { Online, Offline }
-
private static QtHelp Instance
{
get;
@@ -141,7 +140,7 @@ namespace QtVsTools
if (qchFiles.Length == 0)
return TryShowGenericSearchResultsOnline(keyword, info.qtMajor);
- var offline = QtVsToolsPackage.Instance.Options.HelpPreference == SourcePreference.Offline;
+ var offline = QtVsToolsPackage.Instance.Options.HelpPreference == Offline;
var linksForKeyword = "SELECT d.Title, f.Name, e.Name, "
+ "d.Name, a.Anchor FROM IndexTable a, FileNameTable d, FolderTable e, "
@@ -222,7 +221,7 @@ namespace QtVsTools
private static bool TryShowGenericSearchResultsOnline(string keyword, uint version)
{
- if (QtVsToolsPackage.Instance.Options.HelpPreference != SourcePreference.Online)
+ if (QtVsToolsPackage.Instance.Options.HelpPreference != Online)
return false;
VsShellUtilities.OpenSystemBrowser(HelperFunctions.FromNativeSeparators(
diff --git a/QtVsTools.Package/Package/QtMainMenu.cs b/QtVsTools.Package/Package/QtMainMenu.cs
index cd7b2637..1ec71447 100644
--- a/QtVsTools.Package/Package/QtMainMenu.cs
+++ b/QtVsTools.Package/Package/QtMainMenu.cs
@@ -12,6 +12,7 @@ using EnvDTE;
namespace QtVsTools
{
using Core;
+ using Core.MsBuild;
using VisualStudio;
/// <summary>
@@ -117,10 +118,10 @@ namespace QtVsTools
}
break;
case QtMenus.Package.QtOptions:
- QtVsToolsPackage.Instance.ShowOptionPage(typeof(Options.QtOptionsPage));
+ QtVsToolsPackage.Instance.ShowOptionPage(typeof(Core.Options.QtOptionsPage));
break;
case QtMenus.Package.QtVersions:
- QtVsToolsPackage.Instance.ShowOptionPage(typeof(Options.QtVersionsPage));
+ QtVsToolsPackage.Instance.ShowOptionPage(typeof(Core.Options.QtVersionsPage));
break;
}
}
diff --git a/QtVsTools.Package/Package/QtProjectContextMenu.cs b/QtVsTools.Package/Package/QtProjectContextMenu.cs
index 3a5250fe..1e501f27 100644
--- a/QtVsTools.Package/Package/QtProjectContextMenu.cs
+++ b/QtVsTools.Package/Package/QtProjectContextMenu.cs
@@ -13,7 +13,6 @@ namespace QtVsTools
{
using Core;
using Core.MsBuild;
- using QtMsBuild;
using VisualStudio;
/// <summary>
diff --git a/QtVsTools.Package/Package/QtSolutionContextMenu.cs b/QtVsTools.Package/Package/QtSolutionContextMenu.cs
index 3f4d285a..4a337f04 100644
--- a/QtVsTools.Package/Package/QtSolutionContextMenu.cs
+++ b/QtVsTools.Package/Package/QtSolutionContextMenu.cs
@@ -11,7 +11,6 @@ namespace QtVsTools
{
using Core;
using Core.MsBuild;
- using QtMsBuild;
using VisualStudio;
/// <summary>
diff --git a/QtVsTools.Package/Package/Translation.cs b/QtVsTools.Package/Package/Translation.cs
index 80b85d0d..083c3876 100644
--- a/QtVsTools.Package/Package/Translation.cs
+++ b/QtVsTools.Package/Package/Translation.cs
@@ -14,7 +14,6 @@ namespace QtVsTools
{
using Core;
using Core.MsBuild;
- using QtMsBuild;
/// <summary>
/// Run Qt translation tools by invoking the corresponding Qt/MSBuild targets
diff --git a/QtVsTools.Package/QtVsTools.Package.csproj b/QtVsTools.Package/QtVsTools.Package.csproj
index ee2ac9b0..0bc4d670 100644
--- a/QtVsTools.Package/QtVsTools.Package.csproj
+++ b/QtVsTools.Package/QtVsTools.Package.csproj
@@ -298,6 +298,8 @@
<DependsOn>$(SolutionDir)\version.targets;$(SolutionDir)\version.tt;$(SolutionDir)\common.tt</DependsOn>
<LastGenOutput>AssemblyInfo.tt.cs</LastGenOutput>
</T4Template>
+ <Compile Include="MsBuild\QtModulesEditor.cs" />
+ <Compile Include="MsBuild\QtVersionProvider.cs" />
<Compile Include="Properties\AssemblyInfo.tt.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -328,15 +330,6 @@
<Compile Include="Editors\Editor.QtDesigner.cs" />
<Compile Include="Editors\Editor.QtLinguist.cs" />
<Compile Include="Editors\Editor.QtResourceEditor.cs" />
- <Compile Include="Options\QtOptionsPage.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="Options\QtVersionsTable.cs">
- <DependentUpon>QtVersionsTable.xaml</DependentUpon>
- </Compile>
- <Compile Include="Options\QtVersionsPage.cs">
- <SubType>Component</SubType>
- </Compile>
<Compile Include="QML\Classification\QmlAsyncClassifier.cs" />
<Compile Include="QML\Classification\QmlClassificationFormat.cs" />
<Compile Include="QML\Classification\QmlExpressionEvalClassifier.cs" />
@@ -386,16 +379,6 @@
<Compile Include="Package\QtHelp.cs" />
<Compile Include="Package\QtItemContextMenu.cs" />
<Compile Include="Package\QtMainMenu.cs" />
- <Compile Include="Package\QtMsBuildConverter.cs" />
- <Compile Include="QtMsBuild\QtModulesEditor.cs" />
- <Compile Include="QtMsBuild\QtModulesPopup.xaml.cs">
- <DependentUpon>QtModulesPopup.xaml</DependentUpon>
- </Compile>
- <Compile Include="QtMsBuild\QtProjectBuild.cs" />
- <Compile Include="QtMsBuild\QtProjectIntelliSense.cs" />
- <Compile Include="QtMsBuild\QtProjectLogger.cs" />
- <Compile Include="QtMsBuild\QtVersionProvider.cs" />
- <Compile Include="QtMsBuild\QtProjectTracker.cs" />
<Compile Include="Package\QtProjectContextMenu.cs" />
<Compile Include="Package\QtSolutionContextMenu.cs" />
<Compile Include="Package\Translation.cs" />
@@ -482,18 +465,10 @@
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Resources\menuimages.png" />
- <Page Include="Options\QtVersionsTable.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Package\QtHelpLinkChooser.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
- <Page Include="QtMsBuild\QtModulesPopup.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\transform.targets" />
diff --git a/QtVsTools.Package/QtVsToolsPackage.cs b/QtVsTools.Package/QtVsToolsPackage.cs
index 9641c4b5..c4b3eb63 100644
--- a/QtVsTools.Package/QtVsToolsPackage.cs
+++ b/QtVsTools.Package/QtVsToolsPackage.cs
@@ -24,7 +24,6 @@ using Task = System.Threading.Tasks.Task;
namespace QtVsTools
{
using Core;
- using QtMsBuild;
using Package;
using VisualStudio;
@@ -68,19 +67,19 @@ namespace QtVsTools
logicalViewGuid: VSConstants.LOGVIEWID.TextView_string)]
// Options page
- [ProvideOptionPage(typeof(Options.QtOptionsPage),
+ [ProvideOptionPage(typeof(Core.Options.QtOptionsPage),
"Qt", "General", 0, 0, true, Sort = 0)]
// Qt Versions page
- [ProvideOptionPage(typeof(Options.QtVersionsPage),
+ [ProvideOptionPage(typeof(Core.Options.QtVersionsPage),
"Qt", "Versions", 0, 0, true, Sort = 1)]
public sealed class QtVsToolsPackage : AsyncPackage, IVsServiceProvider
{
public DTE Dte { get; private set; }
public string PkgInstallPath { get; private set; }
- public Options.QtOptionsPage Options
- => GetDialogPage(typeof(Options.QtOptionsPage)) as Options.QtOptionsPage;
+ public Core.Options.QtOptionsPage Options
+ => GetDialogPage(typeof(Core.Options.QtOptionsPage)) as Core.Options.QtOptionsPage;
public Editors.QtDesigner QtDesigner { get; private set; }
public Editors.QtLinguist QtLinguist { get; private set; }
private Editors.QtResourceEditor QtResourceEditor { get; set; }