Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 1 addition & 4 deletions Flow.Launcher/CustomQueryHotkeySetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,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="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
5 changes: 1 addition & 4 deletions Flow.Launcher/CustomShortcutSetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,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="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@
<system:String x:Key="reportWindow_report_succeed">Report sent successfully</system:String>
<system:String x:Key="reportWindow_report_failed">Failed to send report</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String>
<system:String x:Key="reportWindow_please_open_issue">Please open new issue in</system:String>
<system:String x:Key="reportWindow_upload_log">1. Upload log file: {0}</system:String>
<system:String x:Key="reportWindow_copy_below">2. Copy below exception message</system:String>
<system:String x:Key="reportWindow_date">Date: {0}</system:String>
<system:String x:Key="reportWindow_exception">Exception:</system:String>
<system:String x:Key="reportWindow_length">Length</system:String>

<!-- General Notice -->
<system:String x:Key="pleaseWait">Please wait...</system:String>
Expand Down
5 changes: 1 addition & 4 deletions Flow.Launcher/PriorityChangeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,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="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
101 changes: 80 additions & 21 deletions Flow.Launcher/ReportWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,82 @@
<Window x:Class="Flow.Launcher.ReportWindow"
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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Icon="Images/app_error.png"
Topmost="True"
ResizeMode="NoResize"
Width="600"
Height="455"
Title="{DynamicResource reportWindow_flowlauncher_got_an_error}"
d:DesignHeight="300" d:DesignWidth="600" x:ClassModifier="internal">
<RichTextBox x:Name="ErrorTextbox"
IsDocumentEnabled="True"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"
FontSize="14"
Margin="10"
BorderThickness="0"/>
<Window
x:Class="Flow.Launcher.ReportWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{DynamicResource reportWindow_flowlauncher_got_an_error}"
Width="600"
Height="455"
d:DesignHeight="300"
d:DesignWidth="600"
x:ClassModifier="internal"
Background="{DynamicResource PopuBGColor}"
Foreground="{DynamicResource PopupTextColor}"
Icon="/Images/app_error.png"
ResizeMode="NoResize"
Topmost="True"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
</WindowChrome.WindowChrome>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
Width="16"
Height="16"
Margin="10 4 4 4"
RenderOptions.BitmapScalingMode="HighQuality"
Source="/Images/app_error.png" />
<TextBlock
Grid.Column="1"
Margin="4 0 0 0"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource Color05B}"
Text="{DynamicResource reportWindow_flowlauncher_got_an_error}" />
<Button
Grid.Column="2"
Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Width="46"
Height="32"
Data="M 18,11 27,20 M 18,20 27,11"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
StrokeThickness="1">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
<Setter Property="Opacity" Value="0.5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Button>
</Grid>
<RichTextBox
x:Name="ErrorTextbox"
Grid.Row="1"
Margin="10"
BorderThickness="0"
FontSize="14"
HorizontalScrollBarVisibility="Auto"
IsDocumentEnabled="True"
VerticalScrollBarVisibility="Auto" />
</Grid>

</Window>
64 changes: 48 additions & 16 deletions Flow.Launcher/ReportWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using System.Linq;
using System.Windows;
using System.Windows.Documents;
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Infrastructure.Exception;

namespace Flow.Launcher
{
Expand Down Expand Up @@ -43,32 +43,36 @@ private void SetException(Exception exception)
var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).First();

var websiteUrl = exception switch
{
FlowPluginException pluginException =>GetIssuesUrl(pluginException.Metadata.Website),
_ => Constant.IssuesUrl
};

{
FlowPluginException pluginException =>GetIssuesUrl(pluginException.Metadata.Website),
_ => Constant.IssuesUrl
};

var paragraph = Hyperlink("Please open new issue in: ", websiteUrl);
paragraph.Inlines.Add($"1. upload log file: {log.FullName}\n");
paragraph.Inlines.Add($"2. copy below exception message");
var paragraph = Hyperlink(App.API.GetTranslation("reportWindow_please_open_issue"), websiteUrl);
paragraph.Inlines.Add(string.Format(App.API.GetTranslation("reportWindow_upload_log"), log.FullName));
paragraph.Inlines.Add("\n");
paragraph.Inlines.Add(App.API.GetTranslation("reportWindow_copy_below"));
ErrorTextbox.Document.Blocks.Add(paragraph);

StringBuilder content = new StringBuilder();
content.AppendLine(ErrorReporting.RuntimeInfo());
content.AppendLine(ErrorReporting.DependenciesInfo());
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
content.AppendLine("Exception:");
content.AppendLine(RuntimeInfo());
content.AppendLine();
content.AppendLine(DependenciesInfo());
content.AppendLine();
content.AppendLine(string.Format(App.API.GetTranslation("reportWindow_date"), DateTime.Now.ToString(CultureInfo.InvariantCulture)));
content.AppendLine(App.API.GetTranslation("reportWindow_exception"));
content.AppendLine(exception.ToString());
paragraph = new Paragraph();
paragraph.Inlines.Add(content.ToString());
ErrorTextbox.Document.Blocks.Add(paragraph);
}

private Paragraph Hyperlink(string textBeforeUrl, string url)
private static Paragraph Hyperlink(string textBeforeUrl, string url)
{
var paragraph = new Paragraph();
paragraph.Margin = new Thickness(0);
var paragraph = new Paragraph
{
Margin = new Thickness(0)
};

var link = new Hyperlink
{
Expand All @@ -79,10 +83,38 @@ private Paragraph Hyperlink(string textBeforeUrl, string url)
link.Click += (s, e) => SearchWeb.OpenInBrowserTab(url);

paragraph.Inlines.Add(textBeforeUrl);
paragraph.Inlines.Add(" ");
paragraph.Inlines.Add(link);
paragraph.Inlines.Add("\n");

return paragraph;
}

private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
{
Close();
}

private static string RuntimeInfo()
{
var info =
$"""
Flow Launcher {App.API.GetTranslation("reportWindow_version")}: {Constant.Version}
OS {App.API.GetTranslation("reportWindow_version")}: {ExceptionFormatter.GetWindowsFullVersionFromRegistry()}
IntPtr {App.API.GetTranslation("reportWindow_length")}: {IntPtr.Size}
x64: {Environment.Is64BitOperatingSystem}
""";
return info;
}

private static string DependenciesInfo()
{
var info =
$"""
{App.API.GetTranslation("pythonFilePath")}: {Constant.PythonPath}
{App.API.GetTranslation("nodeFilePath")}: {Constant.NodePath}
""";
return info;
}
}
}
5 changes: 1 addition & 4 deletions Flow.Launcher/SelectBrowserWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,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="btnCancel_Click"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
5 changes: 1 addition & 4 deletions Flow.Launcher/SelectFileManagerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
<StackPanel>
<Grid Grid.Row="0">
<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="btnCancel_Click"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
5 changes: 1 addition & 4 deletions Flow.Launcher/WelcomeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
Expand All @@ -53,9 +51,8 @@
FontSize="12"
Foreground="{DynamicResource Color05B}"
Text="{DynamicResource Welcome_Page1_Title}" />

<Button
Grid.Column="4"
Grid.Column="2"
Click="BtnCancel_OnClick"
Style="{StaticResource TitleBarCloseButtonStyle}">
<Path
Expand Down
Loading