linux: Show warning if file picker portal is missing (#14401)
This PR adds a warning when the file chooser couldn't be opened on Linux It's quite confusing when trying to open a file and apparently nothing happens: fixes https://github.com/zed-industries/zed/issues/11089, https://github.com/zed-industries/zed/issues/14328, https://github.com/zed-industries/zed/issues/13753#issuecomment-2225812703, https://github.com/zed-industries/zed/issues/13766, https://github.com/zed-industries/zed/issues/14384, https://github.com/zed-industries/zed/issues/14353, https://github.com/zed-industries/zed/issues/9209  Release Notes: - N/A
This commit is contained in:
parent
5d860e2286
commit
f3ddd18201
11 changed files with 248 additions and 75 deletions
|
@ -612,10 +612,11 @@ impl AppContext {
|
|||
/// Displays a platform modal for selecting paths.
|
||||
/// When one or more paths are selected, they'll be relayed asynchronously via the returned oneshot channel.
|
||||
/// If cancelled, a `None` will be relayed instead.
|
||||
/// May return an error on Linux if the file picker couldn't be opened.
|
||||
pub fn prompt_for_paths(
|
||||
&self,
|
||||
options: PathPromptOptions,
|
||||
) -> oneshot::Receiver<Option<Vec<PathBuf>>> {
|
||||
) -> oneshot::Receiver<Result<Option<Vec<PathBuf>>>> {
|
||||
self.platform.prompt_for_paths(options)
|
||||
}
|
||||
|
||||
|
@ -623,7 +624,11 @@ impl AppContext {
|
|||
/// The provided directory will be used to set the initial location.
|
||||
/// When a path is selected, it is relayed asynchronously via the returned oneshot channel.
|
||||
/// If cancelled, a `None` will be relayed instead.
|
||||
pub fn prompt_for_new_path(&self, directory: &Path) -> oneshot::Receiver<Option<PathBuf>> {
|
||||
/// May return an error on Linux if the file picker couldn't be opened.
|
||||
pub fn prompt_for_new_path(
|
||||
&self,
|
||||
directory: &Path,
|
||||
) -> oneshot::Receiver<Result<Option<PathBuf>>> {
|
||||
self.platform.prompt_for_new_path(directory)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue