mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Implement 'formats' command in GUI.
This commit is contained in:
@@ -1,28 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>DiscImageChef.Gui</RootNamespace>
|
||||
<AssemblyName>DiscImageChef.Gui</AssemblyName>
|
||||
<ReleaseVersion>$(Version)</ReleaseVersion>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<Version>4.5.99.1693</Version>
|
||||
<Company>Claunia.com</Company>
|
||||
<Copyright>Copyright © {copyright:2011} Natalia Portillo</Copyright>
|
||||
<Product>The Disc Image Chef</Product>
|
||||
<Title>The Disc Image Chef</Title>
|
||||
<ApplicationVersion>$(Version)</ApplicationVersion>
|
||||
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<NrtRevisionFormat>$(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified}</NrtRevisionFormat>
|
||||
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
|
||||
<NrtShowRevision>true</NrtShowRevision>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Eto.Forms" Version="2.4.1" />
|
||||
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.2.2-beta" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DiscImageChef.Devices\DiscImageChef.Devices.csproj" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<RootNamespace>DiscImageChef.Gui</RootNamespace>
|
||||
<AssemblyName>DiscImageChef.Gui</AssemblyName>
|
||||
<ReleaseVersion>$(Version)</ReleaseVersion>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<Version>4.5.99.1693</Version>
|
||||
<Company>Claunia.com</Company>
|
||||
<Copyright>Copyright © {copyright:2011} Natalia Portillo</Copyright>
|
||||
<Product>The Disc Image Chef</Product>
|
||||
<Title>The Disc Image Chef</Title>
|
||||
<ApplicationVersion>$(Version)</ApplicationVersion>
|
||||
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<NrtRevisionFormat>$(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified}</NrtRevisionFormat>
|
||||
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
|
||||
<NrtShowRevision>true</NrtShowRevision>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Eto.Forms" Version="2.4.1" />
|
||||
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.2.2-beta" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DiscImageChef.Core\DiscImageChef.Core.csproj" />
|
||||
<ProjectReference Include="..\DiscImageChef.Devices\DiscImageChef.Devices.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
105
DiscImageChef.Gui/dlgPlugins.xeto
Normal file
105
DiscImageChef.Gui/dlgPlugins.xeto
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
//
|
||||
// Filename : dlgPlugins.xeto
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Plugins dialog.
|
||||
//
|
||||
// ==[ Description ] ==========================================================
|
||||
//
|
||||
// Defines the structure for the console window.
|
||||
//
|
||||
// ==[ License ] ==============================================================
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
<Dialog xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Plugins"
|
||||
ClientSize="600, 450" Padding="10">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<TabControl>
|
||||
<TabPage ID="tabFilters" Text="Filters">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GridView ID="grdFilters"/>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabPartitions" Text="Partitions">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GridView ID="grdPartitions"/>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabFilesystems" Text="Filesystems">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpFilesystemIdentifyOnly" Text="Identify only">
|
||||
<GridView ID="grdFilesystem"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpFilesystemReadable" Text="Readable">
|
||||
<GridView ID="grdReadOnlyFilesystem"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabMediaImages" Text="Media images">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpReadableMediaImages" Text="Readable">
|
||||
<GridView ID="grdReadableMediaImages"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpWritableMediaImages" Text="Writable">
|
||||
<GridView ID="grdWritableMediaImages"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabFloppyImages" Text="Floppy images">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpReadableFloppyImages" Text="Readable">
|
||||
<GridView ID="grdReadableFloppyImages"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True" VerticalAlignment="Stretch">
|
||||
<GroupBox ID="grpWritableFloppyImages" Text="Writable">
|
||||
<GridView ID="grdWritableFloppyImages"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
</TabControl>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" Expand="True">
|
||||
<Button ID="btnClose" Click="OnBtnClose">Close</Button>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</StackLayoutItem>
|
||||
</StackLayout>
|
||||
</Dialog>
|
||||
442
DiscImageChef.Gui/dlgPlugins.xeto.cs
Normal file
442
DiscImageChef.Gui/dlgPlugins.xeto.cs
Normal file
@@ -0,0 +1,442 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : dlgPlugins.xeto.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Plugins dialog.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Implements the plugins dialog.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
using DiscImageChef.CommonTypes.Interfaces;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Partitions;
|
||||
using Eto.Forms;
|
||||
using Eto.Serialization.Xaml;
|
||||
|
||||
namespace DiscImageChef.Gui
|
||||
{
|
||||
public class dlgPlugins : Dialog
|
||||
{
|
||||
ObservableCollection<PluginEntry> filesystems;
|
||||
ObservableCollection<PluginEntry> filters;
|
||||
ObservableCollection<PluginEntry> floppyImages;
|
||||
ObservableCollection<PluginEntry> mediaImages;
|
||||
ObservableCollection<PluginEntry> partitions;
|
||||
ObservableCollection<PluginEntry> readOnlyFilesystems;
|
||||
ObservableCollection<PluginEntry> writableFloppyImages;
|
||||
ObservableCollection<PluginEntry> writableImages;
|
||||
|
||||
public dlgPlugins()
|
||||
{
|
||||
XamlReader.Load(this);
|
||||
|
||||
DefaultButton = btnClose;
|
||||
DisplayMode = DialogDisplayMode.Attached;
|
||||
|
||||
filters = new ObservableCollection<PluginEntry>();
|
||||
floppyImages = new ObservableCollection<PluginEntry>();
|
||||
mediaImages = new ObservableCollection<PluginEntry>();
|
||||
partitions = new ObservableCollection<PluginEntry>();
|
||||
filesystems = new ObservableCollection<PluginEntry>();
|
||||
readOnlyFilesystems = new ObservableCollection<PluginEntry>();
|
||||
writableFloppyImages = new ObservableCollection<PluginEntry>();
|
||||
writableImages = new ObservableCollection<PluginEntry>();
|
||||
|
||||
grdFilters.DataStore = filters;
|
||||
grdFilters.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilters.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilters.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilters.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilters.AllowMultipleSelection = false;
|
||||
grdFilters.AllowColumnReordering = true;
|
||||
|
||||
grdReadableMediaImages.DataStore = mediaImages;
|
||||
grdReadableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableMediaImages.AllowMultipleSelection = false;
|
||||
grdReadableMediaImages.AllowColumnReordering = true;
|
||||
|
||||
grdPartitions.DataStore = partitions;
|
||||
grdPartitions.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdPartitions.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdPartitions.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdPartitions.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdPartitions.AllowMultipleSelection = false;
|
||||
grdPartitions.AllowColumnReordering = true;
|
||||
|
||||
grdFilesystem.DataStore = filesystems;
|
||||
grdFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdFilesystem.AllowMultipleSelection = false;
|
||||
grdFilesystem.AllowColumnReordering = true;
|
||||
|
||||
grdReadOnlyFilesystem.DataStore = readOnlyFilesystems;
|
||||
grdReadOnlyFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadOnlyFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadOnlyFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadOnlyFilesystem.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadOnlyFilesystem.AllowMultipleSelection = false;
|
||||
grdReadOnlyFilesystem.AllowColumnReordering = true;
|
||||
|
||||
grdReadableFloppyImages.DataStore = floppyImages;
|
||||
grdReadableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdReadableFloppyImages.AllowMultipleSelection = false;
|
||||
grdReadableFloppyImages.AllowColumnReordering = true;
|
||||
|
||||
grdWritableFloppyImages.DataStore = writableFloppyImages;
|
||||
grdWritableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableFloppyImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableFloppyImages.AllowMultipleSelection = false;
|
||||
grdWritableFloppyImages.AllowColumnReordering = true;
|
||||
|
||||
grdWritableMediaImages.DataStore = writableImages;
|
||||
grdWritableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Name)},
|
||||
HeaderText = "Name",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => $"{r.Uuid}")},
|
||||
HeaderText = "UUID",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Version)},
|
||||
HeaderText = "Version",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableMediaImages.Columns.Add(new GridColumn
|
||||
{
|
||||
DataCell = new TextBoxCell {Binding = Binding.Property<PluginEntry, string>(r => r.Author)},
|
||||
HeaderText = "Author",
|
||||
Sortable = true
|
||||
});
|
||||
grdWritableMediaImages.AllowMultipleSelection = false;
|
||||
grdWritableMediaImages.AllowColumnReordering = true;
|
||||
}
|
||||
|
||||
protected override void OnLoadComplete(EventArgs e)
|
||||
{
|
||||
base.OnLoadComplete(e);
|
||||
|
||||
filters.Clear();
|
||||
floppyImages.Clear();
|
||||
mediaImages.Clear();
|
||||
partitions.Clear();
|
||||
filesystems.Clear();
|
||||
readOnlyFilesystems.Clear();
|
||||
writableFloppyImages.Clear();
|
||||
writableImages.Clear();
|
||||
|
||||
foreach(IFilter filter in GetPluginBase.Instance.Filters.Values)
|
||||
filters.Add(new PluginEntry
|
||||
{
|
||||
Name = filter.Name,
|
||||
Uuid = filter.Id,
|
||||
Version = Assembly.GetAssembly(filter.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)Attribute.GetCustomAttribute(Assembly.GetAssembly(filter.GetType()),
|
||||
typeof(AssemblyCompanyAttribute),
|
||||
false)).Company
|
||||
});
|
||||
|
||||
foreach(IFloppyImage floppyImage in GetPluginBase.Instance.FloppyImages.Values)
|
||||
floppyImages.Add(new PluginEntry
|
||||
{
|
||||
Name = floppyImage.Name,
|
||||
Uuid = floppyImage.Id,
|
||||
Version = Assembly.GetAssembly(floppyImage.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(floppyImage.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IMediaImage mediaImage in GetPluginBase.Instance.ImagePluginsList.Values)
|
||||
mediaImages.Add(new PluginEntry
|
||||
{
|
||||
Name = mediaImage.Name,
|
||||
Uuid = mediaImage.Id,
|
||||
Version = Assembly.GetAssembly(mediaImage.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(mediaImage.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IPartition partition in GetPluginBase.Instance.PartPluginsList.Values)
|
||||
partitions.Add(new PluginEntry
|
||||
{
|
||||
Name = partition.Name,
|
||||
Uuid = partition.Id,
|
||||
Version = Assembly.GetAssembly(partition.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(partition.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IFilesystem filesystem in GetPluginBase.Instance.PluginsList.Values)
|
||||
filesystems.Add(new PluginEntry
|
||||
{
|
||||
Name = filesystem.Name,
|
||||
Uuid = filesystem.Id,
|
||||
Version = Assembly.GetAssembly(filesystem.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(filesystem.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IReadOnlyFilesystem readOnlyFilesystem in GetPluginBase.Instance.ReadOnlyFilesystems.Values)
|
||||
readOnlyFilesystems.Add(new PluginEntry
|
||||
{
|
||||
Name = readOnlyFilesystem.Name,
|
||||
Uuid = readOnlyFilesystem.Id,
|
||||
Version = Assembly.GetAssembly(readOnlyFilesystem.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(readOnlyFilesystem.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IWritableFloppyImage writableFloppyImage in GetPluginBase.Instance.WritableFloppyImages.Values)
|
||||
writableFloppyImages.Add(new PluginEntry
|
||||
{
|
||||
Name = writableFloppyImage.Name,
|
||||
Uuid = writableFloppyImage.Id,
|
||||
Version = Assembly.GetAssembly(writableFloppyImage.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(writableFloppyImage.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
|
||||
foreach(IWritableImage writableImage in GetPluginBase.Instance.WritableImages.Values)
|
||||
writableImages.Add(new PluginEntry
|
||||
{
|
||||
Name = writableImage.Name,
|
||||
Uuid = writableImage.Id,
|
||||
Version = Assembly.GetAssembly(writableImage.GetType())?.GetName().Version.ToString(),
|
||||
Author =
|
||||
((AssemblyCompanyAttribute)
|
||||
Attribute.GetCustomAttribute(Assembly.GetAssembly(writableImage.GetType()),
|
||||
typeof(AssemblyCompanyAttribute), false)).Company
|
||||
});
|
||||
}
|
||||
|
||||
protected void OnBtnClose(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
class PluginEntry
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Guid Uuid { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string Author { get; set; }
|
||||
}
|
||||
|
||||
#region XAML controls
|
||||
TabPage tabFilters;
|
||||
GridView grdFilters;
|
||||
TabPage tabPartitions;
|
||||
GridView grdPartitions;
|
||||
TabPage tabFilesystems;
|
||||
GroupBox grpFilesystemIdentifyOnly;
|
||||
GridView grdFilesystem;
|
||||
GroupBox grpFilesystemReadable;
|
||||
GridView grdReadOnlyFilesystem;
|
||||
TabPage tabMediaImages;
|
||||
GroupBox grpReadableMediaImages;
|
||||
GridView grdReadableMediaImages;
|
||||
GroupBox grpWritableMediaImages;
|
||||
GridView grdWritableMediaImages;
|
||||
Button btnClose;
|
||||
TabPage tabFloppyImages;
|
||||
GroupBox grpReadableFloppyImages;
|
||||
GridView grdReadableFloppyImages;
|
||||
GroupBox grpWritableFloppyImages;
|
||||
GridView grdWritableFloppyImages;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
@@ -53,6 +52,9 @@
|
||||
<ButtonMenuItem Text="&Window">
|
||||
<ButtonMenuItem Text="&Console" Click="OnMenuConsole"/>
|
||||
</ButtonMenuItem>
|
||||
<ButtonMenuItem Text="&Help">
|
||||
<ButtonMenuItem Text="&Plugins" Click="OnMenuPlugins"/>
|
||||
</ButtonMenuItem>
|
||||
<MenuBar.ApplicationItems>
|
||||
<ButtonMenuItem Text="Preferences.." Shortcut="{On Control+O, Mac=Application+Comma}"/>
|
||||
</MenuBar.ApplicationItems>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
@@ -131,12 +132,12 @@ namespace DiscImageChef.Gui
|
||||
DicConsole.WriteLine("Refreshing devices");
|
||||
devicesRoot.Children.Clear();
|
||||
|
||||
foreach (DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor)
|
||||
.ThenBy(d => d.Model))
|
||||
foreach(DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor)
|
||||
.ThenBy(d => d.Model))
|
||||
{
|
||||
DicConsole.DebugWriteLine("Main window",
|
||||
"Found supported device model {0} by manufacturer {1} on bus {2} and path {3}",
|
||||
device.Model, device.Vendor, device.Bus, device.Path);
|
||||
"Found supported device model {0} by manufacturer {1} on bus {2} and path {3}",
|
||||
device.Model, device.Vendor, device.Bus, device.Path);
|
||||
devicesRoot.Children.Add(new TreeGridItem
|
||||
{
|
||||
Values = new object[] {$"{device.Vendor} {device.Model} ({device.Bus})", device.Path}
|
||||
@@ -145,10 +146,7 @@ namespace DiscImageChef.Gui
|
||||
|
||||
treeImages.ReloadData();
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
DicConsole.ErrorWriteLine(ex.Message);
|
||||
}
|
||||
catch(InvalidOperationException ex) { DicConsole.ErrorWriteLine(ex.Message); }
|
||||
}
|
||||
|
||||
protected void OnMenuConsole(object sender, EventArgs e)
|
||||
@@ -156,6 +154,11 @@ namespace DiscImageChef.Gui
|
||||
new frmConsole().Show();
|
||||
}
|
||||
|
||||
protected void OnMenuPlugins(object sender, EventArgs e)
|
||||
{
|
||||
new dlgPlugins().ShowModal(this);
|
||||
}
|
||||
|
||||
#region XAML IDs
|
||||
TreeGridItem devicesRoot;
|
||||
GridView grdFiles;
|
||||
|
||||
Reference in New Issue
Block a user