From 2f4d258694596de9932e39994eace72efa5ee892 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 4 Jan 2017 21:43:42 +0400 Subject: [PATCH] (MainWindow): [Ctrl+Ins] copies selected filenames to clipboard. --- GUI/MainWindow.xaml | 2 ++ GUI/MainWindow.xaml.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/GUI/MainWindow.xaml b/GUI/MainWindow.xaml index 9416b88f..84708347 100644 --- a/GUI/MainWindow.xaml +++ b/GUI/MainWindow.xaml @@ -277,6 +277,7 @@ + @@ -380,6 +381,7 @@ + diff --git a/GUI/MainWindow.xaml.cs b/GUI/MainWindow.xaml.cs index 2daefe02..63807d85 100644 --- a/GUI/MainWindow.xaml.cs +++ b/GUI/MainWindow.xaml.cs @@ -1194,6 +1194,15 @@ namespace GARbro.GUI CurrentDirectory.SelectAll(); } + void CopyNamesExec (object sender, ExecutedRoutedEventArgs e) + { + var names = CurrentDirectory.SelectedItems.Cast().Select (f => f.Name); + if (names.Any()) + { + Clipboard.SetText (string.Join ("\r\n", names)); + } + } + void NextItemExec (object sender, ExecutedRoutedEventArgs e) { if (LookupActive) @@ -1442,5 +1451,6 @@ namespace GARbro.GUI public static readonly RoutedCommand SelectAll = new RoutedCommand(); public static readonly RoutedCommand SetFileType = new RoutedCommand(); public static readonly RoutedCommand NextItem = new RoutedCommand(); + public static readonly RoutedCommand CopyNames = new RoutedCommand(); } }