ui.tools.error-list: re-use the same actual gadget, so that the current selection and set of displayed error types is preserved if the user closes and re-opens the error list
parent
dd2a4c2c77
commit
f46a56024c
|
@ -1,4 +1,4 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009, 2010 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays sequences sorting assocs colors.constants fry
|
USING: accessors arrays sequences sorting assocs colors.constants fry
|
||||||
combinators combinators.smart combinators.short-circuit editors make
|
combinators combinators.smart combinators.short-circuit editors make
|
||||||
|
@ -154,7 +154,7 @@ error-display "toolbar" f {
|
||||||
[ swap '[ error-type _ at ] filter ] <smart-arrow> ;
|
[ swap '[ error-type _ at ] filter ] <smart-arrow> ;
|
||||||
|
|
||||||
:: <error-list-gadget> ( model -- gadget )
|
:: <error-list-gadget> ( model -- gadget )
|
||||||
vertical error-list-gadget new-track
|
vertical \ error-list-gadget new-track
|
||||||
<error-toggle> [ >>error-toggle ] [ >>visible-errors ] bi*
|
<error-toggle> [ >>error-toggle ] [ >>visible-errors ] bi*
|
||||||
dup visible-errors>> model <error-model> >>model
|
dup visible-errors>> model <error-model> >>model
|
||||||
f <model> >>source-file
|
f <model> >>source-file
|
||||||
|
@ -178,16 +178,16 @@ M: error-list-gadget focusable-child*
|
||||||
|
|
||||||
\ error-list-help H{ { +nullary+ t } } define-command
|
\ error-list-help H{ { +nullary+ t } } define-command
|
||||||
|
|
||||||
error-list-gadget "toolbar" f {
|
\ error-list-gadget "toolbar" f {
|
||||||
{ T{ key-down f f "F1" } error-list-help }
|
{ T{ key-down f f "F1" } error-list-help }
|
||||||
} define-command-map
|
} define-command-map
|
||||||
|
|
||||||
: error-list-window ( -- )
|
MEMO: error-list-gadget ( -- gadget )
|
||||||
error-list-model get [ drop all-errors ] <arrow>
|
error-list-model get-global [ drop all-errors ] <arrow>
|
||||||
<error-list-gadget> "Errors" open-status-window ;
|
<error-list-gadget> ;
|
||||||
|
|
||||||
: show-error-list ( -- )
|
: show-error-list ( -- )
|
||||||
[ error-list-gadget? ] find-window
|
[ error-list-gadget eq? ] find-window
|
||||||
[ raise-window ] [ error-list-window ] if* ;
|
[ raise-window ] [ error-list-gadget "Errors" open-status-window ] if* ;
|
||||||
|
|
||||||
\ show-error-list H{ { +nullary+ t } } define-command
|
\ show-error-list H{ { +nullary+ t } } define-command
|
||||||
|
|
Loading…
Reference in New Issue