Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
e17bba7b
Commit
e17bba7b
authored
4 years ago
by
Loïc Correnson
Committed by
Allan Blanchard
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[gui] use global hook
parent
265a9868
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/kernel_internals/runtime/messages.ml
+7
-2
7 additions, 2 deletions
src/kernel_internals/runtime/messages.ml
src/kernel_internals/runtime/messages.mli
+2
-2
2 additions, 2 deletions
src/kernel_internals/runtime/messages.mli
src/plugins/gui/design.ml
+6
-6
6 additions, 6 deletions
src/plugins/gui/design.ml
with
15 additions
and
10 deletions
src/kernel_internals/runtime/messages.ml
+
7
−
2
View file @
e17bba7b
...
@@ -48,7 +48,12 @@ module Messages =
...
@@ -48,7 +48,12 @@ module Messages =
end
)
end
)
let
()
=
Ast
.
add_monotonic_state
Messages
.
self
let
()
=
Ast
.
add_monotonic_state
Messages
.
self
let
add_message
m
=
Messages
.
set
(
m
::
Messages
.
get
()
)
let
demons
=
ref
[]
let
add_message
m
=
begin
Messages
.
set
(
m
::
Messages
.
get
()
)
;
List
.
iter
(
fun
fn
->
fn
()
)
!
demons
;
end
let
nb_errors
()
=
let
nb_errors
()
=
Messages
.
fold_left
Messages
.
fold_left
...
@@ -95,7 +100,7 @@ let () = Log.check_not_yet := check_not_yet
...
@@ -95,7 +100,7 @@ let () = Log.check_not_yet := check_not_yet
let
reset_once_flag
()
=
OnceTable
.
clear
()
let
reset_once_flag
()
=
OnceTable
.
clear
()
let
add_
update
_hook
fn
=
Messages
.
add_hook_on_update
(
fun
_
->
fn
()
)
let
add_
global
_hook
fn
=
demons
:=
!
demons
@
[
fn
]
(*
(*
Local Variables:
Local Variables:
...
...
This diff is collapsed.
Click to expand it.
src/kernel_internals/runtime/messages.mli
+
2
−
2
View file @
e17bba7b
...
@@ -44,8 +44,8 @@ val nb_messages: unit -> int
...
@@ -44,8 +44,8 @@ val nb_messages: unit -> int
(** Number of stored warning messages, error messages, or all
(** Number of stored warning messages, error messages, or all
messages.*)
messages.*)
val
add_
update
_hook
:
(
unit
->
unit
)
->
unit
val
add_
global
_hook
:
(
unit
->
unit
)
->
unit
(** Register a
hook
on message addition *)
(** Register a
global hook (not projectified)
on message addition
.
*)
(*
(*
Local Variables:
Local Variables:
...
...
This diff is collapsed.
Click to expand it.
src/plugins/gui/design.ml
+
6
−
6
View file @
e17bba7b
...
@@ -1718,12 +1718,12 @@ class main_window () : main_window_extension_points =
...
@@ -1718,12 +1718,12 @@ class main_window () : main_window_extension_points =
GtkMisc
.
Label
.
set_text
label
text
GtkMisc
.
Label
.
set_text
label
text
in
in
register_reset_extension
(
fun
_
->
display_warnings
()
);
register_reset_extension
(
fun
_
->
display_warnings
()
);
Messages
.
add_
update
_hook
(
fun
()
->
Messages
.
add_
global
_hook
(
fun
()
->
if
not
!
outdated_warnings
then
if
not
!
outdated_warnings
then
begin
begin
outdated_warnings
:=
true
;
outdated_warnings
:=
true
;
Wutil
.
later
display_warnings
Wutil
.
later
display_warnings
end
end
);
);
Messages
.
reset_once_flag
()
;
Messages
.
reset_once_flag
()
;
display_warnings
()
;
display_warnings
()
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment