Skip to content

Commit

Permalink
Merge branch 'dev' into dev1
Browse files Browse the repository at this point in the history
  • Loading branch information
jjw24 committed Dec 8, 2024
2 parents 6df0837 + 304f98e commit bce07ee
Show file tree
Hide file tree
Showing 60 changed files with 498 additions and 371 deletions.
20 changes: 10 additions & 10 deletions Flow.Launcher.Core/Configuration/Portable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void DisablePortableMode()
#endif
IndicateDeletion(DataLocation.PortableDataPath);

MessageBox.Show("Flow Launcher needs to restart to finish disabling portable mode, " +
MessageBoxEx.Show("Flow Launcher needs to restart to finish disabling portable mode, " +
"after the restart your portable data profile will be deleted and roaming data profile kept");

UpdateManager.RestartApp(Constant.ApplicationFileName);
Expand All @@ -64,7 +64,7 @@ public void EnablePortableMode()
#endif
IndicateDeletion(DataLocation.RoamingDataPath);

MessageBox.Show("Flow Launcher needs to restart to finish enabling portable mode, " +
MessageBoxEx.Show("Flow Launcher needs to restart to finish enabling portable mode, " +
"after the restart your roaming data profile will be deleted and portable data profile kept");

UpdateManager.RestartApp(Constant.ApplicationFileName);
Expand Down Expand Up @@ -95,13 +95,13 @@ public void RemoveUninstallerEntry()

public void MoveUserDataFolder(string fromLocation, string toLocation)
{
FilesFolders.CopyAll(fromLocation, toLocation);
FilesFolders.CopyAll(fromLocation, toLocation, MessageBoxEx.Show);
VerifyUserDataAfterMove(fromLocation, toLocation);
}

public void VerifyUserDataAfterMove(string fromLocation, string toLocation)
{
FilesFolders.VerifyBothFolderFilesEqual(fromLocation, toLocation);
FilesFolders.VerifyBothFolderFilesEqual(fromLocation, toLocation, MessageBoxEx.Show);
}

public void CreateShortcuts()
Expand Down Expand Up @@ -157,13 +157,13 @@ public void PreStartCleanUpAfterPortabilityUpdate()
// delete it and prompt the user to pick the portable data location
if (File.Exists(roamingDataDeleteFilePath))
{
FilesFolders.RemoveFolderIfExists(roamingDataDir);
FilesFolders.RemoveFolderIfExists(roamingDataDir, MessageBoxEx.Show);

if (MessageBox.Show("Flow Launcher has detected you enabled portable mode, " +
if (MessageBoxEx.Show("Flow Launcher has detected you enabled portable mode, " +
"would you like to move it to a different location?", string.Empty,
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
FilesFolders.OpenPath(Constant.RootDirectory);
FilesFolders.OpenPath(Constant.RootDirectory, MessageBoxEx.Show);

Environment.Exit(0);
}
Expand All @@ -172,9 +172,9 @@ public void PreStartCleanUpAfterPortabilityUpdate()
// delete it and notify the user about it.
else if (File.Exists(portableDataDeleteFilePath))
{
FilesFolders.RemoveFolderIfExists(portableDataDir);
FilesFolders.RemoveFolderIfExists(portableDataDir, MessageBoxEx.Show);

MessageBox.Show("Flow Launcher has detected you disabled portable mode, " +
MessageBoxEx.Show("Flow Launcher has detected you disabled portable mode, " +
"the relevant shortcuts and uninstaller entry have been created");
}
}
Expand All @@ -186,7 +186,7 @@ public bool CanUpdatePortability()

if (roamingLocationExists && portableLocationExists)
{
MessageBox.Show(string.Format("Flow Launcher detected your user data exists both in {0} and " +
MessageBoxEx.Show(string.Format("Flow Launcher detected your user data exists both in {0} and " +
"{1}. {2}{2}Please delete {1} in order to proceed. No changes have occurred.",
DataLocation.PortableDataPath, DataLocation.RoamingDataPath, Environment.NewLine));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Flow.Launcher.Plugin.SharedCommands;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Forms;
using Flow.Launcher.Core.Resource;

Expand Down Expand Up @@ -57,7 +57,7 @@ internal IEnumerable<PluginPair> Setup()
EnvName,
Environment.NewLine
);
if (MessageBox.Show(noRuntimeMessage, string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
if (MessageBoxEx.Show(noRuntimeMessage, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No)
{
var msg = string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginChooseRuntimeExecutable"), EnvName);
string selectedFile;
Expand All @@ -82,7 +82,7 @@ internal IEnumerable<PluginPair> Setup()
}
else
{
MessageBox.Show(string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginUnableToSetExecutablePath"), Language));
MessageBoxEx.Show(string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginUnableToSetExecutablePath"), Language));
Log.Error("PluginsLoader",
$"Not able to successfully set {EnvName} path, setting's plugin executable path variable is still an empty string.",
$"{Language}Environment");
Expand All @@ -98,7 +98,7 @@ private void EnsureLatestInstalled(string expectedPath, string currentPath, stri
if (expectedPath == currentPath)
return;

FilesFolders.RemoveFolderIfExists(installedDirPath);
FilesFolders.RemoveFolderIfExists(installedDirPath, MessageBoxEx.Show);

InstallEnvironment();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal PythonEnvironment(List<PluginMetadata> pluginMetadataList, PluginsSetti

internal override void InstallEnvironment()
{
FilesFolders.RemoveFolderIfExists(InstallPath);
FilesFolders.RemoveFolderIfExists(InstallPath, MessageBoxEx.Show);

// Python 3.11.4 is no longer Windows 7 compatible. If user is on Win 7 and
// uses Python plugin they need to custom install and use v3.8.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal TypeScriptEnvironment(List<PluginMetadata> pluginMetadataList, PluginsS

internal override void InstallEnvironment()
{
FilesFolders.RemoveFolderIfExists(InstallPath);
FilesFolders.RemoveFolderIfExists(InstallPath, MessageBoxEx.Show);

DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath).Wait();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal TypeScriptV2Environment(List<PluginMetadata> pluginMetadataList, Plugin

internal override void InstallEnvironment()
{
FilesFolders.RemoveFolderIfExists(InstallPath);
FilesFolders.RemoveFolderIfExists(InstallPath, MessageBoxEx.Show);

DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath).Wait();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Window
x:Class="Flow.Launcher.MessageBoxEx"
x:Class="Flow.Launcher.Core.MessageBoxEx"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher"
xmlns:local="clr-namespace:Flow.Launcher.Core"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="MessageBoxWindow"
Width="420"
Expand All @@ -21,7 +21,7 @@
<KeyBinding Key="Escape" Command="Close" />
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="Close" Executed="cmdEsc_OnPress" />
<CommandBinding Command="Close" Executed="KeyEsc_OnPress" />
</Window.CommandBindings>
<Grid>
<Grid.RowDefinitions>
Expand All @@ -33,14 +33,11 @@
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="4"
Grid.Column="1"
Click="Button_Cancel"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand All @@ -63,8 +60,12 @@
</Grid>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" Margin="30 0 30 24">
<Grid Grid.Column="0" Margin="0 0 0 12">
<Grid Grid.Row="1" Margin="30 0 30 24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0 0 0 12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
Expand All @@ -74,7 +75,7 @@
Grid.Column="0"
Width="18"
Height="18"
Margin="0 0 0 0"
Margin="0 0 10 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
RenderOptions.BitmapScalingMode="Fant"
Expand All @@ -84,7 +85,7 @@
x:Name="TitleTextBlock"
Grid.Column="1"
MaxWidth="400"
Margin="10 0 26 0"
Margin="0 0 26 0"
VerticalAlignment="Center"
FontFamily="Segoe UI"
FontSize="20"
Expand All @@ -94,14 +95,26 @@
</Grid>
<TextBlock
x:Name="DescTextBlock"
Grid.Column="1"
Grid.Row="1"
MaxWidth="400"
Margin="0 0 26 0"
HorizontalAlignment="Stretch"
FontSize="14"
TextAlignment="Left"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
x:Name="DescOnlyTextBlock"
Grid.Row="0"
Grid.RowSpan="2"
MaxWidth="400"
Margin="0 0 26 0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
FontSize="14"
TextAlignment="Left"
TextWrapping="Wrap"
Visibility="Collapsed" />
</Grid>
<Border
Grid.Row="2"
Margin="0 0 0 0"
Expand All @@ -113,29 +126,29 @@
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnCancel"
MinWidth="140"
x:Name="btnOk"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Click"
Content="{DynamicResource commonCancel}" />
Content="{DynamicResource commonOK}" />
<Button
x:Name="btnNo"
MinWidth="140"
x:Name="btnYes"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Click"
Content="{DynamicResource commonNo}" />
Content="{DynamicResource commonYes}" />
<Button
x:Name="btnOk"
MinWidth="140"
x:Name="btnNo"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Click"
Content="{DynamicResource commonOK}" />
Content="{DynamicResource commonNo}" />
<Button
x:Name="btnYes"
MinWidth="140"
x:Name="btnCancel"
MinWidth="120"
Margin="5 0 5 0"
Click="Button_Click"
Content="{DynamicResource commonYes}" />
Content="{DynamicResource commonCancel}" />
</WrapPanel>
</Border>
</Grid>
Expand Down
Loading

0 comments on commit bce07ee

Please sign in to comment.