Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Why3
why3
Commits
189fbdd5
Commit
189fbdd5
authored
Jun 07, 2017
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
context menu allows to run a prover
parent
f4c0dc50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
51 deletions
+95
-51
src/ide/why3ide.ml
src/ide/why3ide.ml
+95
-51
No files found.
src/ide/why3ide.ml
View file @
189fbdd5
...
@@ -457,6 +457,8 @@ let unfocus_item =
...
@@ -457,6 +457,8 @@ let unfocus_item =
create_menu_item
tools_factory
"Unfocus"
create_menu_item
tools_factory
"Unfocus"
"Unfocus"
"Unfocus"
(* 1.3 "View" menu items *)
(* 1.3 "View" menu items *)
...
@@ -871,6 +873,9 @@ let update_monitor =
...
@@ -871,6 +873,9 @@ let update_monitor =
(
f
^
(
string_of_int
t
)
^
"/"
^
(
string_of_int
s
)
^
"/"
^
(
string_of_int
r
))
(
f
^
(
string_of_int
t
)
^
"/"
^
(
string_of_int
s
)
^
"/"
^
(
string_of_int
r
))
(****************************)
(****************************)
(* command entry completion *)
(* command entry completion *)
(****************************)
(****************************)
...
@@ -893,23 +898,7 @@ let match_function s iter =
...
@@ -893,23 +898,7 @@ let match_function s iter =
true
true
with
Not_found
->
false
with
Not_found
->
false
let
init_completion
provers
transformations
commands
=
(* see also init_compeltion below *)
(* add the names of all the the transformations *)
List
.
iter
add_completion_entry
transformations
;
(* add the name of the commands *)
List
.
iter
add_completion_entry
commands
;
(* todo: add queries *)
(* add provers *)
List
.
iter
add_completion_entry
provers
;
add_completion_entry
"auto"
;
add_completion_entry
"auto 2"
;
command_entry_completion
#
set_text_column
completion_col
;
command_entry_completion
#
set_match_func
match_function
;
command_entry
#
set_completion
command_entry_completion
(*********************)
(*********************)
(* Terminal history *)
(* Terminal history *)
...
@@ -1225,30 +1214,14 @@ let (_ : GtkSignal.id) =
...
@@ -1225,30 +1214,14 @@ let (_ : GtkSignal.id) =
(
fun
()
->
(
fun
()
->
begin
begin
match
get_selected_row_references
()
with
match
get_selected_row_references
()
with
|
[
r
]
->
on_selected_row
r
;
|
[
r
]
->
if
!
has_right_click
then
on_selected_row
r
;
(* TODO here show the menu *)
if
!
has_right_click
then
tools_menu
#
popup
~
button
:
1
~
time
:
0
l
;
begin
(*
tools_menu
#
popup
~
button
:
3
~
time
:
0
l
;
GToolbox.popup_menu ~entries:[
Debug
.
dprintf
debug
"[IDE INFO] after tools_menu#popup@."
;
`I("Mark Obsolete",
has_right_click
:=
false
(* TODO add a mark_obsolete function *)
end
(fun () ->
match get_selected_row_references () with
| [r] ->
let id = get_node_id r#iter in
send_request (Mark_obsolete_req id)
| _ -> print_message "Select only one node to perform this action"));
`I("Choix 1.2",(fun () -> Format.eprintf "Popup menu: choix 1.2 active@."));
`S;
`I("Choix 2.1",(fun () -> Format.eprintf "Popup menu: choix 2.1 active@."));
`I("Choix 2.2",(fun () -> Format.eprintf "Popup menu: choix 2.2 active@."));
`I("Choix 2.3",(fun () -> Format.eprintf "Popup menu: choix 2.3 active@."));
]
~button:1 ~time:0l;
*)
has_right_click
:=
false
|
_
->
()
|
_
->
()
end
(* ;
end
(* ;
command_entry#misc#grab_focus () *)
;
has_right_click
:=
false
)
command_entry#misc#grab_focus () *)
;
has_right_click
:=
false
)
...
@@ -1256,16 +1229,20 @@ let (_ : GtkSignal.id) =
...
@@ -1256,16 +1229,20 @@ let (_ : GtkSignal.id) =
let
_
=
let
_
=
(* This event is executed BEFORE the other connected event goals_view#selection#connect#after#changed above *)
(* This event is executed BEFORE the other connected event goals_view#selection#connect#after#changed above *)
(* We return false so that the second callback above is executed ? *)
(* We return false so that the second callback above is executed ? *)
goals_view
#
event
#
connect
#
button_press
~
callback
:
(
fun
x
->
let
callback
ev
=
(
match
GdkEvent
.
Button
.
button
x
with
let
n
=
GdkEvent
.
Button
.
button
ev
in
|
1
->
(* Left click *)
()
begin
|
2
->
(* Middle click *)
()
match
n
with
|
3
->
(* Right click *)
|
1
->
(* Left click *)
()
has_right_click
:=
true
|
2
->
(* Middle click *)
()
|
3
->
(* Right click *)
|
_
->
(* Error case TODO *)
assert
false
);
has_right_click
:=
true
Format
.
eprintf
"TODO button number %d was clicked on the tree view@."
(
GdkEvent
.
Button
.
button
x
);
false
)
|
_
->
(* Error case TODO *)
assert
false
end
;
Debug
.
dprintf
debug
"[IDE INFO] button number %d was clicked on the tree view@."
n
;
false
in
goals_view
#
event
#
connect
#
button_press
~
callback
(***********************)
(***********************)
(* Tools menu signals *)
(* Tools menu signals *)
...
@@ -1517,6 +1494,73 @@ let set_status_and_time_column row pa obsolete l =
...
@@ -1517,6 +1494,73 @@ let set_status_and_time_column row pa obsolete l =
let
t
=
if
obsolete
then
t
^
" (obsolete)"
else
t
in
let
t
=
if
obsolete
then
t
^
" (obsolete)"
else
t
in
goals_model
#
set
~
row
:
row
#
iter
~
column
:
time_column
t
goals_model
#
set
~
row
:
row
#
iter
~
column
:
time_column
t
(*****************************)
(* tools submenu for provers *)
(*****************************)
let
provers_factory
=
let
(
_
:
GMenu
.
menu_item
)
=
tools_factory
#
add_separator
()
in
let
tools_submenu_provers
=
tools_factory
#
add_submenu
"Provers"
in
new
GMenu
.
factory
tools_submenu_provers
let
add_submenu_prover
prover
=
(*
let provers =
C.Mprover.fold
(fun k p acc ->
let pr = p.prover in
if List.mem (C.prover_parseable_format pr) gconfig.hidden_provers
then acc
else C.Mprover.add k p acc)
provers C.Mprover.empty
in
C.Mprover.iter
(fun p _ ->
*)
let
n
=
(*Pp.string_of_wnl Whyconf.print_prover *)
prover
in
let
(
_
:
GMenu
.
image_menu_item
)
=
provers_factory
#
add_image_item
~
label
:
n
~
callback
:
(
fun
()
->
Debug
.
dprintf
debug
"[IDE INFO] interp command '%s'@."
n
;
interp
n
;
(* send_request (Command_req (id, n)) *)
)
()
in
(* prover button, obsolete
let b = GButton.button ~packing:provers_box#add ~label:n () in
b#misc#set_tooltip_markup
(Pp.sprintf_wnl "Start <tt>%a</tt> on the <b>selected goal(s)</b>"
C.print_prover p);
let (_ : GtkSignal.id) =
b#connect#pressed
~callback:(fun () -> prover_on_selected_goals p)
in
*)
()
let
init_completion
provers
transformations
commands
=
(* add the names of all the the transformations *)
List
.
iter
add_completion_entry
transformations
;
(* add the name of the commands *)
List
.
iter
add_completion_entry
commands
;
(* todo: add queries *)
(* add provers *)
List
.
iter
add_completion_entry
provers
;
List
.
iter
add_submenu_prover
provers
;
add_completion_entry
"auto"
;
add_completion_entry
"auto 2"
;
command_entry_completion
#
set_text_column
completion_col
;
command_entry_completion
#
set_match_func
match_function
;
command_entry
#
set_completion
command_entry_completion
let
treat_notification
n
=
let
treat_notification
n
=
begin
match
n
with
begin
match
n
with
|
Node_change
(
id
,
uinfo
)
->
|
Node_change
(
id
,
uinfo
)
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment