Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed Open File/Folder Dialog compatible with all Linux Distros #1993

Merged
merged 48 commits into from Jul 25, 2019
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2c4eee9
import managed file dialogs.
danwalmsley Jul 23, 2019
6bbddc9
use wasabi window style.
danwalmsley Jul 23, 2019
0b92049
polish file icon and label spacing.
danwalmsley Jul 23, 2019
4f068c4
use managed dialogs on linux
danwalmsley Jul 23, 2019
cc58bcf
formatting
danwalmsley Jul 23, 2019
c7d0850
dont show files if we are choosing a folder.
danwalmsley Jul 23, 2019
12628ce
some code issues
danwalmsley Jul 23, 2019
b7dad75
formatting
danwalmsley Jul 23, 2019
6ce3e5c
fix code factor issues.
danwalmsley Jul 23, 2019
195b839
restore import coldcard code.
danwalmsley Jul 24, 2019
3643b04
catch unauthorized exceptions where user is not allowed to navigate.
danwalmsley Jul 24, 2019
de1e306
add file details
danwalmsley Jul 24, 2019
87c9cb9
display file size in human readable format.
danwalmsley Jul 24, 2019
6fe6959
allow navigate to path
danwalmsley Jul 24, 2019
107f817
allow opening by entering full file path and pressing enter.
danwalmsley Jul 24, 2019
1ad3e16
code factor
danwalmsley Jul 24, 2019
0424483
code factor
danwalmsley Jul 24, 2019
49575b7
fix warnings
danwalmsley Jul 24, 2019
ae0aa82
only display file size if greater than 0
danwalmsley Jul 24, 2019
db4765c
add grid splitters to allow column resizing
danwalmsley Jul 24, 2019
ee5e21d
polish splitters
danwalmsley Jul 24, 2019
428578c
fix exception on linux
danwalmsley Jul 24, 2019
70dd401
prevent scrolling
danwalmsley Jul 24, 2019
fef59e5
fix sizing issue
danwalmsley Jul 24, 2019
7828759
header stretch
danwalmsley Jul 24, 2019
d9090b2
fix size column
danwalmsley Jul 24, 2019
c23b57d
remove splitters
danwalmsley Jul 24, 2019
5a5a4a5
linux only file dialogs
danwalmsley Jul 24, 2019
b30f7e4
remove allowmultiple
danwalmsley Jul 24, 2019
9b828c7
fix warning
danwalmsley Jul 24, 2019
b2fd6dd
use managed file chooser on osx.
danwalmsley Jul 24, 2019
dbe9366
fix spacing on osx
danwalmsley Jul 24, 2019
f3a847f
looking good on osx
danwalmsley Jul 24, 2019
9b24ea8
Merge remote-tracking branch 'origin/master' into feature/managed-fil…
danwalmsley Jul 24, 2019
39e7113
default to users home directory on osx.
danwalmsley Jul 24, 2019
1ece235
save file dialog also defaults to home directory on osx.
danwalmsley Jul 24, 2019
2d8afda
make save file dialog actually work.
danwalmsley Jul 24, 2019
5facf83
hide filename textbox when selecting folder.
danwalmsley Jul 24, 2019
c48466b
code factor
danwalmsley Jul 24, 2019
dc3bf3c
dont use sharedsize group.
danwalmsley Jul 24, 2019
3219b75
fix column sizing issues
danwalmsley Jul 24, 2019
c5a9e16
use normal cursor instead of hand.
danwalmsley Jul 24, 2019
71aeeac
dont use managed dialogs on windows
danwalmsley Jul 24, 2019
25b9f4b
handle extensions when saving
danwalmsley Jul 24, 2019
613b525
fix save file extension handling.
danwalmsley Jul 24, 2019
c532d3c
fix when someone clicks save without a filename.
danwalmsley Jul 24, 2019
303a2fa
add drives for file dialog on linux
danwalmsley Jul 24, 2019
ee99b12
fix compile error
danwalmsley Jul 24, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

handle extensions when saving

  • Loading branch information...
danwalmsley committed Jul 24, 2019
commit 25b9f4b6999f989b385acfbc6edf0c816f08131a
@@ -37,6 +37,7 @@ class ManagedFileChooserViewModel : ViewModelBase
private bool _selectingDirectory;
private bool _savingFile;
private bool _scheduledSelectionValidation;
private string _defaultExtension;

public string Location
{
@@ -135,8 +136,13 @@ public ManagedFileChooserViewModel(FileSystemDialog dialog)
}
}

_selectingDirectory = dialog is OpenFolderDialog;
_savingFile = dialog is SaveFileDialog;
_selectingDirectory = dialog is OpenFolderDialog;

if(dialog is SaveFileDialog sfd)
{
_savingFile = true;
_defaultExtension = sfd.DefaultExtension;
}

Navigate(directory, (dialog as FileDialog)?.InitialFileName);
SelectedItems.CollectionChanged += OnSelectionChangedAsync;
@@ -304,6 +310,11 @@ public void Ok()
}
else if(_savingFile)
{
if(!Path.HasExtension(Location))
{
Location = Location + _defaultExtension;
}

CompleteRequested?.Invoke(new[] { Path.Combine(Location, FileName) });
}
else
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.