aboutsummaryrefslogtreecommitdiff
path: root/ide/ideutils.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ide/ideutils.ml')
-rw-r--r--ide/ideutils.ml17
1 files changed, 9 insertions, 8 deletions
diff --git a/ide/ideutils.ml b/ide/ideutils.ml
index 1cf065cf25..eeb818ce5f 100644
--- a/ide/ideutils.ml
+++ b/ide/ideutils.ml
@@ -1,7 +1,7 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
-(* <O___,, * (see CREDITS file for the list of authors) *)
+(* v * Copyright INRIA, CNRS and contributors *)
+(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -259,7 +259,7 @@ let current_dir () = match project_path#get with
| None -> ""
| Some dir -> dir
-let select_file_for_open ~title ?(filter=true) ?parent ?filename () =
+let select_file_for_open ~title ?(filter=true) ?(multiple=false) ?parent ?filename () =
let file_chooser =
GWindow.file_chooser_dialog ~action:`OPEN ~modal:true ~title ?parent ()
in
@@ -271,6 +271,7 @@ let select_file_for_open ~title ?(filter=true) ?parent ?filename () =
file_chooser#add_filter (filter_all_files ())
end;
file_chooser#set_default_response `OPEN;
+ file_chooser#set_select_multiple multiple;
let dir = match filename with
| None -> current_dir ()
| Some f -> Filename.dirname f in
@@ -279,12 +280,12 @@ let select_file_for_open ~title ?(filter=true) ?parent ?filename () =
match file_chooser#run () with
| `OPEN ->
begin
- match file_chooser#filename with
- | None -> None
- | Some _ as f ->
- project_path#set file_chooser#current_folder; f
+ let filenames = file_chooser#get_filenames in
+ (if filenames <> [] then
+ project_path#set file_chooser#current_folder);
+ filenames
end
- | `DELETE_EVENT | `CANCEL -> None in
+ | `DELETE_EVENT | `CANCEL -> [] in
file_chooser#destroy ();
file