Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3ae960d
Replace System.Windows.Message with MessageBoxEx
Jack251970 Nov 24, 2024
6feca10
Improve MessageBoxEx paramters as System.Windows.MessageBox for reada…
Jack251970 Nov 24, 2024
ab087bd
Remove useless columns
Jack251970 Nov 24, 2024
fd78972
Improve OK MessageBoxEx display style
Jack251970 Nov 24, 2024
c103244
Merge branch 'dev4' of https://github.com/Jack251970/Flow.Launcher in…
Jack251970 Nov 24, 2024
b30cc4f
Replace System.Windows.MessageBox with MessageBoxEx
Jack251970 Nov 25, 2024
4bc9e86
Improve MessageBoxEx style as System.Windows.MessageBox
Jack251970 Nov 25, 2024
dcea54a
Fix parameter bug under release mode
Jack251970 Nov 26, 2024
897fd7a
Replace Flow.Launcher.Core.MessageBoxType & MessageBoxImage with Syst…
Jack251970 Nov 26, 2024
32c138b
Improve MessageBoxEx show function, making experience like System.Win…
Jack251970 Nov 26, 2024
7cb17ab
Improve title display experience & Fix three button dialog display is…
Jack251970 Nov 26, 2024
7ba8d58
Improve result handle & Improve exception support
Jack251970 Nov 27, 2024
9b75acd
Add ShowMsgBox functions in public api
Jack251970 Nov 27, 2024
534a111
Use public api to call ShowMsgBox functions & remove useless Core pro…
Jack251970 Nov 27, 2024
5d8f277
Use image loader to load image
Jack251970 Nov 27, 2024
5312505
Improve code quality
Jack251970 Nov 27, 2024
0d362b3
Add default messageboxShow parameter for functions in FilesFolders
Jack251970 Dec 1, 2024
b568d2d
Combine ShowMsgBox into one function.
Jack251970 Dec 1, 2024
57cbe10
Fix parameter bug
Jack251970 Dec 1, 2024
676a5b1
add defaults to MessageBoxEx Show & update WebSearch to use api call
jjw24 Dec 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading