Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
eb4ef3f092 | |||
a358e557c3 | |||
|
3919c185a8 | ||
|
cd84ba89ce | ||
|
18a2d7154f | ||
|
e107be13c4 | ||
|
4119cb9eac | ||
|
10153a9bd2 |
|
@ -1,8 +0,0 @@
|
|||
image: ilyasemenov/gitlab-ci-git-push
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy to production:
|
||||
stage: deploy
|
||||
script: git-push git@github.com:adroslice/bfr.git
|
|
@ -114,6 +114,7 @@
|
|||
<Setter Property="Margin" Value="4,4,4,-5"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
</Style>
|
||||
<Style Selector="Grid.StyleBorders > Border">
|
||||
<Setter Property="Margin" Value="4"/>
|
||||
|
@ -124,6 +125,18 @@
|
|||
<Style Selector="Border.ConnectUp">
|
||||
<Setter Property="Margin" Value="4,-5,4,4"/>
|
||||
</Style>
|
||||
|
||||
<!-- Drag + Drop -->
|
||||
<Style Selector="ListBoxItem.BlackBottom">
|
||||
<Setter Property="BorderThickness" Value="0,0,0,2"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="Margin" Value="0,0,0,-2"/>
|
||||
</Style>
|
||||
<Style Selector="ListBoxItem.BlackTop">
|
||||
<Setter Property="BorderThickness" Value="0,2,0,0"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="Margin" Value="0,-2,0,0"/>
|
||||
</Style>
|
||||
|
||||
<!-- Expander Fix -->
|
||||
<Style Selector="Expander /template/ ToggleButton#PART_toggle /template/ Border">
|
||||
|
@ -159,7 +172,7 @@
|
|||
</Grid>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Grid Grid.Column="3" Background="Transparent" Cursor="SizeAll" IsVisible="{Binding $parent.IsPointerOver}" ToolTip.Tip="Click and drag to move this operation." PointerPressed="StartMoveOperation" PointerReleased="EndMoveOperation">
|
||||
<Grid Grid.Column="3" Background="Transparent" Cursor="SizeAll" IsVisible="{Binding $parent.IsPointerOver}" ToolTip.Tip="Click and drag to move this operation." PointerPressed="StartMoveOperation" PointerReleased="EndMoveOperation" PointerMoved="MoveOperation">
|
||||
<Path Data="M0,0 L12,0 M0,4 L12,4 M0,8 L12,8" Height="8" VerticalAlignment="Center" Margin="4" Stroke="Black" StrokeThickness="2"/>
|
||||
</Grid>
|
||||
<ContentPresenter Grid.ColumnSpan="4" Grid.Row="1" Content="{TemplateBinding Content}" IsVisible="{Binding #OperationExpander.IsExpanded}"/>
|
||||
|
|
|
@ -6,15 +6,16 @@ using System.Collections.Generic;
|
|||
using System.Text.RegularExpressions;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.VisualTree;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.LogicalTree;
|
||||
|
||||
using BFR.Helpers;
|
||||
using BFR.DataModels;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.VisualTree;
|
||||
using BFR.Operations;
|
||||
using Avalonia.Markup.Xaml.Styling;
|
||||
|
||||
namespace BFR
|
||||
{
|
||||
|
@ -26,8 +27,9 @@ namespace BFR
|
|||
public async Task OpenDirectoryButtonClick() => OpenDirectory(await new OpenFolderDialog() { Directory = WorkingDirectory }.ShowAsync(this));
|
||||
public void OpenDirectory(string directory)
|
||||
{
|
||||
WorkingDirectory = directory;
|
||||
AllFiles.ReplaceAll(Directory.GetFiles(WorkingDirectory).Select(x => new FileModel(x)));
|
||||
WorkingDirectory = directory.Replace('\\', '/');
|
||||
AllFiles.ReplaceAll(Directory.GetFiles(WorkingDirectory).Select(x => new FileModel(x.Replace('\\', '/'))));
|
||||
new Sort() { Mode = SortMode.Natural }.ApplyTo(AllFiles);
|
||||
Filter();
|
||||
}
|
||||
|
||||
|
@ -94,21 +96,39 @@ namespace BFR
|
|||
Preview();
|
||||
}
|
||||
|
||||
public void StartMoveOperation(object sender, PointerPressedEventArgs e) =>
|
||||
private void ClearDropStyling()
|
||||
{
|
||||
foreach (ListBoxItem item in OperationsListBox.GetLogicalChildren())
|
||||
item.Classes.RemoveAll(new[] { "BlackTop", "BlackBottom" });
|
||||
}
|
||||
|
||||
public void StartMoveOperation(object sender, PointerPressedEventArgs e) =>
|
||||
DragItem = OperationsListBox.GetLogicalChildren().Cast<ListBoxItem>().Single(x => x.IsPointerOver);
|
||||
|
||||
public void MoveOperation(object sender, PointerEventArgs e)
|
||||
{
|
||||
if (DragItem == null) return;
|
||||
|
||||
var hoveredItem = (ListBoxItem)OperationsListBox.GetLogicalChildren().FirstOrDefault(x => this.GetVisualsAt(e.GetPosition(this)).Contains(((IVisual)x).GetVisualChildren().First()));
|
||||
var dragItemIndex = OperationsListBox.GetLogicalChildren().ToList().IndexOf(DragItem);
|
||||
var hoveredItemIndex = OperationsListBox.GetLogicalChildren().ToList().IndexOf(hoveredItem);
|
||||
|
||||
ClearDropStyling();
|
||||
if (hoveredItem != DragItem) hoveredItem?.Classes.Add(dragItemIndex > hoveredItemIndex ? "BlackTop" : "BlackBottom");
|
||||
}
|
||||
|
||||
public void EndMoveOperation(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
var hoveredItem = (ListBoxItem)OperationsListBox.GetLogicalChildren().FirstOrDefault(x => this.GetVisualsAt(e.GetPosition(this)).Contains(((IVisual)x).GetVisualChildren().First()));
|
||||
if (DragItem == null ||
|
||||
hoveredItem == null ||
|
||||
DragItem == hoveredItem)
|
||||
return;
|
||||
Operations.Move(
|
||||
OperationsListBox.GetLogicalChildren().ToList().IndexOf(DragItem),
|
||||
OperationsListBox.GetLogicalChildren().ToList().IndexOf(hoveredItem));
|
||||
if (DragItem != null && hoveredItem != null && DragItem != hoveredItem)
|
||||
{
|
||||
Operations.Move(
|
||||
OperationsListBox.GetLogicalChildren().ToList().IndexOf(DragItem),
|
||||
OperationsListBox.GetLogicalChildren().ToList().IndexOf(hoveredItem));
|
||||
Preview();
|
||||
}
|
||||
ClearDropStyling();
|
||||
DragItem = null;
|
||||
Preview();
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
|
@ -137,9 +157,15 @@ namespace BFR
|
|||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
DataContext = this;
|
||||
OpenDirectory(Environment.OSVersion.Platform == PlatformID.Win32NT ? @"C:\Users" : @"\home");
|
||||
OpenDirectory(Environment.OSVersion.Platform == PlatformID.Win32NT ? @"C:/Users/" : @"/home/");
|
||||
HandleEvents = true;
|
||||
OperationsListBox = this.Find<ListBox>("OperationsListBox");
|
||||
|
||||
/*var dark = new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
|
||||
{
|
||||
Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default")
|
||||
};
|
||||
Styles[0] = dark;/**/
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,8 +27,8 @@
|
|||
get => $"{Directory}{FullName}";
|
||||
set
|
||||
{
|
||||
FullName = value.Substring(value.LastIndexOf('\\') + 1);
|
||||
Directory = value.Substring(0, value.LastIndexOf('\\') + 1);
|
||||
FullName = value.Substring(value.LastIndexOf('/') + 1);
|
||||
Directory = value.Substring(0, value.LastIndexOf('/') + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
24
README.md
24
README.md
|
@ -1,28 +1,24 @@
|
|||
# BFR - A Modular Bulk File Renaming Utility
|
||||
Inspired by [this project](https://git.lastassault.de/speatzle/BulkFileRenamer) by speatzle_.
|
||||
|
||||
Everyone is welcome to contribute!
|
||||
|
||||
## Features
|
||||
- Mordern scalable UI (Avalonia)
|
||||
- Extremely flexible
|
||||
- Stack-based undo
|
||||
- Fast and automatic preview
|
||||
- Cross-Platform and portable
|
||||
- Indefinite undo
|
||||
- Fast automatic preview
|
||||
- Crossplatform and portable
|
||||
- Supports RegEx
|
||||
|
||||
### Operations
|
||||
- Add, Remove, Replace, Overwrite, Number, Sort
|
||||
|
||||
### Upcoming Features
|
||||
- [Case Conversion](../issues/1)
|
||||
- [Save-/Loadable Profiles](../issues/3)
|
||||
- [Operations based on file Metadata](../issues//4)
|
||||
- [Optional Subdirectory Scanning](../issues/5)
|
||||
- [Option to disable automatic previewing](../issues/7)
|
||||
- [Improved Add-/Remove-Buttons](../issues/6)
|
||||
- Anything good that gets [requested](../issues)!
|
||||
### Planned Features
|
||||
- Case Conversion #1
|
||||
- Save-/Loadable Profiles #3
|
||||
- Operations based on file Metadata #4
|
||||
- Optional Subdirectory Scanning #5
|
||||
- Anything good that gets [requested](https://git.ulra.eu/adrian/bfr/issues)!
|
||||
|
||||
## [Releases](../-/releases)
|
||||
## [Releases](https://git.ulra.eu/adrian/bfr/releases)
|
||||
## Screenshot
|
||||

|
||||
|
|
Loading…
Reference in New Issue
Block a user