From f46a56024cdcd21290befcadc6cd1cffd71f76af Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 4 May 2010 02:53:46 -0400 Subject: [PATCH] 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 --- basis/ui/tools/error-list/error-list.factor | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/basis/ui/tools/error-list/error-list.factor b/basis/ui/tools/error-list/error-list.factor index 76df264131..8cc8781b19 100644 --- a/basis/ui/tools/error-list/error-list.factor +++ b/basis/ui/tools/error-list/error-list.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2009 Slava Pestov. +! Copyright (C) 2009, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays sequences sorting assocs colors.constants fry combinators combinators.smart combinators.short-circuit editors make @@ -154,7 +154,7 @@ error-display "toolbar" f { [ swap '[ error-type _ at ] filter ] ; :: ( model -- gadget ) - vertical error-list-gadget new-track + vertical \ error-list-gadget new-track [ >>error-toggle ] [ >>visible-errors ] bi* dup visible-errors>> model >>model f >>source-file @@ -178,16 +178,16 @@ M: error-list-gadget focusable-child* \ 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 } } define-command-map -: error-list-window ( -- ) - error-list-model get [ drop all-errors ] - "Errors" open-status-window ; +MEMO: error-list-gadget ( -- gadget ) + error-list-model get-global [ drop all-errors ] + ; : show-error-list ( -- ) - [ error-list-gadget? ] find-window - [ raise-window ] [ error-list-window ] if* ; + [ error-list-gadget eq? ] find-window + [ raise-window ] [ error-list-gadget "Errors" open-status-window ] if* ; \ show-error-list H{ { +nullary+ t } } define-command