mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
added "Set file type" command.
This commit is contained in:
parent
31842bdea5
commit
ab19d0b0e3
@ -80,6 +80,16 @@
|
|||||||
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExtract}" InputGestureText="F4"
|
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExtract}" InputGestureText="F4"
|
||||||
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
|
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
|
||||||
Command="{x:Static local:Commands.ExtractItem}" />
|
Command="{x:Static local:Commands.ExtractItem}" />
|
||||||
|
<MenuItem Header="{x:Static s:guiStrings.CtxMenuFileType}">
|
||||||
|
<MenuItem DataContext="image" Header="{Binding Converter={StaticResource entryTypeConverter}}"
|
||||||
|
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
|
||||||
|
<MenuItem DataContext="audio" Header="{Binding Converter={StaticResource entryTypeConverter}}"
|
||||||
|
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
|
||||||
|
<MenuItem DataContext="script" Header="{Binding Converter={StaticResource entryTypeConverter}}"
|
||||||
|
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
|
||||||
|
<MenuItem Header="{x:Static s:guiStrings.Type_NONE}"
|
||||||
|
Command="{x:Static local:Commands.SetFileType}" CommandParameter=""/>
|
||||||
|
</MenuItem>
|
||||||
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExplorer}" InputGestureText="Ctrl+E"
|
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExplorer}" InputGestureText="Ctrl+E"
|
||||||
Command="{x:Static local:Commands.ExploreItem}"/>
|
Command="{x:Static local:Commands.ExploreItem}"/>
|
||||||
<MenuItem Header="{x:Static s:guiStrings.CtxMenuDelete}" InputGestureText="Del"
|
<MenuItem Header="{x:Static s:guiStrings.CtxMenuDelete}" InputGestureText="Del"
|
||||||
@ -372,6 +382,7 @@
|
|||||||
<CommandBinding Command="{x:Static local:Commands.ExploreItem}" Executed="ExploreItemExec" CanExecute="CanExecuteInDirectory" />
|
<CommandBinding Command="{x:Static local:Commands.ExploreItem}" Executed="ExploreItemExec" CanExecute="CanExecuteInDirectory" />
|
||||||
<CommandBinding Command="{x:Static local:Commands.ConvertMedia}" Executed="ConvertMediaExec" CanExecute="CanExecuteConvertMedia" />
|
<CommandBinding Command="{x:Static local:Commands.ConvertMedia}" Executed="ConvertMediaExec" CanExecute="CanExecuteConvertMedia" />
|
||||||
<CommandBinding Command="{x:Static local:Commands.SortBy}" Executed="SortByExec" CanExecute="CanExecuteAlways"/>
|
<CommandBinding Command="{x:Static local:Commands.SortBy}" Executed="SortByExec" CanExecute="CanExecuteAlways"/>
|
||||||
|
<CommandBinding Command="{x:Static local:Commands.SetFileType}" Executed="SetFileTypeExec" CanExecute="CanExecuteOnSelected"/>
|
||||||
<CommandBinding Command="{x:Static local:Commands.GoBack}" Executed="GoBackExec" CanExecute="CanExecuteGoBack"/>
|
<CommandBinding Command="{x:Static local:Commands.GoBack}" Executed="GoBackExec" CanExecute="CanExecuteGoBack"/>
|
||||||
<CommandBinding Command="{x:Static local:Commands.GoForward}" Executed="GoForwardExec" CanExecute="CanExecuteGoForward"/>
|
<CommandBinding Command="{x:Static local:Commands.GoForward}" Executed="GoForwardExec" CanExecute="CanExecuteGoForward"/>
|
||||||
<CommandBinding Command="{x:Static local:Commands.Refresh}" Executed="RefreshExec" CanExecute="CanExecuteAlways"/>
|
<CommandBinding Command="{x:Static local:Commands.Refresh}" Executed="RefreshExec" CanExecute="CanExecuteAlways"/>
|
||||||
|
@ -526,6 +526,21 @@ namespace GARbro.GUI
|
|||||||
lv_SetSortMode (sort_by, ListSortDirection.Ascending);
|
lv_SetSortMode (sort_by, ListSortDirection.Ascending);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handle "Set file type" commands.
|
||||||
|
/// </summary>
|
||||||
|
private void SetFileTypeExec (object sender, ExecutedRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var selected = CurrentDirectory.SelectedItems.Cast<EntryViewModel>().Where (x => !x.IsDirectory);
|
||||||
|
if (!selected.Any())
|
||||||
|
return;
|
||||||
|
string type = e.Parameter as string;
|
||||||
|
foreach (var entry in selected)
|
||||||
|
{
|
||||||
|
entry.Type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event handler for keys pressed in the directory view pane
|
/// Event handler for keys pressed in the directory view pane
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1314,5 +1329,6 @@ namespace GARbro.GUI
|
|||||||
public static readonly RoutedCommand HideToolBar = new RoutedCommand();
|
public static readonly RoutedCommand HideToolBar = new RoutedCommand();
|
||||||
public static readonly RoutedCommand AddSelection = new RoutedCommand();
|
public static readonly RoutedCommand AddSelection = new RoutedCommand();
|
||||||
public static readonly RoutedCommand SelectAll = new RoutedCommand();
|
public static readonly RoutedCommand SelectAll = new RoutedCommand();
|
||||||
|
public static readonly RoutedCommand SetFileType = new RoutedCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,5 +51,5 @@ using System.Windows;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion ("1.1.5.24")]
|
[assembly: AssemblyVersion ("1.1.5.636")]
|
||||||
[assembly: AssemblyFileVersion ("1.1.5.24")]
|
[assembly: AssemblyFileVersion ("1.1.5.636")]
|
||||||
|
18
Strings/guiStrings.Designer.cs
generated
18
Strings/guiStrings.Designer.cs
generated
@ -168,6 +168,15 @@ namespace GARbro.GUI.Strings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Set file type.
|
||||||
|
/// </summary>
|
||||||
|
public static string CtxMenuFileType {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("CtxMenuFileType", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Open.
|
/// Looks up a localized string similar to Open.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1036,5 +1045,14 @@ namespace GARbro.GUI.Strings {
|
|||||||
return ResourceManager.GetString("Type_directory", resourceCulture);
|
return ResourceManager.GetString("Type_directory", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to none.
|
||||||
|
/// </summary>
|
||||||
|
public static string Type_NONE {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Type_NONE", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -446,4 +446,10 @@ Overwrite?</value>
|
|||||||
{0}
|
{0}
|
||||||
{1}</value>
|
{1}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="CtxMenuFileType" xml:space="preserve">
|
||||||
|
<value>Set file type</value>
|
||||||
|
</data>
|
||||||
|
<data name="Type_NONE" xml:space="preserve">
|
||||||
|
<value>none</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -467,4 +467,10 @@
|
|||||||
{0}
|
{0}
|
||||||
{1}</value>
|
{1}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="CtxMenuFileType" xml:space="preserve">
|
||||||
|
<value>Изменить тип файла</value>
|
||||||
|
</data>
|
||||||
|
<data name="Type_NONE" xml:space="preserve">
|
||||||
|
<value>без типа</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
25
ViewModel.cs
25
ViewModel.cs
@ -213,7 +213,7 @@ namespace GARbro.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EntryViewModel
|
public class EntryViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
public EntryViewModel (Entry entry, int priority)
|
public EntryViewModel (Entry entry, int priority)
|
||||||
{
|
{
|
||||||
@ -222,13 +222,34 @@ namespace GARbro.GUI
|
|||||||
Priority = priority;
|
Priority = priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
public Entry Source { get; private set; }
|
public Entry Source { get; private set; }
|
||||||
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public string Type { get { return Source.Type; } }
|
public string Type
|
||||||
|
{
|
||||||
|
get { return Source.Type; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (Source.Type != value)
|
||||||
|
{
|
||||||
|
Source.Type = value;
|
||||||
|
OnPropertyChanged ("Type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public uint? Size { get { return IsDirectory ? null : (uint?)Source.Size; } }
|
public uint? Size { get { return IsDirectory ? null : (uint?)Source.Size; } }
|
||||||
public int Priority { get; private set; }
|
public int Priority { get; private set; }
|
||||||
public bool IsDirectory { get { return Priority < 0; } }
|
public bool IsDirectory { get { return Priority < 0; } }
|
||||||
|
|
||||||
|
private void OnPropertyChanged (string property = "")
|
||||||
|
{
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
PropertyChanged (this, new PropertyChangedEventArgs (property));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class FileSystemComparer : IComparer
|
public sealed class FileSystemComparer : IComparer
|
||||||
|
@ -21,7 +21,10 @@ tr.odd td { background-color: #eee }
|
|||||||
<tr><td>*.afs</td><td><tt>AFS</tt></td><td>No</td><td rowspan="2">PlayStation 2</td><td rowspan="2">Remember11</td></tr>
|
<tr><td>*.afs</td><td><tt>AFS</tt></td><td>No</td><td rowspan="2">PlayStation 2</td><td rowspan="2">Remember11</td></tr>
|
||||||
<tr><td>*.bip</td><td>-</td><td>No</td></tr>
|
<tr><td>*.bip</td><td>-</td><td>No</td></tr>
|
||||||
<tr class="odd"><td>data.ami</td><td><tt>AMI</tt></td><td>Yes</td><td>-</td><td>Muv-Luv Amaterasu Translation data files</td></tr>
|
<tr class="odd"><td>data.ami</td><td><tt>AMI</tt></td><td>Yes</td><td>-</td><td>Muv-Luv Amaterasu Translation data files</td></tr>
|
||||||
<tr><td>*.arc</td><td><tt>PackFile</tt></td><td>No</td><td>BGI/Ethornell</td><td>Chou Dengeki Stryker</td></tr>
|
<tr><td>*.arc</td><td><tt>PackFile</tt></td><td>No</td><td>BGI/Ethornell</td><td>
|
||||||
|
Chou Dengeki Stryker<br/>
|
||||||
|
H2O -Footprints in the Sand-<br/>
|
||||||
|
</td></tr>
|
||||||
<tr class="odd"><td>*</td><td>-<br/><tt>SM2MPX10</tt></td><td>No</td><td rowspan="4">DRS</td><td rowspan="4">
|
<tr class="odd"><td>*</td><td>-<br/><tt>SM2MPX10</tt></td><td>No</td><td rowspan="4">DRS</td><td rowspan="4">
|
||||||
Anata no Osanazuma<br/>
|
Anata no Osanazuma<br/>
|
||||||
Ecchi na Bunny-san wa Kirai?<br/>
|
Ecchi na Bunny-san wa Kirai?<br/>
|
||||||
@ -103,7 +106,10 @@ Tsukihime<br/>
|
|||||||
Umineko<br/>
|
Umineko<br/>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>*.pac</td><td><tt>PAC</tt></td><td>No</td><td>NeXAS</td><td>Maji de Watashi ni Koishinasai!</td></tr>
|
<tr><td>*.pac</td><td><tt>PAC</tt></td><td>No</td><td>NeXAS</td><td>Maji de Watashi ni Koishinasai!</td></tr>
|
||||||
<tr class="odd"><td>*.pac</td><td><tt>PAC1</tt></td><td>No</td><td rowspan="2">Riddle Soft</td><td rowspan="2">Hana Hiraku</td></tr>
|
<tr class="odd"><td>*.pac</td><td><tt>PAC1</tt></td><td>No</td><td rowspan="2">Riddle Soft</td><td rowspan="2">
|
||||||
|
Hana Hiraku<br/>
|
||||||
|
Iinari<br/>
|
||||||
|
</td></tr>
|
||||||
<tr class="odd"><td>*.gcp</td><td><tt>CMP1</tt></td><td>No</td></tr>
|
<tr class="odd"><td>*.gcp</td><td><tt>CMP1</tt></td><td>No</td></tr>
|
||||||
<tr><td>*.pd</td><td><tt>PackOnly</tt><br/><tt>PackPlus</tt><br/><tt>FlyingShinePDFile</tt></td><td>Yes</td><td>Flying Shine</td><td>Cross†Channel</td></tr>
|
<tr><td>*.pd</td><td><tt>PackOnly</tt><br/><tt>PackPlus</tt><br/><tt>FlyingShinePDFile</tt></td><td>Yes</td><td>Flying Shine</td><td>Cross†Channel</td></tr>
|
||||||
<tr class="odd"><td>*.rpa</td><td><tt>RPA-3.0</tt></td><td>Yes</td><td>Ren'Py</td><td>Katawa Shoujo</td></tr>
|
<tr class="odd"><td>*.rpa</td><td><tt>RPA-3.0</tt></td><td>Yes</td><td>Ren'Py</td><td>Katawa Shoujo</td></tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user