<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
- <accelerator key="Home" modifiers="0" signal="clicked"/>
+ <accelerator key="Home" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
<child>
<widget class="GtkImage" id="image253">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
- <accelerator key="Page_Up" modifiers="0" signal="clicked"/>
+ <accelerator key="Page_Up" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
<child>
<widget class="GtkImage" id="image254">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
- <accelerator key="Page_Down" modifiers="0" signal="clicked"/>
+ <accelerator key="Page_Down" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
<child>
<widget class="GtkImage" id="image256">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
- <accelerator key="End" modifiers="0" signal="clicked"/>
+ <accelerator key="End" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
<child>
<widget class="GtkImage" id="image257">
MatitaGui.interactive_uri_choice ~selection_mode:`SINGLE
~title:"Matita: URI chooser"
~msg:"Select the URI" ~hide_uri_entry:true
- ~hide_try:true ~ok_label:"_Apply"
+ ~hide_try:true ~ok_label:"_Apply" ~ok_action:`SELECT
~copy_cb:(fun s -> gui#main#scriptTextView#buffer#insert ("\n"^s^"\n"))
() ~id:"boh?" uris
with MatitaTypes.Cancel -> [])
String.sub s (String.length s - 4) 4 = ".var"
with Invalid_argument _ -> false
+(* this is a shit and should be changed :-{ *)
let interactive_uri_choice
?(selection_mode:[`SINGLE|`MULTIPLE] = `MULTIPLE) ?(title = "")
?(msg = "") ?(nonvars_button = false) ?(hide_uri_entry=false)
- ?(hide_try=false) ?(ok_label="_Auto") ?copy_cb ()
+ ?(hide_try=false) ?(ok_label="_Auto") ?(ok_action:[`SELECT|`AUTO] = `AUTO)
+ ?copy_cb ()
~id uris
=
let gui = instance () in
ignore (dialog#uriChoiceDialog#event#connect#delete (fun _ -> true));
connect_button dialog#uriChoiceConstantsButton (fun _ ->
return (Some (Lazy.force nonvars_uris)));
- connect_button dialog#uriChoiceAutoButton (fun _ ->
- Helm_registry.set_bool "matita.auto_disambiguation" true;
- return (Some (Lazy.force nonvars_uris)));
+ if ok_action = `AUTO then
+ connect_button dialog#uriChoiceAutoButton (fun _ ->
+ Helm_registry.set_bool "matita.auto_disambiguation" true;
+ return (Some (Lazy.force nonvars_uris)))
+ else
+ connect_button dialog#uriChoiceAutoButton (fun _ ->
+ match model#easy_selection () with
+ | [] -> ()
+ | uris -> return (Some uris));
connect_button dialog#uriChoiceSelectedButton (fun _ ->
match model#easy_selection () with
| [] -> ()
?selection_mode:([`SINGLE|`MULTIPLE]) -> ?title:string ->
?msg:string -> ?nonvars_button:bool ->
?hide_uri_entry:bool -> ?hide_try:bool -> ?ok_label:string ->
+ ?ok_action:[`AUTO|`SELECT] ->
?copy_cb:(string -> unit) -> unit ->
MatitaDisambiguator.choose_uris_callback
"\n" ^ TAPp.pp_statement ast
in
[ new_status , extra_text ], parsed_text_length
- | _ -> assert false)
+ | _ ->
+ MatitaLog.error
+ "The result of the urichooser should be only 1 uri, not:\n";
+ List.iter (
+ fun u -> MatitaLog.error (u ^ "\n")
+ ) selected;
+ assert false)
| TA.Check (_,term) ->
let metasenv = MatitaMisc.get_proof_metasenv status in
let context = MatitaMisc.get_proof_context status in