mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-19 09:01:32 +01:00
Add application start help
In case the user launch the application without using the context menu it launch a window to help him.
This commit is contained in:
1 parent
939d6db778
commit
42ccbdb8fa
6 files changed
+83
-4
No files matched your search
@@ -25,6 +25,7 @@ namespace FileConverter
|
||||
using FileConverter.ConversionJobs;
|
||||
using FileConverter.Diagnostics;
|
||||
using FileConverter.Upgrade;
|
||||
using FileConverter.Windows;
|
||||
|
||||
public partial class Application : System.Windows.Application
|
||||
{
|
||||
@@ -73,6 +74,12 @@ namespace FileConverter
|
||||
set;
|
||||
}
|
||||
|
||||
public bool HideMainWindow
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Verbose
|
||||
{
|
||||
get;
|
||||
@@ -180,7 +187,7 @@ namespace FileConverter
|
||||
//args[6] = @"D:\Test\Track03.mp3";
|
||||
//args[7] = @"D:\Test\Track04.mp3";
|
||||
|
||||
System.Array.Resize(ref args, 2);
|
||||
System.Array.Resize(ref args, 1);
|
||||
args[1] = "--settings";
|
||||
|
||||
//System.Array.Resize(ref args, 5);
|
||||
@@ -201,7 +208,11 @@ namespace FileConverter
|
||||
|
||||
if (args.Length == 1)
|
||||
{
|
||||
// TODO: Help windows to explain that this application is a context menu extension.
|
||||
// Diplay help windows to explain that this application is a context menu extension.
|
||||
ApplicationStartHelp applicationStartHelp = new ApplicationStartHelp();
|
||||
applicationStartHelp.Show();
|
||||
this.HideMainWindow = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ConversionPreset conversionPreset = null;
|
||||
@@ -225,6 +236,7 @@ namespace FileConverter
|
||||
|
||||
case "settings":
|
||||
this.ShowSettings = true;
|
||||
this.HideMainWindow = true;
|
||||
break;
|
||||
|
||||
case "apply-settings":
|
||||
|
||||
@@ -124,6 +124,9 @@
|
||||
<Compile Include="ValueConverters\OutputTypeToVisibility.cs" />
|
||||
<Compile Include="ValueConverters\Generic\StringToEnum.cs" />
|
||||
<Compile Include="ValueConverters\Generic\ValueConverterGroup.cs" />
|
||||
<Compile Include="Windows\ApplicationStartHelp.xaml.cs">
|
||||
<DependentUpon>ApplicationStartHelp.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\DiagnosticsWindow.xaml.cs">
|
||||
<DependentUpon>DiagnosticsWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -142,6 +145,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\ApplicationStartHelp.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\DiagnosticsWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -215,6 +222,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\DownloadIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ContextMenuScreenshot.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,24 @@
|
||||
<Window x:Class="FileConverter.Windows.ApplicationStartHelp"
|
||||
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"
|
||||
xmlns:local="clr-namespace:FileConverter.Windows"
|
||||
xmlns:fileConverter="clr-namespace:FileConverter"
|
||||
xmlns:valueConverters="clr-namespace:FileConverter.ValueConverters"
|
||||
mc:Ignorable="d"
|
||||
Height="480" Width="640" Icon="/FileConverter;component/Resources/ApplicationIcon.ico" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize">
|
||||
<Window.Resources>
|
||||
<valueConverters:ApplicationVersionToApplicationName x:Key="ApplicationVersionToApplicationName"/>
|
||||
</Window.Resources>
|
||||
<Window.Title>
|
||||
<Binding Converter="{StaticResource ApplicationVersionToApplicationName}" Mode="OneWay" Path="(fileConverter:Application.ApplicationVersion)"/>
|
||||
</Window.Title>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock Margin="0,0,0,4" Text="File Converter is a shell extension." TextWrapping="Wrap" FontWeight="Bold" FontSize="13.333"/>
|
||||
<TextBlock Text="That means it is integrated into the Windows explorer." TextWrapping="Wrap"/>
|
||||
<TextBlock Text="To use File Converter please open the explorer and right-click on any file you like to bring up the context menu where you will find File Converter commands (see the readme file to see the list of compatible file formats)." TextWrapping="Wrap" />
|
||||
<Image Margin="0,7,0,7" HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="Auto" Source="/FileConverter;component/Resources/ContextMenuScreenshot.png" Stretch="None"/>
|
||||
<Button Content="Ok" Height="28" Click="OkButton_Click"/>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
@@ -0,0 +1,29 @@
|
||||
// <copyright file="ApplicationStartHelp.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||
|
||||
namespace FileConverter.Windows
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
public partial class ApplicationStartHelp : Window
|
||||
{
|
||||
public ApplicationStartHelp()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public static FileConverter.Version ApplicationVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return FileConverter.Application.ApplicationVersion;
|
||||
}
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
Dispatcher.BeginInvoke((Action)(() => Application.Current.Shutdown()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,12 @@ namespace FileConverter
|
||||
Application application = Application.Current as Application;
|
||||
|
||||
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
|
||||
|
||||
if (application.HideMainWindow)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
if (application.Verbose)
|
||||
{
|
||||
this.ShowDiagnosticsWindow();
|
||||
@@ -29,8 +35,6 @@ namespace FileConverter
|
||||
|
||||
if (application.ShowSettings)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
this.ShowSettingsWindow();
|
||||
this.settingsWindow.OnSettingsWindowHide += this.SettingsWindow_Closed;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user