Skip to content

Commit

Permalink
Implement "select all"
Browse files Browse the repository at this point in the history
The default behavior is fine so long as the file list DataGrid has
focus, but we want to be able to select all files regardless of
which GUI control has focus.
  • Loading branch information
fadden committed Oct 31, 2023
1 parent 5d12691 commit ce3cf75
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CiderPress2-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ A simple button on the toolbar determines whether "extract" or "export" mode wil
The behavior is otherwise the same as it would be if that menu command were chosen. The various
options can be set in the options bar on the right side of the window.

If the export conversion mode is set to a specific type, rather than "best", then only the
items suited for conversion will be exported.

[ right-side options bar to be explained elsewhere ]

When transferring files between CiderPress II instances, the mode must be set to "extract". If
Expand Down
5 changes: 4 additions & 1 deletion cp2_wpf/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ public void CopyToClipboard() {
internal VirtualFileDataObject GenerateVFDO() {
DataGrid dataGrid = mMainWin.fileListDataGrid;
if (dataGrid.SelectedItems.Count == 0) {
Debug.Assert(false); // not expected; continue anyway to create empty obj
// continue anyway to create empty obj
}

List<IFileEntry> entries = new List<IFileEntry>();
Expand Down Expand Up @@ -1749,6 +1749,9 @@ internal VirtualFileDataObject GenerateVFDO() {
}

// Configure the virtual file descriptors that transmit the file contents.
// The start/end actions on the VFDO only work if the drop *target* supports
// drop as an asynchronous operation. So they'll fire if dragging into Windows
// Explorer but not into another CP2 window, unless we figure that part out.
List<ClipFileEntry> clipEntries = clipSet.ForeignEntries;
VirtualFileDataObject vfdo = new VirtualFileDataObject();
VirtualFileDataObject.FileDescriptor[] vfds =
Expand Down
2 changes: 2 additions & 0 deletions cp2_wpf/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ limitations under the License.
CanExecute="IsNibbleImageSelected" Executed="ScanForBadBlocksCmd_Executed"/>
<CommandBinding Command="{StaticResource ScanForSubVolCmd}"
CanExecute="IsFileSystemSelected" Executed="ScanForSubVolCmd_Executed"/>
<CommandBinding Command="SelectAll"
CanExecute="IsFileOpen" Executed="SelectAllCmd_Executed"/>
<CommandBinding Command="{StaticResource ShowDirListCmd}"
CanExecute="IsFileOpen" Executed="ShowDirListCmd_Executed"/>
<CommandBinding Command="{StaticResource ShowFullListCmd}"
Expand Down
3 changes: 3 additions & 0 deletions cp2_wpf/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ private void ScanForBadBlocksCmd_Executed(object sender, ExecutedRoutedEventArgs
private void ScanForSubVolCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
mMainCtrl.ScanForSubVol();
}
private void SelectAllCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
fileListDataGrid.SelectAll();
}
private void ShowDirListCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
PreferSingleDirList = true;
if (!ShowSingleDirFileList) {
Expand Down

0 comments on commit ce3cf75

Please sign in to comment.