A Swiss Army knife for developers.
C# blazorcross-platformcsharpdesktopdesktop-appdesktop-applicationdeveloper-toolsextensiblefluentfluent-designlinuxmacosmicasyntax-highlightingtypescriptwindowswindows-10windows-11winui
Added welcome experience (#1075)
Etienne Baudoux62c31b92b9b4
diff --git a/src/app/dev/DevToys.Blazor/Components/Layout/Dialog/Dialog.razor.cs b/src/app/dev/DevToys.Blazor/Components/Layout/Dialog/Dialog.razor.csindex 33cab995b..4fce70df8 100644--- a/src/app/dev/DevToys.Blazor/Components/Layout/Dialog/Dialog.razor.cs+++ b/src/app/dev/DevToys.Blazor/Components/Layout/Dialog/Dialog.razor.cs@@ -1,7 +1,15 @@-namespace DevToys.Blazor.Components;+using DevToys.Blazor.Core.Services;++namespace DevToys.Blazor.Components;public partial class Dialog : JSStyledComponentBase, IFocusable{+ private bool _isOpen;+ private IDisposable? _session;++ [Inject]+ internal GlobalDialogService DialogService { get; set; } = default!;+/// <summary>/// Gets or sets the content to be rendered inside the component./// </summary>@@ -31,6 +39,49 @@ public partial class Dialog : JSStyledComponentBase, IFocusablereturn JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.DOM.setFocus", Element);}+ public bool TryOpen()+ {+ IsOpen = DialogService.TryOpenDialog(out _session);+ _isOpen = IsOpen;+ if (IsOpen)+ {+ StateHasChanged();+ }++ return IsOpen;+ }++ internal void Close()+ {+ IsOpen = false;+ _isOpen = false;+ _session?.Dispose();+ StateHasChanged();+ }++ public override ValueTask DisposeAsync()+ {+ Close();+ return base.DisposeAsync();+ }++ protected override void OnParametersSet()+ {+ if (IsOpen != _isOpen)+ {+ if (IsOpen)+ {+ _isOpen = TryOpen();+ }+ else+ {+ Close();+ }+ }++ base.OnParametersSet();+ }+protected override Task OnAfterRenderAsync(bool firstRender){if (firstRender)@@ -48,7 +99,7 @@ public partial class Dialog : JSStyledComponentBase, IFocusable{if (Dismissible){- IsOpen = false;+ Close();if (OnDismissed.HasDelegate){OnDismissed.InvokeAsync();diff --git a/src/app/dev/DevToys.Blazor/Core/Services/GlobalDialogService.cs b/src/app/dev/DevToys.Blazor/Core/Services/GlobalDialogService.csnew file mode 100644index 000000000..0ed22495f--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Core/Services/GlobalDialogService.cs@@ -0,0 +1,48 @@+namespace DevToys.Blazor.Core.Services;++public sealed class GlobalDialogService+{+ private readonly object _syncLock = new();++ internal bool IsDialogOpened { get; private set; }++ internal bool TryOpenDialog(out IDisposable? session)+ {+ lock (_syncLock)+ {+ if (IsDialogOpened)+ {+ // Only one dialog should open at the same time.+ session = null;+ return false;+ }++ IsDialogOpened = true;+ session = new DialogSession(this);+ return true;+ }+ }++ private class DialogSession : IDisposable+ {+ private readonly GlobalDialogService _dialogService;+ private bool _isDisposed;++ public DialogSession(GlobalDialogService dialogService)+ {+ _dialogService = dialogService;+ }++ public void Dispose()+ {+ lock (_dialogService._syncLock)+ {+ if (!_isDisposed)+ {+ _isDisposed = true;+ _dialogService.IsDialogOpened = false;+ }+ }+ }+ }+}diff --git a/src/app/dev/DevToys.Blazor/Core/Services/DialogService.cs b/src/app/dev/DevToys.Blazor/Core/Services/UIDialogService.cssimilarity index 75%rename from src/app/dev/DevToys.Blazor/Core/Services/DialogService.csrename to src/app/dev/DevToys.Blazor/Core/Services/UIDialogService.csindex b333bd8d1..39db2bcee 100644--- a/src/app/dev/DevToys.Blazor/Core/Services/DialogService.cs+++ b/src/app/dev/DevToys.Blazor/Core/Services/UIDialogService.cs@@ -1,8 +1,14 @@namespace DevToys.Blazor.Core.Services;-public sealed class DialogService+public sealed class UIDialogService{private readonly object _lock = new();+ private readonly GlobalDialogService _globalDialogService;++ public UIDialogService(GlobalDialogService globalDialogService)+ {+ _globalDialogService = globalDialogService;+ }internal bool IsDialogOpened { get; private set; }@@ -20,9 +26,9 @@ public sealed class DialogService{lock (_lock){- if (IsDialogOpened)+ if (_globalDialogService.IsDialogOpened){- // Only one context menu should open at the same time.+ // Only one dialog should open at the same time.return false;}diff --git a/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razor b/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razornew file mode 100644index 000000000..351be1c5a--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razor@@ -0,0 +1,36 @@+@namespace DevToys.Blazor.Pages.Dialogs+@inherits MefComponentBase++<Dialog @ref=_dialog+ Dismissible ="false">+ <Content>+ <StackPanel Orientation="UIOrientation.Vertical"+ Spacing="16">+ <StackPanel Orientation="UIOrientation.Vertical">+ <TextBlock Appearance="@TextBlockAppearance.Title" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.Welcome" />+ <TextBlock Appearance="@TextBlockAppearance.Body" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.AppDescription" />+ </StackPanel>+ <StackPanel Orientation="UIOrientation.Vertical">+ <TextBlock Appearance="@TextBlockAppearance.BodyStrong" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.OfflineFirstTitle" />+ <TextBlock Appearance="@TextBlockAppearance.Body" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.OfflineFirstDescription" />+ </StackPanel>+ <StackPanel Orientation="UIOrientation.Vertical">+ <TextBlock Appearance="@TextBlockAppearance.BodyStrong" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.TrustButVerifyTitle" />+ <TextBlock Appearance="@TextBlockAppearance.Body" Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.TrustButVerifyDescription" />+ </StackPanel>+ </StackPanel>+ </Content>+ <Footer>+ <StackPanel Orientation="UIOrientation.Horizontal"+ HorizontalAlignment="UIHorizontalAlignment.Right"+ Spacing="16">+ <CheckBox Text="@DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.UnderstandAndAgree"+ IsCheckedChanged="IsAgreeCheckBoxCheckedChanged"/>+ <Button @ref=_continueButton+ Appearance="@ButtonAppearance.Accent"+ @onclick="@OnContinueButtonClick">+ @DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog.Continue+ </Button>+ </StackPanel>+ </Footer>+</Dialog>\ No newline at end of filediff --git a/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razor.cs b/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razor.csnew file mode 100644index 000000000..ed96b0371--- /dev/null+++ b/src/app/dev/DevToys.Blazor/Pages/Dialogs/FirstStartDialog.razor.cs@@ -0,0 +1,41 @@+using DevToys.Blazor.Components;+using DevToys.Core.Settings;+using Microsoft.AspNetCore.Components.Web;++namespace DevToys.Blazor.Pages.Dialogs;++public partial class FirstStartDialog : MefComponentBase+{+ private Button _continueButton = default!;+ private Dialog _dialog = default!;++ [Import]+ private ISettingsProvider SettingsProvider { get; set; } = default!;++ internal void Open()+ {+ _dialog.TryOpen();+ }++ protected override void OnAfterRender(bool firstRender)+ {+ if (firstRender)+ {+ _continueButton.IsEnabled = false;+ StateHasChanged();+ }++ base.OnAfterRender(firstRender);+ }++ private void IsAgreeCheckBoxCheckedChanged(bool isChecked)+ {+ _continueButton.IsEnabled = isChecked;+ }++ private void OnContinueButtonClick(MouseEventArgs ev)+ {+ SettingsProvider.SetSetting(PredefinedSettings.IsFirstStart, false);+ _dialog.Close();+ }+}diff --git a/src/app/dev/DevToys.Blazor/Pages/Index.razor b/src/app/dev/DevToys.Blazor/Pages/Index.razorindex a5c461033..22e565292 100644--- a/src/app/dev/DevToys.Blazor/Pages/Index.razor+++ b/src/app/dev/DevToys.Blazor/Pages/Index.razor@@ -1,6 +1,8 @@@page "/"+@using DevToys.Blazor.Pages.Dialogs@using DevToys.Blazor.Pages.SubPages+@using DevToys.Core.Settings@using DevToys.Core.Tools.ViewItems;@using DevToys.Core.Tools;@using DevToys.Localization.Strings.MainWindow;@@ -8,16 +10,21 @@@inherits MefComponentBase<CascadingValue Value="this" IsFixed="true">- @if (DialogService.IsDialogOpened)+ @if (SettingsProvider.GetSetting(PredefinedSettings.IsFirstStart)){- <Dialog IsOpen="@DialogService.IsDialogOpened"- Dismissible="@DialogService.IsDismissible"- OnDismissed="@(() => DialogService.OnCloseDialogRequested())">+ <FirstStartDialog @ref=_firstStartDialog />+ }++ @if (UIDialogService.IsDialogOpened)+ {+ <Dialog IsOpen="@UIDialogService.IsDialogOpened"+ Dismissible="@UIDialogService.IsDismissible"+ OnDismissed="@(() => UIDialogService.OnCloseDialogRequested())"><Content>- @DialogService.DialogContent+ @UIDialogService.DialogContent</Content><Footer>- @DialogService.FooterContent+ @UIDialogService.FooterContent</Footer></Dialog>}diff --git a/src/app/dev/DevToys.Blazor/Pages/Index.razor.cs b/src/app/dev/DevToys.Blazor/Pages/Index.razor.csindex 7ab4bc2bf..69672f401 100644--- a/src/app/dev/DevToys.Blazor/Pages/Index.razor.cs+++ b/src/app/dev/DevToys.Blazor/Pages/Index.razor.cs@@ -1,9 +1,11 @@using DevToys.Blazor.Components;using DevToys.Blazor.Core.Services;+using DevToys.Blazor.Pages.Dialogs;using DevToys.Blazor.Pages.SubPages;using DevToys.Business.Services;using DevToys.Business.ViewModels;using DevToys.Core;+using DevToys.Core.Settings;using DevToys.Core.Tools;using DevToys.Core.Tools.ViewItems;using DevToys.Localization.Strings.ToolGroupPage;@@ -25,6 +27,7 @@ public partial class Index : MefComponentBaseprivate const int TitleBarMarginLeftWhenNavBarHidden = 90;private const int TitleBarMarginLeftWhenNavBarNotHidden = 47;+ private FirstStartDialog _firstStartDialog = default!;private NavBar<INotifyPropertyChanged, GuiToolViewItem> _navBar = default!;private IFocusable? _contentPage;@@ -50,7 +53,10 @@ public partial class Index : MefComponentBaseinternal ContextMenuService ContextMenuService { get; set; } = default!;[Inject]- internal DialogService DialogService { get; set; } = default!;+ internal UIDialogService UIDialogService { get; set; } = default!;++ [Inject]+ internal GlobalDialogService GlobalDialogService { get; set; } = default!;[Inject]internal IWindowService WindowService { get; set; } = default!;@@ -66,7 +72,7 @@ public partial class Index : MefComponentBaseprotected override void OnInitialized(){base.OnInitialized();- DialogService.IsDialogOpenedChanged += DialogService_IsDialogOpenedChanged;+ UIDialogService.IsDialogOpenedChanged += DialogService_IsDialogOpenedChanged;ViewModel.SelectedMenuItemChanged += ViewModel_SelectedMenuItemChanged;ViewModel.SelectedMenuItem ??= ViewModel.HeaderAndBodyToolViewItems[0];ContextMenuService.IsContextMenuOpenedChanged += ContextMenuService_IsContextMenuOpenedChanged;@@ -108,7 +114,7 @@ public partial class Index : MefComponentBaseStateHasChanged();// Start Smart Detection- ViewModel.RunSmartDetectionAsync(WindowService.IsCompactOverlayMode, DialogService.IsDialogOpened)+ ViewModel.RunSmartDetectionAsync(WindowService.IsCompactOverlayMode, GlobalDialogService.IsDialogOpened).ContinueWith(async _ =>{await InvokeAsync(StateHasChanged);@@ -213,8 +219,13 @@ public partial class Index : MefComponentBase// Focus on the Search Box._navBar.TryFocusSearchBoxAsync();+ if (SettingsProvider.GetSetting(PredefinedSettings.IsFirstStart))+ {+ _firstStartDialog.Open();+ }+// Start Smart Detection- ViewModel.RunSmartDetectionAsync(WindowService.IsCompactOverlayMode, DialogService.IsDialogOpened).Forget();+ ViewModel.RunSmartDetectionAsync(WindowService.IsCompactOverlayMode, GlobalDialogService.IsDialogOpened).Forget();}if (IsTransitioning)diff --git a/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor b/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razorindex 3fbfd0d84..45a592534 100644--- a/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor+++ b/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor@@ -13,7 +13,7 @@protected override Task OnInitializedAsync(){- DialogService.DialogContent = (__builder) =>+ UIDialogService.DialogContent = (__builder) =>{@if (ViewModel.ToolView.CurrentOpenedDialog is not null){@@ -21,7 +21,7 @@}};- DialogService.FooterContent = (__builder) =>+ UIDialogService.FooterContent = (__builder) =>{@if (ViewModel.ToolView.CurrentOpenedDialog is not null){diff --git a/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor.cs b/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor.csindex 378adff6b..986171af1 100644--- a/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor.cs+++ b/src/app/dev/DevToys.Blazor/Pages/SubPages/ToolPage.razor.cs@@ -15,7 +15,7 @@ public partial class ToolPage : MefComponentBase, IFocusableinternal IWindowService WindowService { get; set; } = default!;[Inject]- internal DialogService DialogService { get; set; } = default!;+ internal UIDialogService UIDialogService { get; set; } = default!;[Import]internal ToolPageViewModel ViewModel { get; set; } = default!;@@ -35,7 +35,7 @@ public partial class ToolPage : MefComponentBase, IFocusableprotected override void OnInitialized(){base.OnInitialized();- DialogService.CloseDialogRequested += DialogService_CloseDialogRequested;+ UIDialogService.CloseDialogRequested += DialogService_CloseDialogRequested;HotReloadService.HotReloadRequestUpdateApplication += OnHotReloadRequestUpdateApplication;}@@ -66,7 +66,7 @@ public partial class ToolPage : MefComponentBase, IFocusable}HotReloadService.HotReloadRequestUpdateApplication -= OnHotReloadRequestUpdateApplication;- DialogService.CloseDialogRequested -= DialogService_CloseDialogRequested;+ UIDialogService.CloseDialogRequested -= DialogService_CloseDialogRequested;if (ViewModel.ToolView is not null){@@ -92,12 +92,12 @@ public partial class ToolPage : MefComponentBase, IFocusable{if (ViewModel.ToolView.CurrentOpenedDialog is null){- DialogService.CloseDialog();+ UIDialogService.CloseDialog();}else{ViewModel.ToolView.CurrentOpenedDialog.IsOpenedChanged += DialogService_CloseDialogRequested;- DialogService.TryOpenDialog(ViewModel.ToolView.CurrentOpenedDialog.IsDismissible);+ UIDialogService.TryOpenDialog(ViewModel.ToolView.CurrentOpenedDialog.IsDismissible);}}@@ -108,7 +108,7 @@ public partial class ToolPage : MefComponentBase, IFocusableViewModel.ToolView.CurrentOpenedDialog.IsOpenedChanged -= DialogService_CloseDialogRequested;}- DialogService.CloseDialog();+ UIDialogService.CloseDialog();ViewModel.ToolView.CurrentOpenedDialog?.Close();}diff --git a/src/app/dev/DevToys.Core/AppHelper.cs b/src/app/dev/DevToys.Core/AppHelper.csnew file mode 100644index 000000000..428adc1e6--- /dev/null+++ b/src/app/dev/DevToys.Core/AppHelper.cs@@ -0,0 +1,19 @@+using System.Reflection;++namespace DevToys.Core;++public static class AppHelper+{+ /// <summary>+ /// Indicates whether the current instance of the app is a preview/beta version.+ /// </summary>+ public static readonly Lazy<bool> IsPreviewVersion = new(() =>+ {+ var assemblyInformationalVersion+ = (AssemblyInformationalVersionAttribute)+ Assembly+ .GetExecutingAssembly()+ .GetCustomAttribute(typeof(AssemblyInformationalVersionAttribute))!;+ return assemblyInformationalVersion.InformationalVersion.Contains("pre", StringComparison.CurrentCultureIgnoreCase);+ });+}diff --git a/src/app/dev/DevToys.Core/Settings/PredefinedSettings.cs b/src/app/dev/DevToys.Core/Settings/PredefinedSettings.csindex a25f6e48c..44481c5a6 100644--- a/src/app/dev/DevToys.Core/Settings/PredefinedSettings.cs+++ b/src/app/dev/DevToys.Core/Settings/PredefinedSettings.cs@@ -37,6 +37,14 @@ public static class PredefinedSettings"Segoe UI",};+ /// <summary>+ /// Indicates whether it is the first time the app starts or not.+ /// </summary>+ public static readonly SettingDefinition<bool> IsFirstStart+ = new(+ name: nameof(IsFirstStart),+ defaultValue: true);+/// <summary>/// The language to use for the texts in the user interface./// </summary>diff --git a/src/app/dev/DevToys.Localization/DevToys.Localization.csproj b/src/app/dev/DevToys.Localization/DevToys.Localization.csprojindex 832cb77a5..3673a18bd 100644--- a/src/app/dev/DevToys.Localization/DevToys.Localization.csproj+++ b/src/app/dev/DevToys.Localization/DevToys.Localization.csproj@@ -16,6 +16,11 @@<PackageReference Include="System.ComponentModel.Composition" /></ItemGroup><ItemGroup>+ <Compile Update="Strings\FirstStartDialog\FirstStartDialog.Designer.cs">+ <DesignTime>True</DesignTime>+ <AutoGen>True</AutoGen>+ <DependentUpon>FirstStartDialog.resx</DependentUpon>+ </Compile><Compile Update="Strings\InfoBar\InfoBar.Designer.cs"><DesignTime>True</DesignTime><AutoGen>True</AutoGen>diff --git a/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.Designer.cs b/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.Designer.csnew file mode 100644index 000000000..dafa3e25c--- /dev/null+++ b/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.Designer.cs@@ -0,0 +1,136 @@+//------------------------------------------------------------------------------+// <auto-generated>+// This code was generated by a tool.+// Runtime Version:4.0.30319.42000+//+// Changes to this file may cause incorrect behavior and will be lost if+// the code is regenerated.+// </auto-generated>+//------------------------------------------------------------------------------++namespace DevToys.Localization.Strings.FirstStartDialog {+ using System;+++ /// <summary>+ /// A strongly-typed resource class, for looking up localized strings, etc.+ /// </summary>+ // This class was auto-generated by the StronglyTypedResourceBuilder+ // class via a tool like ResGen or Visual Studio.+ // To add or remove a member, edit your .ResX file then rerun ResGen+ // with the /str option, or rebuild your VS project.+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]+ public class FirstStartDialog {++ private static global::System.Resources.ResourceManager resourceMan;++ private static global::System.Globalization.CultureInfo resourceCulture;++ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]+ internal FirstStartDialog() {+ }++ /// <summary>+ /// Returns the cached ResourceManager instance used by this class.+ /// </summary>+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]+ public static global::System.Resources.ResourceManager ResourceManager {+ get {+ if (object.ReferenceEquals(resourceMan, null)) {+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DevToys.Localization.Strings.FirstStartDialog.FirstStartDialog", typeof(FirstStartDialog).Assembly);+ resourceMan = temp;+ }+ return resourceMan;+ }+ }++ /// <summary>+ /// Overrides the current thread's CurrentUICulture property for all+ /// resource lookups using this strongly typed resource class.+ /// </summary>+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]+ public static global::System.Globalization.CultureInfo Culture {+ get {+ return resourceCulture;+ }+ set {+ resourceCulture = value;+ }+ }++ /// <summary>+ /// Looks up a localized string similar to DevToys is your go-to toolbox for developers, packed with a collection of free and open-source tools. Think of it as a Swiss Army knife tailored to tackle those pesky daily tasks that slow you down.+ ///Here’s what you need to know:.+ /// </summary>+ public static string AppDescription {+ get {+ return ResourceManager.GetString("AppDescription", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Continue.+ /// </summary>+ public static string Continue {+ get {+ return ResourceManager.GetString("Continue", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to DevToys operates with an offline-first mindset. We collect minimal anonymized data locally for troubleshooting purposes. We don’t upload logs to the internet. If you encounter a bug and choose to report it, we may ask you to share the logs with us. We will occasionally connect to the internet to check for updates, ensuring you have access to the latest features and security enhancements..+ /// </summary>+ public static string OfflineFirstDescription {+ get {+ return ResourceManager.GetString("OfflineFirstDescription", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Offline First Philosophy.+ /// </summary>+ public static string OfflineFirstTitle {+ get {+ return ResourceManager.GetString("OfflineFirstTitle", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to The power of DevToys grows with extensions, adding more power to your toolbox. While we ensure the core app’s integrity, it is important to know that we have no control over what third-party extensions do with your computer and data. Therefore, we encourage you to practice caution when installing extensions. To monitor DevToys or any extension’s network activity, tools like Wireshark, Little Snitch, or Fiddler can be utilized to track incoming and outgoing connections..+ /// </summary>+ public static string TrustButVerifyDescription {+ get {+ return ResourceManager.GetString("TrustButVerifyDescription", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Trust but Verify.+ /// </summary>+ public static string TrustButVerifyTitle {+ get {+ return ResourceManager.GetString("TrustButVerifyTitle", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to I understand and agree.+ /// </summary>+ public static string UnderstandAndAgree {+ get {+ return ResourceManager.GetString("UnderstandAndAgree", resourceCulture);+ }+ }++ /// <summary>+ /// Looks up a localized string similar to Welcome to DevToys!.+ /// </summary>+ public static string Welcome {+ get {+ return ResourceManager.GetString("Welcome", resourceCulture);+ }+ }+ }+}diff --git a/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.resx b/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.resxnew file mode 100644index 000000000..a6996935a--- /dev/null+++ b/src/app/dev/DevToys.Localization/Strings/FirstStartDialog/FirstStartDialog.resx@@ -0,0 +1,145 @@+<?xml version="1.0" encoding="utf-8"?>+<root>+ <!--+ Microsoft ResX Schema++ Version 2.0++ The primary goals of this format is to allow a simple XML format+ that is mostly human readable. The generation and parsing of the+ various data types are done through the TypeConverter classes+ associated with the data types.++ Example:++ ... ado.net/XML headers & schema ...+ <resheader name="resmimetype">text/microsoft-resx</resheader>+ <resheader name="version">2.0</resheader>+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">+ <value>[base64 mime encoded serialized .NET Framework object]</value>+ </data>+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>+ <comment>This is a comment</comment>+ </data>++ There are any number of "resheader" rows that contain simple+ name/value pairs.++ Each data row contains a name, and value. The row also contains a+ type or mimetype. Type corresponds to a .NET class that support+ text/value conversion through the TypeConverter architecture.+ Classes that don't support this are serialized and stored with the+ mimetype set.++ The mimetype is used for serialized objects, and tells the+ ResXResourceReader how to depersist the object. This is currently not+ extensible. For a given mimetype the value must be set accordingly:++ Note - application/x-microsoft.net.object.binary.base64 is the format+ that the ResXResourceWriter will generate, however the reader can+ read any of the formats listed below.++ mimetype: application/x-microsoft.net.object.binary.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.soap.base64+ value : The object must be serialized with+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter+ : and then encoded with base64 encoding.++ mimetype: application/x-microsoft.net.object.bytearray.base64+ value : The object must be serialized into a byte array+ : using a System.ComponentModel.TypeConverter+ : and then encoded with base64 encoding.+ -->+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />+ <xsd:element name="root" msdata:IsDataSet="true">+ <xsd:complexType>+ <xsd:choice maxOccurs="unbounded">+ <xsd:element name="metadata">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" />+ </xsd:sequence>+ <xsd:attribute name="name" use="required" type="xsd:string" />+ <xsd:attribute name="type" type="xsd:string" />+ <xsd:attribute name="mimetype" type="xsd:string" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="assembly">+ <xsd:complexType>+ <xsd:attribute name="alias" type="xsd:string" />+ <xsd:attribute name="name" type="xsd:string" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="data">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />+ <xsd:attribute ref="xml:space" />+ </xsd:complexType>+ </xsd:element>+ <xsd:element name="resheader">+ <xsd:complexType>+ <xsd:sequence>+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />+ </xsd:sequence>+ <xsd:attribute name="name" type="xsd:string" use="required" />+ </xsd:complexType>+ </xsd:element>+ </xsd:choice>+ </xsd:complexType>+ </xsd:element>+ </xsd:schema>+ <resheader name="resmimetype">+ <value>text/microsoft-resx</value>+ </resheader>+ <resheader name="version">+ <value>2.0</value>+ </resheader>+ <resheader name="reader">+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <resheader name="writer">+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>+ </resheader>+ <data name="AppDescription" xml:space="preserve">+ <value>DevToys is your go-to toolbox for developers, packed with a collection of free and open-source tools. Think of it as a Swiss Army knife tailored to tackle those pesky daily tasks that slow you down.+Here’s what you need to know:</value>+ </data>+ <data name="Continue" xml:space="preserve">+ <value>Continue</value>+ </data>+ <data name="OfflineFirstDescription" xml:space="preserve">+ <value>DevToys operates with an offline-first mindset. We collect minimal anonymized data locally for troubleshooting purposes. We don’t upload logs to the internet. If you encounter a bug and choose to report it, we may ask you to share the logs with us. We will occasionally connect to the internet to check for updates, ensuring you have access to the latest features and security enhancements.</value>+ </data>+ <data name="OfflineFirstTitle" xml:space="preserve">+ <value>Offline First Philosophy</value>+ </data>+ <data name="TrustButVerifyDescription" xml:space="preserve">+ <value>The power of DevToys grows with extensions, adding more power to your toolbox. While we ensure the core app’s integrity, it is important to know that we have no control over what third-party extensions do with your computer and data. Therefore, we encourage you to practice caution when installing extensions. To monitor DevToys or any extension’s network activity, tools like Wireshark, Little Snitch, or Fiddler can be utilized to track incoming and outgoing connections.</value>+ </data>+ <data name="TrustButVerifyTitle" xml:space="preserve">+ <value>Trust but Verify</value>+ </data>+ <data name="UnderstandAndAgree" xml:space="preserve">+ <value>I understand and agree</value>+ </data>+ <data name="Welcome" xml:space="preserve">+ <value>Welcome to DevToys!</value>+ </data>+</root>\ No newline at end of filediff --git a/src/app/dev/platforms/desktop/DevToys.Linux/Core/Constants.cs b/src/app/dev/platforms/desktop/DevToys.Linux/Core/Constants.csindex 8c7754e93..5c3a23104 100644--- a/src/app/dev/platforms/desktop/DevToys.Linux/Core/Constants.cs+++ b/src/app/dev/platforms/desktop/DevToys.Linux/Core/Constants.cs@@ -1,4 +1,6 @@-namespace DevToys.Linux.Core;+using DevToys.Core;++namespace DevToys.Linux.Core;internal static class Constants{@@ -24,6 +26,6 @@ internal static class ConstantsapplicationDataRootFolder = Path.Combine(userHomeFolderPath, ".local", "share");}- return Path.Combine(applicationDataRootFolder, "devtoys");+ return Path.Combine(applicationDataRootFolder, AppHelper.IsPreviewVersion.Value ? "devtoys-preview" : "devtoys");}}diff --git a/src/app/dev/platforms/desktop/DevToys.Linux/LinuxProgram.cs b/src/app/dev/platforms/desktop/DevToys.Linux/LinuxProgram.csindex 0ae85b200..472f74222 100644--- a/src/app/dev/platforms/desktop/DevToys.Linux/LinuxProgram.cs+++ b/src/app/dev/platforms/desktop/DevToys.Linux/LinuxProgram.cs@@ -127,7 +127,8 @@ internal partial class LinuxProgram_serviceCollection.AddScoped<DocumentEventService, DocumentEventService>();_serviceCollection.AddScoped<PopoverService, PopoverService>();_serviceCollection.AddScoped<ContextMenuService, ContextMenuService>();- _serviceCollection.AddScoped<DialogService, DialogService>();+ _serviceCollection.AddScoped<GlobalDialogService, GlobalDialogService>();+ _serviceCollection.AddScoped<UIDialogService, UIDialogService>();_serviceCollection.AddScoped<FontService, FontService>();ServiceProvider serviceProvider = _serviceCollection.BuildServiceProvider();diff --git a/src/app/dev/platforms/desktop/DevToys.MacOS/AppDelegate.cs b/src/app/dev/platforms/desktop/DevToys.MacOS/AppDelegate.csindex 9f7184194..ab416b4f9 100644--- a/src/app/dev/platforms/desktop/DevToys.MacOS/AppDelegate.cs+++ b/src/app/dev/platforms/desktop/DevToys.MacOS/AppDelegate.cs@@ -1,4 +1,4 @@-using DevToys.Api;+using DevToys.Api;using DevToys.Blazor.BuiltInTools;using DevToys.Blazor.BuiltInTools.ExtensionsManager;using DevToys.Blazor.Core.Languages;@@ -134,7 +134,8 @@ public class AppDelegate : NSApplicationDelegateserviceCollection.AddScoped<DocumentEventService, DocumentEventService>();serviceCollection.AddScoped<PopoverService, PopoverService>();serviceCollection.AddScoped<ContextMenuService, ContextMenuService>();- serviceCollection.AddScoped<DialogService, DialogService>();+ serviceCollection.AddScoped<GlobalDialogService, GlobalDialogService>();+ serviceCollection.AddScoped<UIDialogService, UIDialogService>();serviceCollection.AddScoped<FontService, FontService>();ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();diff --git a/src/app/dev/platforms/desktop/DevToys.MacOS/Core/Constants.cs b/src/app/dev/platforms/desktop/DevToys.MacOS/Core/Constants.csindex f2b2c1cf1..e25ddf425 100644--- a/src/app/dev/platforms/desktop/DevToys.MacOS/Core/Constants.cs+++ b/src/app/dev/platforms/desktop/DevToys.MacOS/Core/Constants.cs@@ -1,10 +1,12 @@+using DevToys.Core;+namespace DevToys.MacOS.Core;internal static class Constants{- internal static readonly string AppCacheDirectory = Path.Combine(GetCacheDirectory(), "com.devtoys");+ internal static readonly string AppCacheDirectory = Path.Combine(GetCacheDirectory(), GetAppFolderName());- internal static string PluginInstallationFolder => Path.Combine(GetLibraryDirectory(), "com.devtoys", "Plugins");+ internal static string PluginInstallationFolder => Path.Combine(GetLibraryDirectory(), GetAppFolderName(), "Plugins");internal static string AppTempFolder => Path.Combine(AppCacheDirectory, "Temp");@@ -21,4 +23,9 @@ internal static class Constantsreturn dirs[0];}++ private static string GetAppFolderName()+ {+ return AppHelper.IsPreviewVersion.Value ? "com.devtoys.preview" : "com.devtoys";+ }}diff --git a/src/app/dev/platforms/desktop/DevToys.Windows/Core/Constants.cs b/src/app/dev/platforms/desktop/DevToys.Windows/Core/Constants.csindex 1184224b4..200e67920 100644--- a/src/app/dev/platforms/desktop/DevToys.Windows/Core/Constants.cs+++ b/src/app/dev/platforms/desktop/DevToys.Windows/Core/Constants.cs@@ -1,10 +1,11 @@using System.IO;+using DevToys.Core;namespace DevToys.Windows.Core;internal static class Constants{- internal static readonly string AppCacheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DevToys");+ internal static readonly string AppCacheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), AppHelper.IsPreviewVersion.Value ? "DevToys-preview" : "DevToys");internal static string PluginInstallationFolder => Path.Combine(AppCacheDirectory, "Plugins");diff --git a/src/app/dev/platforms/desktop/DevToys.Windows/MainWindow.xaml.cs b/src/app/dev/platforms/desktop/DevToys.Windows/MainWindow.xaml.csindex b62aad32d..7ab0fc344 100644--- a/src/app/dev/platforms/desktop/DevToys.Windows/MainWindow.xaml.cs+++ b/src/app/dev/platforms/desktop/DevToys.Windows/MainWindow.xaml.cs@@ -178,7 +178,8 @@ public partial class MainWindow : MicaWindowWithOverlayserviceCollection.AddScoped<DocumentEventService, DocumentEventService>();serviceCollection.AddScoped<PopoverService, PopoverService>();serviceCollection.AddScoped<ContextMenuService, ContextMenuService>();- serviceCollection.AddScoped<DialogService, DialogService>();+ serviceCollection.AddScoped<GlobalDialogService, GlobalDialogService>();+ serviceCollection.AddScoped<UIDialogService, UIDialogService>();serviceCollection.AddScoped<FontService, FontService>();ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();